I can only get subpixel movement on Sprite2D but not others?

Godot Version

4.5

Question

Working with a very low resolution pixel game. I have toggled off all pixel snapping settings and all the Sprite2Ds render at subpixel positions. However, I was creating a marquee effect for text and noticed that Labels and other text only render at integer positions, no matter how I moved them. I have made sure my import settings for the pixel font are all set to allow subpixel drawing, yet there’s a very jittery effect when the text moves.

As an alternative, I create a Sprite2D and then render text to it via draw_string(), which then produces smooth movement. What’s strange is that if I try to instead draw text on a TextureRect, I notice the jittery movement again. I only notice smooth movement specifically on Sprite2Ds. Ideally, I’d like to be able to force text and other types to allow rendering at subpixel positions. Does anyone have an idea of what’s happening?

Try changing the ProjectSettings.gui/common/snap_controls_to_pixels to false.

If you are using a SubViewport then you’ll need to change its Viewport.gui_snap_controls_to_pixels

1 Like