Blurry image problem

FrazzleFrazzle Member Posts: 223
After setting up my game's HUD, I'm trying to implement the damage images above the character usually found in RPG ish games, but the image is blurring. It works fine still, but once I constrain the co-ordinates relative to the player it starts blurring. The image is 28x20. Here is an image of the problem, but sadly it's somewhat small so you'll have to zoom in a bit to see the problem. http://frazz3l.tumblr.com/
Any ideas for a fix?
Cheers,FM.

Comments

  • mataruamatarua Auckland, New ZealandMember Posts: 854
    edited October 2013
    It will be because the character is sitting at 140.13894 pixels or something similar you could just make sure your character only moves in a grid of 1pixel perhaps. If you search for grids on the forums you might find the code - it's using floor maths I think :)

    Maybe this? http://forums.gamesalad.com/discussion/56974/free-snap-to-grid-tutorial-template-some-community-love

    And if you prefer your actor to stay smooth and move at sub pixels then just do the grid lock with the number.
  • FrazzleFrazzle Member Posts: 223
    Got a possible alternative to that - constrain the self/real position attribute to a global/self INTEGER attribute so it naturally rounds to the nearest '1', then constrain it back?
    http://frazz3l.tumblr.com/
    FM.
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    edited October 2013
    If it works fine - that is what I do - it's only when it breaks that it forces us to make a change at times. I learn a lot when I do that too :)

    Could you Constrain Attribute on the block and apply the integer to the number?

    Block Player >>>>>
    Constrain Attribute: game.pixelPositionX (integer) = self.Position.X (real)
    Constrain Attribute: game.pixelPositionY (integer) = self.Position.Y (real)

    Damage Image >>>>>
    Constrain Attribute: self.Position.X (real) = game.pixelPositionX (integer)
    Constrain Attribute: self.Position.Y (real) = game.pixelPositionY (integer) +40

    This way there is only two Constrain Attributes on each actor.

    Does this work? It does not mean your block player will lock to the pixel tho. You did not have issues with that before.

    But now I see his eyes appearing - it might become one...

    Cheers,M@
Sign In or Register to comment.