refactor with ColorRect
This commit is contained in:
parent
d98ad5fd23
commit
8a720717e4
4 changed files with 73 additions and 11 deletions
|
@ -5,11 +5,13 @@ tool
|
|||
export var size: int = 64
|
||||
var number: int = 0
|
||||
|
||||
func _draw() -> void:
|
||||
draw_rect(Rect2(0, 0, size, size), Color.yellow)
|
||||
#func _draw() -> void:
|
||||
# draw_rect(Rect2(0, 0, size, size), Color.yellow)
|
||||
|
||||
func set_number(num: int) -> void:
|
||||
number = num
|
||||
|
||||
func _ready() -> void:
|
||||
$Label.text = str(number)
|
||||
$ColorRect.rect_size.x = size
|
||||
$ColorRect.rect_size.y = size
|
||||
$ColorRect/Label.text = str(number)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue