taqin/game/src/Piece.gd

18 lines
332 B
GDScript

extends Node2D
class_name Piece
tool
export var size: int = 64
var number: int = 0
#func _draw() -> void:
# draw_rect(Rect2(0, 0, size, size), Color.yellow)
func set_number(num: int) -> void:
number = num
func _ready() -> void:
$ColorRect.rect_size.x = size
$ColorRect.rect_size.y = size
$ColorRect/Label.text = str(number)