refactor with ColorRect

This commit is contained in:
Fabien Freling 2019-11-27 00:50:35 +01:00
parent d98ad5fd23
commit 8a720717e4
4 changed files with 73 additions and 11 deletions

View file

@ -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)