rename number to order

master
Fabien Freling 2020-02-13 13:38:07 +01:00
parent 0f8ddd4d71
commit b4ca5f576c
2 changed files with 6 additions and 6 deletions

View File

@ -4,14 +4,14 @@ class_name Piece
export var size: int = 160 export var size: int = 160
var number: int = 0 var order: int = 0
var taquin_position = Vector2.ZERO var taquin_position := Vector2.ZERO
var taquin_index = Vector2.ZERO var taquin_index := Vector2.ZERO
var piece_scale = Vector2(0.25, 0.25) var piece_scale := Vector2(0.25, 0.25)
func _ready() -> void: func _ready() -> void:
$ColorRect.rect_size = Vector2(size, size) $ColorRect.rect_size = Vector2(size, size)
$ColorRect/Label.text = str(number) $ColorRect/Label.text = str(order)
# We need a dedicated material to have separate uniform, # We need a dedicated material to have separate uniform,
# otherwise uniforms will be shared. # otherwise uniforms will be shared.

View File

@ -67,7 +67,7 @@ func _ready() -> void:
piece.size = piece_size piece.size = piece_size
piece.position = position_for_index(Vector2(c, r), piece.size) piece.position = position_for_index(Vector2(c, r), piece.size)
piece.number = 1 + c + r * columns piece.order = 1 + c + r * columns
piece.taquin_index = Vector2(c, r) piece.taquin_index = Vector2(c, r)
piece.piece_scale = Vector2((float(piece_size) / width), (float(piece_size) / height)) piece.piece_scale = Vector2((float(piece_size) / width), (float(piece_size) / height))
piece.taquin_position = Vector2(float(piece.position.x) / width, float(piece.position.y) / height) piece.taquin_position = Vector2(float(piece.position.x) / width, float(piece.position.y) / height)