Skip to content

VFXPreview ​

Inherits: VBoxContainer

The preview of a visual effect (VFX tab): the effect plays in a 3D view you can turn around (AssetViewport3D). A loop effect plays by itself; a one shot plays again and again (Repeat, on to begin with) or once each time you press Play; a weather has a slider for its intensity; a beam stretches between two points (a length slider, and a sweep that moves the far end); a path puts its section along a line; a telegraph fills up on the ground (a circle or a square, a size); a material is on a capsule the size of a character. A speed slider slows the effect down to look at it. The effect is shown as the scene is: the preview does not run the game's effect code (pools, timers, targets), it starts the particles and the animation of the scene and places the parts of a beam and a path the way the effect does. See docs: Assets > VFX.

Variables ​

Stringvfx_type""
Nodeinstancenull
ShaderMaterialtelegraph_materialnull
ColorPickerButtoncolor_buttonnull
CheckBoxchain_checknull
HBoxContainertint_rownull
CheckBoxtint_checknull
ColorPickerButtontint_color_buttonnull
OptionButtontint_mode_optionnull
HSlidertint_strength_slidernull
HBoxContainerweapon_rownull
OptionButtonweapon_optionnull
MeshInstance3Dweapon_nodenull

Methods ​

boolshow_vfx( path: String, type: String )
voidclear()
voidplay()
Vector2fade_times()

Constants ​

  • Array[String] PREVIEWED = ["oneshot", "loop", "enchant", "weather", "beam", "path", "telegraph", "mater... - The kinds of effect the preview plays
  • float REPEAT_GAP = 0.6 - The seconds between the end of a one shot and the next play when it repeats
  • Vector3 BEAM_START = Vector3(0.0, 1.0, 0.0) - Where a beam starts and a path begins (metres above the ground)

Variable descriptions ​

String vfx_type = "" ​

The kind of the effect in the view ("oneshot", "loop" ...)

Node instance = null ​

The effect in the view

ShaderMaterial telegraph_material = null ​

The material of the warning of a telegraph, and the clock of its fill

ColorPickerButton color_button = null ​

The colour of the warning of a telegraph, and the switch that shows a beam that chains as a chain of beams (made in _ready)

CheckBox chain_check = null ​

No description yet.

HBoxContainer tint_row = null ​

The row with the tint of the preview (a colour put on the effect to see it in another colour: made in _ready), and its controls

CheckBox tint_check = null ​

No description yet.

ColorPickerButton tint_color_button = null ​

No description yet.

OptionButton tint_mode_option = null ​

No description yet.

HSlider tint_strength_slider = null ​

No description yet.

HBoxContainer weapon_row = null ​

No description yet.

OptionButton weapon_option = null ​

No description yet.

MeshInstance3D weapon_node = null ​

No description yet.

Method descriptions ​

bool show_vfx( path: String, type: String ) ​

Shows an effect: the scene of the file, and the controls of its kind. Plays at once. False when the kind has no preview or the file does not load

void clear() ​

Empties the preview

void play() ​

Plays the effect from its start: a one shot once (and again after its length when Repeat is on), a loop from the beginning, a beam and a path placed again

Vector2 fade_times() ​

How long the effect shown fades in (x) and out (y): its own fade_in and fade_out, or the defaults of its kind (VFXFade.DEFAULTS; a loop or a beam with an end animation fades out over it), as VFX does in the game (read as properties: in the editor a one shot is a placeholder, with no methods to call)