-1

Blurry Character Animation

ok So ^^ is a picture of two sprites side by side.

The left sprite is the character after it has completed an animation..

The right sprite is the character as a static image..

As you can see, for some reason the left after animation sprite is blurry? Does anyone have a fix for this? i've tried to set the filter, use single sprites instead of sprite sheets.. etc etc...

please help

Thanks in advance! :)

Savlon
  • 744
  • 2
  • 11
  • 18
  • Please include some code where you think the problem may be happening. – adchilds Jul 14 '12 at 03:48
  • well i wasn't sure it was in my code? I was thinking more along the lines of the code in slick... I vaguely remember watching a video tutorial on slick and the text that was displayed on screen was blurry. The tutor added some more code to rectify the problem and make it crystal clear. was thinking my problem would be similar to that? If you can't help me then can you at least explain why animating a sprite does this? Cheers... – Savlon Jul 14 '12 at 04:44
  • Are `java.awt.RenderingHints` available in this context? – trashgod Jul 14 '12 at 08:43
  • Thanks for the input trashgod! i just tried than, however, the "Graphics" in this method is from slicks own library... public void draw(GameContainer gc, Graphics g) {} but thanks a lot for the input! – Savlon Jul 14 '12 at 09:05

1 Answers1

2

The most likely problem is that the blurry character is in a non-integer position. If the animation you mentioned moves the character to, say 500.5,500.5 instead of 500,500 or 501,501, then slick will probably perform some sort of interpolation to move the image less than a pixel, and that can lead to the blur you see. If this is the problem, you may solve it my casting the parameters of your draw call to integers like so:

image.draw((int)x,(int)y); //this may solve your problem