oh-my-git/scenes/cli_badge.gd

27 lines
610 B
GDScript3
Raw Normal View History

2021-01-21 15:08:59 +01:00
extends TextureRect
2023-09-06 16:04:23 +02:00
@export var active = true: set = _set_active
@export var sparkling = true: set = _set_sparkling
@export var impossible = false: set = _set_impossible
2021-01-21 15:08:59 +01:00
func _ready():
_set_sparkling(sparkling)
func _set_active(new_active):
active = new_active
if active:
self.self_modulate = Color(1, 1, 1)
2021-01-21 15:08:59 +01:00
else:
self.self_modulate = Color(0.2, 0.2, 0.2)
2021-01-21 15:08:59 +01:00
sparkling = false
func _set_sparkling(new_sparkling):
sparkling = new_sparkling
2023-09-06 16:04:23 +02:00
if $GPUParticles2D:
$GPUParticles2D.emitting = sparkling
func _set_impossible(new_impossible):
impossible = new_impossible
$Nope.visible = impossible