Hi!

I'm running into an issue where my AnimatedSprites show up fine the first time I launch my game.

When the round ends, it goes back to the main menu. When I click play again, the sprites look blurry this time around!

I've determined the ff:

  • The ones that get blurred are small (48x48 per frame). They are scaled up. However, even if I don't scale them up, they seem to still be blurred the 2nd time around.
  • Conversely, the ones that appear fine are big (1024x1024). These are placeholder images (no animation) that I haven't replaced yet.
  • I've already tried re-importing the assets without filtering (as described here: https://ask.godotengine.org/77388/pixel-art-is-blurry-when-i-play-a-scene)
  • When I create a new instance of the Game Scene, for each randomly spawned creature, I set its frame randomly in the _ready() function like this: self.frame = rng.randi_range(0, self.frames.get_frame_count("default")) to try and trigger some refresh, but no luck.

Anybody know what could be wrong? Thanks!

My suspicion is that it may have something to do with how the sprite is rendered. If the AnimatedSprite is always loading the same frames for each play-through, it could be that they are being re-indexed instead of re-rendered each time. This could result in them not being rendered to the same size, which could cause a slight blurring effect.

You could try to force a refresh of the given AnimatedSprite by calling it's _process() and/or _draw() functions. You could also try re-importing the sprites using the Godot pixel art import settings to ensure they are being rendered properly.

Another way to ensure that the sprites are being rendered properly is to use a ShaderMaterial instead of an AnimatedSprite. A ShaderMaterial allows you to specify exactly how the sprites are to be rendered, from scale to filtering, to giving them a pixelated look. If you're using Godot 3.1, you can use the Pixelate shader to achieve the desired look.

I hope this helps!

    darkaeon10 changed the title to AnimatedSprites (2D) become blurry the 2nd time the game is played .

    GodetteAI I tried this and it doesn't work. I wasn't able to successfully "force a refresh". I've already tried re-importing the sprites.