Quit-Rolling-Around-gmtk-ja.../UI/DiceView.gd

23 lines
455 B
GDScript3
Raw Normal View History

tool
2022-07-16 21:33:47 +01:00
extends Control
const dice_image_string = "res://Assets/Dice/Dice%s.png"
const selected_shader = preload("res://UI/RainbowOutline.tres")
2022-08-14 11:24:48 +01:00
export (int, 0, 6) var dice_value : int = 0
export var selected : bool setget set_selected
2022-07-17 14:32:42 +01:00
2022-07-16 21:33:47 +01:00
func set_selected(new_value):
selected = new_value
if selected:
self.material = selected_shader
else:
self.material = null
2022-07-16 21:33:47 +01:00
func _physics_process(_delta):
self.texture = load(dice_image_string % dice_value)
2022-07-17 13:05:20 +01:00