Skip to reading
Eight Adventure Interface Workshops

Pulse an unlocked portrait three times

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Record ID: flash_portrait. Global Script: off. Call it when Mara becomes available. The Button keeps its size and position throughout the pulse.

Code example
extends "res://scripts/runtime/script_base.gd"
Code example
func run(_context: Dictionary = {}) -> Variant:
    var manager: Node = Runtime.get("authored_gui_manager")
    var nodes: Dictionary = manager.get("element_nodes")
    var portrait: Control = nodes.get("dot_actor_assistant") as Control
    if not is_instance_valid(portrait):
        return false
    var original: Color = portrait.modulate
    var tween: Tween = create_tween().set_loops(3)
    tween.tween_property(portrait, "modulate", Color(1.0, 0.68, 0.5), 0.12)
    tween.tween_property(portrait, "modulate", original, 0.12)
    await tween.finished
    if is_instance_valid(portrait):
        portrait.modulate = original
    return true

Each cycle is 0.12 seconds to the warm tint and 0.12 seconds back. Three cycles take about 0.72 seconds. The original color is restored at the end.

For reduced motion, use a one-time steady highlight or a short message instead. Do not use repeated flashing to show permanent selection.

Page 105 of 119Permalink
Go to page