Changing control node size verses scale in editor?
Asked Answered
B

4

0

In the Godot editor in 2D mode there is a tool to change the scale of a node, but I don't see one to change the pixel size. It seems that sometimes this matters for containers because of how the scaling affects the child nodes. Maybe this concern is just because I'm still not very far along the learning curve of how to use this powerful but somewhat demented UI model, but I've found that some things work better when I'm laying them out of I keep the scaling of the containers at 1.

Is there a way to change the pixel size of items without editing the text fields in the Inspector?

Bathrobe answered 12/12, 2023 at 18:50 Comment(0)
S
0

Bathrobe You could apply your own Theme.

Stoffel answered 12/12, 2023 at 23:6 Comment(0)
B
0

You could apply your own Theme.

I don't really understand this answer. Is it saying that there is a way to set up your own Theme so you never have to resize containers after you've put things into them? In any case, it isn't really very useful to me.

I'm pretty sure the class of problems I'm seeing are because I'm using things wrong, and I was hoping to get some guidance in what to avoid. For example, sometimes a button inside a container will have its text horribly stretched when you change the size of the container using the "scale" tool. If you change the size of the container by hand editing the size values in the transform this doesn't happen. I am convinced I'm doing something outside the expected use of the tools, or there would be a "resize" tool in addition to the "rescale" tool, but I'm new, so not sure how I'm going off the rails.

Bathrobe answered 13/12, 2023 at 22:5 Comment(0)
S
0

Bathrobe Generally speaking it's best to avoid scale if you want to change the size of something because scale stretches things like a rubber band. For example if you render text at a font size of 10 and then set the scale to 5 the result is that it won't render the text with a crisp font size of 50 but instead it will still render it with font size 10 and then stretch those pixels by 5 making look blurry.

Stoffel answered 14/12, 2023 at 10:19 Comment(0)
I
0

Bathrobe

Yesterday a watched a really good tutorial on Godot UI. It's pretty long, but very well explained. It also covers the scaling of child nodes.

Intractable answered 14/12, 2023 at 14:34 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.