0 votes

I'm just trying to make a simple crosshair. I know to add a control node to the camera and add a texture rect with my crosshair image to the control node, but I can't figure out how to center it, hopefully in a way that would work with multiple aspect ratios.

What's the best way to center a texture rect on the screen?

Godot version 3.4.4
in Engine by (391 points)

1 Answer

+1 vote
Best answer
  1. Click the layout button. Click center.
  2. Add it as a child of a centercontainer with the full rect layout
  3. make it full rect layout, stretch mode keep centered
by (8,526 points)
selected by

Thanks, that worked perfectly. =D

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.