class_visualscriptpropertyset.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the VisualScriptPropertySet.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_VisualScriptPropertySet:
  6. VisualScriptPropertySet
  7. =======================
  8. **Inherits:** :ref:`VisualScriptNode<class_VisualScriptNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. A Visual Script node that sets a property of an :ref:`Object<class_Object>`.
  10. Description
  11. -----------
  12. ``VisualScriptPropertySet`` can set the value of any property from the current object or other objects.
  13. Properties
  14. ----------
  15. +--------------------------------------------------------+------------------------------------------------------------------------+--------------+
  16. | :ref:`AssignOp<enum_VisualScriptPropertySet_AssignOp>` | :ref:`assign_op<class_VisualScriptPropertySet_property_assign_op>` | ``0`` |
  17. +--------------------------------------------------------+------------------------------------------------------------------------+--------------+
  18. | :ref:`String<class_String>` | :ref:`base_script<class_VisualScriptPropertySet_property_base_script>` | |
  19. +--------------------------------------------------------+------------------------------------------------------------------------+--------------+
  20. | :ref:`String<class_String>` | :ref:`base_type<class_VisualScriptPropertySet_property_base_type>` | ``"Object"`` |
  21. +--------------------------------------------------------+------------------------------------------------------------------------+--------------+
  22. | :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` | :ref:`basic_type<class_VisualScriptPropertySet_property_basic_type>` | |
  23. +--------------------------------------------------------+------------------------------------------------------------------------+--------------+
  24. | :ref:`String<class_String>` | :ref:`index<class_VisualScriptPropertySet_property_index>` | |
  25. +--------------------------------------------------------+------------------------------------------------------------------------+--------------+
  26. | :ref:`NodePath<class_NodePath>` | :ref:`node_path<class_VisualScriptPropertySet_property_node_path>` | |
  27. +--------------------------------------------------------+------------------------------------------------------------------------+--------------+
  28. | :ref:`String<class_String>` | :ref:`property<class_VisualScriptPropertySet_property_property>` | ``""`` |
  29. +--------------------------------------------------------+------------------------------------------------------------------------+--------------+
  30. | :ref:`CallMode<enum_VisualScriptPropertySet_CallMode>` | :ref:`set_mode<class_VisualScriptPropertySet_property_set_mode>` | ``0`` |
  31. +--------------------------------------------------------+------------------------------------------------------------------------+--------------+
  32. Enumerations
  33. ------------
  34. .. _enum_VisualScriptPropertySet_CallMode:
  35. .. _class_VisualScriptPropertySet_constant_CALL_MODE_SELF:
  36. .. _class_VisualScriptPropertySet_constant_CALL_MODE_NODE_PATH:
  37. .. _class_VisualScriptPropertySet_constant_CALL_MODE_INSTANCE:
  38. .. _class_VisualScriptPropertySet_constant_CALL_MODE_BASIC_TYPE:
  39. enum **CallMode**:
  40. - **CALL_MODE_SELF** = **0** --- The property will be set on this :ref:`Object<class_Object>`.
  41. - **CALL_MODE_NODE_PATH** = **1** --- The property will be set on the given :ref:`Node<class_Node>` in the scene tree.
  42. - **CALL_MODE_INSTANCE** = **2** --- The property will be set on an instanced node with the given type and script.
  43. - **CALL_MODE_BASIC_TYPE** = **3** --- The property will be set on a GDScript basic type (e.g. :ref:`Vector2<class_Vector2>`).
  44. ----
  45. .. _enum_VisualScriptPropertySet_AssignOp:
  46. .. _class_VisualScriptPropertySet_constant_ASSIGN_OP_NONE:
  47. .. _class_VisualScriptPropertySet_constant_ASSIGN_OP_ADD:
  48. .. _class_VisualScriptPropertySet_constant_ASSIGN_OP_SUB:
  49. .. _class_VisualScriptPropertySet_constant_ASSIGN_OP_MUL:
  50. .. _class_VisualScriptPropertySet_constant_ASSIGN_OP_DIV:
  51. .. _class_VisualScriptPropertySet_constant_ASSIGN_OP_MOD:
  52. .. _class_VisualScriptPropertySet_constant_ASSIGN_OP_SHIFT_LEFT:
  53. .. _class_VisualScriptPropertySet_constant_ASSIGN_OP_SHIFT_RIGHT:
  54. .. _class_VisualScriptPropertySet_constant_ASSIGN_OP_BIT_AND:
  55. .. _class_VisualScriptPropertySet_constant_ASSIGN_OP_BIT_OR:
  56. .. _class_VisualScriptPropertySet_constant_ASSIGN_OP_BIT_XOR:
  57. enum **AssignOp**:
  58. - **ASSIGN_OP_NONE** = **0** --- The property will be assigned regularly.
  59. - **ASSIGN_OP_ADD** = **1** --- The value will be added to the property. Equivalent of doing ``+=``.
  60. - **ASSIGN_OP_SUB** = **2** --- The value will be subtracted from the property. Equivalent of doing ``-=``.
  61. - **ASSIGN_OP_MUL** = **3** --- The property will be multiplied by the value. Equivalent of doing ``*=``.
  62. - **ASSIGN_OP_DIV** = **4** --- The property will be divided by the value. Equivalent of doing ``/=``.
  63. - **ASSIGN_OP_MOD** = **5** --- A modulo operation will be performed on the property and the value. Equivalent of doing ``%=``.
  64. - **ASSIGN_OP_SHIFT_LEFT** = **6** --- The property will be binarly shifted to the left by the given value. Equivalent of doing ``<<``.
  65. - **ASSIGN_OP_SHIFT_RIGHT** = **7** --- The property will be binarly shifted to the right by the given value. Equivalent of doing ``>>``.
  66. - **ASSIGN_OP_BIT_AND** = **8** --- A binary ``AND`` operation will be performed on the property. Equivalent of doing ``&=``.
  67. - **ASSIGN_OP_BIT_OR** = **9** --- A binary ``OR`` operation will be performed on the property. Equivalent of doing ``|=``.
  68. - **ASSIGN_OP_BIT_XOR** = **10** --- A binary ``XOR`` operation will be performed on the property. Equivalent of doing ``^=``.
  69. Property Descriptions
  70. ---------------------
  71. .. _class_VisualScriptPropertySet_property_assign_op:
  72. - :ref:`AssignOp<enum_VisualScriptPropertySet_AssignOp>` **assign_op**
  73. +-----------+----------------------+
  74. | *Default* | ``0`` |
  75. +-----------+----------------------+
  76. | *Setter* | set_assign_op(value) |
  77. +-----------+----------------------+
  78. | *Getter* | get_assign_op() |
  79. +-----------+----------------------+
  80. The additional operation to perform when assigning. See :ref:`AssignOp<enum_VisualScriptPropertySet_AssignOp>` for options.
  81. ----
  82. .. _class_VisualScriptPropertySet_property_base_script:
  83. - :ref:`String<class_String>` **base_script**
  84. +----------+------------------------+
  85. | *Setter* | set_base_script(value) |
  86. +----------+------------------------+
  87. | *Getter* | get_base_script() |
  88. +----------+------------------------+
  89. The script to be used when :ref:`set_mode<class_VisualScriptPropertySet_property_set_mode>` is set to :ref:`CALL_MODE_INSTANCE<class_VisualScriptPropertySet_constant_CALL_MODE_INSTANCE>`.
  90. ----
  91. .. _class_VisualScriptPropertySet_property_base_type:
  92. - :ref:`String<class_String>` **base_type**
  93. +-----------+----------------------+
  94. | *Default* | ``"Object"`` |
  95. +-----------+----------------------+
  96. | *Setter* | set_base_type(value) |
  97. +-----------+----------------------+
  98. | *Getter* | get_base_type() |
  99. +-----------+----------------------+
  100. The base type to be used when :ref:`set_mode<class_VisualScriptPropertySet_property_set_mode>` is set to :ref:`CALL_MODE_INSTANCE<class_VisualScriptPropertySet_constant_CALL_MODE_INSTANCE>`.
  101. ----
  102. .. _class_VisualScriptPropertySet_property_basic_type:
  103. - :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **basic_type**
  104. +----------+-----------------------+
  105. | *Setter* | set_basic_type(value) |
  106. +----------+-----------------------+
  107. | *Getter* | get_basic_type() |
  108. +----------+-----------------------+
  109. The type to be used when :ref:`set_mode<class_VisualScriptPropertySet_property_set_mode>` is set to :ref:`CALL_MODE_BASIC_TYPE<class_VisualScriptPropertySet_constant_CALL_MODE_BASIC_TYPE>`.
  110. ----
  111. .. _class_VisualScriptPropertySet_property_index:
  112. - :ref:`String<class_String>` **index**
  113. +----------+------------------+
  114. | *Setter* | set_index(value) |
  115. +----------+------------------+
  116. | *Getter* | get_index() |
  117. +----------+------------------+
  118. The indexed name of the property to set. See :ref:`Object.set_indexed<class_Object_method_set_indexed>` for details.
  119. ----
  120. .. _class_VisualScriptPropertySet_property_node_path:
  121. - :ref:`NodePath<class_NodePath>` **node_path**
  122. +----------+----------------------+
  123. | *Setter* | set_base_path(value) |
  124. +----------+----------------------+
  125. | *Getter* | get_base_path() |
  126. +----------+----------------------+
  127. The node path to use when :ref:`set_mode<class_VisualScriptPropertySet_property_set_mode>` is set to :ref:`CALL_MODE_NODE_PATH<class_VisualScriptPropertySet_constant_CALL_MODE_NODE_PATH>`.
  128. ----
  129. .. _class_VisualScriptPropertySet_property_property:
  130. - :ref:`String<class_String>` **property**
  131. +-----------+---------------------+
  132. | *Default* | ``""`` |
  133. +-----------+---------------------+
  134. | *Setter* | set_property(value) |
  135. +-----------+---------------------+
  136. | *Getter* | get_property() |
  137. +-----------+---------------------+
  138. The name of the property to set. Changing this will clear :ref:`index<class_VisualScriptPropertySet_property_index>`.
  139. ----
  140. .. _class_VisualScriptPropertySet_property_set_mode:
  141. - :ref:`CallMode<enum_VisualScriptPropertySet_CallMode>` **set_mode**
  142. +-----------+----------------------+
  143. | *Default* | ``0`` |
  144. +-----------+----------------------+
  145. | *Setter* | set_call_mode(value) |
  146. +-----------+----------------------+
  147. | *Getter* | get_call_mode() |
  148. +-----------+----------------------+
  149. ``set_mode`` determines the target object on which the property will be set. See :ref:`CallMode<enum_VisualScriptPropertySet_CallMode>` for options.
  150. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  151. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  152. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`