VisualScript

A script implemented in the Visual Script programming environment.

A script implemented in the Visual Script programming environment. The script extends the functionality of all objects that instance it. GodotObject.setScript extends an existing object, if that object's class matches one of the script's base classes. You are most likely to use this class via the Visual Script editor or when writing plugins for it.

@GodotBaseClass
struct VisualScript {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

_getData
Dictionary _getData()
_nodePortsChanged
void _nodePortsChanged(long arg0)
_setData
void _setData(Dictionary data)
addCustomSignal
void addCustomSignal(String name)

Add a custom signal with the specified name to the VisualScript.

addFunction
void addFunction(String name)

Add a function with the specified name to the VisualScript.

addNode
void addNode(String func, long id, VisualScriptNode node, Vector2 position)

Add a node to a function of the VisualScript.

addVariable
void addVariable(String name, VariantArg1 default_value, bool _export)

Add a variable to the VisualScript, optionally giving it a default value or marking it as exported.

customSignalAddArgument
void customSignalAddArgument(String name, long type, String argname, long index)

Add an argument to a custom signal added with addCustomSignal.

customSignalGetArgumentCount
long customSignalGetArgumentCount(String name)

Get the count of a custom signal's arguments.

customSignalGetArgumentName
String customSignalGetArgumentName(String name, long argidx)

Get the name of a custom signal's argument.

customSignalGetArgumentType
Variant.Type customSignalGetArgumentType(String name, long argidx)

Get the type of a custom signal's argument.

customSignalRemoveArgument
void customSignalRemoveArgument(String name, long argidx)

Remove a specific custom signal's argument.

customSignalSetArgumentName
void customSignalSetArgumentName(String name, long argidx, String argname)

Rename a custom signal's argument.

customSignalSetArgumentType
void customSignalSetArgumentType(String name, long argidx, long type)

Change the type of a custom signal's argument.

customSignalSwapArgument
void customSignalSwapArgument(String name, long argidx, long withidx)

Swap two of the arguments of a custom signal.

dataConnect
void dataConnect(String func, long from_node, long from_port, long to_node, long to_port)

Connect two data ports. The value of from_node's from_port would be fed into to_node's to_port.

dataDisconnect
void dataDisconnect(String func, long from_node, long from_port, long to_node, long to_port)

Disconnect two data ports previously connected with dataConnect.

getFunctionNodeId
long getFunctionNodeId(String name)

Returns the id of a function's entry point node.

getFunctionScroll
Vector2 getFunctionScroll(String name)

Returns the position of the center of the screen for a given function.

getNode
Ref!VisualScriptNode getNode(String func, long id)

Returns a node given its id and its function.

getNodePosition
Vector2 getNodePosition(String func, long id)

Returns a node's position in pixels.

getVariableDefaultValue
Variant getVariableDefaultValue(String name)

Returns the default (initial) value of a variable.

getVariableExport
bool getVariableExport(String name)

Returns whether a variable is exported.

getVariableInfo
Dictionary getVariableInfo(String name)

Returns the information for a given variable as a dictionary. The information includes its name, type, hint and usage.

hasCustomSignal
bool hasCustomSignal(String name)

Returns whether a signal exists with the specified name.

hasDataConnection
bool hasDataConnection(String func, long from_node, long from_port, long to_node, long to_port)

Returns whether the specified data ports are connected.

hasFunction
bool hasFunction(String name)

Returns whether a function exists with the specified name.

hasNode
bool hasNode(String func, long id)

Returns whether a node exists with the given id.

hasSequenceConnection
bool hasSequenceConnection(String func, long from_node, long from_output, long to_node)

Returns whether the specified sequence ports are connected.

hasVariable
bool hasVariable(String name)

Returns whether a variable exists with the specified name.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(VisualScript other)
opEquals
bool opEquals(typeof(null) n)
removeCustomSignal
void removeCustomSignal(String name)

Remove a custom signal with the given name.

removeFunction
void removeFunction(String name)

Remove a specific function and its nodes from the script.

removeNode
void removeNode(String func, long id)

Remove a specific node.

removeVariable
void removeVariable(String name)

Remove a variable with the given name.

renameCustomSignal
void renameCustomSignal(String name, String new_name)

Change the name of a custom signal.

renameFunction
void renameFunction(String name, String new_name)

Change the name of a function.

renameVariable
void renameVariable(String name, String new_name)

Change the name of a variable.

sequenceConnect
void sequenceConnect(String func, long from_node, long from_output, long to_node)

Connect two sequence ports. The execution will flow from of from_node's from_output into to_node. Unlike dataConnect, there isn't a to_port, since the target node can have only one sequence port.

sequenceDisconnect
void sequenceDisconnect(String func, long from_node, long from_output, long to_node)

Disconnect two sequence ports previously connected with sequenceConnect.

setFunctionScroll
void setFunctionScroll(String name, Vector2 ofs)

Position the center of the screen for a function.

setInstanceBaseType
void setInstanceBaseType(String type)

Set the base type of the script.

setNodePosition
void setNodePosition(String func, long id, Vector2 position)

Position a node on the screen.

setVariableDefaultValue
void setVariableDefaultValue(String name, VariantArg1 value)

Change the default (initial) value of a variable.

setVariableExport
void setVariableExport(String name, bool enable)

Change whether a variable is exported.

setVariableInfo
void setVariableInfo(String name, Dictionary value)

Set a variable's info, using the same format as getVariableInfo.

toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

data
Dictionary data [@property getter]
Dictionary data [@property setter]

Static functions

_new
VisualScript _new()

Construct a new instance of VisualScript. Note: use memnew!VisualScript instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta