A script implemented in the Visual Script programming environment. The script extends the functionality of all objects that instance it.
godot.Object.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.
Constructor
Variables
Methods
addNode(func:String, id:Int, node:VisualScriptNode, ?position:Vector2):Void
Add a node to a function of the VisualScript.
Parameters:
position | If the parameter is null, then the default value is new Vector2(0, 0) |
---|
addVariable(name:String, ?defaultValue:Dynamic, ?export:Bool):Void
Add a variable to the VisualScript, optionally giving it a default value or marking it as exported.
customSignalAddArgument(name:String, type:Variant_Type, argname:String, ?index:Int):Void
Add an argument to a custom signal added with godot.VisualScript.addCustomSignal
.
customSignalGetArgumentName(name:String, argidx:Int):String
Get the name of a custom signal's argument.
customSignalGetArgumentType(name:String, argidx:Int):Variant_Type
Get the type of a custom signal's argument.
customSignalSetArgumentName(name:String, argidx:Int, argname:String):Void
Rename a custom signal's argument.
customSignalSetArgumentType(name:String, argidx:Int, type:Variant_Type):Void
Change the type of a custom signal's argument.
customSignalSwapArgument(name:String, argidx:Int, withidx:Int):Void
Swap two of the arguments of a custom signal.
dataConnect(func:String, fromNode:Int, fromPort:Int, toNode:Int, toPort:Int):Void
Connect two data ports. The value of from_node
's from_port
would be fed into to_node
's to_port
.
dataDisconnect(func:String, fromNode:Int, fromPort:Int, toNode:Int, toPort:Int):Void
Disconnect two data ports previously connected with godot.VisualScript.dataConnect
.
getFunctionScroll(name:String):Vector2
Returns the position of the center of the screen for a given function.
getVariableInfo(name:String):Dictionary
Returns the information for a given variable as a dictionary. The information includes its name, type, hint and usage.
hasDataConnection(func:String, fromNode:Int, fromPort:Int, toNode:Int, toPort:Int):Bool
Returns whether the specified data ports are connected.
hasSequenceConnection(func:String, fromNode:Int, fromOutput:Int, toNode:Int):Bool
Returns whether the specified sequence ports are connected.
sequenceConnect(func:String, fromNode:Int, fromOutput:Int, toNode:Int):Void
Connect two sequence ports. The execution will flow from of from_node
's from_output
into to_node
.
Unlike godot.VisualScript.dataConnect
, there isn't a to_port
, since the target node can have only one sequence port.
sequenceDisconnect(func:String, fromNode:Int, fromOutput:Int, toNode:Int):Void
Disconnect two sequence ports previously connected with godot.VisualScript.sequenceConnect
.
setVariableDefaultValue(name:String, value:Dynamic):Void
Change the default (initial) value of a variable.
setVariableInfo(name:String, value:Dictionary):Void
Set a variable's info, using the same format as godot.VisualScript.getVariableInfo
.