The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

I'm making UI, and want to set anchor to middle of the image, but changing anchor from Layout -> Anchors Only or setting Anchor value directly doesn't work. The value was updated, but anchor point not moved at all. Is it bug or is there are something that I missed?

Here's the node tree:

  • CanvasLayer

    • Control

      • TextureRect <- Anchor is not moving at all

Using Godot 3.1.1.

Also I can't find how to resize texture rect. I can set the min-size, but change size doesn't work, the value immediately set back to original size. How to change the texture rect size?

in Engine by (140 points)

Is your TextureRect inside a container node?

No, it's inside of Control node. Should I change control node type to container? What's the purpose of using container node?

1 Answer

0 votes

1.Make sure to set your control node to (Full rect) so that it can adjust according to your viewport thus letting its child node -> texture rect to keep itself in the middle

2.You could either: -Use scale but it will mess up with your image pivot or Change the resolution of your image

by (410 points)
  1. Set control node to full rect doesn't change anything.
  2. Yep, temporarily I used scale. So, no way to size down?

1.Change the layout of your image to center, then try to expand contract your control node if its child stays in the middle

2.Yup that's the only way I know of in changing the size of image

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.