Add support for hovering with the DiceView

This commit is contained in:
CactiChameleon9 2022-08-24 09:44:17 +01:00
parent 41c2689e1f
commit bf15a8a824

View File

@ -2,16 +2,16 @@ tool
extends Control
const dice_image_string = "res://Assets/Dice/Dice%s.png"
const selected_shader = preload("res://UI/RainbowOutline.tres")
const hovering_shader = preload("res://UI/RainbowOutline.tres")
export (int, 0, 6) var dice_value : int = 0
export var selected : bool setget set_selected
export var hovering : bool setget set_hovering
func set_selected(new_value):
selected = new_value
if selected:
self.material = selected_shader
func set_hovering(new_value):
hovering = new_value
if hovering:
self.material = hovering_shader
else:
self.material = null