Skip to content

VFXTelegraph ​

Inherits: VFX < Node3D

Telegraph VFX - Warning/indicator effects for abilities Uses shader-based approach for smooth fill animations without texture regeneration

Properties ​

Vector2telegraph_sizeVector2(5.0, 5.0)
TelegraphShapetelegraph_shapeTelegraphShape.CIRCLE
Colortelegraph_colorColor.RED
TelegraphAttachmentattachment_typeTelegraphAttachment.POINT
floatorientation_offset0.0

Variables ​

floattelegraph_duration0.0
floatcompletion_percentage0.0
Tweentelegraph_tween
MeshInstance3Dtelegraph_mesh
ShaderMaterialtelegraph_material
Shadertelegraph_shader
boolis_telegraph_activefalse
boolis_interruptedfalse
Texture2Doutline_texturenull

Methods ​

voidsetup_from_selection( selection: VFXSelectionTelegraph )
voidset_outline_texture( texture: Texture2D )
voidstart_telegraph( duration: float )
voidinterrupt_telegraph()
floatdefault_fade_in()
floatdefault_fade_out()
voiddeactivate_vfx()
boolis_telegraph_valid()
floatget_remaining_time()
voidset_telegraph_shape( shape: TelegraphShape )
voidset_telegraph_color( color: Color )
voidset_shader_parameter( param_name: String, value )
voidreset_for_pooling()

Enumerations ​

enum TelegraphAttachment ​

The options of telegraph attachment: point, attached.

  • POINT = 0

enum TelegraphShape ​

The options of telegraph shape: circle, square.

  • CIRCLE = 0
  • SQUARE = 1

Constants ​

  • const TELEGRAPH_FILL_SHADER = preload("res://addons/chroniclenode/assets/shaders/telegraph_fill_shader.gdsh... - The shader that fills the warning.

Property descriptions ​

Telegraph Settings

Vector2 telegraph_size = Vector2(5.0, 5.0) ​

The size of the warning.

TelegraphShape telegraph_shape = TelegraphShape.CIRCLE ​

The shape of the warning.

Color telegraph_color = Color.RED ​

The color of the warning.

TelegraphAttachment attachment_type = TelegraphAttachment.POINT ​

What the warning is attached to.

float orientation_offset = 0.0 ​

Y rotation in degrees

Variable descriptions ​

float telegraph_duration = 0.0 ​

Animation

float completion_percentage = 0.0 ​

0.0 to 1.0 progression

Tween telegraph_tween ​

The tween that fills the warning.

MeshInstance3D telegraph_mesh ​

Telegraph visual components

ShaderMaterial telegraph_material ​

The material of the warning.

Shader telegraph_shader ​

The shader of the warning.

bool is_telegraph_active = false ​

State tracking

bool is_interrupted = false ​

True when the warning was cut short.

Texture2D outline_texture = null ​

The picture of the shape the warning draws (a telegraph outline of the library, src/data/vfx/telegraph: the red channel is the area, the green how far inside the edge, the blue the order it fills in). With none the circle or the square is drawn

Method descriptions ​

void setup_from_selection( selection: VFXSelectionTelegraph ) ​

Setup telegraph from selection (called by VFXManager)

void set_outline_texture( texture: Texture2D ) ​

Set the picture of the shape (the VFXManager picks it by the name of the telegraph; null goes back to the circle and square)

void start_telegraph( duration: float ) ​

Start the telegraph animation with given duration

void interrupt_telegraph() ​

Called when telegraph is interrupted (cast cancelled, etc.)

float default_fade_in() ​

A warning fades in over 0.1 s and, cut short, out over 0.15 s

float default_fade_out() ​

The fade out of the kind of effect (VFX: 0.2 s); a kind overrides it (from VFX)

void deactivate_vfx() ​

Override cleanup to handle telegraph-specific cleanup

bool is_telegraph_valid() ​

Check if telegraph is still valid

float get_remaining_time() ​

Get remaining time on telegraph

void set_telegraph_shape( shape: TelegraphShape ) ​

Set telegraph shape (can be called at runtime)

void set_telegraph_color( color: Color ) ​

Set telegraph color (can be called at runtime)

void set_shader_parameter( param_name: String, value ) ​

Set shader parameter directly (for advanced customization)

void reset_for_pooling() ​

Reset telegraph for pool reuse