#Render sprites to whole pixels

4 messages · Page 1 of 1 (latest)

waxen bobcat
#

When originally developing my game with SDL, I had my tiles render on whole-pixels to avoid artifacts. In Bevy, however, the transform for the sprite bundle is in f32s. Is there anyway to to change this or make sure the positions for my tiles are whole-numbers on each update? Or any other solutions to avoid artifacts in a tiled level?

tiny birch
#

This might be what you are looking for, or at least help. It aligns sprites to integer pixels.

.add_plugins(DefaultPlugins .set(ImagePlugin::default_nearest())

#

Another option would be to create a system that runs at the end of the update loop that rounds the transform coordinates, but I would start with the image plugin settings first

left aurora