this post was submitted on 30 Sep 2023
10 points (85.7% liked)
Godot
5885 readers
52 users here now
Welcome to the programming.dev Godot community!
This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.
Make sure to follow the Godot CoC while chatting
We have a matrix room that can be used for chatting with other members of the community here
Links
Other Communities
- !inat@programming.dev
- !play_my_game@programming.dev
- !destroy_my_game@programming.dev
- !voxel_dev@programming.dev
- !roguelikedev@programming.dev
- !game_design@programming.dev
- !gamedev@programming.dev
Rules
- Posts need to be in english
- Posts with explicit content must be tagged with nsfw
- We do not condone harassment inside the community as well as trolling or equivalent behaviour
- Do not post illegal materials or post things encouraging actions such as pirating games
We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent
Wormhole
Credits
- The icon is a modified version of the official godot engine logo (changing the colors to a gradient and black background)
- The banner is from Godot Design
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
If you are working with vector font, you can set some global settings that should help.
In Project Settings, tick Advanced Settings and then look for:
General -> Rendering -> Textures -> Canvas Textures -> Default Texture Filter: set to Nearest
General -> GUI -> Theme -> Default Theme Scale: set to the appropriate value, e.g., 4
Note that in this same panel you can set the default theme to your own. Then, as suggested, reload the project for the changes to apply.
If you are working with bitmap fonts, then yes, you have to manually scale the root Control node of all your scenes, while still enabling the texture filter to nearest. But there should be few of them hopefully.
Though, I'm not an expert, so there might be a better way.
I already have this set, but the default theme scale doesn't change anything on my case. I changed the default scale, I changed the scale specifically allocated to the theme, but all these kept the "round" pixel art edges of my panel (in the background and on the buttons) the same size unfortunately. Also, my goal is not to scale my font, but to scale the background. Scaling fonts I just do with the font size parameter.
Ah, I see. I think you might need to specify your own pre-scaled texture for those then. By creating a StyleBoxTexture, as many as needed for all the disabled/hover/normal/... effects and use those in your theme. Which is not ideal, but that's all I have.
Otherwise, if you want to automatically scale your UI, you can have a look at the viewport suggestion from @magikmw and make an auto-loading node that does the necessary manipulations for you. Though it will scale everything, font and icon included.