Struct VisualScript

A script implemented in the Visual Script programming environment.

struct VisualScript ;

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.

Properties

NameTypeDescription
data[get, set] Dictionary

Methods

NameDescription
_getData
_nodePortsChanged
_setData
addCustomSignal Add a custom signal with the specified name to the VisualScript.
addFunction Add a function with the specified name to the VisualScript.
addNode Add a node to a function of the VisualScript.
addVariable Add a variable to the VisualScript, optionally giving it a default value or marking it as exported.
customSignalAddArgument Add an argument to a custom signal added with addCustomSignal.
customSignalGetArgumentCount Get the count of a custom signal's arguments.
customSignalGetArgumentName Get the name of a custom signal's argument.
customSignalGetArgumentType Get the type of a custom signal's argument.
customSignalRemoveArgument Remove a specific custom signal's argument.
customSignalSetArgumentName Rename a custom signal's argument.
customSignalSetArgumentType Change the type of a custom signal's argument.
customSignalSwapArgument Swap two of the arguments of a custom signal.
dataConnect Connect two data ports. The value of from_node's from_port would be fed into to_node's to_port.
dataDisconnect Disconnect two data ports previously connected with dataConnect.
getFunctionNodeId Returns the id of a function's entry point node.
getFunctionScroll Returns the position of the center of the screen for a given function.
getNode Returns a node given its id and its function.
getNodePosition Returns a node's position in pixels.
getVariableDefaultValue Returns the default (initial) value of a variable.
getVariableExport Returns whether a variable is exported.
getVariableInfo Returns the information for a given variable as a dictionary. The information includes its name, type, hint and usage.
hasCustomSignal Returns whether a signal exists with the specified name.
hasDataConnection Returns whether the specified data ports are connected.
hasFunction Returns whether a function exists with the specified name.
hasNode Returns whether a node exists with the given id.
hasSequenceConnection Returns whether the specified sequence ports are connected.
hasVariable Returns whether a variable exists with the specified name.
removeCustomSignal Remove a custom signal with the given name.
removeFunction Remove a specific function and its nodes from the script.
removeNode Remove a specific node.
removeVariable Remove a variable with the given name.
renameCustomSignal Change the name of a custom signal.
renameFunction Change the name of a function.
renameVariable Change the name of a variable.
sequenceConnect 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 Disconnect two sequence ports previously connected with sequenceConnect.
setFunctionScroll Position the center of the screen for a function.
setInstanceBaseType Set the base type of the script.
setNodePosition Position a node on the screen.
setVariableDefaultValue Change the default (initial) value of a variable.
setVariableExport Change whether a variable is exported.
setVariableInfo Set a variable's info, using the same format as getVariableInfo.