How to use high resolution UI over pixel games.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By RoniPerson

I have a pixel game for which I want to add ui. But my ui shouldn’t be pixelated. I can use styleboxes for that and the UI looks smooth because I use scale mode 2d and not viewport. Now I created a texture as base of my ui. As the UI shouldn’t be pixelated the texture has a high resolution. Sadly this won’t work with stylebox texture because the outer margins are at 50px and they take exactly that space in the window (which is nearly the complete area). Recreating the texture with StyleBoxFlat isn’t an option either because antialiasing levels can only be given in whole numbers, which make the antialiasing to strong on strength 1 because of the low resolution.

Has anyone already created a pixelgame with high reolution ui and knows how to do that?

:bust_in_silhouette: Reply From: figroot

would it be possible to place the game into a viewport like this?
root node (control set to full rect)
|-viewport container
||-viewport (optionally with own world enabled to make transforms easier)
|||-instance of your game

this would let you give whatever is in the viewport a specific resolution while keeping everything else responsive