Is there a faster way to disable anti-aliasing on UI elements?

Godot Version

4.4

Question

I’m working on a pixel art project with the following setup:

Viewport Size: 320×180

Window Size Override: 1280×720

Stretch Mode: viewport

Stretch Scale Mode: integer

Default Texture Filter: nearest

This setup works well for rendering pixel-perfect graphics.
However, I’m running into an issue with UI nodes like Button and Tabs:
Each UI element uses anti-aliasing in its StyleBox settings by default (for all states like normal, hover, focus, etc.).

Manually creating a custom theme for every UI node type and disabling anti-aliasing for each style and state seems very tedious.

Is there a way to disable anti-aliasing for all UI nodes at once without manually editing each style?
(Note: I’m not interested in the dual-viewport approach where UI is rendered at high resolution — I want the UI itself to maintain a pixel-perfect look, consistent with the rest of the game.)

May be a good time to make a custom theme then, get more out of the themeing system than just aliasing. You should only need one theme for the whole project, on the parent of your UI scenes, and saved as a tres file.

1 Like

So do I just make a custom theme, disable anti-aliasing for UI nodes I’m using, and then just reuse this theme resource in other projects?

You probably could reuse the theme for other projects yes. If you intend to make low-resolution games you may want to adjust other settings like default font size and margins/spacing too.

1 Like