0 votes

Hello everyone!

I have the following structure:
-Panel
--TextureFrame
--Control1 (All controls have children)
--Control2
--Control3
--Control4

I use draw_line() in the Panel's script to draw some figures in the screen. My problem is that they are drawn under everything so if I want to see the figures, I have to hide the TextureFrame.

My drawing function needs to use Controls' positions, so that's why I use it in the Panel.

What can I do to draw on top of the TextureFrame?

Any help is greatly appreciated, greetings!

in Engine by (86 points)

1 Answer

0 votes
Best answer

StraToN @#godotengine gave the solution:

Create a new control that will have the drawing code and place it on top of the TextureFrame (or on below in the editor) like so:

-Panel
--TextureFrame
--DrawingControl
--Control1 (All controls have children)
--Control2
--Control3
--Control4

And then attach the code of the drawing (the code Panel used) to the DrawingControl.

Replace the part that gets Control's position using

 get_node("../brother_control")

Enjoy!

by (86 points)
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 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 webmaster@godotengine.org with your username.