VisualScript

Inherits: Script < Resource < Reference < Object

类别: 核心

简要说明

在可视脚本编程环境中实现的脚本。

方法

无效

add_custom_signal ( String name )

无效

add_function ( String name )

无效

add_node ( String func, int id, VisualScriptNode node, Vector2 position=Vector2( 0, 0 ) )

无效

add_variable ( String name, Variant default_value=null, bool export=false )

无效

custom_signal_add_argument ( String name, Variant.Type type, String argname, int index=-1 )

int

custom_signal_get_argument_count ( String name ) const

String

custom_signal_get_argument_name ( String name, int argidx ) const

Variant.Type

custom_signal_get_argument_type ( String name, int argidx ) const

无效

custom_signal_remove_argument ( String name, int argidx )

无效

custom_signal_set_argument_name ( String name, int argidx, String argname )

无效

custom_signal_set_argument_type ( String name, int argidx, Variant.Type type )

无效

custom_signal_swap_argument ( String name, int argidx, int withidx )

无效

data_connect ( String func, int from_node, int from_port, int to_node, int to_port )

无效

data_disconnect ( String func, int from_node, int from_port, int to_node, int to_port )

int

get_function_node_id ( String name ) const

Vector2

get_function_scroll ( String name ) const

VisualScriptNode

get_node ( String func, int id ) const

Vector2

get_node_position ( String func, int id ) const

Variant

get_variable_default_value ( String name ) const

bool

get_variable_export ( String name ) const

Dictionary

get_variable_info ( String name ) const

bool

has_custom_signal ( String name ) const

bool

has_data_connection ( String func, int from_node, int from_port, int to_node, int to_port ) const

bool

has_function ( String name ) const

bool

has_node ( String func, int id ) const

bool

has_sequence_connection ( String func, int from_node, int from_output, int to_node ) const

bool

has_variable ( String name ) const

无效

remove_custom_signal ( String name )

无效

remove_function ( String name )

无效

remove_node ( String func, int id )

无效

remove_variable ( String name )

无效

rename_custom_signal ( String name, String new_name )

无效

rename_function ( String name, String new_name )

无效

rename_variable ( String name, String new_name )

无效

sequence_connect ( String func, int from_node, int from_output, int to_node )

无效

sequence_disconnect ( String func, int from_node, int from_output, int to_node )

无效

set_function_scroll ( String name, Vector2 ofs )

无效

set_instance_base_type ( String type )

无效

set_node_position ( String func, int id, Vector2 position )

无效

set_variable_default_value ( String name, Variant value )

无效

set_variable_export ( String name, bool enable )

无效

set_variable_info ( String name, Dictionary value )

信号

  • node_ports_changed ( String function, int id )

在更改节点的端口时发出。

描述

在可视脚本编程环境中实现的脚本。该脚本扩展了实例它的所有对象的功能。

Object.set_script 扩展现有对象(如果该对象的类与脚本的某个基类匹配)。

您很可能通过可视化脚本编辑器使用这个类,或者在为它编写插件时使用这个类。

方法说明

  • void add_custom_signal ( String name )

将具有指定名称的自定义信号添加到VisualScript中。

  • void add_function ( String name )

将具有指定名称的函数添加到VisualScript中。

将节点添加到VisualScript的函数中。

将变量添加到VisualScript中,可以选择为其提供默认值或将其标记为已导出。

向用添加的自定义信号添加参数 add_custom_signal .

  • int custom_signal_get_argument_count ( String name ) const

获取自定义信号参数的计数。

获取自定义信号参数的名称。

获取自定义信号参数的类型。

  • void custom_signal_remove_argument ( String name, int argidx )

删除特定自定义信号的参数。

  • void custom_signal_set_argument_name ( String name, int argidx, String argname )

重命名自定义信号的参数。

更改自定义信号参数的类型。

  • void custom_signal_swap_argument ( String name, int argidx, int withidx )

交换自定义信号的两个参数。

  • void data_connect ( String func, int from_node, int from_port, int to_node, int to_port )

连接两个数据端口。价值 from_nodefrom_port 将被送入 to_nodeto_port .

  • void data_disconnect ( String func, int from_node, int from_port, int to_node, int to_port )

断开先前连接的两个数据端口 data_connect .

  • int get_function_node_id ( String name ) const

返回函数入口点节点的ID。

返回给定函数的屏幕中心位置。

返回给定ID和函数的节点。

返回节点的位置(像素)。

返回变量的默认(初始)值。

返回是否导出变量。

以字典形式返回给定变量的信息。信息包括名称、类型、提示和用法。

返回具有指定名称的信号是否存在。

返回指定的数据端口是否已连接。

返回具有指定名称的函数是否存在。

返回具有给定ID的节点是否存在。

  • bool has_sequence_connection ( String func, int from_node, int from_output, int to_node ) const

返回指定的序列端口是否已连接。

返回具有指定名称的变量是否存在。

  • void remove_custom_signal ( String name )

删除具有给定名称的自定义信号。

  • void remove_function ( String name )

从脚本中删除特定函数及其节点。

删除特定节点。

  • void remove_variable ( String name )

删除具有给定名称的变量。

  • void rename_custom_signal ( String name, String new_name )

更改自定义信号的名称。

更改函数的名称。

更改变量的名称。

  • void sequence_connect ( String func, int from_node, int from_output, int to_node )

连接两个顺序端口。执行将从 from_nodefrom_output 进入之内 to_node .

不像 data_connect ,没有 to_port ,因为目标节点只能有一个序列端口。

  • void sequence_disconnect ( String func, int from_node, int from_output, int to_node )

断开先前连接的两个序列端口 sequence_connect .

定位屏幕中心的功能。

  • void set_instance_base_type ( String type )

设置脚本的基类型。

在屏幕上定位一个节点。

更改变量的默认(初始)值。

  • void set_variable_export ( String name, bool enable )

更改是否导出变量。

使用与相同的格式设置变量的信息 get_variable_info .