20 lines
544 B
GDScript
20 lines
544 B
GDScript
extends Control
|
|
|
|
var mesh: QuadMesh
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func set_mesh(new_mesh: Mesh):
|
|
mesh = new_mesh
|
|
|
|
func _on_add_width_pressed() -> void:
|
|
mesh.size = Vector2(mesh.size.x + 20, mesh.size.y)
|
|
|
|
func _on_subtract_width_pressed() -> void:
|
|
mesh.size = Vector2(max(20, mesh.size.x - 20), mesh.size.y)
|
|
|
|
func _on_add_height_pressed() -> void:
|
|
mesh.size = Vector2(mesh.size.x, mesh.size.y + 20)
|
|
|
|
func _on_subtract_height_pressed() -> void:
|
|
mesh.size = Vector2(mesh.size.x, max(20, mesh.size.y - 20))
|