0 votes

Doing this just draws one circle and everyhing else disappears.

extends Control

var array = ["7b5454","7f4444","402828","6e4040","603e3e","7d4242","644242","623d3d","6f3737"]

func _draw():
    for color in array:
        var myToolButton = ToolButton.new()
        myToolButton.align = 2
        myToolButton.text = "#" + color
        myToolButton.size_flags_vertical = 1
        myToolButton.rect_min_size = Vector2(125,50)
        $VBoxContainer.add_child(myToolButton)
        draw_circle(Vector2(myToolButton.rect_position) + Vector2(30/2, 30/2), 30, color)

What do I have to do?

asked May 24 in Engine by MaaaxiKing (291 points)

I noticed, it has to do something with the shader I have put on two Sprites in this scene. It is by GDQuest https://www.youtube.com/watch?v=LAa8UE3ItM8

1 Answer

0 votes

they are probably overlapping?

extends Control

var array = ["7b5454","7f4444","402828","6e4040","603e3e","7d4242","644242","623d3d","6f3737"]

func draw():
| var Pos := Vector2.ZERO
| for color in array:
| | var myToolButton = ToolButton.new()
| | myToolButton.align = 2
| | myToolButton.text = "#" + color
| | myToolButton.size
flagsvertical = 1
| | myToolButton.rect
minsize = Vector2(125,50)
| | Pos += Vector2(40, 0)
| | #$VBoxContainer.add
child(myToolButton)
| | draw_circle(Pos, 30, color)

answered May 24 by LoneDespair (315 points)

Now I have all circles, nevertheless everything else which could be seen in the scene is away.

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.