Add support for hovering with the DiceView
This commit is contained in:
parent
41c2689e1f
commit
bf15a8a824
@ -2,16 +2,16 @@ tool
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
const dice_image_string = "res://Assets/Dice/Dice%s.png"
|
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 (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):
|
func set_hovering(new_value):
|
||||||
selected = new_value
|
hovering = new_value
|
||||||
if selected:
|
if hovering:
|
||||||
self.material = selected_shader
|
self.material = hovering_shader
|
||||||
else:
|
else:
|
||||||
self.material = null
|
self.material = null
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user