code
stringlengths
2.5k
150k
kind
stringclasses
1 value
godot VisualShaderNodeTransformFunc VisualShaderNodeTransformFunc ============================= **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Computes a [Transform](class_transform#class-transform) function within the visual shader graph. Description ----------- Computes an inverse or transpose function on the provided [Transform](class_transform#class-transform). Properties ---------- | | | | | --- | --- | --- | | [Function](#enum-visualshadernodetransformfunc-function) | [function](#class-visualshadernodetransformfunc-property-function) | `0` | Enumerations ------------ enum **Function**: * **FUNC\_INVERSE** = **0** --- Perform the inverse operation on the [Transform](class_transform#class-transform) matrix. * **FUNC\_TRANSPOSE** = **1** --- Perform the transpose operation on the [Transform](class_transform#class-transform) matrix. Property Descriptions --------------------- ### [Function](#enum-visualshadernodetransformfunc-function) function | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_function(value) | | *Getter* | get\_function() | The function to be computed. See [Function](#enum-visualshadernodetransformfunc-function) for options. godot NavigationObstacle NavigationObstacle ================== **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) 3D obstacle used in navigation for collision avoidance. Description ----------- 3D obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. This can be done by having the obstacle as a child of a [Navigation](class_navigation#class-navigation) node, or using [set\_navigation](#class-navigationobstacle-method-set-navigation). `NavigationObstacle` is physics safe. **Note:** Obstacles are intended as a last resort option for constantly moving objects that cannot be (re)baked to a navigation mesh efficiently. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [estimate\_radius](#class-navigationobstacle-property-estimate-radius) | `true` | | [float](class_float#class-float) | [radius](#class-navigationobstacle-property-radius) | `1.0` | Methods ------- | | | | --- | --- | | [Node](class_node#class-node) | [get\_navigation](#class-navigationobstacle-method-get-navigation) **(** **)** const | | [RID](class_rid#class-rid) | [get\_rid](#class-navigationobstacle-method-get-rid) **(** **)** const | | void | [set\_navigation](#class-navigationobstacle-method-set-navigation) **(** [Node](class_node#class-node) navigation **)** | Property Descriptions --------------------- ### [bool](class_bool#class-bool) estimate\_radius | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_estimate\_radius(value) | | *Getter* | is\_radius\_estimated() | Enables radius estimation algorithm which uses parent's collision shapes to determine the obstacle radius. ### [float](class_float#class-float) radius | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_radius(value) | | *Getter* | get\_radius() | The radius of the agent. Used only if [estimate\_radius](#class-navigationobstacle-property-estimate-radius) is set to `false`. Method Descriptions ------------------- ### [Node](class_node#class-node) get\_navigation ( ) const Returns the [Navigation](class_navigation#class-navigation) node that the obstacle is using for its navigation system. ### [RID](class_rid#class-rid) get\_rid ( ) const Returns the [RID](class_rid#class-rid) of this obstacle on the [NavigationServer](class_navigationserver#class-navigationserver). ### void set\_navigation ( [Node](class_node#class-node) navigation ) Sets the [Navigation](class_navigation#class-navigation) node used by the obstacle. Useful when you don't want to make the obstacle a child of a [Navigation](class_navigation#class-navigation) node. godot EditorResourcePicker EditorResourcePicker ==================== **Inherits:** [HBoxContainer](class_hboxcontainer#class-hboxcontainer) **<** [BoxContainer](class_boxcontainer#class-boxcontainer) **<** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [EditorScriptPicker](class_editorscriptpicker#class-editorscriptpicker) Godot editor's control for selecting [Resource](class_resource#class-resource) type properties. Description ----------- This [Control](class_control#class-control) node is used in the editor's Inspector dock to allow editing of [Resource](class_resource#class-resource) type properties. It provides options for creating, loading, saving and converting resources. Can be used with [EditorInspectorPlugin](class_editorinspectorplugin#class-editorinspectorplugin) to recreate the same behavior. **Note:** This [Control](class_control#class-control) does not include any editor for the resource, as editing is controlled by the Inspector dock itself or sub-Inspectors. Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [base\_type](#class-editorresourcepicker-property-base-type) | `""` | | [bool](class_bool#class-bool) | [editable](#class-editorresourcepicker-property-editable) | `true` | | [Resource](class_resource#class-resource) | [edited\_resource](#class-editorresourcepicker-property-edited-resource) | | | [bool](class_bool#class-bool) | [toggle\_mode](#class-editorresourcepicker-property-toggle-mode) | `false` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [can\_drop\_data\_fw](#class-editorresourcepicker-method-can-drop-data-fw) **(** [Vector2](class_vector2#class-vector2) position, [Variant](class_variant#class-variant) data, [Control](class_control#class-control) from **)** const | | void | [drop\_data\_fw](#class-editorresourcepicker-method-drop-data-fw) **(** [Vector2](class_vector2#class-vector2) position, [Variant](class_variant#class-variant) data, [Control](class_control#class-control) from **)** | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_allowed\_types](#class-editorresourcepicker-method-get-allowed-types) **(** **)** const | | [Variant](class_variant#class-variant) | [get\_drag\_data\_fw](#class-editorresourcepicker-method-get-drag-data-fw) **(** [Vector2](class_vector2#class-vector2) position, [Control](class_control#class-control) from **)** | | [bool](class_bool#class-bool) | [handle\_menu\_selected](#class-editorresourcepicker-method-handle-menu-selected) **(** [int](class_int#class-int) id **)** virtual | | void | [set\_create\_options](#class-editorresourcepicker-method-set-create-options) **(** [Object](class_object#class-object) menu\_node **)** virtual | | void | [set\_toggle\_pressed](#class-editorresourcepicker-method-set-toggle-pressed) **(** [bool](class_bool#class-bool) pressed **)** | Signals ------- ### resource\_changed ( [Resource](class_resource#class-resource) resource ) Emitted when the value of the edited resource was changed. ### resource\_selected ( [Resource](class_resource#class-resource) resource, [bool](class_bool#class-bool) edit ) Emitted when the resource value was set and user clicked to edit it. When `edit` is `true`, the signal was caused by the context menu "Edit" option. Property Descriptions --------------------- ### [String](class_string#class-string) base\_type | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_base\_type(value) | | *Getter* | get\_base\_type() | The base type of allowed resource types. Can be a comma-separated list of several options. ### [bool](class_bool#class-bool) editable | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_editable(value) | | *Getter* | is\_editable() | If `true`, the value can be selected and edited. ### [Resource](class_resource#class-resource) edited\_resource | | | | --- | --- | | *Setter* | set\_edited\_resource(value) | | *Getter* | get\_edited\_resource() | The edited resource value. ### [bool](class_bool#class-bool) toggle\_mode | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_toggle\_mode(value) | | *Getter* | is\_toggle\_mode() | If `true`, the main button with the resource preview works in the toggle mode. Use [set\_toggle\_pressed](#class-editorresourcepicker-method-set-toggle-pressed) to manually set the state. Method Descriptions ------------------- ### [bool](class_bool#class-bool) can\_drop\_data\_fw ( [Vector2](class_vector2#class-vector2) position, [Variant](class_variant#class-variant) data, [Control](class_control#class-control) from ) const ### void drop\_data\_fw ( [Vector2](class_vector2#class-vector2) position, [Variant](class_variant#class-variant) data, [Control](class_control#class-control) from ) ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_allowed\_types ( ) const Returns a list of all allowed types and subtypes corresponding to the [base\_type](#class-editorresourcepicker-property-base-type). If the [base\_type](#class-editorresourcepicker-property-base-type) is empty, an empty list is returned. ### [Variant](class_variant#class-variant) get\_drag\_data\_fw ( [Vector2](class_vector2#class-vector2) position, [Control](class_control#class-control) from ) ### [bool](class_bool#class-bool) handle\_menu\_selected ( [int](class_int#class-int) id ) virtual This virtual method can be implemented to handle context menu items not handled by default. See [set\_create\_options](#class-editorresourcepicker-method-set-create-options). ### void set\_create\_options ( [Object](class_object#class-object) menu\_node ) virtual This virtual method is called when updating the context menu of `EditorResourcePicker`. Implement this method to override the "New ..." items with your own options. `menu_node` is a reference to the [PopupMenu](class_popupmenu#class-popupmenu) node. **Note:** Implement [handle\_menu\_selected](#class-editorresourcepicker-method-handle-menu-selected) to handle these custom items. ### void set\_toggle\_pressed ( [bool](class_bool#class-bool) pressed ) Sets the toggle mode state for the main button. Works only if [toggle\_mode](#class-editorresourcepicker-property-toggle-mode) is set to `true`. godot Control Control ======= **Inherits:** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [BaseButton](class_basebutton#class-basebutton), [ColorRect](class_colorrect#class-colorrect), [Container](class_container#class-container), [GraphEdit](class_graphedit#class-graphedit), [ItemList](class_itemlist#class-itemlist), [Label](class_label#class-label), [LineEdit](class_lineedit#class-lineedit), [NinePatchRect](class_ninepatchrect#class-ninepatchrect), [Panel](class_panel#class-panel), [Popup](class_popup#class-popup), [Range](class_range#class-range), [ReferenceRect](class_referencerect#class-referencerect), [RichTextLabel](class_richtextlabel#class-richtextlabel), [Separator](class_separator#class-separator), [Tabs](class_tabs#class-tabs), [TextEdit](class_textedit#class-textedit), [TextureRect](class_texturerect#class-texturerect), [Tree](class_tree#class-tree), [VideoPlayer](class_videoplayer#class-videoplayer) All user interface nodes inherit from Control. A control's anchors and margins adapt its position and size relative to its parent. Description ----------- Base class for all UI-related nodes. `Control` features a bounding rectangle that defines its extents, an anchor position relative to its parent control or the current viewport, and margins that represent an offset to the anchor. The margins update automatically when the node, any of its parents, or the screen size change. For more information on Godot's UI system, anchors, margins, and containers, see the related tutorials in the manual. To build flexible UIs, you'll need a mix of UI elements that inherit from `Control` and [Container](class_container#class-container) nodes. **User Interface nodes and input** Godot sends input events to the scene's root node first, by calling [Node.\_input](class_node#class-node-method-input). [Node.\_input](class_node#class-node-method-input) forwards the event down the node tree to the nodes under the mouse cursor, or on keyboard focus. To do so, it calls [MainLoop.\_input\_event](class_mainloop#class-mainloop-method-input-event). Call [accept\_event](#class-control-method-accept-event) so no other node receives the event. Once you accept an input, it becomes handled so [Node.\_unhandled\_input](class_node#class-node-method-unhandled-input) will not process it. Only one `Control` node can be in keyboard focus. Only the node in focus will receive keyboard events. To get the focus, call [grab\_focus](#class-control-method-grab-focus). `Control` nodes lose focus when another node grabs it, or if you hide the node in focus. Sets [mouse\_filter](#class-control-property-mouse-filter) to [MOUSE\_FILTER\_IGNORE](#class-control-constant-mouse-filter-ignore) to tell a `Control` node to ignore mouse or touch events. You'll need it if you place an icon on top of a button. [Theme](class_theme#class-theme) resources change the Control's appearance. If you change the [Theme](class_theme#class-theme) on a `Control` node, it affects all of its children. To override some of the theme's parameters, call one of the `add_*_override` methods, like [add\_font\_override](#class-control-method-add-font-override). You can override the theme with the inspector. **Note:** Theme items are *not* [Object](class_object#class-object) properties. This means you can't access their values using [Object.get](class_object#id1) and [Object.set](class_object#id4). Instead, use [get\_color](#class-control-method-get-color), [get\_constant](#class-control-method-get-constant), [get\_font](#class-control-method-get-font), [get\_icon](#class-control-method-get-icon), [get\_stylebox](#class-control-method-get-stylebox), and the `add_*_override` methods provided by this class. Tutorials --------- * [GUI tutorial index](https://docs.godotengine.org/en/3.5/tutorials/ui/index.html) * [Custom drawing in 2D](https://docs.godotengine.org/en/3.5/tutorials/2d/custom_drawing_in_2d.html) * [Control node gallery](https://docs.godotengine.org/en/3.5/tutorials/ui/control_node_gallery.html) * [All GUI Demos](https://github.com/godotengine/godot-demo-projects/tree/master/gui) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [anchor\_bottom](#class-control-property-anchor-bottom) | `0.0` | | [float](class_float#class-float) | [anchor\_left](#class-control-property-anchor-left) | `0.0` | | [float](class_float#class-float) | [anchor\_right](#class-control-property-anchor-right) | `0.0` | | [float](class_float#class-float) | [anchor\_top](#class-control-property-anchor-top) | `0.0` | | [FocusMode](#enum-control-focusmode) | [focus\_mode](#class-control-property-focus-mode) | `0` | | [NodePath](class_nodepath#class-nodepath) | [focus\_neighbour\_bottom](#class-control-property-focus-neighbour-bottom) | `NodePath("")` | | [NodePath](class_nodepath#class-nodepath) | [focus\_neighbour\_left](#class-control-property-focus-neighbour-left) | `NodePath("")` | | [NodePath](class_nodepath#class-nodepath) | [focus\_neighbour\_right](#class-control-property-focus-neighbour-right) | `NodePath("")` | | [NodePath](class_nodepath#class-nodepath) | [focus\_neighbour\_top](#class-control-property-focus-neighbour-top) | `NodePath("")` | | [NodePath](class_nodepath#class-nodepath) | [focus\_next](#class-control-property-focus-next) | `NodePath("")` | | [NodePath](class_nodepath#class-nodepath) | [focus\_previous](#class-control-property-focus-previous) | `NodePath("")` | | [GrowDirection](#enum-control-growdirection) | [grow\_horizontal](#class-control-property-grow-horizontal) | `1` | | [GrowDirection](#enum-control-growdirection) | [grow\_vertical](#class-control-property-grow-vertical) | `1` | | [String](class_string#class-string) | [hint\_tooltip](#class-control-property-hint-tooltip) | `""` | | [bool](class_bool#class-bool) | [input\_pass\_on\_modal\_close\_click](#class-control-property-input-pass-on-modal-close-click) | `true` | | [float](class_float#class-float) | [margin\_bottom](#class-control-property-margin-bottom) | `0.0` | | [float](class_float#class-float) | [margin\_left](#class-control-property-margin-left) | `0.0` | | [float](class_float#class-float) | [margin\_right](#class-control-property-margin-right) | `0.0` | | [float](class_float#class-float) | [margin\_top](#class-control-property-margin-top) | `0.0` | | [CursorShape](#enum-control-cursorshape) | [mouse\_default\_cursor\_shape](#class-control-property-mouse-default-cursor-shape) | `0` | | [MouseFilter](#enum-control-mousefilter) | [mouse\_filter](#class-control-property-mouse-filter) | `0` | | [bool](class_bool#class-bool) | [rect\_clip\_content](#class-control-property-rect-clip-content) | `false` | | [Vector2](class_vector2#class-vector2) | [rect\_global\_position](#class-control-property-rect-global-position) | | | [Vector2](class_vector2#class-vector2) | [rect\_min\_size](#class-control-property-rect-min-size) | `Vector2( 0, 0 )` | | [Vector2](class_vector2#class-vector2) | [rect\_pivot\_offset](#class-control-property-rect-pivot-offset) | `Vector2( 0, 0 )` | | [Vector2](class_vector2#class-vector2) | [rect\_position](#class-control-property-rect-position) | `Vector2( 0, 0 )` | | [float](class_float#class-float) | [rect\_rotation](#class-control-property-rect-rotation) | `0.0` | | [Vector2](class_vector2#class-vector2) | [rect\_scale](#class-control-property-rect-scale) | `Vector2( 1, 1 )` | | [Vector2](class_vector2#class-vector2) | [rect\_size](#class-control-property-rect-size) | `Vector2( 0, 0 )` | | [int](class_int#class-int) | [size\_flags\_horizontal](#class-control-property-size-flags-horizontal) | `1` | | [float](class_float#class-float) | [size\_flags\_stretch\_ratio](#class-control-property-size-flags-stretch-ratio) | `1.0` | | [int](class_int#class-int) | [size\_flags\_vertical](#class-control-property-size-flags-vertical) | `1` | | [Theme](class_theme#class-theme) | [theme](#class-control-property-theme) | | | [String](class_string#class-string) | [theme\_type\_variation](#class-control-property-theme-type-variation) | `""` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [\_clips\_input](#class-control-method-clips-input) **(** **)** virtual | | [Vector2](class_vector2#class-vector2) | [\_get\_minimum\_size](#class-control-method-get-minimum-size) **(** **)** virtual | | void | [\_gui\_input](#class-control-method-gui-input) **(** [InputEvent](class_inputevent#class-inputevent) event **)** virtual | | [Control](#class-control) | [\_make\_custom\_tooltip](#class-control-method-make-custom-tooltip) **(** [String](class_string#class-string) for\_text **)** virtual | | void | [accept\_event](#class-control-method-accept-event) **(** **)** | | void | [add\_color\_override](#class-control-method-add-color-override) **(** [String](class_string#class-string) name, [Color](class_color#class-color) color **)** | | void | [add\_constant\_override](#class-control-method-add-constant-override) **(** [String](class_string#class-string) name, [int](class_int#class-int) constant **)** | | void | [add\_font\_override](#class-control-method-add-font-override) **(** [String](class_string#class-string) name, [Font](class_font#class-font) font **)** | | void | [add\_icon\_override](#class-control-method-add-icon-override) **(** [String](class_string#class-string) name, [Texture](class_texture#class-texture) texture **)** | | void | [add\_shader\_override](#class-control-method-add-shader-override) **(** [String](class_string#class-string) name, [Shader](class_shader#class-shader) shader **)** | | void | [add\_stylebox\_override](#class-control-method-add-stylebox-override) **(** [String](class_string#class-string) name, [StyleBox](class_stylebox#class-stylebox) stylebox **)** | | [bool](class_bool#class-bool) | [can\_drop\_data](#class-control-method-can-drop-data) **(** [Vector2](class_vector2#class-vector2) position, [Variant](class_variant#class-variant) data **)** virtual | | void | [drop\_data](#class-control-method-drop-data) **(** [Vector2](class_vector2#class-vector2) position, [Variant](class_variant#class-variant) data **)** virtual | | [Control](#class-control) | [find\_next\_valid\_focus](#class-control-method-find-next-valid-focus) **(** **)** const | | [Control](#class-control) | [find\_prev\_valid\_focus](#class-control-method-find-prev-valid-focus) **(** **)** const | | void | [force\_drag](#class-control-method-force-drag) **(** [Variant](class_variant#class-variant) data, [Control](#class-control) preview **)** | | [float](class_float#class-float) | [get\_anchor](#class-control-method-get-anchor) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin **)** const | | [Vector2](class_vector2#class-vector2) | [get\_begin](#class-control-method-get-begin) **(** **)** const | | [Color](class_color#class-color) | [get\_color](#class-control-method-get-color) **(** [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" **)** const | | [Vector2](class_vector2#class-vector2) | [get\_combined\_minimum\_size](#class-control-method-get-combined-minimum-size) **(** **)** const | | [int](class_int#class-int) | [get\_constant](#class-control-method-get-constant) **(** [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" **)** const | | [CursorShape](#enum-control-cursorshape) | [get\_cursor\_shape](#class-control-method-get-cursor-shape) **(** [Vector2](class_vector2#class-vector2) position=Vector2( 0, 0 ) **)** const | | [Variant](class_variant#class-variant) | [get\_drag\_data](#class-control-method-get-drag-data) **(** [Vector2](class_vector2#class-vector2) position **)** virtual | | [Vector2](class_vector2#class-vector2) | [get\_end](#class-control-method-get-end) **(** **)** const | | [NodePath](class_nodepath#class-nodepath) | [get\_focus\_neighbour](#class-control-method-get-focus-neighbour) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin **)** const | | [Control](#class-control) | [get\_focus\_owner](#class-control-method-get-focus-owner) **(** **)** const | | [Font](class_font#class-font) | [get\_font](#class-control-method-get-font) **(** [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" **)** const | | [Rect2](class_rect2#class-rect2) | [get\_global\_rect](#class-control-method-get-global-rect) **(** **)** const | | [Texture](class_texture#class-texture) | [get\_icon](#class-control-method-get-icon) **(** [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" **)** const | | [float](class_float#class-float) | [get\_margin](#class-control-method-get-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin **)** const | | [Vector2](class_vector2#class-vector2) | [get\_minimum\_size](#id1) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_parent\_area\_size](#class-control-method-get-parent-area-size) **(** **)** const | | [Control](#class-control) | [get\_parent\_control](#class-control-method-get-parent-control) **(** **)** const | | [Rect2](class_rect2#class-rect2) | [get\_rect](#class-control-method-get-rect) **(** **)** const | | [float](class_float#class-float) | [get\_rotation](#class-control-method-get-rotation) **(** **)** const | | [StyleBox](class_stylebox#class-stylebox) | [get\_stylebox](#class-control-method-get-stylebox) **(** [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" **)** const | | [Font](class_font#class-font) | [get\_theme\_default\_font](#class-control-method-get-theme-default-font) **(** **)** const | | [String](class_string#class-string) | [get\_tooltip](#class-control-method-get-tooltip) **(** [Vector2](class_vector2#class-vector2) at\_position=Vector2( 0, 0 ) **)** const | | void | [grab\_click\_focus](#class-control-method-grab-click-focus) **(** **)** | | void | [grab\_focus](#class-control-method-grab-focus) **(** **)** | | [bool](class_bool#class-bool) | [has\_color](#class-control-method-has-color) **(** [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" **)** const | | [bool](class_bool#class-bool) | [has\_color\_override](#class-control-method-has-color-override) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [has\_constant](#class-control-method-has-constant) **(** [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" **)** const | | [bool](class_bool#class-bool) | [has\_constant\_override](#class-control-method-has-constant-override) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [has\_focus](#class-control-method-has-focus) **(** **)** const | | [bool](class_bool#class-bool) | [has\_font](#class-control-method-has-font) **(** [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" **)** const | | [bool](class_bool#class-bool) | [has\_font\_override](#class-control-method-has-font-override) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [has\_icon](#class-control-method-has-icon) **(** [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" **)** const | | [bool](class_bool#class-bool) | [has\_icon\_override](#class-control-method-has-icon-override) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [has\_point](#class-control-method-has-point) **(** [Vector2](class_vector2#class-vector2) point **)** virtual | | [bool](class_bool#class-bool) | [has\_shader\_override](#class-control-method-has-shader-override) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [has\_stylebox](#class-control-method-has-stylebox) **(** [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" **)** const | | [bool](class_bool#class-bool) | [has\_stylebox\_override](#class-control-method-has-stylebox-override) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [is\_drag\_successful](#class-control-method-is-drag-successful) **(** **)** const | | void | [minimum\_size\_changed](#class-control-method-minimum-size-changed) **(** **)** | | void | [release\_focus](#class-control-method-release-focus) **(** **)** | | void | [remove\_color\_override](#class-control-method-remove-color-override) **(** [String](class_string#class-string) name **)** | | void | [remove\_constant\_override](#class-control-method-remove-constant-override) **(** [String](class_string#class-string) name **)** | | void | [remove\_font\_override](#class-control-method-remove-font-override) **(** [String](class_string#class-string) name **)** | | void | [remove\_icon\_override](#class-control-method-remove-icon-override) **(** [String](class_string#class-string) name **)** | | void | [remove\_shader\_override](#class-control-method-remove-shader-override) **(** [String](class_string#class-string) name **)** | | void | [remove\_stylebox\_override](#class-control-method-remove-stylebox-override) **(** [String](class_string#class-string) name **)** | | void | [set\_anchor](#class-control-method-set-anchor) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) anchor, [bool](class_bool#class-bool) keep\_margin=false, [bool](class_bool#class-bool) push\_opposite\_anchor=true **)** | | void | [set\_anchor\_and\_margin](#class-control-method-set-anchor-and-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) anchor, [float](class_float#class-float) offset, [bool](class_bool#class-bool) push\_opposite\_anchor=false **)** | | void | [set\_anchors\_and\_margins\_preset](#class-control-method-set-anchors-and-margins-preset) **(** [LayoutPreset](#enum-control-layoutpreset) preset, [LayoutPresetMode](#enum-control-layoutpresetmode) resize\_mode=0, [int](class_int#class-int) margin=0 **)** | | void | [set\_anchors\_preset](#class-control-method-set-anchors-preset) **(** [LayoutPreset](#enum-control-layoutpreset) preset, [bool](class_bool#class-bool) keep\_margins=false **)** | | void | [set\_begin](#class-control-method-set-begin) **(** [Vector2](class_vector2#class-vector2) position **)** | | void | [set\_drag\_forwarding](#class-control-method-set-drag-forwarding) **(** [Control](#class-control) target **)** | | void | [set\_drag\_preview](#class-control-method-set-drag-preview) **(** [Control](#class-control) control **)** | | void | [set\_end](#class-control-method-set-end) **(** [Vector2](class_vector2#class-vector2) position **)** | | void | [set\_focus\_neighbour](#class-control-method-set-focus-neighbour) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin, [NodePath](class_nodepath#class-nodepath) neighbour **)** | | void | [set\_global\_position](#class-control-method-set-global-position) **(** [Vector2](class_vector2#class-vector2) position, [bool](class_bool#class-bool) keep\_margins=false **)** | | void | [set\_margin](#class-control-method-set-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) offset **)** | | void | [set\_margins\_preset](#class-control-method-set-margins-preset) **(** [LayoutPreset](#enum-control-layoutpreset) preset, [LayoutPresetMode](#enum-control-layoutpresetmode) resize\_mode=0, [int](class_int#class-int) margin=0 **)** | | void | [set\_position](#class-control-method-set-position) **(** [Vector2](class_vector2#class-vector2) position, [bool](class_bool#class-bool) keep\_margins=false **)** | | void | [set\_rotation](#class-control-method-set-rotation) **(** [float](class_float#class-float) radians **)** | | void | [set\_size](#class-control-method-set-size) **(** [Vector2](class_vector2#class-vector2) size, [bool](class_bool#class-bool) keep\_margins=false **)** | | void | [show\_modal](#class-control-method-show-modal) **(** [bool](class_bool#class-bool) exclusive=false **)** | | void | [warp\_mouse](#class-control-method-warp-mouse) **(** [Vector2](class_vector2#class-vector2) to\_position **)** | Signals ------- ### focus\_entered ( ) Emitted when the node gains keyboard focus. ### focus\_exited ( ) Emitted when the node loses keyboard focus. ### gui\_input ( [InputEvent](class_inputevent#class-inputevent) event ) Emitted when the node receives an [InputEvent](class_inputevent#class-inputevent). ### minimum\_size\_changed ( ) Emitted when the node's minimum size changes. ### modal\_closed ( ) Emitted when a modal `Control` is closed. See [show\_modal](#class-control-method-show-modal). ### mouse\_entered ( ) Emitted when the mouse enters the control's `Rect` area, provided its [mouse\_filter](#class-control-property-mouse-filter) lets the event reach it. **Note:** [mouse\_entered](#class-control-signal-mouse-entered) will not be emitted if the mouse enters a child `Control` node before entering the parent's `Rect` area, at least until the mouse is moved to reach the parent's `Rect` area. ### mouse\_exited ( ) Emitted when the mouse leaves the control's `Rect` area, provided its [mouse\_filter](#class-control-property-mouse-filter) lets the event reach it. **Note:** [mouse\_exited](#class-control-signal-mouse-exited) will be emitted if the mouse enters a child `Control` node, even if the mouse cursor is still inside the parent's `Rect` area. If you want to check whether the mouse truly left the area, ignoring any top nodes, you can use code like this: ``` func _on_mouse_exited(): if not Rect2(Vector2(), rect_size).has_point(get_local_mouse_position()): # Not hovering over area. ``` ### resized ( ) Emitted when the control changes size. ### size\_flags\_changed ( ) Emitted when one of the size flags changes. See [size\_flags\_horizontal](#class-control-property-size-flags-horizontal) and [size\_flags\_vertical](#class-control-property-size-flags-vertical). Enumerations ------------ enum **FocusMode**: * **FOCUS\_NONE** = **0** --- The node cannot grab focus. Use with [focus\_mode](#class-control-property-focus-mode). * **FOCUS\_CLICK** = **1** --- The node can only grab focus on mouse clicks. Use with [focus\_mode](#class-control-property-focus-mode). * **FOCUS\_ALL** = **2** --- The node can grab focus on mouse click or using the arrows and the Tab keys on the keyboard. Use with [focus\_mode](#class-control-property-focus-mode). enum **CursorShape**: * **CURSOR\_ARROW** = **0** --- Show the system's arrow mouse cursor when the user hovers the node. Use with [mouse\_default\_cursor\_shape](#class-control-property-mouse-default-cursor-shape). * **CURSOR\_IBEAM** = **1** --- Show the system's I-beam mouse cursor when the user hovers the node. The I-beam pointer has a shape similar to "I". It tells the user they can highlight or insert text. * **CURSOR\_POINTING\_HAND** = **2** --- Show the system's pointing hand mouse cursor when the user hovers the node. * **CURSOR\_CROSS** = **3** --- Show the system's cross mouse cursor when the user hovers the node. * **CURSOR\_WAIT** = **4** --- Show the system's wait mouse cursor when the user hovers the node. Often an hourglass. * **CURSOR\_BUSY** = **5** --- Show the system's busy mouse cursor when the user hovers the node. Often an arrow with a small hourglass. * **CURSOR\_DRAG** = **6** --- Show the system's drag mouse cursor, often a closed fist or a cross symbol, when the user hovers the node. It tells the user they're currently dragging an item, like a node in the Scene dock. * **CURSOR\_CAN\_DROP** = **7** --- Show the system's drop mouse cursor when the user hovers the node. It can be an open hand. It tells the user they can drop an item they're currently grabbing, like a node in the Scene dock. * **CURSOR\_FORBIDDEN** = **8** --- Show the system's forbidden mouse cursor when the user hovers the node. Often a crossed circle. * **CURSOR\_VSIZE** = **9** --- Show the system's vertical resize mouse cursor when the user hovers the node. A double-headed vertical arrow. It tells the user they can resize the window or the panel vertically. * **CURSOR\_HSIZE** = **10** --- Show the system's horizontal resize mouse cursor when the user hovers the node. A double-headed horizontal arrow. It tells the user they can resize the window or the panel horizontally. * **CURSOR\_BDIAGSIZE** = **11** --- Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically. * **CURSOR\_FDIAGSIZE** = **12** --- Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the top left to the bottom right, the opposite of [CURSOR\_BDIAGSIZE](#class-control-constant-cursor-bdiagsize). It tells the user they can resize the window or the panel both horizontally and vertically. * **CURSOR\_MOVE** = **13** --- Show the system's move mouse cursor when the user hovers the node. It shows 2 double-headed arrows at a 90 degree angle. It tells the user they can move a UI element freely. * **CURSOR\_VSPLIT** = **14** --- Show the system's vertical split mouse cursor when the user hovers the node. On Windows, it's the same as [CURSOR\_VSIZE](#class-control-constant-cursor-vsize). * **CURSOR\_HSPLIT** = **15** --- Show the system's horizontal split mouse cursor when the user hovers the node. On Windows, it's the same as [CURSOR\_HSIZE](#class-control-constant-cursor-hsize). * **CURSOR\_HELP** = **16** --- Show the system's help mouse cursor when the user hovers the node, a question mark. enum **LayoutPreset**: * **PRESET\_TOP\_LEFT** = **0** --- Snap all 4 anchors to the top-left of the parent control's bounds. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_TOP\_RIGHT** = **1** --- Snap all 4 anchors to the top-right of the parent control's bounds. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_BOTTOM\_LEFT** = **2** --- Snap all 4 anchors to the bottom-left of the parent control's bounds. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_BOTTOM\_RIGHT** = **3** --- Snap all 4 anchors to the bottom-right of the parent control's bounds. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_CENTER\_LEFT** = **4** --- Snap all 4 anchors to the center of the left edge of the parent control's bounds. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_CENTER\_TOP** = **5** --- Snap all 4 anchors to the center of the top edge of the parent control's bounds. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_CENTER\_RIGHT** = **6** --- Snap all 4 anchors to the center of the right edge of the parent control's bounds. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_CENTER\_BOTTOM** = **7** --- Snap all 4 anchors to the center of the bottom edge of the parent control's bounds. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_CENTER** = **8** --- Snap all 4 anchors to the center of the parent control's bounds. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_LEFT\_WIDE** = **9** --- Snap all 4 anchors to the left edge of the parent control. The left margin becomes relative to the left edge and the top margin relative to the top left corner of the node's parent. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_TOP\_WIDE** = **10** --- Snap all 4 anchors to the top edge of the parent control. The left margin becomes relative to the top left corner, the top margin relative to the top edge, and the right margin relative to the top right corner of the node's parent. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_RIGHT\_WIDE** = **11** --- Snap all 4 anchors to the right edge of the parent control. The right margin becomes relative to the right edge and the top margin relative to the top right corner of the node's parent. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_BOTTOM\_WIDE** = **12** --- Snap all 4 anchors to the bottom edge of the parent control. The left margin becomes relative to the bottom left corner, the bottom margin relative to the bottom edge, and the right margin relative to the bottom right corner of the node's parent. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_VCENTER\_WIDE** = **13** --- Snap all 4 anchors to a vertical line that cuts the parent control in half. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_HCENTER\_WIDE** = **14** --- Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **PRESET\_WIDE** = **15** --- Snap all 4 anchors to the respective corners of the parent control. Set all 4 margins to 0 after you applied this preset and the `Control` will fit its parent control. This is equivalent to the "Full Rect" layout option in the editor. Use with [set\_anchors\_preset](#class-control-method-set-anchors-preset). enum **LayoutPresetMode**: * **PRESET\_MODE\_MINSIZE** = **0** --- The control will be resized to its minimum size. * **PRESET\_MODE\_KEEP\_WIDTH** = **1** --- The control's width will not change. * **PRESET\_MODE\_KEEP\_HEIGHT** = **2** --- The control's height will not change. * **PRESET\_MODE\_KEEP\_SIZE** = **3** --- The control's size will not change. enum **SizeFlags**: * **SIZE\_FILL** = **1** --- Tells the parent [Container](class_container#class-container) to expand the bounds of this node to fill all the available space without pushing any other node. Use with [size\_flags\_horizontal](#class-control-property-size-flags-horizontal) and [size\_flags\_vertical](#class-control-property-size-flags-vertical). * **SIZE\_EXPAND** = **2** --- Tells the parent [Container](class_container#class-container) to let this node take all the available space on the axis you flag. If multiple neighboring nodes are set to expand, they'll share the space based on their stretch ratio. See [size\_flags\_stretch\_ratio](#class-control-property-size-flags-stretch-ratio). Use with [size\_flags\_horizontal](#class-control-property-size-flags-horizontal) and [size\_flags\_vertical](#class-control-property-size-flags-vertical). * **SIZE\_EXPAND\_FILL** = **3** --- Sets the node's size flags to both fill and expand. See the 2 constants above for more information. * **SIZE\_SHRINK\_CENTER** = **4** --- Tells the parent [Container](class_container#class-container) to center the node in itself. It centers the control based on its bounding box, so it doesn't work with the fill or expand size flags. Use with [size\_flags\_horizontal](#class-control-property-size-flags-horizontal) and [size\_flags\_vertical](#class-control-property-size-flags-vertical). * **SIZE\_SHRINK\_END** = **8** --- Tells the parent [Container](class_container#class-container) to align the node with its end, either the bottom or the right edge. It doesn't work with the fill or expand size flags. Use with [size\_flags\_horizontal](#class-control-property-size-flags-horizontal) and [size\_flags\_vertical](#class-control-property-size-flags-vertical). enum **MouseFilter**: * **MOUSE\_FILTER\_STOP** = **0** --- The control will receive mouse button input events through [\_gui\_input](#class-control-method-gui-input) if clicked on. And the control will receive the [mouse\_entered](#class-control-signal-mouse-entered) and [mouse\_exited](#class-control-signal-mouse-exited) signals. These events are automatically marked as handled, and they will not propagate further to other controls. This also results in blocking signals in other controls. * **MOUSE\_FILTER\_PASS** = **1** --- The control will receive mouse button input events through [\_gui\_input](#class-control-method-gui-input) if clicked on. And the control will receive the [mouse\_entered](#class-control-signal-mouse-entered) and [mouse\_exited](#class-control-signal-mouse-exited) signals. If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it. This also allows signals to fire in other controls. Even if no control handled it at all, the event will still be handled automatically, so unhandled input will not be fired. * **MOUSE\_FILTER\_IGNORE** = **2** --- The control will not receive mouse button input events through [\_gui\_input](#class-control-method-gui-input). The control will also not receive the [mouse\_entered](#class-control-signal-mouse-entered) nor [mouse\_exited](#class-control-signal-mouse-exited) signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically. enum **GrowDirection**: * **GROW\_DIRECTION\_BEGIN** = **0** --- The control will grow to the left or top to make up if its minimum size is changed to be greater than its current size on the respective axis. * **GROW\_DIRECTION\_END** = **1** --- The control will grow to the right or bottom to make up if its minimum size is changed to be greater than its current size on the respective axis. * **GROW\_DIRECTION\_BOTH** = **2** --- The control will grow in both directions equally to make up if its minimum size is changed to be greater than its current size. enum **Anchor**: * **ANCHOR\_BEGIN** = **0** --- Snaps one of the 4 anchor's sides to the origin of the node's `Rect`, in the top left. Use it with one of the `anchor_*` member variables, like [anchor\_left](#class-control-property-anchor-left). To change all 4 anchors at once, use [set\_anchors\_preset](#class-control-method-set-anchors-preset). * **ANCHOR\_END** = **1** --- Snaps one of the 4 anchor's sides to the end of the node's `Rect`, in the bottom right. Use it with one of the `anchor_*` member variables, like [anchor\_left](#class-control-property-anchor-left). To change all 4 anchors at once, use [set\_anchors\_preset](#class-control-method-set-anchors-preset). Constants --------- * **NOTIFICATION\_RESIZED** = **40** --- Sent when the node changes size. Use [rect\_size](#class-control-property-rect-size) to get the new size. * **NOTIFICATION\_MOUSE\_ENTER** = **41** --- Sent when the mouse pointer enters the node. * **NOTIFICATION\_MOUSE\_EXIT** = **42** --- Sent when the mouse pointer exits the node. * **NOTIFICATION\_FOCUS\_ENTER** = **43** --- Sent when the node grabs focus. * **NOTIFICATION\_FOCUS\_EXIT** = **44** --- Sent when the node loses focus. * **NOTIFICATION\_THEME\_CHANGED** = **45** --- Sent when the node's [theme](#class-control-property-theme) changes, right before Godot redraws the control. Happens when you call one of the `add_*_override` methods. * **NOTIFICATION\_MODAL\_CLOSE** = **46** --- Sent when an open modal dialog closes. See [show\_modal](#class-control-method-show-modal). * **NOTIFICATION\_SCROLL\_BEGIN** = **47** --- Sent when this node is inside a [ScrollContainer](class_scrollcontainer#class-scrollcontainer) which has begun being scrolled. * **NOTIFICATION\_SCROLL\_END** = **48** --- Sent when this node is inside a [ScrollContainer](class_scrollcontainer#class-scrollcontainer) which has stopped being scrolled. Property Descriptions --------------------- ### [float](class_float#class-float) anchor\_bottom | | | | --- | --- | | *Default* | `0.0` | | *Getter* | get\_anchor() | Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom margin updates when the node moves or changes size. You can use one of the [Anchor](#enum-control-anchor) constants for convenience. ### [float](class_float#class-float) anchor\_left | | | | --- | --- | | *Default* | `0.0` | | *Getter* | get\_anchor() | Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left margin updates when the node moves or changes size. You can use one of the [Anchor](#enum-control-anchor) constants for convenience. ### [float](class_float#class-float) anchor\_right | | | | --- | --- | | *Default* | `0.0` | | *Getter* | get\_anchor() | Anchors the right edge of the node to the origin, the center or the end of its parent control. It changes how the right margin updates when the node moves or changes size. You can use one of the [Anchor](#enum-control-anchor) constants for convenience. ### [float](class_float#class-float) anchor\_top | | | | --- | --- | | *Default* | `0.0` | | *Getter* | get\_anchor() | Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top margin updates when the node moves or changes size. You can use one of the [Anchor](#enum-control-anchor) constants for convenience. ### [FocusMode](#enum-control-focusmode) focus\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_focus\_mode(value) | | *Getter* | get\_focus\_mode() | The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals. ### [NodePath](class_nodepath#class-nodepath) focus\_neighbour\_bottom | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_focus\_neighbour(value) | | *Getter* | get\_focus\_neighbour() | Tells Godot which node it should give keyboard focus to if the user presses the down arrow on the keyboard or down on a gamepad by default. You can change the key by editing the `ui_down` input action. The node must be a `Control`. If this property is not set, Godot will give focus to the closest `Control` to the bottom of this one. ### [NodePath](class_nodepath#class-nodepath) focus\_neighbour\_left | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_focus\_neighbour(value) | | *Getter* | get\_focus\_neighbour() | Tells Godot which node it should give keyboard focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the `ui_left` input action. The node must be a `Control`. If this property is not set, Godot will give focus to the closest `Control` to the left of this one. ### [NodePath](class_nodepath#class-nodepath) focus\_neighbour\_right | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_focus\_neighbour(value) | | *Getter* | get\_focus\_neighbour() | Tells Godot which node it should give keyboard focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the `ui_right` input action. The node must be a `Control`. If this property is not set, Godot will give focus to the closest `Control` to the bottom of this one. ### [NodePath](class_nodepath#class-nodepath) focus\_neighbour\_top | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_focus\_neighbour(value) | | *Getter* | get\_focus\_neighbour() | Tells Godot which node it should give keyboard focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the `ui_top` input action. The node must be a `Control`. If this property is not set, Godot will give focus to the closest `Control` to the bottom of this one. ### [NodePath](class_nodepath#class-nodepath) focus\_next | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_focus\_next(value) | | *Getter* | get\_focus\_next() | Tells Godot which node it should give keyboard focus to if the user presses Tab on a keyboard by default. You can change the key by editing the `ui_focus_next` input action. If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree. ### [NodePath](class_nodepath#class-nodepath) focus\_previous | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_focus\_previous(value) | | *Getter* | get\_focus\_previous() | Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab on a keyboard by default. You can change the key by editing the `ui_focus_prev` input action. If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree. ### [GrowDirection](#enum-control-growdirection) grow\_horizontal | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_h\_grow\_direction(value) | | *Getter* | get\_h\_grow\_direction() | Controls the direction on the horizontal axis in which the control should grow if its horizontal minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size. ### [GrowDirection](#enum-control-growdirection) grow\_vertical | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_v\_grow\_direction(value) | | *Getter* | get\_v\_grow\_direction() | Controls the direction on the vertical axis in which the control should grow if its vertical minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size. ### [String](class_string#class-string) hint\_tooltip | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_tooltip(value) | Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [mouse\_filter](#class-control-property-mouse-filter) property is not [MOUSE\_FILTER\_IGNORE](#class-control-constant-mouse-filter-ignore). You can change the time required for the tooltip to appear with `gui/timers/tooltip_delay_sec` option in Project Settings. The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding [\_make\_custom\_tooltip](#class-control-method-make-custom-tooltip). The default tooltip includes a [PopupPanel](class_popuppanel#class-popuppanel) and [Label](class_label#class-label) whose theme properties can be customized using [Theme](class_theme#class-theme) methods with the `"TooltipPanel"` and `"TooltipLabel"` respectively. For example: ``` var style_box = StyleBoxFlat.new() style_box.set_bg_color(Color(1, 1, 0)) style_box.set_border_width_all(2) # We assume here that the `theme` property has been assigned a custom Theme beforehand. theme.set_stylebox("panel", "TooltipPanel", style_box) theme.set_color("font_color", "TooltipLabel", Color(0, 1, 1)) ``` ### [bool](class_bool#class-bool) input\_pass\_on\_modal\_close\_click | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_pass\_on\_modal\_close\_click(value) | | *Getter* | get\_pass\_on\_modal\_close\_click() | Enables whether input should propagate when you close the control as modal. If `false`, stops event handling at the viewport input event handling. The viewport first hides the modal and after marks the input as handled. ### [float](class_float#class-float) margin\_bottom | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_margin(value) | | *Getter* | get\_margin() | Distance between the node's bottom edge and its parent control, based on [anchor\_bottom](#class-control-property-anchor-bottom). Margins are often controlled by one or multiple parent [Container](class_container#class-container) nodes, so you should not modify them manually if your node is a direct child of a [Container](class_container#class-container). Margins update automatically when you move or resize the node. ### [float](class_float#class-float) margin\_left | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_margin(value) | | *Getter* | get\_margin() | Distance between the node's left edge and its parent control, based on [anchor\_left](#class-control-property-anchor-left). Margins are often controlled by one or multiple parent [Container](class_container#class-container) nodes, so you should not modify them manually if your node is a direct child of a [Container](class_container#class-container). Margins update automatically when you move or resize the node. ### [float](class_float#class-float) margin\_right | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_margin(value) | | *Getter* | get\_margin() | Distance between the node's right edge and its parent control, based on [anchor\_right](#class-control-property-anchor-right). Margins are often controlled by one or multiple parent [Container](class_container#class-container) nodes, so you should not modify them manually if your node is a direct child of a [Container](class_container#class-container). Margins update automatically when you move or resize the node. ### [float](class_float#class-float) margin\_top | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_margin(value) | | *Getter* | get\_margin() | Distance between the node's top edge and its parent control, based on [anchor\_top](#class-control-property-anchor-top). Margins are often controlled by one or multiple parent [Container](class_container#class-container) nodes, so you should not modify them manually if your node is a direct child of a [Container](class_container#class-container). Margins update automatically when you move or resize the node. ### [CursorShape](#enum-control-cursorshape) mouse\_default\_cursor\_shape | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_default\_cursor\_shape(value) | | *Getter* | get\_default\_cursor\_shape() | The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors. **Note:** On Linux, shapes may vary depending on the cursor theme of the system. ### [MouseFilter](#enum-control-mousefilter) mouse\_filter | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_mouse\_filter(value) | | *Getter* | get\_mouse\_filter() | Controls whether the control will be able to receive mouse button input events through [\_gui\_input](#class-control-method-gui-input) and how these events should be handled. Also controls whether the control can receive the [mouse\_entered](#class-control-signal-mouse-entered), and [mouse\_exited](#class-control-signal-mouse-exited) signals. See the constants to learn what each does. ### [bool](class_bool#class-bool) rect\_clip\_content | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_clip\_contents(value) | | *Getter* | is\_clipping\_contents() | Enables whether rendering of [CanvasItem](class_canvasitem#class-canvasitem) based children should be clipped to this control's rectangle. If `true`, parts of a child which would be visibly outside of this control's rectangle will not be rendered. ### [Vector2](class_vector2#class-vector2) rect\_global\_position | | | | --- | --- | | *Getter* | get\_global\_position() | The node's global position, relative to the world (usually to the top-left corner of the window). ### [Vector2](class_vector2#class-vector2) rect\_min\_size | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_custom\_minimum\_size(value) | | *Getter* | get\_custom\_minimum\_size() | The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes. ### [Vector2](class_vector2#class-vector2) rect\_pivot\_offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_pivot\_offset(value) | | *Getter* | get\_pivot\_offset() | By default, the node's pivot is its top-left corner. When you change its [rect\_rotation](#class-control-property-rect-rotation) or [rect\_scale](#class-control-property-rect-scale), it will rotate or scale around this pivot. Set this property to [rect\_size](#class-control-property-rect-size) / 2 to pivot around the Control's center. ### [Vector2](class_vector2#class-vector2) rect\_position | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Getter* | get\_position() | The node's position, relative to its parent. It corresponds to the rectangle's top-left corner. The property is not affected by [rect\_pivot\_offset](#class-control-property-rect-pivot-offset). ### [float](class_float#class-float) rect\_rotation | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_rotation\_degrees(value) | | *Getter* | get\_rotation\_degrees() | The node's rotation around its pivot, in degrees. See [rect\_pivot\_offset](#class-control-property-rect-pivot-offset) to change the pivot's position. ### [Vector2](class_vector2#class-vector2) rect\_scale | | | | --- | --- | | *Default* | `Vector2( 1, 1 )` | | *Setter* | set\_scale(value) | | *Getter* | get\_scale() | The node's scale, relative to its [rect\_size](#class-control-property-rect-size). Change this property to scale the node around its [rect\_pivot\_offset](#class-control-property-rect-pivot-offset). The Control's [hint\_tooltip](#class-control-property-hint-tooltip) will also scale according to this value. **Note:** This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [documentation](https://docs.godotengine.org/en/3.5/tutorials/rendering/multiple_resolutions.html) instead of scaling Controls individually. **Note:** If the Control node is a child of a [Container](class_container#class-container) node, the scale will be reset to `Vector2(1, 1)` when the scene is instanced. To set the Control's scale when it's instanced, wait for one frame using `yield(get_tree(), "idle_frame")` then set its [rect\_scale](#class-control-property-rect-scale) property. ### [Vector2](class_vector2#class-vector2) rect\_size | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Getter* | get\_size() | The size of the node's bounding rectangle, in pixels. [Container](class_container#class-container) nodes update this property automatically. ### [int](class_int#class-int) size\_flags\_horizontal | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_h\_size\_flags(value) | | *Getter* | get\_h\_size\_flags() | Tells the parent [Container](class_container#class-container) nodes how they should resize and place the node on the X axis. Use one of the [SizeFlags](#enum-control-sizeflags) constants to change the flags. See the constants to learn what each does. ### [float](class_float#class-float) size\_flags\_stretch\_ratio | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_stretch\_ratio(value) | | *Getter* | get\_stretch\_ratio() | If the node and at least one of its neighbours uses the [SIZE\_EXPAND](#class-control-constant-size-expand) size flag, the parent [Container](class_container#class-container) will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbour a ratio of 1, this node will take two thirds of the available space. ### [int](class_int#class-int) size\_flags\_vertical | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_v\_size\_flags(value) | | *Getter* | get\_v\_size\_flags() | Tells the parent [Container](class_container#class-container) nodes how they should resize and place the node on the Y axis. Use one of the [SizeFlags](#enum-control-sizeflags) constants to change the flags. See the constants to learn what each does. ### [Theme](class_theme#class-theme) theme | | | | --- | --- | | *Setter* | set\_theme(value) | | *Getter* | get\_theme() | Changing this property replaces the current [Theme](class_theme#class-theme) resource this node and all its `Control` children use. ### [String](class_string#class-string) theme\_type\_variation | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_theme\_type\_variation(value) | | *Getter* | get\_theme\_type\_variation() | The name of a theme type variation used by this `Control` to look up its own theme items. When empty, the class name of the node is used (e.g. `Button` for the [Button](class_button#class-button) control), as well as the class names of all parent classes (in order of inheritance). When set, this property gives the highest priority to the type of the specified name. This type can in turn extend another type, forming a dependency chain. See [Theme.set\_type\_variation](class_theme#class-theme-method-set-type-variation). If the theme item cannot be found using this type or its base types, lookup falls back on the class names. **Note:** To look up `Control`'s own items use various `get_*` methods without specifying `theme_type`. **Note:** Theme items are looked for in the tree order, from branch to root, where each `Control` node is checked for its [theme](#class-control-property-theme) property. The earliest match against any type/class name is returned. The project-level Theme and the default Theme are checked last. Method Descriptions ------------------- ### [bool](class_bool#class-bool) \_clips\_input ( ) virtual Virtual method to be implemented by the user. Returns whether [\_gui\_input](#class-control-method-gui-input) should not be called for children controls outside this control's rectangle. Input will be clipped to the Rect of this `Control`. Similar to [rect\_clip\_content](#class-control-property-rect-clip-content), but doesn't affect visibility. If not overridden, defaults to `false`. ### [Vector2](class_vector2#class-vector2) \_get\_minimum\_size ( ) virtual Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [rect\_min\_size](#class-control-property-rect-min-size) for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately). If not overridden, defaults to [Vector2.ZERO](class_vector2#class-vector2-constant-zero). **Note:** This method will not be called when the script is attached to a `Control` node that already overrides its minimum size (e.g. [Label](class_label#class-label), [Button](class_button#class-button), [PanelContainer](class_panelcontainer#class-panelcontainer) etc.). It can only be used with most basic GUI nodes, like `Control`, [Container](class_container#class-container), [Panel](class_panel#class-panel) etc. ### void \_gui\_input ( [InputEvent](class_inputevent#class-inputevent) event ) virtual Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See [accept\_event](#class-control-method-accept-event). Example: clicking a control. ``` func _gui_input(event): if event is InputEventMouseButton: if event.button_index == BUTTON_LEFT and event.pressed: print("I've been clicked D:") ``` The event won't trigger if: \* clicking outside the control (see [has\_point](#class-control-method-has-point)); \* control has [mouse\_filter](#class-control-property-mouse-filter) set to [MOUSE\_FILTER\_IGNORE](#class-control-constant-mouse-filter-ignore); \* control is obstructed by another `Control` on top of it, which doesn't have [mouse\_filter](#class-control-property-mouse-filter) set to [MOUSE\_FILTER\_IGNORE](#class-control-constant-mouse-filter-ignore); \* control's parent has [mouse\_filter](#class-control-property-mouse-filter) set to [MOUSE\_FILTER\_STOP](#class-control-constant-mouse-filter-stop) or has accepted the event; \* it happens outside the parent's rectangle and the parent has either [rect\_clip\_content](#class-control-property-rect-clip-content) or [\_clips\_input](#class-control-method-clips-input) enabled. **Note:** Event position is relative to the control origin. ### [Control](#class-control) \_make\_custom\_tooltip ( [String](class_string#class-string) for\_text ) virtual Virtual method to be implemented by the user. Returns a `Control` node that should be used as a tooltip instead of the default one. The `for_text` includes the contents of the [hint\_tooltip](#class-control-property-hint-tooltip) property. The returned node must be of type `Control` or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When `null` or a non-Control node is returned, the default tooltip will be used instead. The returned node will be added as child to a [PopupPanel](class_popuppanel#class-popuppanel), so you should only provide the contents of that panel. That [PopupPanel](class_popuppanel#class-popuppanel) can be themed using [Theme.set\_stylebox](class_theme#class-theme-method-set-stylebox) for the type `"TooltipPanel"` (see [hint\_tooltip](#class-control-property-hint-tooltip) for an example). **Note:** The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [rect\_min\_size](#class-control-property-rect-min-size) to some non-zero value. Example of usage with a custom-constructed node: ``` func _make_custom_tooltip(for_text): var label = Label.new() label.text = for_text return label ``` Example of usage with a custom scene instance: ``` func _make_custom_tooltip(for_text): var tooltip = preload("res://SomeTooltipScene.tscn").instance() tooltip.get_node("Label").text = for_text return tooltip ``` ### void accept\_event ( ) Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to [Node.\_unhandled\_input](class_node#class-node-method-unhandled-input) or [Node.\_unhandled\_key\_input](class_node#class-node-method-unhandled-key-input). ### void add\_color\_override ( [String](class_string#class-string) name, [Color](class_color#class-color) color ) Creates a local override for a theme [Color](class_color#class-color) with the specified `name`. Local overrides always take precedence when fetching theme items for the control. See also [get\_color](#class-control-method-get-color), [remove\_color\_override](#class-control-method-remove-color-override). **Example of overriding a label's color and resetting it later:** ``` # Given the child Label node "MyLabel", override its font color with a custom value. $MyLabel.add_color_override("font_color", Color(1, 0.5, 0)) # Reset the font color of the child label. $MyLabel.add_color_override("font_color", get_color("font_color", "Label")) ``` ### void add\_constant\_override ( [String](class_string#class-string) name, [int](class_int#class-int) constant ) Creates a local override for a theme constant with the specified `name`. Local overrides always take precedence when fetching theme items for the control. See also [get\_constant](#class-control-method-get-constant), [remove\_constant\_override](#class-control-method-remove-constant-override). ### void add\_font\_override ( [String](class_string#class-string) name, [Font](class_font#class-font) font ) Creates a local override for a theme [Font](class_font#class-font) with the specified `name`. Local overrides always take precedence when fetching theme items for the control. **Note:** An override can be removed by assigning it a `null` value. This behavior is deprecated and will be removed in 4.0, use [remove\_font\_override](#class-control-method-remove-font-override) instead. See also [get\_font](#class-control-method-get-font). ### void add\_icon\_override ( [String](class_string#class-string) name, [Texture](class_texture#class-texture) texture ) Creates a local override for a theme icon with the specified `name`. Local overrides always take precedence when fetching theme items for the control. **Note:** An override can be removed by assigning it a `null` value. This behavior is deprecated and will be removed in 4.0, use [remove\_icon\_override](#class-control-method-remove-icon-override) instead. See also [get\_icon](#class-control-method-get-icon). ### void add\_shader\_override ( [String](class_string#class-string) name, [Shader](class_shader#class-shader) shader ) Creates a local override for a theme shader with the specified `name`. Local overrides always take precedence when fetching theme items for the control. **Note:** An override can be removed by assigning it a `null` value. This behavior is deprecated and will be removed in 4.0, use [remove\_shader\_override](#class-control-method-remove-shader-override) instead. ### void add\_stylebox\_override ( [String](class_string#class-string) name, [StyleBox](class_stylebox#class-stylebox) stylebox ) Creates a local override for a theme [StyleBox](class_stylebox#class-stylebox) with the specified `name`. Local overrides always take precedence when fetching theme items for the control. **Note:** An override can be removed by assigning it a `null` value. This behavior is deprecated and will be removed in 4.0, use [remove\_stylebox\_override](#class-control-method-remove-stylebox-override) instead. See also [get\_stylebox](#class-control-method-get-stylebox). **Example of modifying a property in a StyleBox by duplicating it:** ``` # The snippet below assumes the child node MyButton has a StyleBoxFlat assigned. # Resources are shared across instances, so we need to duplicate it # to avoid modifying the appearance of all other buttons. var new_stylebox_normal = $MyButton.get_stylebox("normal").duplicate() new_stylebox_normal.border_width_top = 3 new_stylebox_normal.border_color = Color(0, 1, 0.5) $MyButton.add_stylebox_override("normal", new_stylebox_normal) # Remove the stylebox override. $MyButton.add_stylebox_override("normal", null) ``` ### [bool](class_bool#class-bool) can\_drop\_data ( [Vector2](class_vector2#class-vector2) position, [Variant](class_variant#class-variant) data ) virtual Godot calls this method to test if `data` from a control's [get\_drag\_data](#class-control-method-get-drag-data) can be dropped at `position`. `position` is local to this control. This method should only be used to test the data. Process the data in [drop\_data](#class-control-method-drop-data). ``` func can_drop_data(position, data): # Check position if it is relevant to you # Otherwise, just check data return typeof(data) == TYPE_DICTIONARY and data.has("expected") ``` ### void drop\_data ( [Vector2](class_vector2#class-vector2) position, [Variant](class_variant#class-variant) data ) virtual Godot calls this method to pass you the `data` from a control's [get\_drag\_data](#class-control-method-get-drag-data) result. Godot first calls [can\_drop\_data](#class-control-method-can-drop-data) to test if `data` is allowed to drop at `position` where `position` is local to this control. ``` func can_drop_data(position, data): return typeof(data) == TYPE_DICTIONARY and data.has("color") func drop_data(position, data): color = data["color"] ``` ### [Control](#class-control) find\_next\_valid\_focus ( ) const Finds the next (below in the tree) `Control` that can receive the focus. ### [Control](#class-control) find\_prev\_valid\_focus ( ) const Finds the previous (above in the tree) `Control` that can receive the focus. ### void force\_drag ( [Variant](class_variant#class-variant) data, [Control](#class-control) preview ) Forces drag and bypasses [get\_drag\_data](#class-control-method-get-drag-data) and [set\_drag\_preview](#class-control-method-set-drag-preview) by passing `data` and `preview`. Drag will start even if the mouse is neither over nor pressed on this control. The methods [can\_drop\_data](#class-control-method-can-drop-data) and [drop\_data](#class-control-method-drop-data) must be implemented on controls that want to receive drop data. ### [float](class_float#class-float) get\_anchor ( [Margin](class_%40globalscope#enum-globalscope-margin) margin ) const Returns the anchor identified by `margin` constant from [Margin](class_%40globalscope#enum-globalscope-margin) enum. A getter method for [anchor\_bottom](#class-control-property-anchor-bottom), [anchor\_left](#class-control-property-anchor-left), [anchor\_right](#class-control-property-anchor-right) and [anchor\_top](#class-control-property-anchor-top). ### [Vector2](class_vector2#class-vector2) get\_begin ( ) const Returns [margin\_left](#class-control-property-margin-left) and [margin\_top](#class-control-property-margin-top). See also [rect\_position](#class-control-property-rect-position). ### [Color](class_color#class-color) get\_color ( [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" ) const Returns a [Color](class_color#class-color) from the first matching [Theme](class_theme#class-theme) in the tree if that [Theme](class_theme#class-theme) has a color item with the specified `name` and `theme_type`. If `theme_type` is omitted the class name of the current control is used as the type, or [theme\_type\_variation](#class-control-property-theme-type-variation) if it is defined. If the type is a class name its parent classes are also checked, in order of inheritance. For the current control its local overrides are considered first (see [add\_color\_override](#class-control-method-add-color-override)), then its assigned [theme](#class-control-property-theme). After the current control, each parent control and its assigned [theme](#class-control-property-theme) are considered; controls without a [theme](#class-control-property-theme) assigned are skipped. If no matching [Theme](class_theme#class-theme) is found in the tree, a custom project [Theme](class_theme#class-theme) (see [ProjectSettings.gui/theme/custom](class_projectsettings#class-projectsettings-property-gui-theme-custom)) and the default [Theme](class_theme#class-theme) are used. ``` func _ready(): # Get the font color defined for the current Control's class, if it exists. modulate = get_color("font_color") # Get the font color defined for the Button class. modulate = get_color("font_color", "Button") ``` ### [Vector2](class_vector2#class-vector2) get\_combined\_minimum\_size ( ) const Returns combined minimum size from [rect\_min\_size](#class-control-property-rect-min-size) and [get\_minimum\_size](#id1). ### [int](class_int#class-int) get\_constant ( [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" ) const Returns a constant from the first matching [Theme](class_theme#class-theme) in the tree if that [Theme](class_theme#class-theme) has a constant item with the specified `name` and `theme_type`. See [get\_color](#class-control-method-get-color) for details. ### [CursorShape](#enum-control-cursorshape) get\_cursor\_shape ( [Vector2](class_vector2#class-vector2) position=Vector2( 0, 0 ) ) const Returns the mouse cursor shape the control displays on mouse hover. See [CursorShape](#enum-control-cursorshape). ### [Variant](class_variant#class-variant) get\_drag\_data ( [Vector2](class_vector2#class-vector2) position ) virtual Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns `null` if there is no data to drag. Controls that want to receive drop data should implement [can\_drop\_data](#class-control-method-can-drop-data) and [drop\_data](#class-control-method-drop-data). `position` is local to this control. Drag may be forced with [force\_drag](#class-control-method-force-drag). A preview that will follow the mouse that should represent the data can be set with [set\_drag\_preview](#class-control-method-set-drag-preview). A good time to set the preview is in this method. ``` func get_drag_data(position): var mydata = make_data() set_drag_preview(make_preview(mydata)) return mydata ``` ### [Vector2](class_vector2#class-vector2) get\_end ( ) const Returns [margin\_right](#class-control-property-margin-right) and [margin\_bottom](#class-control-property-margin-bottom). ### [NodePath](class_nodepath#class-nodepath) get\_focus\_neighbour ( [Margin](class_%40globalscope#enum-globalscope-margin) margin ) const Returns the focus neighbour identified by `margin` constant from [Margin](class_%40globalscope#enum-globalscope-margin) enum. A getter method for [focus\_neighbour\_bottom](#class-control-property-focus-neighbour-bottom), [focus\_neighbour\_left](#class-control-property-focus-neighbour-left), [focus\_neighbour\_right](#class-control-property-focus-neighbour-right) and [focus\_neighbour\_top](#class-control-property-focus-neighbour-top). ### [Control](#class-control) get\_focus\_owner ( ) const Returns the control that has the keyboard focus or `null` if none. ### [Font](class_font#class-font) get\_font ( [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" ) const Returns a [Font](class_font#class-font) from the first matching [Theme](class_theme#class-theme) in the tree if that [Theme](class_theme#class-theme) has a font item with the specified `name` and `theme_type`. See [get\_color](#class-control-method-get-color) for details. ### [Rect2](class_rect2#class-rect2) get\_global\_rect ( ) const Returns the position and size of the control relative to the top-left corner of the screen. See [rect\_position](#class-control-property-rect-position) and [rect\_size](#class-control-property-rect-size). ### [Texture](class_texture#class-texture) get\_icon ( [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" ) const Returns an icon from the first matching [Theme](class_theme#class-theme) in the tree if that [Theme](class_theme#class-theme) has an icon item with the specified `name` and `theme_type`. See [get\_color](#class-control-method-get-color) for details. ### [float](class_float#class-float) get\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin ) const Returns the anchor identified by `margin` constant from [Margin](class_%40globalscope#enum-globalscope-margin) enum. A getter method for [margin\_bottom](#class-control-property-margin-bottom), [margin\_left](#class-control-property-margin-left), [margin\_right](#class-control-property-margin-right) and [margin\_top](#class-control-property-margin-top). ### [Vector2](class_vector2#class-vector2) get\_minimum\_size ( ) const Returns the minimum size for this control. See [rect\_min\_size](#class-control-property-rect-min-size). ### [Vector2](class_vector2#class-vector2) get\_parent\_area\_size ( ) const Returns the width/height occupied in the parent control. ### [Control](#class-control) get\_parent\_control ( ) const Returns the parent control node. ### [Rect2](class_rect2#class-rect2) get\_rect ( ) const Returns the position and size of the control relative to the top-left corner of the parent Control. See [rect\_position](#class-control-property-rect-position) and [rect\_size](#class-control-property-rect-size). ### [float](class_float#class-float) get\_rotation ( ) const Returns the rotation (in radians). ### [StyleBox](class_stylebox#class-stylebox) get\_stylebox ( [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" ) const Returns a [StyleBox](class_stylebox#class-stylebox) from the first matching [Theme](class_theme#class-theme) in the tree if that [Theme](class_theme#class-theme) has a stylebox item with the specified `name` and `theme_type`. See [get\_color](#class-control-method-get-color) for details. ### [Font](class_font#class-font) get\_theme\_default\_font ( ) const Returns the default font from the first matching [Theme](class_theme#class-theme) in the tree if that [Theme](class_theme#class-theme) has a valid [Theme.default\_font](class_theme#class-theme-property-default-font) value. See [get\_color](#class-control-method-get-color) for details. ### [String](class_string#class-string) get\_tooltip ( [Vector2](class_vector2#class-vector2) at\_position=Vector2( 0, 0 ) ) const Returns the tooltip, which will appear when the cursor is resting over this control. See [hint\_tooltip](#class-control-property-hint-tooltip). ### void grab\_click\_focus ( ) Creates an [InputEventMouseButton](class_inputeventmousebutton#class-inputeventmousebutton) that attempts to click the control. If the event is received, the control acquires focus. ``` func _process(delta): grab_click_focus() #when clicking another Control node, this node will be clicked instead ``` ### void grab\_focus ( ) Steal the focus from another control and become the focused control (see [focus\_mode](#class-control-property-focus-mode)). **Note**: Using this method together with [Object.call\_deferred](class_object#class-object-method-call-deferred) makes it more reliable, especially when called inside [Node.\_ready](class_node#class-node-method-ready). ### [bool](class_bool#class-bool) has\_color ( [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" ) const Returns `true` if there is a matching [Theme](class_theme#class-theme) in the tree that has a color item with the specified `name` and `theme_type`. See [get\_color](#class-control-method-get-color) for details. ### [bool](class_bool#class-bool) has\_color\_override ( [String](class_string#class-string) name ) const Returns `true` if there is a local override for a theme [Color](class_color#class-color) with the specified `name` in this `Control` node. See [add\_color\_override](#class-control-method-add-color-override). ### [bool](class_bool#class-bool) has\_constant ( [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" ) const Returns `true` if there is a matching [Theme](class_theme#class-theme) in the tree that has a constant item with the specified `name` and `theme_type`. See [get\_color](#class-control-method-get-color) for details. ### [bool](class_bool#class-bool) has\_constant\_override ( [String](class_string#class-string) name ) const Returns `true` if there is a local override for a theme constant with the specified `name` in this `Control` node. See [add\_constant\_override](#class-control-method-add-constant-override). ### [bool](class_bool#class-bool) has\_focus ( ) const Returns `true` if this is the current focused control. See [focus\_mode](#class-control-property-focus-mode). ### [bool](class_bool#class-bool) has\_font ( [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" ) const Returns `true` if there is a matching [Theme](class_theme#class-theme) in the tree that has a font item with the specified `name` and `theme_type`. See [get\_color](#class-control-method-get-color) for details. ### [bool](class_bool#class-bool) has\_font\_override ( [String](class_string#class-string) name ) const Returns `true` if there is a local override for a theme [Font](class_font#class-font) with the specified `name` in this `Control` node. See [add\_font\_override](#class-control-method-add-font-override). ### [bool](class_bool#class-bool) has\_icon ( [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" ) const Returns `true` if there is a matching [Theme](class_theme#class-theme) in the tree that has an icon item with the specified `name` and `theme_type`. See [get\_color](#class-control-method-get-color) for details. ### [bool](class_bool#class-bool) has\_icon\_override ( [String](class_string#class-string) name ) const Returns `true` if there is a local override for a theme icon with the specified `name` in this `Control` node. See [add\_icon\_override](#class-control-method-add-icon-override). ### [bool](class_bool#class-bool) has\_point ( [Vector2](class_vector2#class-vector2) point ) virtual Virtual method to be implemented by the user. Returns whether the given `point` is inside this control. If not overridden, default behavior is checking if the point is within control's Rect. **Note:** If you want to check if a point is inside the control, you can use `get_rect().has_point(point)`. ### [bool](class_bool#class-bool) has\_shader\_override ( [String](class_string#class-string) name ) const Returns `true` if there is a local override for a theme shader with the specified `name` in this `Control` node. See [add\_shader\_override](#class-control-method-add-shader-override). ### [bool](class_bool#class-bool) has\_stylebox ( [String](class_string#class-string) name, [String](class_string#class-string) theme\_type="" ) const Returns `true` if there is a matching [Theme](class_theme#class-theme) in the tree that has a stylebox item with the specified `name` and `theme_type`. See [get\_color](#class-control-method-get-color) for details. ### [bool](class_bool#class-bool) has\_stylebox\_override ( [String](class_string#class-string) name ) const Returns `true` if there is a local override for a theme [StyleBox](class_stylebox#class-stylebox) with the specified `name` in this `Control` node. See [add\_stylebox\_override](#class-control-method-add-stylebox-override). ### [bool](class_bool#class-bool) is\_drag\_successful ( ) const Returns `true` if a drag operation is successful. Alternative to [Viewport.gui\_is\_drag\_successful](class_viewport#class-viewport-method-gui-is-drag-successful). Best used with [Node.NOTIFICATION\_DRAG\_END](class_node#class-node-constant-notification-drag-end). ### void minimum\_size\_changed ( ) Invalidates the size cache in this node and in parent nodes up to toplevel. Intended to be used with [get\_minimum\_size](#id1) when the return value is changed. Setting [rect\_min\_size](#class-control-property-rect-min-size) directly calls this method automatically. ### void release\_focus ( ) Give up the focus. No other control will be able to receive keyboard input. ### void remove\_color\_override ( [String](class_string#class-string) name ) Removes a theme override for a [Color](class_color#class-color) with the given `name`. ### void remove\_constant\_override ( [String](class_string#class-string) name ) Removes a theme override for a constant with the given `name`. ### void remove\_font\_override ( [String](class_string#class-string) name ) Removes a theme override for a [Font](class_font#class-font) with the given `name`. ### void remove\_icon\_override ( [String](class_string#class-string) name ) Removes a theme override for an icon with the given `name`. ### void remove\_shader\_override ( [String](class_string#class-string) name ) Removes a theme override for a shader with the given `name`. ### void remove\_stylebox\_override ( [String](class_string#class-string) name ) Removes a theme override for a [StyleBox](class_stylebox#class-stylebox) with the given `name`. ### void set\_anchor ( [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) anchor, [bool](class_bool#class-bool) keep\_margin=false, [bool](class_bool#class-bool) push\_opposite\_anchor=true ) Sets the anchor identified by `margin` constant from [Margin](class_%40globalscope#enum-globalscope-margin) enum to value `anchor`. A setter method for [anchor\_bottom](#class-control-property-anchor-bottom), [anchor\_left](#class-control-property-anchor-left), [anchor\_right](#class-control-property-anchor-right) and [anchor\_top](#class-control-property-anchor-top). If `keep_margin` is `true`, margins aren't updated after this operation. If `push_opposite_anchor` is `true` and the opposite anchor overlaps this anchor, the opposite one will have its value overridden. For example, when setting left anchor to 1 and the right anchor has value of 0.5, the right anchor will also get value of 1. If `push_opposite_anchor` was `false`, the left anchor would get value 0.5. ### void set\_anchor\_and\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) anchor, [float](class_float#class-float) offset, [bool](class_bool#class-bool) push\_opposite\_anchor=false ) Works the same as [set\_anchor](#class-control-method-set-anchor), but instead of `keep_margin` argument and automatic update of margin, it allows to set the margin offset yourself (see [set\_margin](#class-control-method-set-margin)). ### void set\_anchors\_and\_margins\_preset ( [LayoutPreset](#enum-control-layoutpreset) preset, [LayoutPresetMode](#enum-control-layoutpresetmode) resize\_mode=0, [int](class_int#class-int) margin=0 ) Sets both anchor preset and margin preset. See [set\_anchors\_preset](#class-control-method-set-anchors-preset) and [set\_margins\_preset](#class-control-method-set-margins-preset). ### void set\_anchors\_preset ( [LayoutPreset](#enum-control-layoutpreset) preset, [bool](class_bool#class-bool) keep\_margins=false ) Sets the anchors to a `preset` from [LayoutPreset](#enum-control-layoutpreset) enum. This is the code equivalent to using the Layout menu in the 2D editor. If `keep_margins` is `true`, control's position will also be updated. ### void set\_begin ( [Vector2](class_vector2#class-vector2) position ) Sets [margin\_left](#class-control-property-margin-left) and [margin\_top](#class-control-property-margin-top) at the same time. Equivalent of changing [rect\_position](#class-control-property-rect-position). ### void set\_drag\_forwarding ( [Control](#class-control) target ) Forwards the handling of this control's drag and drop to `target` control. Forwarding can be implemented in the target control similar to the methods [get\_drag\_data](#class-control-method-get-drag-data), [can\_drop\_data](#class-control-method-can-drop-data), and [drop\_data](#class-control-method-drop-data) but with two differences: 1. The function name must be suffixed with **\_fw** 2. The function must take an extra argument that is the control doing the forwarding ``` # ThisControl.gd extends Control func _ready(): set_drag_forwarding(target_control) # TargetControl.gd extends Control func can_drop_data_fw(position, data, from_control): return true func drop_data_fw(position, data, from_control): my_handle_data(data) func get_drag_data_fw(position, from_control): set_drag_preview(my_preview) return my_data() ``` ### void set\_drag\_preview ( [Control](#class-control) control ) Shows the given control at the mouse pointer. A good time to call this method is in [get\_drag\_data](#class-control-method-get-drag-data). The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended. ``` export (Color, RGBA) var color = Color(1, 0, 0, 1) func get_drag_data(position): # Use a control that is not in the tree var cpb = ColorPickerButton.new() cpb.color = color cpb.rect_size = Vector2(50, 50) set_drag_preview(cpb) return color ``` ### void set\_end ( [Vector2](class_vector2#class-vector2) position ) Sets [margin\_right](#class-control-property-margin-right) and [margin\_bottom](#class-control-property-margin-bottom) at the same time. ### void set\_focus\_neighbour ( [Margin](class_%40globalscope#enum-globalscope-margin) margin, [NodePath](class_nodepath#class-nodepath) neighbour ) Sets the anchor identified by `margin` constant from [Margin](class_%40globalscope#enum-globalscope-margin) enum to `Control` at `neighbor` node path. A setter method for [focus\_neighbour\_bottom](#class-control-property-focus-neighbour-bottom), [focus\_neighbour\_left](#class-control-property-focus-neighbour-left), [focus\_neighbour\_right](#class-control-property-focus-neighbour-right) and [focus\_neighbour\_top](#class-control-property-focus-neighbour-top). ### void set\_global\_position ( [Vector2](class_vector2#class-vector2) position, [bool](class_bool#class-bool) keep\_margins=false ) Sets the [rect\_global\_position](#class-control-property-rect-global-position) to given `position`. If `keep_margins` is `true`, control's anchors will be updated instead of margins. ### void set\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) offset ) Sets the margin identified by `margin` constant from [Margin](class_%40globalscope#enum-globalscope-margin) enum to given `offset`. A setter method for [margin\_bottom](#class-control-property-margin-bottom), [margin\_left](#class-control-property-margin-left), [margin\_right](#class-control-property-margin-right) and [margin\_top](#class-control-property-margin-top). ### void set\_margins\_preset ( [LayoutPreset](#enum-control-layoutpreset) preset, [LayoutPresetMode](#enum-control-layoutpresetmode) resize\_mode=0, [int](class_int#class-int) margin=0 ) Sets the margins to a `preset` from [LayoutPreset](#enum-control-layoutpreset) enum. This is the code equivalent to using the Layout menu in the 2D editor. Use parameter `resize_mode` with constants from [LayoutPresetMode](#enum-control-layoutpresetmode) to better determine the resulting size of the `Control`. Constant size will be ignored if used with presets that change size, e.g. `PRESET_LEFT_WIDE`. Use parameter `margin` to determine the gap between the `Control` and the edges. ### void set\_position ( [Vector2](class_vector2#class-vector2) position, [bool](class_bool#class-bool) keep\_margins=false ) Sets the [rect\_position](#class-control-property-rect-position) to given `position`. If `keep_margins` is `true`, control's anchors will be updated instead of margins. ### void set\_rotation ( [float](class_float#class-float) radians ) Sets the rotation (in radians). ### void set\_size ( [Vector2](class_vector2#class-vector2) size, [bool](class_bool#class-bool) keep\_margins=false ) Sets the size (see [rect\_size](#class-control-property-rect-size)). If `keep_margins` is `true`, control's anchors will be updated instead of margins. ### void show\_modal ( [bool](class_bool#class-bool) exclusive=false ) Displays a control as modal. Control must be a subwindow. Modal controls capture the input signals until closed or the area outside them is accessed. When a modal control loses focus, or the ESC key is pressed, they automatically hide. Modal controls are used extensively for popup dialogs and menus. If `exclusive` is `true`, other controls will not receive input and clicking outside this control will not close it. ### void warp\_mouse ( [Vector2](class_vector2#class-vector2) to\_position ) Moves the mouse cursor to `to_position`, relative to [rect\_position](#class-control-property-rect-position) of this `Control`.
programming_docs
godot PoolStringArray PoolStringArray =============== A pooled array of [String](class_string#class-string)s. Description ----------- An array specifically designed to hold [String](class_string#class-string)s. Optimized for memory usage, does not fragment the memory. **Note:** This type is passed by value and not by reference. This means that when *mutating* a class property of type `PoolStringArray` or mutating a `PoolStringArray` within an [Array](class_array#class-array) or [Dictionary](class_dictionary#class-dictionary), changes will be lost: ``` var array = [PoolStringArray()] array[0].push_back("hello") print(array) # [[]] (empty PoolStringArray within an Array) ``` Instead, the entire `PoolStringArray` property must be *reassigned* with `=` for it to be changed: ``` var array = [PoolStringArray()] var pool_array = array[0] pool_array.push_back("hello") array[0] = pool_array print(array) # [[hello]] (PoolStringArray with 1 element inside an Array) ``` Tutorials --------- * [OS Test Demo](https://godotengine.org/asset-library/asset/677) Methods ------- | | | | --- | --- | | [PoolStringArray](#class-poolstringarray) | [PoolStringArray](#class-poolstringarray-method-poolstringarray) **(** [Array](class_array#class-array) from **)** | | void | [append](#class-poolstringarray-method-append) **(** [String](class_string#class-string) string **)** | | void | [append\_array](#class-poolstringarray-method-append-array) **(** [PoolStringArray](#class-poolstringarray) array **)** | | [int](class_int#class-int) | [count](#class-poolstringarray-method-count) **(** [String](class_string#class-string) value **)** | | [bool](class_bool#class-bool) | [empty](#class-poolstringarray-method-empty) **(** **)** | | void | [fill](#class-poolstringarray-method-fill) **(** [String](class_string#class-string) string **)** | | [int](class_int#class-int) | [find](#class-poolstringarray-method-find) **(** [String](class_string#class-string) value, [int](class_int#class-int) from=0 **)** | | [bool](class_bool#class-bool) | [has](#class-poolstringarray-method-has) **(** [String](class_string#class-string) value **)** | | [int](class_int#class-int) | [insert](#class-poolstringarray-method-insert) **(** [int](class_int#class-int) idx, [String](class_string#class-string) string **)** | | void | [invert](#class-poolstringarray-method-invert) **(** **)** | | [String](class_string#class-string) | [join](#class-poolstringarray-method-join) **(** [String](class_string#class-string) delimiter **)** | | void | [push\_back](#class-poolstringarray-method-push-back) **(** [String](class_string#class-string) string **)** | | void | [remove](#class-poolstringarray-method-remove) **(** [int](class_int#class-int) idx **)** | | void | [resize](#class-poolstringarray-method-resize) **(** [int](class_int#class-int) idx **)** | | [int](class_int#class-int) | [rfind](#class-poolstringarray-method-rfind) **(** [String](class_string#class-string) value, [int](class_int#class-int) from=-1 **)** | | void | [set](#class-poolstringarray-method-set) **(** [int](class_int#class-int) idx, [String](class_string#class-string) string **)** | | [int](class_int#class-int) | [size](#class-poolstringarray-method-size) **(** **)** | | void | [sort](#class-poolstringarray-method-sort) **(** **)** | Method Descriptions ------------------- ### [PoolStringArray](#class-poolstringarray) PoolStringArray ( [Array](class_array#class-array) from ) Constructs a new `PoolStringArray`. Optionally, you can pass in a generic [Array](class_array#class-array) that will be converted. ### void append ( [String](class_string#class-string) string ) Appends an element at the end of the array (alias of [push\_back](#class-poolstringarray-method-push-back)). ### void append\_array ( [PoolStringArray](#class-poolstringarray) array ) Appends a `PoolStringArray` at the end of this array. ### [int](class_int#class-int) count ( [String](class_string#class-string) value ) Returns the number of times an element is in the array. ### [bool](class_bool#class-bool) empty ( ) Returns `true` if the array is empty. ### void fill ( [String](class_string#class-string) string ) Assigns the given value to all elements in the array. This can typically be used together with [resize](#class-poolstringarray-method-resize) to create an array with a given size and initialized elements. ### [int](class_int#class-int) find ( [String](class_string#class-string) value, [int](class_int#class-int) from=0 ) Searches the array for a value and returns its index or `-1` if not found. Optionally, the initial search index can be passed. Returns `-1` if `from` is out of bounds. ### [bool](class_bool#class-bool) has ( [String](class_string#class-string) value ) Returns `true` if the array contains the given value. **Note:** This is equivalent to using the `in` operator. ### [int](class_int#class-int) insert ( [int](class_int#class-int) idx, [String](class_string#class-string) string ) Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (`idx == size()`). ### void invert ( ) Reverses the order of the elements in the array. ### [String](class_string#class-string) join ( [String](class_string#class-string) delimiter ) Returns a [String](class_string#class-string) with each element of the array joined with the given `delimiter`. ### void push\_back ( [String](class_string#class-string) string ) Appends a string element at end of the array. ### void remove ( [int](class_int#class-int) idx ) Removes an element from the array by index. ### void resize ( [int](class_int#class-int) idx ) Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. ### [int](class_int#class-int) rfind ( [String](class_string#class-string) value, [int](class_int#class-int) from=-1 ) Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. ### void set ( [int](class_int#class-int) idx, [String](class_string#class-string) string ) Changes the [String](class_string#class-string) at the given index. ### [int](class_int#class-int) size ( ) Returns the number of elements in the array. ### void sort ( ) Sorts the elements of the array in ascending order. godot WeakRef WeakRef ======= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Holds an [Object](class_object#class-object), but does not contribute to the reference count if the object is a reference. Description ----------- A weakref can hold a [Reference](class_reference#class-reference), without contributing to the reference counter. A weakref can be created from an [Object](class_object#class-object) using [@GDScript.weakref](class_%40gdscript#class-gdscript-method-weakref). If this object is not a reference, weakref still works, however, it does not have any effect on the object. Weakrefs are useful in cases where multiple classes have variables that refer to each other. Without weakrefs, using these classes could lead to memory leaks, since both references keep each other from being released. Making part of the variables a weakref can prevent this cyclic dependency, and allows the references to be released. Methods ------- | | | | --- | --- | | [Variant](class_variant#class-variant) | [get\_ref](#class-weakref-method-get-ref) **(** **)** const | Method Descriptions ------------------- ### [Variant](class_variant#class-variant) get\_ref ( ) const Returns the [Object](class_object#class-object) this weakref is referring to. Returns `null` if that object no longer exists. godot AudioEffectEQ10 AudioEffectEQ10 =============== **Inherits:** [AudioEffectEQ](class_audioeffecteq#class-audioeffecteq) **<** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Adds a 10-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 31 Hz to 16000 Hz. Each frequency can be modulated between -60/+24 dB. Description ----------- Frequency bands: Band 1: 31 Hz Band 2: 62 Hz Band 3: 125 Hz Band 4: 250 Hz Band 5: 500 Hz Band 6: 1000 Hz Band 7: 2000 Hz Band 8: 4000 Hz Band 9: 8000 Hz Band 10: 16000 Hz See also [AudioEffectEQ](class_audioeffecteq#class-audioeffecteq), [AudioEffectEQ6](class_audioeffecteq6#class-audioeffecteq6), [AudioEffectEQ21](class_audioeffecteq21#class-audioeffecteq21). godot Spatial Spatial ======= **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [ARVRAnchor](class_arvranchor#class-arvranchor), [ARVRController](class_arvrcontroller#class-arvrcontroller), [ARVROrigin](class_arvrorigin#class-arvrorigin), [AudioStreamPlayer3D](class_audiostreamplayer3d#class-audiostreamplayer3d), [BoneAttachment](class_boneattachment#class-boneattachment), [Camera](class_camera#class-camera), [CollisionObject](class_collisionobject#class-collisionobject), [CollisionPolygon](class_collisionpolygon#class-collisionpolygon), [CollisionShape](class_collisionshape#class-collisionshape), [CullInstance](class_cullinstance#class-cullinstance), [GridMap](class_gridmap#class-gridmap), [Joint](class_joint#class-joint), [Listener](class_listener#class-listener), [Navigation](class_navigation#class-navigation), [NavigationMeshInstance](class_navigationmeshinstance#class-navigationmeshinstance), [Occluder](class_occluder#class-occluder), [Path](class_path#class-path), [PathFollow](class_pathfollow#class-pathfollow), [Portal](class_portal#class-portal), [Position3D](class_position3d#class-position3d), [ProximityGroup](class_proximitygroup#class-proximitygroup), [RayCast](class_raycast#class-raycast), [RemoteTransform](class_remotetransform#class-remotetransform), [Room](class_room#class-room), [RoomGroup](class_roomgroup#class-roomgroup), [RoomManager](class_roommanager#class-roommanager), [Skeleton](class_skeleton#class-skeleton), [SpringArm](class_springarm#class-springarm), [VehicleWheel](class_vehiclewheel#class-vehiclewheel) Most basic 3D game object, parent of all 3D-related nodes. Description ----------- Most basic 3D game object, with a 3D [Transform](class_transform#class-transform) and visibility settings. All other 3D game objects inherit from Spatial. Use `Spatial` as a parent node to move, scale, rotate and show/hide children in a 3D project. Affine operations (rotate, scale, translate) happen in parent's local coordinate system, unless the `Spatial` object is set as top-level. Affine operations in this coordinate system correspond to direct affine operations on the `Spatial`'s transform. The word local below refers to this coordinate system. The coordinate system that is attached to the `Spatial` object itself is referred to as object-local coordinate system. **Note:** Unless otherwise specified, all methods that have angle parameters must have angles specified as *radians*. To convert degrees to radians, use [@GDScript.deg2rad](class_%40gdscript#class-gdscript-method-deg2rad). Tutorials --------- * [Introduction to 3D](https://docs.godotengine.org/en/3.5/tutorials/3d/introduction_to_3d.html) * [All 3D Demos](https://github.com/godotengine/godot-demo-projects/tree/master/3d) Properties ---------- | | | | | --- | --- | --- | | [SpatialGizmo](class_spatialgizmo#class-spatialgizmo) | [gizmo](#class-spatial-property-gizmo) | | | [Vector3](class_vector3#class-vector3) | [global\_rotation](#class-spatial-property-global-rotation) | | | [Transform](class_transform#class-transform) | [global\_transform](#class-spatial-property-global-transform) | | | [Vector3](class_vector3#class-vector3) | [global\_translation](#class-spatial-property-global-translation) | | | [Vector3](class_vector3#class-vector3) | [rotation](#class-spatial-property-rotation) | | | [Vector3](class_vector3#class-vector3) | [rotation\_degrees](#class-spatial-property-rotation-degrees) | `Vector3( 0, 0, 0 )` | | [Vector3](class_vector3#class-vector3) | [scale](#class-spatial-property-scale) | `Vector3( 1, 1, 1 )` | | [Transform](class_transform#class-transform) | [transform](#class-spatial-property-transform) | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | | [Vector3](class_vector3#class-vector3) | [translation](#class-spatial-property-translation) | `Vector3( 0, 0, 0 )` | | [bool](class_bool#class-bool) | [visible](#class-spatial-property-visible) | `true` | Methods ------- | | | | --- | --- | | void | [force\_update\_transform](#class-spatial-method-force-update-transform) **(** **)** | | [Transform](class_transform#class-transform) | [get\_global\_transform\_interpolated](#class-spatial-method-get-global-transform-interpolated) **(** **)** | | [Spatial](#class-spatial) | [get\_parent\_spatial](#class-spatial-method-get-parent-spatial) **(** **)** const | | [World](class_world#class-world) | [get\_world](#class-spatial-method-get-world) **(** **)** const | | void | [global\_rotate](#class-spatial-method-global-rotate) **(** [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle **)** | | void | [global\_scale](#class-spatial-method-global-scale) **(** [Vector3](class_vector3#class-vector3) scale **)** | | void | [global\_translate](#class-spatial-method-global-translate) **(** [Vector3](class_vector3#class-vector3) offset **)** | | void | [hide](#class-spatial-method-hide) **(** **)** | | [bool](class_bool#class-bool) | [is\_local\_transform\_notification\_enabled](#class-spatial-method-is-local-transform-notification-enabled) **(** **)** const | | [bool](class_bool#class-bool) | [is\_scale\_disabled](#class-spatial-method-is-scale-disabled) **(** **)** const | | [bool](class_bool#class-bool) | [is\_set\_as\_toplevel](#class-spatial-method-is-set-as-toplevel) **(** **)** const | | [bool](class_bool#class-bool) | [is\_transform\_notification\_enabled](#class-spatial-method-is-transform-notification-enabled) **(** **)** const | | [bool](class_bool#class-bool) | [is\_visible\_in\_tree](#class-spatial-method-is-visible-in-tree) **(** **)** const | | void | [look\_at](#class-spatial-method-look-at) **(** [Vector3](class_vector3#class-vector3) target, [Vector3](class_vector3#class-vector3) up **)** | | void | [look\_at\_from\_position](#class-spatial-method-look-at-from-position) **(** [Vector3](class_vector3#class-vector3) position, [Vector3](class_vector3#class-vector3) target, [Vector3](class_vector3#class-vector3) up **)** | | void | [orthonormalize](#class-spatial-method-orthonormalize) **(** **)** | | void | [rotate](#class-spatial-method-rotate) **(** [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle **)** | | void | [rotate\_object\_local](#class-spatial-method-rotate-object-local) **(** [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle **)** | | void | [rotate\_x](#class-spatial-method-rotate-x) **(** [float](class_float#class-float) angle **)** | | void | [rotate\_y](#class-spatial-method-rotate-y) **(** [float](class_float#class-float) angle **)** | | void | [rotate\_z](#class-spatial-method-rotate-z) **(** [float](class_float#class-float) angle **)** | | void | [scale\_object\_local](#class-spatial-method-scale-object-local) **(** [Vector3](class_vector3#class-vector3) scale **)** | | void | [set\_as\_toplevel](#class-spatial-method-set-as-toplevel) **(** [bool](class_bool#class-bool) enable **)** | | void | [set\_disable\_scale](#class-spatial-method-set-disable-scale) **(** [bool](class_bool#class-bool) disable **)** | | void | [set\_identity](#class-spatial-method-set-identity) **(** **)** | | void | [set\_ignore\_transform\_notification](#class-spatial-method-set-ignore-transform-notification) **(** [bool](class_bool#class-bool) enabled **)** | | void | [set\_notify\_local\_transform](#class-spatial-method-set-notify-local-transform) **(** [bool](class_bool#class-bool) enable **)** | | void | [set\_notify\_transform](#class-spatial-method-set-notify-transform) **(** [bool](class_bool#class-bool) enable **)** | | void | [show](#class-spatial-method-show) **(** **)** | | [Vector3](class_vector3#class-vector3) | [to\_global](#class-spatial-method-to-global) **(** [Vector3](class_vector3#class-vector3) local\_point **)** const | | [Vector3](class_vector3#class-vector3) | [to\_local](#class-spatial-method-to-local) **(** [Vector3](class_vector3#class-vector3) global\_point **)** const | | void | [translate](#class-spatial-method-translate) **(** [Vector3](class_vector3#class-vector3) offset **)** | | void | [translate\_object\_local](#class-spatial-method-translate-object-local) **(** [Vector3](class_vector3#class-vector3) offset **)** | | void | [update\_gizmo](#class-spatial-method-update-gizmo) **(** **)** | Signals ------- ### gameplay\_entered ( ) Emitted by portal system gameplay monitor when a node enters the gameplay area. ### gameplay\_exited ( ) Emitted by portal system gameplay monitor when a node exits the gameplay area. ### visibility\_changed ( ) Emitted when node visibility changes. Constants --------- ### NOTIFICATION\_TRANSFORM\_CHANGED = 2000 --- Spatial nodes receives this notification when their global transform changes. This means that either the current or a parent node changed its transform. In order for [NOTIFICATION\_TRANSFORM\_CHANGED](#class-spatial-constant-notification-transform-changed) to work, users first need to ask for it, with [set\_notify\_transform](#class-spatial-method-set-notify-transform). The notification is also sent if the node is in the editor context and it has a valid gizmo. * **NOTIFICATION\_ENTER\_WORLD** = **41** --- Spatial nodes receives this notification when they are registered to new [World](class_world#class-world) resource. * **NOTIFICATION\_EXIT\_WORLD** = **42** --- Spatial nodes receives this notification when they are unregistered from current [World](class_world#class-world) resource. * **NOTIFICATION\_VISIBILITY\_CHANGED** = **43** --- Spatial nodes receives this notification when their visibility changes. * **NOTIFICATION\_ENTER\_GAMEPLAY** = **45** --- Spatial nodes receives this notification if the portal system gameplay monitor detects they have entered the gameplay area. * **NOTIFICATION\_EXIT\_GAMEPLAY** = **46** --- Spatial nodes receives this notification if the portal system gameplay monitor detects they have exited the gameplay area. Property Descriptions --------------------- ### [SpatialGizmo](class_spatialgizmo#class-spatialgizmo) gizmo | | | | --- | --- | | *Setter* | set\_gizmo(value) | | *Getter* | get\_gizmo() | The [SpatialGizmo](class_spatialgizmo#class-spatialgizmo) for this node. Used for example in [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) as custom visualization and editing handles in Editor. ### [Vector3](class_vector3#class-vector3) global\_rotation | | | | --- | --- | | *Setter* | set\_global\_rotation(value) | | *Getter* | get\_global\_rotation() | Rotation part of the global transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). **Note:** In the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three independent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a [Vector3](class_vector3#class-vector3) data structure not because the rotation is a vector, but only because [Vector3](class_vector3#class-vector3) exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation "vector" is not meaningful. ### [Transform](class_transform#class-transform) global\_transform | | | | --- | --- | | *Setter* | set\_global\_transform(value) | | *Getter* | get\_global\_transform() | World space (global) [Transform](class_transform#class-transform) of this node. ### [Vector3](class_vector3#class-vector3) global\_translation | | | | --- | --- | | *Setter* | set\_global\_translation(value) | | *Getter* | get\_global\_translation() | Global position of this node. This is equivalent to `global_transform.origin`. ### [Vector3](class_vector3#class-vector3) rotation | | | | --- | --- | | *Setter* | set\_rotation(value) | | *Getter* | get\_rotation() | Rotation part of the local transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). **Note:** In the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three independent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a [Vector3](class_vector3#class-vector3) data structure not because the rotation is a vector, but only because [Vector3](class_vector3#class-vector3) exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation "vector" is not meaningful. ### [Vector3](class_vector3#class-vector3) rotation\_degrees | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_rotation\_degrees(value) | | *Getter* | get\_rotation\_degrees() | Rotation part of the local transformation in degrees, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). ### [Vector3](class_vector3#class-vector3) scale | | | | --- | --- | | *Default* | `Vector3( 1, 1, 1 )` | | *Setter* | set\_scale(value) | | *Getter* | get\_scale() | Scale part of the local transformation. **Note:** Mixed negative scales in 3D are not decomposable from the transformation matrix. Due to the way scale is represented with transformation matrices in Godot, the scale values will either be all positive or all negative. ### [Transform](class_transform#class-transform) transform | | | | --- | --- | | *Default* | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | | *Setter* | set\_transform(value) | | *Getter* | get\_transform() | Local space [Transform](class_transform#class-transform) of this node, with respect to the parent node. ### [Vector3](class_vector3#class-vector3) translation | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_translation(value) | | *Getter* | get\_translation() | Local translation of this node. ### [bool](class_bool#class-bool) visible | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_visible(value) | | *Getter* | is\_visible() | If `true`, this node is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [is\_visible\_in\_tree](#class-spatial-method-is-visible-in-tree) must return `true`). Method Descriptions ------------------- ### void force\_update\_transform ( ) Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. ### [Transform](class_transform#class-transform) get\_global\_transform\_interpolated ( ) When using physics interpolation, there will be circumstances in which you want to know the interpolated (displayed) transform of a node rather than the standard transform (which may only be accurate to the most recent physics tick). This is particularly important for frame-based operations that take place in [Node.\_process](class_node#class-node-method-process), rather than [Node.\_physics\_process](class_node#class-node-method-physics-process). Examples include [Camera](class_camera#class-camera)s focusing on a node, or finding where to fire lasers from on a frame rather than physics tick. ### [Spatial](#class-spatial) get\_parent\_spatial ( ) const Returns the parent `Spatial`, or an empty [Object](class_object#class-object) if no parent exists or parent is not of type `Spatial`. ### [World](class_world#class-world) get\_world ( ) const Returns the current [World](class_world#class-world) resource this `Spatial` node is registered to. ### void global\_rotate ( [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle ) Rotates the global (world) transformation around axis, a unit [Vector3](class_vector3#class-vector3), by specified angle in radians. The rotation axis is in global coordinate system. ### void global\_scale ( [Vector3](class_vector3#class-vector3) scale ) Scales the global (world) transformation by the given [Vector3](class_vector3#class-vector3) scale factors. ### void global\_translate ( [Vector3](class_vector3#class-vector3) offset ) Moves the global (world) transformation by [Vector3](class_vector3#class-vector3) offset. The offset is in global coordinate system. ### void hide ( ) Disables rendering of this node. Changes [visible](#class-spatial-property-visible) to `false`. ### [bool](class_bool#class-bool) is\_local\_transform\_notification\_enabled ( ) const Returns whether node notifies about its local transformation changes. `Spatial` will not propagate this by default. ### [bool](class_bool#class-bool) is\_scale\_disabled ( ) const Returns whether this node uses a scale of `(1, 1, 1)` or its local transformation scale. ### [bool](class_bool#class-bool) is\_set\_as\_toplevel ( ) const Returns whether this node is set as Toplevel, that is whether it ignores its parent nodes transformations. ### [bool](class_bool#class-bool) is\_transform\_notification\_enabled ( ) const Returns whether the node notifies about its global and local transformation changes. `Spatial` will not propagate this by default. ### [bool](class_bool#class-bool) is\_visible\_in\_tree ( ) const Returns `true` if the node is present in the [SceneTree](class_scenetree#class-scenetree), its [visible](#class-spatial-property-visible) property is `true` and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree. ### void look\_at ( [Vector3](class_vector3#class-vector3) target, [Vector3](class_vector3#class-vector3) up ) Rotates the node so that the local forward axis (-Z) points toward the `target` position. The local up axis (+Y) points as close to the `up` vector as possible while staying perpendicular to the local forward axis. The resulting transform is orthogonal, and the scale is preserved. Non-uniform scaling may not work correctly. The `target` position cannot be the same as the node's position, the `up` vector cannot be zero, and the direction from the node's position to the `target` vector cannot be parallel to the `up` vector. Operations take place in global space. ### void look\_at\_from\_position ( [Vector3](class_vector3#class-vector3) position, [Vector3](class_vector3#class-vector3) target, [Vector3](class_vector3#class-vector3) up ) Moves the node to the specified `position`, and then rotates itself to point toward the `target` as per [look\_at](#class-spatial-method-look-at). Operations take place in global space. ### void orthonormalize ( ) Resets this node's transformations (like scale, skew and taper) preserving its rotation and translation by performing Gram-Schmidt orthonormalization on this node's [Transform](class_transform#class-transform). ### void rotate ( [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle ) Rotates the local transformation around axis, a unit [Vector3](class_vector3#class-vector3), by specified angle in radians. ### void rotate\_object\_local ( [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle ) Rotates the local transformation around axis, a unit [Vector3](class_vector3#class-vector3), by specified angle in radians. The rotation axis is in object-local coordinate system. ### void rotate\_x ( [float](class_float#class-float) angle ) Rotates the local transformation around the X axis by angle in radians. ### void rotate\_y ( [float](class_float#class-float) angle ) Rotates the local transformation around the Y axis by angle in radians. ### void rotate\_z ( [float](class_float#class-float) angle ) Rotates the local transformation around the Z axis by angle in radians. ### void scale\_object\_local ( [Vector3](class_vector3#class-vector3) scale ) Scales the local transformation by given 3D scale factors in object-local coordinate system. ### void set\_as\_toplevel ( [bool](class_bool#class-bool) enable ) Makes the node ignore its parents transformations. Node transformations are only in global space. ### void set\_disable\_scale ( [bool](class_bool#class-bool) disable ) Sets whether the node uses a scale of `(1, 1, 1)` or its local transformation scale. Changes to the local transformation scale are preserved. ### void set\_identity ( ) Reset all transformations for this node (sets its [Transform](class_transform#class-transform) to the identity matrix). ### void set\_ignore\_transform\_notification ( [bool](class_bool#class-bool) enabled ) Sets whether the node ignores notification that its transformation (global or local) changed. ### void set\_notify\_local\_transform ( [bool](class_bool#class-bool) enable ) Sets whether the node notifies about its local transformation changes. `Spatial` will not propagate this by default. ### void set\_notify\_transform ( [bool](class_bool#class-bool) enable ) Sets whether the node notifies about its global and local transformation changes. `Spatial` will not propagate this by default, unless it is in the editor context and it has a valid gizmo. ### void show ( ) Enables rendering of this node. Changes [visible](#class-spatial-property-visible) to `true`. ### [Vector3](class_vector3#class-vector3) to\_global ( [Vector3](class_vector3#class-vector3) local\_point ) const Transforms `local_point` from this node's local space to world space. ### [Vector3](class_vector3#class-vector3) to\_local ( [Vector3](class_vector3#class-vector3) global\_point ) const Transforms `global_point` from world space to this node's local space. ### void translate ( [Vector3](class_vector3#class-vector3) offset ) Changes the node's position by the given offset [Vector3](class_vector3#class-vector3). Note that the translation `offset` is affected by the node's scale, so if scaled by e.g. `(10, 1, 1)`, a translation by an offset of `(2, 0, 0)` would actually add 20 (`2 * 10`) to the X coordinate. ### void translate\_object\_local ( [Vector3](class_vector3#class-vector3) offset ) Changes the node's position by the given offset [Vector3](class_vector3#class-vector3) in local space. ### void update\_gizmo ( ) Updates the [SpatialGizmo](class_spatialgizmo#class-spatialgizmo) of this node.
programming_docs
godot OccluderShapePolygon OccluderShapePolygon ==================== **Inherits:** [OccluderShape](class_occludershape#class-occludershape) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Polygon occlusion primitive for use with the [Occluder](class_occluder#class-occluder) node. Description ----------- [OccluderShape](class_occludershape#class-occludershape)s are resources used by [Occluder](class_occluder#class-occluder) nodes, allowing geometric occlusion culling. The polygon must be a convex polygon. The polygon points can be created and deleted either in the Editor inspector or by calling `set_polygon_points`. The points of the edges can be set by dragging the handles in the Editor viewport. Additionally each polygon occluder can optionally support a single hole. If you add at least three points in the Editor inspector to the hole, you can drag the edge points of the hole in the Editor viewport. In general, the lower the number of edges in polygons and holes, the faster the system will operate at runtime, so in most cases you will want to use 4 points for each. Properties ---------- | | | | | --- | --- | --- | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [hole\_points](#class-occludershapepolygon-property-hole-points) | `PoolVector2Array(  )` | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [polygon\_points](#class-occludershapepolygon-property-polygon-points) | `PoolVector2Array( 1, -1, 1, 1, -1, 1, -1, -1 )` | | [bool](class_bool#class-bool) | [two\_way](#class-occludershapepolygon-property-two-way) | `true` | Methods ------- | | | | --- | --- | | void | [set\_hole\_point](#class-occludershapepolygon-method-set-hole-point) **(** [int](class_int#class-int) index, [Vector2](class_vector2#class-vector2) position **)** | | void | [set\_polygon\_point](#class-occludershapepolygon-method-set-polygon-point) **(** [int](class_int#class-int) index, [Vector2](class_vector2#class-vector2) position **)** | Property Descriptions --------------------- ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) hole\_points | | | | --- | --- | | *Default* | `PoolVector2Array(  )` | | *Setter* | set\_hole\_points(value) | | *Getter* | get\_hole\_points() | Allows changing the hole geometry from code. ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) polygon\_points | | | | --- | --- | | *Default* | `PoolVector2Array( 1, -1, 1, 1, -1, 1, -1, -1 )` | | *Setter* | set\_polygon\_points(value) | | *Getter* | get\_polygon\_points() | Allows changing the polygon geometry from code. ### [bool](class_bool#class-bool) two\_way | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_two\_way(value) | | *Getter* | is\_two\_way() | Specifies whether the occluder should operate from both sides. If `false`, the occluder will operate one way only. Method Descriptions ------------------- ### void set\_hole\_point ( [int](class_int#class-int) index, [Vector2](class_vector2#class-vector2) position ) Sets an individual hole point position. ### void set\_polygon\_point ( [int](class_int#class-int) index, [Vector2](class_vector2#class-vector2) position ) Sets an individual polygon point position. godot StreamPeerSSL StreamPeerSSL ============= **Inherits:** [StreamPeer](class_streampeer#class-streampeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) SSL stream peer. Description ----------- SSL stream peer. This object can be used to connect to an SSL server or accept a single SSL client connection. Tutorials --------- * [SSL certificates](https://docs.godotengine.org/en/3.5/tutorials/networking/ssl_certificates.html) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [blocking\_handshake](#class-streampeerssl-property-blocking-handshake) | `true` | Methods ------- | | | | --- | --- | | [Error](class_%40globalscope#enum-globalscope-error) | [accept\_stream](#class-streampeerssl-method-accept-stream) **(** [StreamPeer](class_streampeer#class-streampeer) stream, [CryptoKey](class_cryptokey#class-cryptokey) private\_key, [X509Certificate](class_x509certificate#class-x509certificate) certificate, [X509Certificate](class_x509certificate#class-x509certificate) chain=null **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [connect\_to\_stream](#class-streampeerssl-method-connect-to-stream) **(** [StreamPeer](class_streampeer#class-streampeer) stream, [bool](class_bool#class-bool) validate\_certs=false, [String](class_string#class-string) for\_hostname="", [X509Certificate](class_x509certificate#class-x509certificate) valid\_certificate=null **)** | | void | [disconnect\_from\_stream](#class-streampeerssl-method-disconnect-from-stream) **(** **)** | | [Status](#enum-streampeerssl-status) | [get\_status](#class-streampeerssl-method-get-status) **(** **)** const | | void | [poll](#class-streampeerssl-method-poll) **(** **)** | Enumerations ------------ enum **Status**: * **STATUS\_DISCONNECTED** = **0** --- A status representing a `StreamPeerSSL` that is disconnected. * **STATUS\_HANDSHAKING** = **1** --- A status representing a `StreamPeerSSL` during handshaking. * **STATUS\_CONNECTED** = **2** --- A status representing a `StreamPeerSSL` that is connected to a host. * **STATUS\_ERROR** = **3** --- A status representing a `StreamPeerSSL` in error state. * **STATUS\_ERROR\_HOSTNAME\_MISMATCH** = **4** --- An error status that shows a mismatch in the SSL certificate domain presented by the host and the domain requested for validation. Property Descriptions --------------------- ### [bool](class_bool#class-bool) blocking\_handshake | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_blocking\_handshake\_enabled(value) | | *Getter* | is\_blocking\_handshake\_enabled() | Method Descriptions ------------------- ### [Error](class_%40globalscope#enum-globalscope-error) accept\_stream ( [StreamPeer](class_streampeer#class-streampeer) stream, [CryptoKey](class_cryptokey#class-cryptokey) private\_key, [X509Certificate](class_x509certificate#class-x509certificate) certificate, [X509Certificate](class_x509certificate#class-x509certificate) chain=null ) Accepts a peer connection as a server using the given `private_key` and providing the given `certificate` to the client. You can pass the optional `chain` parameter to provide additional CA chain information along with the certificate. ### [Error](class_%40globalscope#enum-globalscope-error) connect\_to\_stream ( [StreamPeer](class_streampeer#class-streampeer) stream, [bool](class_bool#class-bool) validate\_certs=false, [String](class_string#class-string) for\_hostname="", [X509Certificate](class_x509certificate#class-x509certificate) valid\_certificate=null ) Connects to a peer using an underlying [StreamPeer](class_streampeer#class-streampeer) `stream`. If `validate_certs` is `true`, `StreamPeerSSL` will validate that the certificate presented by the peer matches the `for_hostname`. **Note:** Specifying a custom `valid_certificate` is not supported in HTML5 exports due to browsers restrictions. ### void disconnect\_from\_stream ( ) Disconnects from host. ### [Status](#enum-streampeerssl-status) get\_status ( ) const Returns the status of the connection. See [Status](#enum-streampeerssl-status) for values. ### void poll ( ) Poll the connection to check for incoming bytes. Call this right before [StreamPeer.get\_available\_bytes](class_streampeer#class-streampeer-method-get-available-bytes) for it to work properly. godot VFlowContainer VFlowContainer ============== **Inherits:** [FlowContainer](class_flowcontainer#class-flowcontainer) **<** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Vertical flow container. Description ----------- Vertical version of [FlowContainer](class_flowcontainer#class-flowcontainer). Theme Properties ---------------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [hseparation](#class-vflowcontainer-theme-constant-hseparation) | `4` | | [int](class_int#class-int) | [vseparation](#class-vflowcontainer-theme-constant-vseparation) | `4` | Theme Property Descriptions --------------------------- ### [int](class_int#class-int) hseparation | | | | --- | --- | | *Default* | `4` | The horizontal separation of children nodes. ### [int](class_int#class-int) vseparation | | | | --- | --- | | *Default* | `4` | The vertical separation of children nodes. godot IntervalTweener IntervalTweener =============== **Inherits:** [Tweener](class_tweener#class-tweener) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Creates an idle interval in a [SceneTreeTween](class_scenetreetween#class-scenetreetween) animation. Description ----------- `IntervalTweener` is used to make delays in a tweening sequence. See [SceneTreeTween.tween\_interval](class_scenetreetween#class-scenetreetween-method-tween-interval) for more usage information. **Note:** [SceneTreeTween.tween\_interval](class_scenetreetween#class-scenetreetween-method-tween-interval) is the only correct way to create `IntervalTweener`. Any `IntervalTweener` created manually will not function correctly. godot CollisionObject CollisionObject =============== **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [Area](class_area#class-area), [PhysicsBody](class_physicsbody#class-physicsbody) Base node for collision objects. Description ----------- CollisionObject is the base class for physics objects. It can hold any number of collision [Shape](class_shape#class-shape)s. Each shape must be assigned to a *shape owner*. The CollisionObject can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the `shape_owner_*` methods. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [collision\_layer](#class-collisionobject-property-collision-layer) | `1` | | [int](class_int#class-int) | [collision\_mask](#class-collisionobject-property-collision-mask) | `1` | | [bool](class_bool#class-bool) | [input\_capture\_on\_drag](#class-collisionobject-property-input-capture-on-drag) | `false` | | [bool](class_bool#class-bool) | [input\_ray\_pickable](#class-collisionobject-property-input-ray-pickable) | `true` | Methods ------- | | | | --- | --- | | void | [\_input\_event](#class-collisionobject-method-input-event) **(** [Object](class_object#class-object) camera, [InputEvent](class_inputevent#class-inputevent) event, [Vector3](class_vector3#class-vector3) position, [Vector3](class_vector3#class-vector3) normal, [int](class_int#class-int) shape\_idx **)** virtual | | [int](class_int#class-int) | [create\_shape\_owner](#class-collisionobject-method-create-shape-owner) **(** [Object](class_object#class-object) owner **)** | | [bool](class_bool#class-bool) | [get\_collision\_layer\_bit](#class-collisionobject-method-get-collision-layer-bit) **(** [int](class_int#class-int) bit **)** const | | [bool](class_bool#class-bool) | [get\_collision\_mask\_bit](#class-collisionobject-method-get-collision-mask-bit) **(** [int](class_int#class-int) bit **)** const | | [RID](class_rid#class-rid) | [get\_rid](#class-collisionobject-method-get-rid) **(** **)** const | | [Array](class_array#class-array) | [get\_shape\_owners](#class-collisionobject-method-get-shape-owners) **(** **)** | | [bool](class_bool#class-bool) | [is\_shape\_owner\_disabled](#class-collisionobject-method-is-shape-owner-disabled) **(** [int](class_int#class-int) owner\_id **)** const | | void | [remove\_shape\_owner](#class-collisionobject-method-remove-shape-owner) **(** [int](class_int#class-int) owner\_id **)** | | void | [set\_collision\_layer\_bit](#class-collisionobject-method-set-collision-layer-bit) **(** [int](class_int#class-int) bit, [bool](class_bool#class-bool) value **)** | | void | [set\_collision\_mask\_bit](#class-collisionobject-method-set-collision-mask-bit) **(** [int](class_int#class-int) bit, [bool](class_bool#class-bool) value **)** | | [int](class_int#class-int) | [shape\_find\_owner](#class-collisionobject-method-shape-find-owner) **(** [int](class_int#class-int) shape\_index **)** const | | void | [shape\_owner\_add\_shape](#class-collisionobject-method-shape-owner-add-shape) **(** [int](class_int#class-int) owner\_id, [Shape](class_shape#class-shape) shape **)** | | void | [shape\_owner\_clear\_shapes](#class-collisionobject-method-shape-owner-clear-shapes) **(** [int](class_int#class-int) owner\_id **)** | | [Object](class_object#class-object) | [shape\_owner\_get\_owner](#class-collisionobject-method-shape-owner-get-owner) **(** [int](class_int#class-int) owner\_id **)** const | | [Shape](class_shape#class-shape) | [shape\_owner\_get\_shape](#class-collisionobject-method-shape-owner-get-shape) **(** [int](class_int#class-int) owner\_id, [int](class_int#class-int) shape\_id **)** const | | [int](class_int#class-int) | [shape\_owner\_get\_shape\_count](#class-collisionobject-method-shape-owner-get-shape-count) **(** [int](class_int#class-int) owner\_id **)** const | | [int](class_int#class-int) | [shape\_owner\_get\_shape\_index](#class-collisionobject-method-shape-owner-get-shape-index) **(** [int](class_int#class-int) owner\_id, [int](class_int#class-int) shape\_id **)** const | | [Transform](class_transform#class-transform) | [shape\_owner\_get\_transform](#class-collisionobject-method-shape-owner-get-transform) **(** [int](class_int#class-int) owner\_id **)** const | | void | [shape\_owner\_remove\_shape](#class-collisionobject-method-shape-owner-remove-shape) **(** [int](class_int#class-int) owner\_id, [int](class_int#class-int) shape\_id **)** | | void | [shape\_owner\_set\_disabled](#class-collisionobject-method-shape-owner-set-disabled) **(** [int](class_int#class-int) owner\_id, [bool](class_bool#class-bool) disabled **)** | | void | [shape\_owner\_set\_transform](#class-collisionobject-method-shape-owner-set-transform) **(** [int](class_int#class-int) owner\_id, [Transform](class_transform#class-transform) transform **)** | Signals ------- ### input\_event ( [Node](class_node#class-node) camera, [InputEvent](class_inputevent#class-inputevent) event, [Vector3](class_vector3#class-vector3) position, [Vector3](class_vector3#class-vector3) normal, [int](class_int#class-int) shape\_idx ) Emitted when the object receives an unhandled [InputEvent](class_inputevent#class-inputevent). `position` is the location in world space of the mouse pointer on the surface of the shape with index `shape_idx` and `normal` is the normal vector of the surface at that point. ### mouse\_entered ( ) Emitted when the mouse pointer enters any of this object's shapes. ### mouse\_exited ( ) Emitted when the mouse pointer exits all this object's shapes. Property Descriptions --------------------- ### [int](class_int#class-int) collision\_layer | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_collision\_layer(value) | | *Getter* | get\_collision\_layer() | The physics layers this CollisionObject3D is in. Collision objects can exist in one or more of 32 different layers. See also [collision\_mask](#class-collisionobject-property-collision-mask). **Note:** A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See [Collision layers and masks](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. ### [int](class_int#class-int) collision\_mask | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_collision\_mask(value) | | *Getter* | get\_collision\_mask() | The physics layers this CollisionObject3D scans. Collision objects can scan one or more of 32 different layers. See also [collision\_layer](#class-collisionobject-property-collision-layer). **Note:** A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See [Collision layers and masks](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. ### [bool](class_bool#class-bool) input\_capture\_on\_drag | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_capture\_input\_on\_drag(value) | | *Getter* | get\_capture\_input\_on\_drag() | If `true`, the `CollisionObject` will continue to receive input events as the mouse is dragged across its shapes. ### [bool](class_bool#class-bool) input\_ray\_pickable | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_ray\_pickable(value) | | *Getter* | is\_ray\_pickable() | If `true`, this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least one [collision\_layer](#class-collisionobject-property-collision-layer) bit to be set. Method Descriptions ------------------- ### void \_input\_event ( [Object](class_object#class-object) camera, [InputEvent](class_inputevent#class-inputevent) event, [Vector3](class_vector3#class-vector3) position, [Vector3](class_vector3#class-vector3) normal, [int](class_int#class-int) shape\_idx ) virtual Receives unhandled [InputEvent](class_inputevent#class-inputevent)s. `position` is the location in world space of the mouse pointer on the surface of the shape with index `shape_idx` and `normal` is the normal vector of the surface at that point. Connect to the [input\_event](#class-collisionobject-signal-input-event) signal to easily pick up these events. ### [int](class_int#class-int) create\_shape\_owner ( [Object](class_object#class-object) owner ) Creates a new shape owner for the given object. Returns `owner_id` of the new owner for future reference. ### [bool](class_bool#class-bool) get\_collision\_layer\_bit ( [int](class_int#class-int) bit ) const Returns whether or not the specified `bit` of the [collision\_layer](#class-collisionobject-property-collision-layer) is set. ### [bool](class_bool#class-bool) get\_collision\_mask\_bit ( [int](class_int#class-int) bit ) const Returns whether or not the specified `bit` of the [collision\_mask](#class-collisionobject-property-collision-mask) is set. ### [RID](class_rid#class-rid) get\_rid ( ) const Returns the object's [RID](class_rid#class-rid). ### [Array](class_array#class-array) get\_shape\_owners ( ) Returns an [Array](class_array#class-array) of `owner_id` identifiers. You can use these ids in other methods that take `owner_id` as an argument. ### [bool](class_bool#class-bool) is\_shape\_owner\_disabled ( [int](class_int#class-int) owner\_id ) const If `true`, the shape owner and its shapes are disabled. ### void remove\_shape\_owner ( [int](class_int#class-int) owner\_id ) Removes the given shape owner. ### void set\_collision\_layer\_bit ( [int](class_int#class-int) bit, [bool](class_bool#class-bool) value ) If `value` is `true`, sets the specified `bit` in the [collision\_layer](#class-collisionobject-property-collision-layer). If `value` is `false`, clears the specified `bit` in the [collision\_layer](#class-collisionobject-property-collision-layer). ### void set\_collision\_mask\_bit ( [int](class_int#class-int) bit, [bool](class_bool#class-bool) value ) If `value` is `true`, sets the specified `bit` in the [collision\_mask](#class-collisionobject-property-collision-mask). If `value` is `false`, clears the specified `bit` in the [collision\_mask](#class-collisionobject-property-collision-mask). ### [int](class_int#class-int) shape\_find\_owner ( [int](class_int#class-int) shape\_index ) const Returns the `owner_id` of the given shape. ### void shape\_owner\_add\_shape ( [int](class_int#class-int) owner\_id, [Shape](class_shape#class-shape) shape ) Adds a [Shape](class_shape#class-shape) to the shape owner. ### void shape\_owner\_clear\_shapes ( [int](class_int#class-int) owner\_id ) Removes all shapes from the shape owner. ### [Object](class_object#class-object) shape\_owner\_get\_owner ( [int](class_int#class-int) owner\_id ) const Returns the parent object of the given shape owner. ### [Shape](class_shape#class-shape) shape\_owner\_get\_shape ( [int](class_int#class-int) owner\_id, [int](class_int#class-int) shape\_id ) const Returns the [Shape](class_shape#class-shape) with the given id from the given shape owner. ### [int](class_int#class-int) shape\_owner\_get\_shape\_count ( [int](class_int#class-int) owner\_id ) const Returns the number of shapes the given shape owner contains. ### [int](class_int#class-int) shape\_owner\_get\_shape\_index ( [int](class_int#class-int) owner\_id, [int](class_int#class-int) shape\_id ) const Returns the child index of the [Shape](class_shape#class-shape) with the given id from the given shape owner. ### [Transform](class_transform#class-transform) shape\_owner\_get\_transform ( [int](class_int#class-int) owner\_id ) const Returns the shape owner's [Transform](class_transform#class-transform). ### void shape\_owner\_remove\_shape ( [int](class_int#class-int) owner\_id, [int](class_int#class-int) shape\_id ) Removes a shape from the given shape owner. ### void shape\_owner\_set\_disabled ( [int](class_int#class-int) owner\_id, [bool](class_bool#class-bool) disabled ) If `true`, disables the given shape owner. ### void shape\_owner\_set\_transform ( [int](class_int#class-int) owner\_id, [Transform](class_transform#class-transform) transform ) Sets the [Transform](class_transform#class-transform) of the given shape owner.
programming_docs
godot LightOccluder2D LightOccluder2D =============== **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Occludes light cast by a Light2D, casting shadows. Description ----------- Occludes light cast by a Light2D, casting shadows. The LightOccluder2D must be provided with an [OccluderPolygon2D](class_occluderpolygon2d#class-occluderpolygon2d) in order for the shadow to be computed. Tutorials --------- * [2D lights and shadows](https://docs.godotengine.org/en/3.5/tutorials/2d/2d_lights_and_shadows.html) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [light\_mask](#class-lightoccluder2d-property-light-mask) | `1` | | [OccluderPolygon2D](class_occluderpolygon2d#class-occluderpolygon2d) | [occluder](#class-lightoccluder2d-property-occluder) | | Property Descriptions --------------------- ### [int](class_int#class-int) light\_mask | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_occluder\_light\_mask(value) | | *Getter* | get\_occluder\_light\_mask() | The LightOccluder2D's light mask. The LightOccluder2D will cast shadows only from Light2D(s) that have the same light mask(s). ### [OccluderPolygon2D](class_occluderpolygon2d#class-occluderpolygon2d) occluder | | | | --- | --- | | *Setter* | set\_occluder\_polygon(value) | | *Getter* | get\_occluder\_polygon() | The [OccluderPolygon2D](class_occluderpolygon2d#class-occluderpolygon2d) used to compute the shadow. godot HeightMapShape HeightMapShape ============== **Inherits:** [Shape](class_shape#class-shape) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Height map shape for 3D physics. Description ----------- Height map shape resource, which can be added to a [PhysicsBody](class_physicsbody#class-physicsbody) or [Area](class_area#class-area). Properties ---------- | | | | | --- | --- | --- | | [PoolRealArray](class_poolrealarray#class-poolrealarray) | [map\_data](#class-heightmapshape-property-map-data) | `PoolRealArray( 0, 0, 0, 0 )` | | [int](class_int#class-int) | [map\_depth](#class-heightmapshape-property-map-depth) | `2` | | [int](class_int#class-int) | [map\_width](#class-heightmapshape-property-map-width) | `2` | Property Descriptions --------------------- ### [PoolRealArray](class_poolrealarray#class-poolrealarray) map\_data | | | | --- | --- | | *Default* | `PoolRealArray( 0, 0, 0, 0 )` | | *Setter* | set\_map\_data(value) | | *Getter* | get\_map\_data() | Height map data, pool array must be of [map\_width](#class-heightmapshape-property-map-width) \* [map\_depth](#class-heightmapshape-property-map-depth) size. ### [int](class_int#class-int) map\_depth | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_map\_depth(value) | | *Getter* | get\_map\_depth() | Number of vertices in the depth of the height map. Changing this will resize the [map\_data](#class-heightmapshape-property-map-data). ### [int](class_int#class-int) map\_width | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_map\_width(value) | | *Getter* | get\_map\_width() | Number of vertices in the width of the height map. Changing this will resize the [map\_data](#class-heightmapshape-property-map-data). godot AnimationPlayer AnimationPlayer =============== **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) Container and player of [Animation](class_animation#class-animation) resources. Description ----------- An animation player is used for general-purpose playback of [Animation](class_animation#class-animation) resources. It contains a dictionary of animations (referenced by name) and custom blend times between their transitions. Additionally, animations can be played and blended in different channels. `AnimationPlayer` is more suited than [Tween](class_tween#class-tween) for animations where you know the final values in advance. For example, fading a screen in and out is more easily done with an `AnimationPlayer` node thanks to the animation tools provided by the editor. That particular example can also be implemented with a [Tween](class_tween#class-tween) node, but it requires doing everything by code. Updating the target properties of animations occurs at process time. Tutorials --------- * [Animation tutorial index](https://docs.godotengine.org/en/3.5/tutorials/animation/index.html) * [2D Sprite animation](https://docs.godotengine.org/en/3.5/tutorials/2d/2d_sprite_animation.html) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [assigned\_animation](#class-animationplayer-property-assigned-animation) | | | [String](class_string#class-string) | [autoplay](#class-animationplayer-property-autoplay) | `""` | | [String](class_string#class-string) | [current\_animation](#class-animationplayer-property-current-animation) | `""` | | [float](class_float#class-float) | [current\_animation\_length](#class-animationplayer-property-current-animation-length) | | | [float](class_float#class-float) | [current\_animation\_position](#class-animationplayer-property-current-animation-position) | | | [AnimationMethodCallMode](#enum-animationplayer-animationmethodcallmode) | [method\_call\_mode](#class-animationplayer-property-method-call-mode) | `0` | | [bool](class_bool#class-bool) | [playback\_active](#class-animationplayer-property-playback-active) | | | [float](class_float#class-float) | [playback\_default\_blend\_time](#class-animationplayer-property-playback-default-blend-time) | `0.0` | | [AnimationProcessMode](#enum-animationplayer-animationprocessmode) | [playback\_process\_mode](#class-animationplayer-property-playback-process-mode) | `1` | | [float](class_float#class-float) | [playback\_speed](#class-animationplayer-property-playback-speed) | `1.0` | | [bool](class_bool#class-bool) | [reset\_on\_save](#class-animationplayer-property-reset-on-save) | `true` | | [NodePath](class_nodepath#class-nodepath) | [root\_node](#class-animationplayer-property-root-node) | `NodePath("..")` | Methods ------- | | | | --- | --- | | [Error](class_%40globalscope#enum-globalscope-error) | [add\_animation](#class-animationplayer-method-add-animation) **(** [String](class_string#class-string) name, [Animation](class_animation#class-animation) animation **)** | | void | [advance](#class-animationplayer-method-advance) **(** [float](class_float#class-float) delta **)** | | [String](class_string#class-string) | [animation\_get\_next](#class-animationplayer-method-animation-get-next) **(** [String](class_string#class-string) anim\_from **)** const | | void | [animation\_set\_next](#class-animationplayer-method-animation-set-next) **(** [String](class_string#class-string) anim\_from, [String](class_string#class-string) anim\_to **)** | | void | [clear\_caches](#class-animationplayer-method-clear-caches) **(** **)** | | void | [clear\_queue](#class-animationplayer-method-clear-queue) **(** **)** | | [String](class_string#class-string) | [find\_animation](#class-animationplayer-method-find-animation) **(** [Animation](class_animation#class-animation) animation **)** const | | [Animation](class_animation#class-animation) | [get\_animation](#class-animationplayer-method-get-animation) **(** [String](class_string#class-string) name **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_animation\_list](#class-animationplayer-method-get-animation-list) **(** **)** const | | [float](class_float#class-float) | [get\_blend\_time](#class-animationplayer-method-get-blend-time) **(** [String](class_string#class-string) anim\_from, [String](class_string#class-string) anim\_to **)** const | | [float](class_float#class-float) | [get\_playing\_speed](#class-animationplayer-method-get-playing-speed) **(** **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_queue](#class-animationplayer-method-get-queue) **(** **)** | | [bool](class_bool#class-bool) | [has\_animation](#class-animationplayer-method-has-animation) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [is\_playing](#class-animationplayer-method-is-playing) **(** **)** const | | void | [play](#class-animationplayer-method-play) **(** [String](class_string#class-string) name="", [float](class_float#class-float) custom\_blend=-1, [float](class_float#class-float) custom\_speed=1.0, [bool](class_bool#class-bool) from\_end=false **)** | | void | [play\_backwards](#class-animationplayer-method-play-backwards) **(** [String](class_string#class-string) name="", [float](class_float#class-float) custom\_blend=-1 **)** | | void | [queue](#class-animationplayer-method-queue) **(** [String](class_string#class-string) name **)** | | void | [remove\_animation](#class-animationplayer-method-remove-animation) **(** [String](class_string#class-string) name **)** | | void | [rename\_animation](#class-animationplayer-method-rename-animation) **(** [String](class_string#class-string) name, [String](class_string#class-string) newname **)** | | void | [seek](#class-animationplayer-method-seek) **(** [float](class_float#class-float) seconds, [bool](class_bool#class-bool) update=false **)** | | void | [set\_blend\_time](#class-animationplayer-method-set-blend-time) **(** [String](class_string#class-string) anim\_from, [String](class_string#class-string) anim\_to, [float](class_float#class-float) sec **)** | | void | [stop](#class-animationplayer-method-stop) **(** [bool](class_bool#class-bool) reset=true **)** | Signals ------- ### animation\_changed ( [String](class_string#class-string) old\_name, [String](class_string#class-string) new\_name ) Emitted when a queued animation plays after the previous animation was finished. See [queue](#class-animationplayer-method-queue). **Note:** The signal is not emitted when the animation is changed via [play](#class-animationplayer-method-play) or from [AnimationTree](class_animationtree#class-animationtree). ### animation\_finished ( [String](class_string#class-string) anim\_name ) Notifies when an animation finished playing. ### animation\_started ( [String](class_string#class-string) anim\_name ) Notifies when an animation starts playing. ### caches\_cleared ( ) Notifies when the caches have been cleared, either automatically, or manually via [clear\_caches](#class-animationplayer-method-clear-caches). Enumerations ------------ enum **AnimationProcessMode**: * **ANIMATION\_PROCESS\_PHYSICS** = **0** --- Process animation during the physics process. This is especially useful when animating physics bodies. * **ANIMATION\_PROCESS\_IDLE** = **1** --- Process animation during the idle process. * **ANIMATION\_PROCESS\_MANUAL** = **2** --- Do not process animation. Use [advance](#class-animationplayer-method-advance) to process the animation manually. enum **AnimationMethodCallMode**: * **ANIMATION\_METHOD\_CALL\_DEFERRED** = **0** --- Batch method calls during the animation process, then do the calls after events are processed. This avoids bugs involving deleting nodes or modifying the AnimationPlayer while playing. * **ANIMATION\_METHOD\_CALL\_IMMEDIATE** = **1** --- Make method calls immediately when reached in the animation. Property Descriptions --------------------- ### [String](class_string#class-string) assigned\_animation | | | | --- | --- | | *Setter* | set\_assigned\_animation(value) | | *Getter* | get\_assigned\_animation() | If playing, the current animation; otherwise, the animation last played. When set, would change the animation, but would not play it unless currently playing. See also [current\_animation](#class-animationplayer-property-current-animation). ### [String](class_string#class-string) autoplay | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_autoplay(value) | | *Getter* | get\_autoplay() | The name of the animation to play when the scene loads. ### [String](class_string#class-string) current\_animation | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_current\_animation(value) | | *Getter* | get\_current\_animation() | The name of the currently playing animation. If no animation is playing, the property's value is an empty string. Changing this value does not restart the animation. See [play](#class-animationplayer-method-play) for more information on playing animations. **Note:** While this property appears in the inspector, it's not meant to be edited, and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see [Animation](class_animation#class-animation). ### [float](class_float#class-float) current\_animation\_length | | | | --- | --- | | *Getter* | get\_current\_animation\_length() | The length (in seconds) of the currently being played animation. ### [float](class_float#class-float) current\_animation\_position | | | | --- | --- | | *Getter* | get\_current\_animation\_position() | The position (in seconds) of the currently playing animation. ### [AnimationMethodCallMode](#enum-animationplayer-animationmethodcallmode) method\_call\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_method\_call\_mode(value) | | *Getter* | get\_method\_call\_mode() | The call mode to use for Call Method tracks. ### [bool](class_bool#class-bool) playback\_active | | | | --- | --- | | *Setter* | set\_active(value) | | *Getter* | is\_active() | If `true`, updates animations in response to process-related notifications. ### [float](class_float#class-float) playback\_default\_blend\_time | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_default\_blend\_time(value) | | *Getter* | get\_default\_blend\_time() | The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 precision. ### [AnimationProcessMode](#enum-animationplayer-animationprocessmode) playback\_process\_mode | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_animation\_process\_mode(value) | | *Getter* | get\_animation\_process\_mode() | The process notification in which to update animations. ### [float](class_float#class-float) playback\_speed | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_speed\_scale(value) | | *Getter* | get\_speed\_scale() | The speed scaling ratio. For instance, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed. ### [bool](class_bool#class-bool) reset\_on\_save | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_reset\_on\_save\_enabled(value) | | *Getter* | is\_reset\_on\_save\_enabled() | This is used by the editor. If set to `true`, the scene will be saved with the effects of the reset animation applied (as if it had been seeked to time 0), then reverted after saving. In other words, the saved scene file will contain the "default pose", as defined by the reset animation, if any, with the editor keeping the values that the nodes had before saving. ### [NodePath](class_nodepath#class-nodepath) root\_node | | | | --- | --- | | *Default* | `NodePath("..")` | | *Setter* | set\_root(value) | | *Getter* | get\_root() | The node from which node path references will travel. Method Descriptions ------------------- ### [Error](class_%40globalscope#enum-globalscope-error) add\_animation ( [String](class_string#class-string) name, [Animation](class_animation#class-animation) animation ) Adds `animation` to the player accessible with the key `name`. ### void advance ( [float](class_float#class-float) delta ) Shifts position in the animation timeline and immediately updates the animation. `delta` is the time in seconds to shift. Events between the current frame and `delta` are handled. ### [String](class_string#class-string) animation\_get\_next ( [String](class_string#class-string) anim\_from ) const Returns the name of the next animation in the queue. ### void animation\_set\_next ( [String](class_string#class-string) anim\_from, [String](class_string#class-string) anim\_to ) Triggers the `anim_to` animation when the `anim_from` animation completes. ### void clear\_caches ( ) `AnimationPlayer` caches animated nodes. It may not notice if a node disappears; [clear\_caches](#class-animationplayer-method-clear-caches) forces it to update the cache again. ### void clear\_queue ( ) Clears all queued, unplayed animations. ### [String](class_string#class-string) find\_animation ( [Animation](class_animation#class-animation) animation ) const Returns the name of `animation` or an empty string if not found. ### [Animation](class_animation#class-animation) get\_animation ( [String](class_string#class-string) name ) const Returns the [Animation](class_animation#class-animation) with the key `name`. If the animation does not exist, `null` is returned and an error is logged. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_animation\_list ( ) const Returns the list of stored animation names. ### [float](class_float#class-float) get\_blend\_time ( [String](class_string#class-string) anim\_from, [String](class_string#class-string) anim\_to ) const Gets the blend time (in seconds) between two animations, referenced by their names. ### [float](class_float#class-float) get\_playing\_speed ( ) const Gets the actual playing speed of current animation or 0 if not playing. This speed is the [playback\_speed](#class-animationplayer-property-playback-speed) property multiplied by `custom_speed` argument specified when calling the [play](#class-animationplayer-method-play) method. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_queue ( ) Returns a list of the animation names that are currently queued to play. ### [bool](class_bool#class-bool) has\_animation ( [String](class_string#class-string) name ) const Returns `true` if the `AnimationPlayer` stores an [Animation](class_animation#class-animation) with key `name`. ### [bool](class_bool#class-bool) is\_playing ( ) const Returns `true` if playing an animation. ### void play ( [String](class_string#class-string) name="", [float](class_float#class-float) custom\_blend=-1, [float](class_float#class-float) custom\_speed=1.0, [bool](class_bool#class-bool) from\_end=false ) Plays the animation with key `name`. Custom blend times and speed can be set. If `custom_speed` is negative and `from_end` is `true`, the animation will play backwards (which is equivalent to calling [play\_backwards](#class-animationplayer-method-play-backwards)). The `AnimationPlayer` keeps track of its current or last played animation with [assigned\_animation](#class-animationplayer-property-assigned-animation). If this method is called with that same animation `name`, or with no `name` parameter, the assigned animation will resume playing if it was paused, or restart if it was stopped (see [stop](#class-animationplayer-method-stop) for both pause and stop). If the animation was already playing, it will keep playing. **Note:** The animation will be updated the next time the `AnimationPlayer` is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call `advance(0)`. ### void play\_backwards ( [String](class_string#class-string) name="", [float](class_float#class-float) custom\_blend=-1 ) Plays the animation with key `name` in reverse. This method is a shorthand for [play](#class-animationplayer-method-play) with `custom_speed = -1.0` and `from_end = true`, so see its description for more information. ### void queue ( [String](class_string#class-string) name ) Queues an animation for playback once the current one is done. **Note:** If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow. ### void remove\_animation ( [String](class_string#class-string) name ) Removes the animation with key `name`. ### void rename\_animation ( [String](class_string#class-string) name, [String](class_string#class-string) newname ) Renames an existing animation with key `name` to `newname`. ### void seek ( [float](class_float#class-float) seconds, [bool](class_bool#class-bool) update=false ) Seeks the animation to the `seconds` point in time (in seconds). If `update` is `true`, the animation updates too, otherwise it updates at process time. Events between the current frame and `seconds` are skipped. **Note:** Seeking to the end of the animation doesn't emit [animation\_finished](#class-animationplayer-signal-animation-finished). If you want to skip animation and emit the signal, use [advance](#class-animationplayer-method-advance). ### void set\_blend\_time ( [String](class_string#class-string) anim\_from, [String](class_string#class-string) anim\_to, [float](class_float#class-float) sec ) Specifies a blend time (in seconds) between two animations, referenced by their names. ### void stop ( [bool](class_bool#class-bool) reset=true ) Stops or pauses the currently playing animation. If `reset` is `true`, the animation position is reset to `0` and the playback speed is reset to `1.0`. If `reset` is `false`, the [current\_animation\_position](#class-animationplayer-property-current-animation-position) will be kept and calling [play](#class-animationplayer-method-play) or [play\_backwards](#class-animationplayer-method-play-backwards) without arguments or with the same animation name as [assigned\_animation](#class-animationplayer-property-assigned-animation) will resume the animation.
programming_docs
godot EditorSettings EditorSettings ============== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Object that holds the project-independent editor settings. Description ----------- Object that holds the project-independent editor settings. These settings are generally visible in the **Editor > Editor Settings** menu. Property names use slash delimiters to distinguish sections. Setting values can be of any [Variant](class_variant#class-variant) type. It's recommended to use `snake_case` for editor settings to be consistent with the Godot editor itself. Accessing the settings can be done using the following methods, such as: ``` # `settings.set("some/property", value)` also works as this class overrides `_set()` internally. settings.set_setting("some/property",value) # `settings.get("some/property", value)` also works as this class overrides `_get()` internally. settings.get_setting("some/property") var list_of_settings = settings.get_property_list() ``` **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using [EditorInterface.get\_editor\_settings](class_editorinterface#class-editorinterface-method-get-editor-settings). Methods ------- | | | | --- | --- | | void | [add\_property\_info](#class-editorsettings-method-add-property-info) **(** [Dictionary](class_dictionary#class-dictionary) info **)** | | void | [erase](#class-editorsettings-method-erase) **(** [String](class_string#class-string) property **)** | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_favorites](#class-editorsettings-method-get-favorites) **(** **)** const | | [Variant](class_variant#class-variant) | [get\_project\_metadata](#class-editorsettings-method-get-project-metadata) **(** [String](class_string#class-string) section, [String](class_string#class-string) key, [Variant](class_variant#class-variant) default=null **)** const | | [String](class_string#class-string) | [get\_project\_settings\_dir](#class-editorsettings-method-get-project-settings-dir) **(** **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_recent\_dirs](#class-editorsettings-method-get-recent-dirs) **(** **)** const | | [Variant](class_variant#class-variant) | [get\_setting](#class-editorsettings-method-get-setting) **(** [String](class_string#class-string) name **)** const | | [String](class_string#class-string) | [get\_settings\_dir](#class-editorsettings-method-get-settings-dir) **(** **)** const | | [bool](class_bool#class-bool) | [has\_setting](#class-editorsettings-method-has-setting) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [property\_can\_revert](#class-editorsettings-method-property-can-revert) **(** [String](class_string#class-string) name **)** | | [Variant](class_variant#class-variant) | [property\_get\_revert](#class-editorsettings-method-property-get-revert) **(** [String](class_string#class-string) name **)** | | void | [set\_favorites](#class-editorsettings-method-set-favorites) **(** [PoolStringArray](class_poolstringarray#class-poolstringarray) dirs **)** | | void | [set\_initial\_value](#class-editorsettings-method-set-initial-value) **(** [String](class_string#class-string) name, [Variant](class_variant#class-variant) value, [bool](class_bool#class-bool) update\_current **)** | | void | [set\_project\_metadata](#class-editorsettings-method-set-project-metadata) **(** [String](class_string#class-string) section, [String](class_string#class-string) key, [Variant](class_variant#class-variant) data **)** | | void | [set\_recent\_dirs](#class-editorsettings-method-set-recent-dirs) **(** [PoolStringArray](class_poolstringarray#class-poolstringarray) dirs **)** | | void | [set\_setting](#class-editorsettings-method-set-setting) **(** [String](class_string#class-string) name, [Variant](class_variant#class-variant) value **)** | Signals ------- ### settings\_changed ( ) Emitted after any editor setting has changed. Constants --------- ### NOTIFICATION\_EDITOR\_SETTINGS\_CHANGED = 10000 --- Emitted after any editor setting has changed. It's used by various editor plugins to update their visuals on theme changes or logic on configuration changes. Method Descriptions ------------------- ### void add\_property\_info ( [Dictionary](class_dictionary#class-dictionary) info ) Adds a custom property info to a property. The dictionary must contain: * `name`: [String](class_string#class-string) (the name of the property) * `type`: [int](class_int#class-int) (see [Variant.Type](class_%40globalscope#enum-globalscope-variant-type)) * optionally `hint`: [int](class_int#class-int) (see [PropertyHint](class_%40globalscope#enum-globalscope-propertyhint)) and `hint_string`: [String](class_string#class-string) **Example:** ``` editor_settings.set("category/property_name", 0) var property_info = { "name": "category/property_name", "type": TYPE_INT, "hint": PROPERTY_HINT_ENUM, "hint_string": "one,two,three" } editor_settings.add_property_info(property_info) ``` ### void erase ( [String](class_string#class-string) property ) Erases the setting whose name is specified by `property`. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_favorites ( ) const Returns the list of favorite files and directories for this project. ### [Variant](class_variant#class-variant) get\_project\_metadata ( [String](class_string#class-string) section, [String](class_string#class-string) key, [Variant](class_variant#class-variant) default=null ) const Returns project-specific metadata for the `section` and `key` specified. If the metadata doesn't exist, `default` will be returned instead. See also [set\_project\_metadata](#class-editorsettings-method-set-project-metadata). ### [String](class_string#class-string) get\_project\_settings\_dir ( ) const Returns the project-specific settings path. Projects all have a unique subdirectory inside the settings path where project-specific settings are saved. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_recent\_dirs ( ) const Returns the list of recently visited folders in the file dialog for this project. ### [Variant](class_variant#class-variant) get\_setting ( [String](class_string#class-string) name ) const Returns the value of the setting specified by `name`. This is equivalent to using [Object.get](class_object#id1) on the EditorSettings instance. ### [String](class_string#class-string) get\_settings\_dir ( ) const Gets the global settings path for the engine. Inside this path, you can find some standard paths such as: `settings/tmp` - Used for temporary storage of files `settings/templates` - Where export templates are located ### [bool](class_bool#class-bool) has\_setting ( [String](class_string#class-string) name ) const Returns `true` if the setting specified by `name` exists, `false` otherwise. ### [bool](class_bool#class-bool) property\_can\_revert ( [String](class_string#class-string) name ) Returns `true` if the setting specified by `name` can have its value reverted to the default value, `false` otherwise. When this method returns `true`, a Revert button will display next to the setting in the Editor Settings. ### [Variant](class_variant#class-variant) property\_get\_revert ( [String](class_string#class-string) name ) Returns the default value of the setting specified by `name`. This is the value that would be applied when clicking the Revert button in the Editor Settings. ### void set\_favorites ( [PoolStringArray](class_poolstringarray#class-poolstringarray) dirs ) Sets the list of favorite files and directories for this project. ### void set\_initial\_value ( [String](class_string#class-string) name, [Variant](class_variant#class-variant) value, [bool](class_bool#class-bool) update\_current ) Sets the initial value of the setting specified by `name` to `value`. This is used to provide a value for the Revert button in the Editor Settings. If `update_current` is true, the current value of the setting will be set to `value` as well. ### void set\_project\_metadata ( [String](class_string#class-string) section, [String](class_string#class-string) key, [Variant](class_variant#class-variant) data ) Sets project-specific metadata with the `section`, `key` and `data` specified. This metadata is stored outside the project folder and therefore won't be checked into version control. See also [get\_project\_metadata](#class-editorsettings-method-get-project-metadata). ### void set\_recent\_dirs ( [PoolStringArray](class_poolstringarray#class-poolstringarray) dirs ) Sets the list of recently visited folders in the file dialog for this project. ### void set\_setting ( [String](class_string#class-string) name, [Variant](class_variant#class-variant) value ) Sets the `value` of the setting specified by `name`. This is equivalent to using [Object.set](class_object#id4) on the EditorSettings instance. godot AnimatedTexture AnimatedTexture =============== **Inherits:** [Texture](class_texture#class-texture) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Proxy texture for simple frame-based animations. Description ----------- `AnimatedTexture` is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike [AnimationPlayer](class_animationplayer#class-animationplayer) or [AnimatedSprite](class_animatedsprite#class-animatedsprite), it isn't a [Node](class_node#class-node), but has the advantage of being usable anywhere a [Texture](class_texture#class-texture) resource can be used, e.g. in a [TileSet](class_tileset#class-tileset). The playback of the animation is controlled by the [fps](#class-animatedtexture-property-fps) property as well as each frame's optional delay (see [set\_frame\_delay](#class-animatedtexture-method-set-frame-delay)). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame. `AnimatedTexture` currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one. **Note:** AnimatedTexture doesn't support using [AtlasTexture](class_atlastexture#class-atlastexture)s. Each frame needs to be a separate [Texture](class_texture#class-texture). Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [current\_frame](#class-animatedtexture-property-current-frame) | | | [int](class_int#class-int) | flags | `0` (overrides [Texture](class_texture#class-texture-property-flags)) | | [float](class_float#class-float) | [fps](#class-animatedtexture-property-fps) | `4.0` | | [int](class_int#class-int) | [frames](#class-animatedtexture-property-frames) | `1` | | [bool](class_bool#class-bool) | [oneshot](#class-animatedtexture-property-oneshot) | `false` | | [bool](class_bool#class-bool) | [pause](#class-animatedtexture-property-pause) | `false` | Methods ------- | | | | --- | --- | | [float](class_float#class-float) | [get\_frame\_delay](#class-animatedtexture-method-get-frame-delay) **(** [int](class_int#class-int) frame **)** const | | [Texture](class_texture#class-texture) | [get\_frame\_texture](#class-animatedtexture-method-get-frame-texture) **(** [int](class_int#class-int) frame **)** const | | void | [set\_frame\_delay](#class-animatedtexture-method-set-frame-delay) **(** [int](class_int#class-int) frame, [float](class_float#class-float) delay **)** | | void | [set\_frame\_texture](#class-animatedtexture-method-set-frame-texture) **(** [int](class_int#class-int) frame, [Texture](class_texture#class-texture) texture **)** | Constants --------- ### MAX\_FRAMES = 256 --- The maximum number of frames supported by `AnimatedTexture`. If you need more frames in your animation, use [AnimationPlayer](class_animationplayer#class-animationplayer) or [AnimatedSprite](class_animatedsprite#class-animatedsprite). Property Descriptions --------------------- ### [int](class_int#class-int) current\_frame | | | | --- | --- | | *Setter* | set\_current\_frame(value) | | *Getter* | get\_current\_frame() | Sets the currently visible frame of the texture. ### [float](class_float#class-float) fps | | | | --- | --- | | *Default* | `4.0` | | *Setter* | set\_fps(value) | | *Getter* | get\_fps() | Animation speed in frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the [frames](#class-animatedtexture-property-frames) property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see [set\_frame\_delay](#class-animatedtexture-method-set-frame-delay)). For example, an animation with 8 frames, no frame delay and a `fps` value of 2 will run for 4 seconds, with each frame lasting 0.5 seconds. ### [int](class_int#class-int) frames | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_frames(value) | | *Getter* | get\_frames() | Number of frames to use in the animation. While you can create the frames independently with [set\_frame\_texture](#class-animatedtexture-method-set-frame-texture), you need to set this value for the animation to take new frames into account. The maximum number of frames is [MAX\_FRAMES](#class-animatedtexture-constant-max-frames). ### [bool](class_bool#class-bool) oneshot | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_oneshot(value) | | *Getter* | get\_oneshot() | If `true`, the animation will only play once and will not loop back to the first frame after reaching the end. Note that reaching the end will not set [pause](#class-animatedtexture-property-pause) to `true`. ### [bool](class_bool#class-bool) pause | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_pause(value) | | *Getter* | get\_pause() | If `true`, the animation will pause where it currently is (i.e. at [current\_frame](#class-animatedtexture-property-current-frame)). The animation will continue from where it was paused when changing this property to `false`. Method Descriptions ------------------- ### [float](class_float#class-float) get\_frame\_delay ( [int](class_int#class-int) frame ) const Returns the given frame's delay value. ### [Texture](class_texture#class-texture) get\_frame\_texture ( [int](class_int#class-int) frame ) const Returns the given frame's [Texture](class_texture#class-texture). ### void set\_frame\_delay ( [int](class_int#class-int) frame, [float](class_float#class-float) delay ) Sets an additional delay (in seconds) between this frame and the next one, that will be added to the time interval defined by [fps](#class-animatedtexture-property-fps). By default, frames have no delay defined. If a delay value is defined, the final time interval between this frame and the next will be `1.0 / fps + delay`. For example, for an animation with 3 frames, 2 FPS and a frame delay on the second frame of 1.2, the resulting playback will be: ``` Frame 0: 0.5 s (1 / fps) Frame 1: 1.7 s (1 / fps + 1.2) Frame 2: 0.5 s (1 / fps) Total duration: 2.7 s ``` ### void set\_frame\_texture ( [int](class_int#class-int) frame, [Texture](class_texture#class-texture) texture ) Assigns a [Texture](class_texture#class-texture) to the given frame. Frame IDs start at 0, so the first frame has ID 0, and the last frame of the animation has ID [frames](#class-animatedtexture-property-frames) - 1. You can define any number of textures up to [MAX\_FRAMES](#class-animatedtexture-constant-max-frames), but keep in mind that only frames from 0 to [frames](#class-animatedtexture-property-frames) - 1 will be part of the animation. godot RayCast2D RayCast2D ========= **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Query the closest object intersecting a ray. Description ----------- A RayCast represents a line from its origin to its destination position, `cast_to`. It is used to query the 2D space in order to find the closest object along the path of the ray. RayCast2D can ignore some objects by adding them to the exception list via `add_exception`, by setting proper filtering with collision layers, or by filtering object types with type masks. RayCast2D can be configured to report collisions with [Area2D](class_area2d#class-area2d)s ([collide\_with\_areas](#class-raycast2d-property-collide-with-areas)) and/or [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d)s ([collide\_with\_bodies](#class-raycast2d-property-collide-with-bodies)). Only enabled raycasts will be able to query the space and report collisions. RayCast2D calculates intersection every physics frame (see [Node](class_node#class-node)), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame) use [force\_raycast\_update](#class-raycast2d-method-force-raycast-update) after adjusting the raycast. Tutorials --------- * [Ray-casting](https://docs.godotengine.org/en/3.5/tutorials/physics/ray-casting.html) Properties ---------- | | | | | --- | --- | --- | | [Vector2](class_vector2#class-vector2) | [cast\_to](#class-raycast2d-property-cast-to) | `Vector2( 0, 50 )` | | [bool](class_bool#class-bool) | [collide\_with\_areas](#class-raycast2d-property-collide-with-areas) | `false` | | [bool](class_bool#class-bool) | [collide\_with\_bodies](#class-raycast2d-property-collide-with-bodies) | `true` | | [int](class_int#class-int) | [collision\_mask](#class-raycast2d-property-collision-mask) | `1` | | [bool](class_bool#class-bool) | [enabled](#class-raycast2d-property-enabled) | `false` | | [bool](class_bool#class-bool) | [exclude\_parent](#class-raycast2d-property-exclude-parent) | `true` | Methods ------- | | | | --- | --- | | void | [add\_exception](#class-raycast2d-method-add-exception) **(** [Object](class_object#class-object) node **)** | | void | [add\_exception\_rid](#class-raycast2d-method-add-exception-rid) **(** [RID](class_rid#class-rid) rid **)** | | void | [clear\_exceptions](#class-raycast2d-method-clear-exceptions) **(** **)** | | void | [force\_raycast\_update](#class-raycast2d-method-force-raycast-update) **(** **)** | | [Object](class_object#class-object) | [get\_collider](#class-raycast2d-method-get-collider) **(** **)** const | | [int](class_int#class-int) | [get\_collider\_shape](#class-raycast2d-method-get-collider-shape) **(** **)** const | | [bool](class_bool#class-bool) | [get\_collision\_mask\_bit](#class-raycast2d-method-get-collision-mask-bit) **(** [int](class_int#class-int) bit **)** const | | [Vector2](class_vector2#class-vector2) | [get\_collision\_normal](#class-raycast2d-method-get-collision-normal) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_collision\_point](#class-raycast2d-method-get-collision-point) **(** **)** const | | [bool](class_bool#class-bool) | [is\_colliding](#class-raycast2d-method-is-colliding) **(** **)** const | | void | [remove\_exception](#class-raycast2d-method-remove-exception) **(** [Object](class_object#class-object) node **)** | | void | [remove\_exception\_rid](#class-raycast2d-method-remove-exception-rid) **(** [RID](class_rid#class-rid) rid **)** | | void | [set\_collision\_mask\_bit](#class-raycast2d-method-set-collision-mask-bit) **(** [int](class_int#class-int) bit, [bool](class_bool#class-bool) value **)** | Property Descriptions --------------------- ### [Vector2](class_vector2#class-vector2) cast\_to | | | | --- | --- | | *Default* | `Vector2( 0, 50 )` | | *Setter* | set\_cast\_to(value) | | *Getter* | get\_cast\_to() | The ray's destination point, relative to the RayCast's `position`. ### [bool](class_bool#class-bool) collide\_with\_areas | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_collide\_with\_areas(value) | | *Getter* | is\_collide\_with\_areas\_enabled() | If `true`, collision with [Area2D](class_area2d#class-area2d)s will be reported. ### [bool](class_bool#class-bool) collide\_with\_bodies | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_collide\_with\_bodies(value) | | *Getter* | is\_collide\_with\_bodies\_enabled() | If `true`, collision with [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d)s will be reported. ### [int](class_int#class-int) collision\_mask | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_collision\_mask(value) | | *Getter* | get\_collision\_mask() | The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [Collision layers and masks](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. ### [bool](class_bool#class-bool) enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_enabled(value) | | *Getter* | is\_enabled() | If `true`, collisions will be reported. ### [bool](class_bool#class-bool) exclude\_parent | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_exclude\_parent\_body(value) | | *Getter* | get\_exclude\_parent\_body() | If `true`, the parent node will be excluded from collision detection. Method Descriptions ------------------- ### void add\_exception ( [Object](class_object#class-object) node ) Adds a collision exception so the ray does not report collisions with the specified node. ### void add\_exception\_rid ( [RID](class_rid#class-rid) rid ) Adds a collision exception so the ray does not report collisions with the specified [RID](class_rid#class-rid). ### void clear\_exceptions ( ) Removes all collision exceptions for this ray. ### void force\_raycast\_update ( ) Updates the collision information for the ray. Use this method to update the collision information immediately instead of waiting for the next `_physics_process` call, for example if the ray or its parent has changed state. **Note:** `enabled` is not required for this to work. ### [Object](class_object#class-object) get\_collider ( ) const Returns the first object that the ray intersects, or `null` if no object is intersecting the ray (i.e. [is\_colliding](#class-raycast2d-method-is-colliding) returns `false`). ### [int](class_int#class-int) get\_collider\_shape ( ) const Returns the shape ID of the first object that the ray intersects, or `0` if no object is intersecting the ray (i.e. [is\_colliding](#class-raycast2d-method-is-colliding) returns `false`). ### [bool](class_bool#class-bool) get\_collision\_mask\_bit ( [int](class_int#class-int) bit ) const Returns an individual bit on the collision mask. ### [Vector2](class_vector2#class-vector2) get\_collision\_normal ( ) const Returns the normal of the intersecting object's shape at the collision point. ### [Vector2](class_vector2#class-vector2) get\_collision\_point ( ) const Returns the collision point at which the ray intersects the closest object. **Note:** This point is in the **global** coordinate system. ### [bool](class_bool#class-bool) is\_colliding ( ) const Returns whether any object is intersecting with the ray's vector (considering the vector length). ### void remove\_exception ( [Object](class_object#class-object) node ) Removes a collision exception so the ray does report collisions with the specified node. ### void remove\_exception\_rid ( [RID](class_rid#class-rid) rid ) Removes a collision exception so the ray does report collisions with the specified [RID](class_rid#class-rid). ### void set\_collision\_mask\_bit ( [int](class_int#class-int) bit, [bool](class_bool#class-bool) value ) Sets or clears individual bits on the collision mask. This makes selecting the areas scanned easier.
programming_docs
godot HFlowContainer HFlowContainer ============== **Inherits:** [FlowContainer](class_flowcontainer#class-flowcontainer) **<** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Horizontal flow container. Description ----------- Horizontal version of [FlowContainer](class_flowcontainer#class-flowcontainer). Theme Properties ---------------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [hseparation](#class-hflowcontainer-theme-constant-hseparation) | `4` | | [int](class_int#class-int) | [vseparation](#class-hflowcontainer-theme-constant-vseparation) | `4` | Theme Property Descriptions --------------------------- ### [int](class_int#class-int) hseparation | | | | --- | --- | | *Default* | `4` | The horizontal separation of children nodes. ### [int](class_int#class-int) vseparation | | | | --- | --- | | *Default* | `4` | The vertical separation of children nodes. godot JavaClass JavaClass ========= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) godot SpinBox SpinBox ======= **Inherits:** [Range](class_range#class-range) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Numerical input text field. Description ----------- SpinBox is a numerical input text field. It allows entering integers and floats. **Example:** ``` var spin_box = SpinBox.new() add_child(spin_box) var line_edit = spin_box.get_line_edit() line_edit.context_menu_enabled = false spin_box.align = LineEdit.ALIGN_RIGHT ``` The above code will create a `SpinBox`, disable context menu on it and set the text alignment to right. See [Range](class_range#class-range) class for more options over the `SpinBox`. **Note:** `SpinBox` relies on an underlying [LineEdit](class_lineedit#class-lineedit) node. To theme a `SpinBox`'s background, add theme items for [LineEdit](class_lineedit#class-lineedit) and customize them. **Note:** If you want to implement drag and drop for the underlying [LineEdit](class_lineedit#class-lineedit), you can use [Control.set\_drag\_forwarding](class_control#class-control-method-set-drag-forwarding) on the node returned by [get\_line\_edit](#class-spinbox-method-get-line-edit). Properties ---------- | | | | | --- | --- | --- | | [Align](class_lineedit#enum-lineedit-align) | [align](#class-spinbox-property-align) | `0` | | [bool](class_bool#class-bool) | [editable](#class-spinbox-property-editable) | `true` | | [String](class_string#class-string) | [prefix](#class-spinbox-property-prefix) | `""` | | [String](class_string#class-string) | [suffix](#class-spinbox-property-suffix) | `""` | Methods ------- | | | | --- | --- | | void | [apply](#class-spinbox-method-apply) **(** **)** | | [LineEdit](class_lineedit#class-lineedit) | [get\_line\_edit](#class-spinbox-method-get-line-edit) **(** **)** | Theme Properties ---------------- | | | | --- | --- | | [Texture](class_texture#class-texture) | [updown](#class-spinbox-theme-icon-updown) | Property Descriptions --------------------- ### [Align](class_lineedit#enum-lineedit-align) align | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_align(value) | | *Getter* | get\_align() | Sets the text alignment of the `SpinBox`. ### [bool](class_bool#class-bool) editable | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_editable(value) | | *Getter* | is\_editable() | If `true`, the `SpinBox` will be editable. Otherwise, it will be read only. ### [String](class_string#class-string) prefix | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_prefix(value) | | *Getter* | get\_prefix() | Adds the specified `prefix` string before the numerical value of the `SpinBox`. ### [String](class_string#class-string) suffix | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_suffix(value) | | *Getter* | get\_suffix() | Adds the specified `suffix` string after the numerical value of the `SpinBox`. Method Descriptions ------------------- ### void apply ( ) Applies the current value of this `SpinBox`. ### [LineEdit](class_lineedit#class-lineedit) get\_line\_edit ( ) Returns the [LineEdit](class_lineedit#class-lineedit) instance from this `SpinBox`. You can use it to access properties and methods of [LineEdit](class_lineedit#class-lineedit). **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. Theme Property Descriptions --------------------------- ### [Texture](class_texture#class-texture) updown Sets a custom [Texture](class_texture#class-texture) for up and down arrows of the `SpinBox`. godot MarginContainer MarginContainer =============== **Inherits:** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Simple margin container. Description ----------- Adds a top, left, bottom, and right margin to all [Control](class_control#class-control) nodes that are direct children of the container. To control the `MarginContainer`'s margin, use the `margin_*` theme properties listed below. **Note:** Be careful, [Control](class_control#class-control) margin values are different than the constant margin values. If you want to change the custom margin values of the `MarginContainer` by code, you should use the following examples: ``` # This code sample assumes the current script is extending MarginContainer. var margin_value = 100 add_constant_override("margin_top", margin_value) add_constant_override("margin_left", margin_value) add_constant_override("margin_bottom", margin_value) add_constant_override("margin_right", margin_value) ``` Tutorials --------- * [GUI containers](https://docs.godotengine.org/en/3.5/tutorials/ui/gui_containers.html) Theme Properties ---------------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [margin\_bottom](#class-margincontainer-theme-constant-margin-bottom) | `0` | | [int](class_int#class-int) | [margin\_left](#class-margincontainer-theme-constant-margin-left) | `0` | | [int](class_int#class-int) | [margin\_right](#class-margincontainer-theme-constant-margin-right) | `0` | | [int](class_int#class-int) | [margin\_top](#class-margincontainer-theme-constant-margin-top) | `0` | Theme Property Descriptions --------------------------- ### [int](class_int#class-int) margin\_bottom | | | | --- | --- | | *Default* | `0` | All direct children of `MarginContainer` will have a bottom margin of `margin_bottom` pixels. ### [int](class_int#class-int) margin\_left | | | | --- | --- | | *Default* | `0` | All direct children of `MarginContainer` will have a left margin of `margin_left` pixels. ### [int](class_int#class-int) margin\_right | | | | --- | --- | | *Default* | `0` | All direct children of `MarginContainer` will have a right margin of `margin_right` pixels. ### [int](class_int#class-int) margin\_top | | | | --- | --- | | *Default* | `0` | All direct children of `MarginContainer` will have a top margin of `margin_top` pixels. godot RigidBody2D RigidBody2D =========== **Inherits:** [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) **<** [CollisionObject2D](class_collisionobject2d#class-collisionobject2d) **<** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) A body that is controlled by the 2D physics engine. Description ----------- This node implements simulated 2D physics. You do not control a RigidBody2D directly. Instead, you apply forces to it (gravity, impulses, etc.) and the physics simulation calculates the resulting movement based on its mass, friction, and other physical properties. A RigidBody2D has 4 behavior [mode](#class-rigidbody2d-property-mode)s: Rigid, Static, Character, and Kinematic. **Note:** You should not change a RigidBody2D's `position` or `linear_velocity` every frame or even very often. If you need to directly affect the body's state, use [\_integrate\_forces](#class-rigidbody2d-method-integrate-forces), which allows you to directly access the physics state. Please also keep in mind that physics bodies manage their own transform which overwrites the ones you set. So any direct or indirect transformation (including scaling of the node or its parent) will be visible in the editor only, and immediately reset at runtime. If you need to override the default physics behavior or add a transformation at runtime, you can write a custom force integration. See [custom\_integrator](#class-rigidbody2d-property-custom-integrator). The center of mass is always located at the node's origin without taking into account the [CollisionShape2D](class_collisionshape2d#class-collisionshape2d) centroid offsets. Tutorials --------- * [2D Physics Platformer Demo](https://godotengine.org/asset-library/asset/119) * [Instancing Demo](https://godotengine.org/asset-library/asset/148) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [angular\_damp](#class-rigidbody2d-property-angular-damp) | `-1.0` | | [float](class_float#class-float) | [angular\_velocity](#class-rigidbody2d-property-angular-velocity) | `0.0` | | [Vector2](class_vector2#class-vector2) | [applied\_force](#class-rigidbody2d-property-applied-force) | `Vector2( 0, 0 )` | | [float](class_float#class-float) | [applied\_torque](#class-rigidbody2d-property-applied-torque) | `0.0` | | [float](class_float#class-float) | [bounce](#class-rigidbody2d-property-bounce) | | | [bool](class_bool#class-bool) | [can\_sleep](#class-rigidbody2d-property-can-sleep) | `true` | | [bool](class_bool#class-bool) | [contact\_monitor](#class-rigidbody2d-property-contact-monitor) | `false` | | [int](class_int#class-int) | [contacts\_reported](#class-rigidbody2d-property-contacts-reported) | `0` | | [CCDMode](#enum-rigidbody2d-ccdmode) | [continuous\_cd](#class-rigidbody2d-property-continuous-cd) | `0` | | [bool](class_bool#class-bool) | [custom\_integrator](#class-rigidbody2d-property-custom-integrator) | `false` | | [float](class_float#class-float) | [friction](#class-rigidbody2d-property-friction) | | | [float](class_float#class-float) | [gravity\_scale](#class-rigidbody2d-property-gravity-scale) | `1.0` | | [float](class_float#class-float) | [inertia](#class-rigidbody2d-property-inertia) | | | [float](class_float#class-float) | [linear\_damp](#class-rigidbody2d-property-linear-damp) | `-1.0` | | [Vector2](class_vector2#class-vector2) | [linear\_velocity](#class-rigidbody2d-property-linear-velocity) | `Vector2( 0, 0 )` | | [float](class_float#class-float) | [mass](#class-rigidbody2d-property-mass) | `1.0` | | [Mode](#enum-rigidbody2d-mode) | [mode](#class-rigidbody2d-property-mode) | `0` | | [PhysicsMaterial](class_physicsmaterial#class-physicsmaterial) | [physics\_material\_override](#class-rigidbody2d-property-physics-material-override) | | | [bool](class_bool#class-bool) | [sleeping](#class-rigidbody2d-property-sleeping) | `false` | | [float](class_float#class-float) | [weight](#class-rigidbody2d-property-weight) | `9.8` | Methods ------- | | | | --- | --- | | void | [\_integrate\_forces](#class-rigidbody2d-method-integrate-forces) **(** [Physics2DDirectBodyState](class_physics2ddirectbodystate#class-physics2ddirectbodystate) state **)** virtual | | void | [add\_central\_force](#class-rigidbody2d-method-add-central-force) **(** [Vector2](class_vector2#class-vector2) force **)** | | void | [add\_force](#class-rigidbody2d-method-add-force) **(** [Vector2](class_vector2#class-vector2) offset, [Vector2](class_vector2#class-vector2) force **)** | | void | [add\_torque](#class-rigidbody2d-method-add-torque) **(** [float](class_float#class-float) torque **)** | | void | [apply\_central\_impulse](#class-rigidbody2d-method-apply-central-impulse) **(** [Vector2](class_vector2#class-vector2) impulse **)** | | void | [apply\_impulse](#class-rigidbody2d-method-apply-impulse) **(** [Vector2](class_vector2#class-vector2) offset, [Vector2](class_vector2#class-vector2) impulse **)** | | void | [apply\_torque\_impulse](#class-rigidbody2d-method-apply-torque-impulse) **(** [float](class_float#class-float) torque **)** | | [Array](class_array#class-array) | [get\_colliding\_bodies](#class-rigidbody2d-method-get-colliding-bodies) **(** **)** const | | void | [set\_axis\_velocity](#class-rigidbody2d-method-set-axis-velocity) **(** [Vector2](class_vector2#class-vector2) axis\_velocity **)** | | [bool](class_bool#class-bool) | [test\_motion](#class-rigidbody2d-method-test-motion) **(** [Vector2](class_vector2#class-vector2) motion, [bool](class_bool#class-bool) infinite\_inertia=true, [float](class_float#class-float) margin=0.08, [Physics2DTestMotionResult](class_physics2dtestmotionresult#class-physics2dtestmotionresult) result=null **)** | Signals ------- ### body\_entered ( [Node](class_node#class-node) body ) Emitted when a collision with another [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) or [TileMap](class_tilemap#class-tilemap) occurs. Requires [contact\_monitor](#class-rigidbody2d-property-contact-monitor) to be set to `true` and [contacts\_reported](#class-rigidbody2d-property-contacts-reported) to be set high enough to detect all the collisions. [TileMap](class_tilemap#class-tilemap)s are detected if the [TileSet](class_tileset#class-tileset) has Collision [Shape2D](class_shape2d#class-shape2d)s. `body` the [Node](class_node#class-node), if it exists in the tree, of the other [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) or [TileMap](class_tilemap#class-tilemap). ### body\_exited ( [Node](class_node#class-node) body ) Emitted when the collision with another [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) or [TileMap](class_tilemap#class-tilemap) ends. Requires [contact\_monitor](#class-rigidbody2d-property-contact-monitor) to be set to `true` and [contacts\_reported](#class-rigidbody2d-property-contacts-reported) to be set high enough to detect all the collisions. [TileMap](class_tilemap#class-tilemap)s are detected if the [TileSet](class_tileset#class-tileset) has Collision [Shape2D](class_shape2d#class-shape2d)s. `body` the [Node](class_node#class-node), if it exists in the tree, of the other [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) or [TileMap](class_tilemap#class-tilemap). ### body\_shape\_entered ( [RID](class_rid#class-rid) body\_rid, [Node](class_node#class-node) body, [int](class_int#class-int) body\_shape\_index, [int](class_int#class-int) local\_shape\_index ) Emitted when one of this RigidBody2D's [Shape2D](class_shape2d#class-shape2d)s collides with another [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) or [TileMap](class_tilemap#class-tilemap)'s [Shape2D](class_shape2d#class-shape2d)s. Requires [contact\_monitor](#class-rigidbody2d-property-contact-monitor) to be set to `true` and [contacts\_reported](#class-rigidbody2d-property-contacts-reported) to be set high enough to detect all the collisions. [TileMap](class_tilemap#class-tilemap)s are detected if the [TileSet](class_tileset#class-tileset) has Collision [Shape2D](class_shape2d#class-shape2d)s. `body_rid` the [RID](class_rid#class-rid) of the other [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) or [TileSet](class_tileset#class-tileset)'s [CollisionObject2D](class_collisionobject2d#class-collisionobject2d) used by the [Physics2DServer](class_physics2dserver#class-physics2dserver). `body` the [Node](class_node#class-node), if it exists in the tree, of the other [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) or [TileMap](class_tilemap#class-tilemap). `body_shape_index` the index of the [Shape2D](class_shape2d#class-shape2d) of the other [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) or [TileMap](class_tilemap#class-tilemap) used by the [Physics2DServer](class_physics2dserver#class-physics2dserver). Get the [CollisionShape2D](class_collisionshape2d#class-collisionshape2d) node with `body.shape_owner_get_owner(body_shape_index)`. `local_shape_index` the index of the [Shape2D](class_shape2d#class-shape2d) of this RigidBody2D used by the [Physics2DServer](class_physics2dserver#class-physics2dserver). Get the [CollisionShape2D](class_collisionshape2d#class-collisionshape2d) node with `self.shape_owner_get_owner(local_shape_index)`. ### body\_shape\_exited ( [RID](class_rid#class-rid) body\_rid, [Node](class_node#class-node) body, [int](class_int#class-int) body\_shape\_index, [int](class_int#class-int) local\_shape\_index ) Emitted when the collision between one of this RigidBody2D's [Shape2D](class_shape2d#class-shape2d)s and another [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) or [TileMap](class_tilemap#class-tilemap)'s [Shape2D](class_shape2d#class-shape2d)s ends. Requires [contact\_monitor](#class-rigidbody2d-property-contact-monitor) to be set to `true` and [contacts\_reported](#class-rigidbody2d-property-contacts-reported) to be set high enough to detect all the collisions. [TileMap](class_tilemap#class-tilemap)s are detected if the [TileSet](class_tileset#class-tileset) has Collision [Shape2D](class_shape2d#class-shape2d)s. `body_rid` the [RID](class_rid#class-rid) of the other [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) or [TileSet](class_tileset#class-tileset)'s [CollisionObject2D](class_collisionobject2d#class-collisionobject2d) used by the [Physics2DServer](class_physics2dserver#class-physics2dserver). `body` the [Node](class_node#class-node), if it exists in the tree, of the other [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) or [TileMap](class_tilemap#class-tilemap). `body_shape_index` the index of the [Shape2D](class_shape2d#class-shape2d) of the other [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) or [TileMap](class_tilemap#class-tilemap) used by the [Physics2DServer](class_physics2dserver#class-physics2dserver). Get the [CollisionShape2D](class_collisionshape2d#class-collisionshape2d) node with `body.shape_owner_get_owner(body_shape_index)`. `local_shape_index` the index of the [Shape2D](class_shape2d#class-shape2d) of this RigidBody2D used by the [Physics2DServer](class_physics2dserver#class-physics2dserver). Get the [CollisionShape2D](class_collisionshape2d#class-collisionshape2d) node with `self.shape_owner_get_owner(local_shape_index)`. ### sleeping\_state\_changed ( ) Emitted when the physics engine changes the body's sleeping state. **Note:** Changing the value [sleeping](#class-rigidbody2d-property-sleeping) will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or `emit_signal("sleeping_state_changed")` is used. Enumerations ------------ enum **Mode**: * **MODE\_RIGID** = **0** --- Rigid mode. The body behaves as a physical object. It collides with other bodies and responds to forces applied to it. This is the default mode. * **MODE\_STATIC** = **1** --- Static mode. The body behaves like a [StaticBody2D](class_staticbody2d#class-staticbody2d) and does not move. * **MODE\_CHARACTER** = **2** --- Character mode. Similar to [MODE\_RIGID](#class-rigidbody2d-constant-mode-rigid), but the body can not rotate. * **MODE\_KINEMATIC** = **3** --- Kinematic mode. The body behaves like a [KinematicBody2D](class_kinematicbody2d#class-kinematicbody2d), and must be moved by code. enum **CCDMode**: * **CCD\_MODE\_DISABLED** = **0** --- Continuous collision detection disabled. This is the fastest way to detect body collisions, but can miss small, fast-moving objects. * **CCD\_MODE\_CAST\_RAY** = **1** --- Continuous collision detection enabled using raycasting. This is faster than shapecasting but less precise. * **CCD\_MODE\_CAST\_SHAPE** = **2** --- Continuous collision detection enabled using shapecasting. This is the slowest CCD method and the most precise. Property Descriptions --------------------- ### [float](class_float#class-float) angular\_damp | | | | --- | --- | | *Default* | `-1.0` | | *Setter* | set\_angular\_damp(value) | | *Getter* | get\_angular\_damp() | Damps the body's [angular\_velocity](#class-rigidbody2d-property-angular-velocity). If `-1`, the body will use the **Default Angular Damp** defined in **Project > Project Settings > Physics > 2d**. If greater than `-1` it will be added to the default project value. See [ProjectSettings.physics/2d/default\_angular\_damp](class_projectsettings#class-projectsettings-property-physics-2d-default-angular-damp) for more details about damping. ### [float](class_float#class-float) angular\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_angular\_velocity(value) | | *Getter* | get\_angular\_velocity() | The body's rotational velocity in *radians* per second. ### [Vector2](class_vector2#class-vector2) applied\_force | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_applied\_force(value) | | *Getter* | get\_applied\_force() | The body's total applied force. ### [float](class_float#class-float) applied\_torque | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_applied\_torque(value) | | *Getter* | get\_applied\_torque() | The body's total applied torque. ### [float](class_float#class-float) bounce | | | | --- | --- | | *Setter* | set\_bounce(value) | | *Getter* | get\_bounce() | The body's bounciness. Values range from `0` (no bounce) to `1` (full bounciness). Deprecated, use [PhysicsMaterial.bounce](class_physicsmaterial#class-physicsmaterial-property-bounce) instead via [physics\_material\_override](#class-rigidbody2d-property-physics-material-override). ### [bool](class_bool#class-bool) can\_sleep | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_can\_sleep(value) | | *Getter* | is\_able\_to\_sleep() | If `true`, the body can enter sleep mode when there is no movement. See [sleeping](#class-rigidbody2d-property-sleeping). **Note:** A RigidBody2D will never enter sleep mode automatically if its [mode](#class-rigidbody2d-property-mode) is [MODE\_CHARACTER](#class-rigidbody2d-constant-mode-character). It can still be put to sleep manually by setting its [sleeping](#class-rigidbody2d-property-sleeping) property to `true`. ### [bool](class_bool#class-bool) contact\_monitor | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_contact\_monitor(value) | | *Getter* | is\_contact\_monitor\_enabled() | If `true`, the body will emit signals when it collides with another RigidBody2D. See also [contacts\_reported](#class-rigidbody2d-property-contacts-reported). ### [int](class_int#class-int) contacts\_reported | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_max\_contacts\_reported(value) | | *Getter* | get\_max\_contacts\_reported() | The maximum number of contacts that will be recorded. Requires [contact\_monitor](#class-rigidbody2d-property-contact-monitor) to be set to `true`. **Note:** The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end). ### [CCDMode](#enum-rigidbody2d-ccdmode) continuous\_cd | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_continuous\_collision\_detection\_mode(value) | | *Getter* | get\_continuous\_collision\_detection\_mode() | Continuous collision detection mode. Continuous collision detection tries to predict where a moving body will collide instead of moving it and correcting its movement after collision. Continuous collision detection is slower, but more precise and misses fewer collisions with small, fast-moving objects. Raycasting and shapecasting methods are available. See [CCDMode](#enum-rigidbody2d-ccdmode) for details. ### [bool](class_bool#class-bool) custom\_integrator | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_custom\_integrator(value) | | *Getter* | is\_using\_custom\_integrator() | If `true`, internal force integration is disabled for this body. Aside from collision response, the body will only move as determined by the [\_integrate\_forces](#class-rigidbody2d-method-integrate-forces) function. ### [float](class_float#class-float) friction | | | | --- | --- | | *Setter* | set\_friction(value) | | *Getter* | get\_friction() | The body's friction. Values range from `0` (frictionless) to `1` (maximum friction). Deprecated, use [PhysicsMaterial.friction](class_physicsmaterial#class-physicsmaterial-property-friction) instead via [physics\_material\_override](#class-rigidbody2d-property-physics-material-override). ### [float](class_float#class-float) gravity\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_gravity\_scale(value) | | *Getter* | get\_gravity\_scale() | Multiplies the gravity applied to the body. The body's gravity is calculated from the **Default Gravity** value in **Project > Project Settings > Physics > 2d** and/or any additional gravity vector applied by [Area2D](class_area2d#class-area2d)s. ### [float](class_float#class-float) inertia | | | | --- | --- | | *Setter* | set\_inertia(value) | | *Getter* | get\_inertia() | The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body. The moment of inertia is usually computed automatically from the mass and the shapes, but this function allows you to set a custom value. Set 0 inertia to return to automatically computing it. ### [float](class_float#class-float) linear\_damp | | | | --- | --- | | *Default* | `-1.0` | | *Setter* | set\_linear\_damp(value) | | *Getter* | get\_linear\_damp() | Damps the body's [linear\_velocity](#class-rigidbody2d-property-linear-velocity). If `-1`, the body will use the **Default Linear Damp** in **Project > Project Settings > Physics > 2d**. If greater than `-1` it will be added to the default project value. See [ProjectSettings.physics/2d/default\_linear\_damp](class_projectsettings#class-projectsettings-property-physics-2d-default-linear-damp) for more details about damping. ### [Vector2](class_vector2#class-vector2) linear\_velocity | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_linear\_velocity(value) | | *Getter* | get\_linear\_velocity() | The body's linear velocity in pixels per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [\_integrate\_forces](#class-rigidbody2d-method-integrate-forces) as your process loop for precise control of the body state. ### [float](class_float#class-float) mass | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_mass(value) | | *Getter* | get\_mass() | The body's mass. ### [Mode](#enum-rigidbody2d-mode) mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_mode(value) | | *Getter* | get\_mode() | The body's mode. See [Mode](#enum-rigidbody2d-mode) for possible values. ### [PhysicsMaterial](class_physicsmaterial#class-physicsmaterial) physics\_material\_override | | | | --- | --- | | *Setter* | set\_physics\_material\_override(value) | | *Getter* | get\_physics\_material\_override() | The physics material override for the body. If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. ### [bool](class_bool#class-bool) sleeping | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_sleeping(value) | | *Getter* | is\_sleeping() | If `true`, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [apply\_impulse](#class-rigidbody2d-method-apply-impulse) or [add\_force](#class-rigidbody2d-method-add-force) methods. ### [float](class_float#class-float) weight | | | | --- | --- | | *Default* | `9.8` | | *Setter* | set\_weight(value) | | *Getter* | get\_weight() | The body's weight based on its mass and the **Default Gravity** value in **Project > Project Settings > Physics > 2d**. Method Descriptions ------------------- ### void \_integrate\_forces ( [Physics2DDirectBodyState](class_physics2ddirectbodystate#class-physics2ddirectbodystate) state ) virtual Allows you to read and safely modify the simulation state for the object. Use this instead of [Node.\_physics\_process](class_node#class-node-method-physics-process) if you need to directly change the body's `position` or other physics properties. By default, it works in addition to the usual physics behavior, but [custom\_integrator](#class-rigidbody2d-property-custom-integrator) allows you to disable the default behavior and write custom force integration for a body. ### void add\_central\_force ( [Vector2](class_vector2#class-vector2) force ) Adds a constant directional force without affecting rotation. ### void add\_force ( [Vector2](class_vector2#class-vector2) offset, [Vector2](class_vector2#class-vector2) force ) Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. ### void add\_torque ( [float](class_float#class-float) torque ) Adds a constant rotational force. ### void apply\_central\_impulse ( [Vector2](class_vector2#class-vector2) impulse ) Applies a directional impulse without affecting rotation. ### void apply\_impulse ( [Vector2](class_vector2#class-vector2) offset, [Vector2](class_vector2#class-vector2) impulse ) Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts (use the "\_force" functions otherwise). The position uses the rotation of the global coordinate system, but is centered at the object's origin. ### void apply\_torque\_impulse ( [float](class_float#class-float) torque ) Applies a rotational impulse to the body. ### [Array](class_array#class-array) get\_colliding\_bodies ( ) const Returns a list of the bodies colliding with this one. Requires [contact\_monitor](#class-rigidbody2d-property-contact-monitor) to be set to `true` and [contacts\_reported](#class-rigidbody2d-property-contacts-reported) to be set high enough to detect all the collisions. **Note:** The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead. ### void set\_axis\_velocity ( [Vector2](class_vector2#class-vector2) axis\_velocity ) Sets the body's velocity on the given axis. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. ### [bool](class_bool#class-bool) test\_motion ( [Vector2](class_vector2#class-vector2) motion, [bool](class_bool#class-bool) infinite\_inertia=true, [float](class_float#class-float) margin=0.08, [Physics2DTestMotionResult](class_physics2dtestmotionresult#class-physics2dtestmotionresult) result=null ) Returns `true` if a collision would result from moving in the given vector. `margin` increases the size of the shapes involved in the collision detection, and `result` is an object of type [Physics2DTestMotionResult](class_physics2dtestmotionresult#class-physics2dtestmotionresult), which contains additional information about the collision (should there be one).
programming_docs
godot VisualShaderNodeUniform VisualShaderNodeUniform ======================= **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [VisualShaderNodeBooleanUniform](class_visualshadernodebooleanuniform#class-visualshadernodebooleanuniform), [VisualShaderNodeColorUniform](class_visualshadernodecoloruniform#class-visualshadernodecoloruniform), [VisualShaderNodeScalarUniform](class_visualshadernodescalaruniform#class-visualshadernodescalaruniform), [VisualShaderNodeTextureUniform](class_visualshadernodetextureuniform#class-visualshadernodetextureuniform), [VisualShaderNodeTransformUniform](class_visualshadernodetransformuniform#class-visualshadernodetransformuniform), [VisualShaderNodeVec3Uniform](class_visualshadernodevec3uniform#class-visualshadernodevec3uniform) A base type for the uniforms within the visual shader graph. Description ----------- A uniform represents a variable in the shader which is set externally, i.e. from the [ShaderMaterial](class_shadermaterial#class-shadermaterial). Uniforms are exposed as properties in the [ShaderMaterial](class_shadermaterial#class-shadermaterial) and can be assigned from the inspector or from a script. Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [uniform\_name](#class-visualshadernodeuniform-property-uniform-name) | `""` | Property Descriptions --------------------- ### [String](class_string#class-string) uniform\_name | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_uniform\_name(value) | | *Getter* | get\_uniform\_name() | Name of the uniform, by which it can be accessed through the [ShaderMaterial](class_shadermaterial#class-shadermaterial) properties. godot Variant Variant ======= The most important data type in Godot. Description ----------- In computer programming, a Variant class is a class that is designed to store a variety of other types. Dynamic programming languages like PHP, Lua, JavaScript and GDScript like to use them to store variables' data on the backend. With these Variants, properties are able to change value types freely. ``` var foo = 2 # foo is dynamically an integer foo = "Now foo is a string!" foo = Reference.new() # foo is an Object var bar: int = 2 # bar is a statically typed integer. # bar = "Uh oh! I can't make static variables become a different type!" ``` Godot tracks all scripting API variables within Variants. Without even realizing it, you use Variants all the time. When a particular language enforces its own rules for keeping data typed, then that language is applying its own custom logic over the base Variant scripting API. * GDScript automatically wrap values in them. It keeps all data in plain Variants by default and then optionally enforces custom static typing rules on variable types. * VisualScript tracks properties inside Variants as well, but it also uses static typing. The GUI interface enforces that properties have a particular type that doesn't change over time. * C# is statically typed, but uses the Mono `object` type in place of Godot's Variant class when it needs to represent a dynamic value. `object` is the Mono runtime's equivalent of the same concept. * The statically-typed language NativeScript C++ does not define a built-in Variant-like class. Godot's GDNative bindings provide their own godot::Variant class for users; Any point at which the C++ code starts interacting with the Godot runtime is a place where you might have to start wrapping data inside Variant objects. The global [@GDScript.typeof](class_%40gdscript#class-gdscript-method-typeof) function returns the enumerated value of the Variant type stored in the current variable (see [Variant.Type](class_%40globalscope#enum-globalscope-variant-type)). ``` var foo = 2 match typeof(foo): TYPE_NIL: print("foo is null") TYPE_INTEGER: print("foo is an integer") TYPE_OBJECT: # Note that Objects are their own special category. # To get the name of the underlying Object type, you need the `get_class()` method. print("foo is a(n) %s" % foo.get_class()) # inject the class name into a formatted string. # Note also that there is not yet any way to get a script's `class_name` string easily. # To fetch that value, you need to dig deeply into a hidden ProjectSettings setting: an Array of Dictionaries called "_global_script_classes". # Open your project.godot file to see it up close. ``` A Variant takes up only 20 bytes and can store almost any engine datatype inside of it. Variants are rarely used to hold information for long periods of time. Instead, they are used mainly for communication, editing, serialization and moving data around. Godot has specifically invested in making its Variant class as flexible as possible; so much so that it is used for a multitude of operations to facilitate communication between all of Godot's systems. A Variant: * Can store almost any datatype. * Can perform operations between many variants. GDScript uses Variant as its atomic/native datatype. * Can be hashed, so it can be compared quickly to other variants. * Can be used to convert safely between datatypes. * Can be used to abstract calling methods and their arguments. Godot exports all its functions through variants. * Can be used to defer calls or move data between threads. * Can be serialized as binary and stored to disk, or transferred via network. * Can be serialized to text and use it for printing values and editable settings. * Can work as an exported property, so the editor can edit it universally. * Can be used for dictionaries, arrays, parsers, etc. **Containers (Array and Dictionary):** Both are implemented using variants. A [Dictionary](class_dictionary#class-dictionary) can match any datatype used as key to any other datatype. An [Array](class_array#class-array) just holds an array of Variants. Of course, a Variant can also hold a [Dictionary](class_dictionary#class-dictionary) and an [Array](class_array#class-array) inside, making it even more flexible. Modifications to a container will modify all references to it. A [Mutex](class_mutex#class-mutex) should be created to lock it if multi-threaded access is desired. Tutorials --------- * [Variant class](https://docs.godotengine.org/en/3.5/development/cpp/variant_class.html) godot SphereShape SphereShape =========== **Inherits:** [Shape](class_shape#class-shape) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Sphere shape for 3D collisions. Description ----------- Sphere shape for 3D collisions, which can be set into a [PhysicsBody](class_physicsbody#class-physicsbody) or [Area](class_area#class-area). This shape is useful for modeling sphere-like 3D objects. Tutorials --------- * [3D Physics Tests Demo](https://godotengine.org/asset-library/asset/675) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [radius](#class-sphereshape-property-radius) | `1.0` | Property Descriptions --------------------- ### [float](class_float#class-float) radius | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_radius(value) | | *Getter* | get\_radius() | The sphere's radius. The shape's diameter is double the radius. godot ConvexPolygonShape2D ConvexPolygonShape2D ==================== **Inherits:** [Shape2D](class_shape2d#class-shape2d) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Convex polygon shape for 2D physics. Description ----------- Convex polygon shape for 2D physics. A convex polygon, whatever its shape, is internally decomposed into as many convex polygons as needed to ensure all collision checks against it are always done on convex polygons (which are faster to check). The main difference between a `ConvexPolygonShape2D` and a [ConcavePolygonShape2D](class_concavepolygonshape2d#class-concavepolygonshape2d) is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection. Properties ---------- | | | | | --- | --- | --- | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [points](#class-convexpolygonshape2d-property-points) | `PoolVector2Array(  )` | Methods ------- | | | | --- | --- | | void | [set\_point\_cloud](#class-convexpolygonshape2d-method-set-point-cloud) **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) point\_cloud **)** | Property Descriptions --------------------- ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) points | | | | --- | --- | | *Default* | `PoolVector2Array(  )` | | *Setter* | set\_points(value) | | *Getter* | get\_points() | The polygon's list of vertices. Can be in either clockwise or counterclockwise order. Only set this property with convex hull points, use [set\_point\_cloud](#class-convexpolygonshape2d-method-set-point-cloud) to generate a convex hull shape from concave shape points. Method Descriptions ------------------- ### void set\_point\_cloud ( [PoolVector2Array](class_poolvector2array#class-poolvector2array) point\_cloud ) Based on the set of points provided, this creates and assigns the [points](#class-convexpolygonshape2d-property-points) property using the convex hull algorithm. Removing all unneeded points. See [Geometry.convex\_hull\_2d](class_geometry#class-geometry-method-convex-hull-2d) for details. godot NativeScript NativeScript ============ **Inherits:** [Script](class_script#class-script) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [class\_name](#class-nativescript-property-class-name) | `""` | | [GDNativeLibrary](class_gdnativelibrary#class-gdnativelibrary) | [library](#class-nativescript-property-library) | | | [String](class_string#class-string) | [script\_class\_icon\_path](#class-nativescript-property-script-class-icon-path) | `""` | | [String](class_string#class-string) | [script\_class\_name](#class-nativescript-property-script-class-name) | `""` | Methods ------- | | | | --- | --- | | [String](class_string#class-string) | [get\_class\_documentation](#class-nativescript-method-get-class-documentation) **(** **)** const | | [String](class_string#class-string) | [get\_method\_documentation](#class-nativescript-method-get-method-documentation) **(** [String](class_string#class-string) method **)** const | | [String](class_string#class-string) | [get\_property\_documentation](#class-nativescript-method-get-property-documentation) **(** [String](class_string#class-string) path **)** const | | [String](class_string#class-string) | [get\_signal\_documentation](#class-nativescript-method-get-signal-documentation) **(** [String](class_string#class-string) signal\_name **)** const | | [Variant](class_variant#class-variant) | [new](#class-nativescript-method-new) **(** ... **)** vararg | Property Descriptions --------------------- ### [String](class_string#class-string) class\_name | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_class\_name(value) | | *Getter* | get\_class\_name() | ### [GDNativeLibrary](class_gdnativelibrary#class-gdnativelibrary) library | | | | --- | --- | | *Setter* | set\_library(value) | | *Getter* | get\_library() | ### [String](class_string#class-string) script\_class\_icon\_path | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_script\_class\_icon\_path(value) | | *Getter* | get\_script\_class\_icon\_path() | ### [String](class_string#class-string) script\_class\_name | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_script\_class\_name(value) | | *Getter* | get\_script\_class\_name() | Method Descriptions ------------------- ### [String](class_string#class-string) get\_class\_documentation ( ) const Returns the documentation string that was previously set with `godot_nativescript_set_class_documentation`. ### [String](class_string#class-string) get\_method\_documentation ( [String](class_string#class-string) method ) const Returns the documentation string that was previously set with `godot_nativescript_set_method_documentation`. ### [String](class_string#class-string) get\_property\_documentation ( [String](class_string#class-string) path ) const Returns the documentation string that was previously set with `godot_nativescript_set_property_documentation`. ### [String](class_string#class-string) get\_signal\_documentation ( [String](class_string#class-string) signal\_name ) const Returns the documentation string that was previously set with `godot_nativescript_set_signal_documentation`. ### [Variant](class_variant#class-variant) new ( ... ) vararg Constructs a new object of the base type with a script of this type already attached. **Note:** Any arguments passed to this function will be ignored and not passed to the native constructor function. This will change with in a future API extension. godot PoolVector3Array PoolVector3Array ================ A pooled array of [Vector3](class_vector3#class-vector3). Description ----------- An array specifically designed to hold [Vector3](class_vector3#class-vector3). Optimized for memory usage, does not fragment the memory. **Note:** This type is passed by value and not by reference. This means that when *mutating* a class property of type `PoolVector3Array` or mutating a `PoolVector3Array` within an [Array](class_array#class-array) or [Dictionary](class_dictionary#class-dictionary), changes will be lost: ``` var array = [PoolVector3Array()] array[0].push_back(Vector3(12, 34, 56)) print(array) # [[]] (empty PoolVector3Array within an Array) ``` Instead, the entire `PoolVector3Array` property must be *reassigned* with `=` for it to be changed: ``` var array = [PoolVector3Array()] var pool_array = array[0] pool_array.push_back(Vector3(12, 34, 56)) array[0] = pool_array print(array) # [[(12, 34, 56)]] (PoolVector3Array with 1 element inside an Array) ``` Methods ------- | | | | --- | --- | | [PoolVector3Array](#class-poolvector3array) | [PoolVector3Array](#class-poolvector3array-method-poolvector3array) **(** [Array](class_array#class-array) from **)** | | void | [append](#class-poolvector3array-method-append) **(** [Vector3](class_vector3#class-vector3) vector3 **)** | | void | [append\_array](#class-poolvector3array-method-append-array) **(** [PoolVector3Array](#class-poolvector3array) array **)** | | [int](class_int#class-int) | [count](#class-poolvector3array-method-count) **(** [Vector3](class_vector3#class-vector3) value **)** | | [bool](class_bool#class-bool) | [empty](#class-poolvector3array-method-empty) **(** **)** | | void | [fill](#class-poolvector3array-method-fill) **(** [Vector3](class_vector3#class-vector3) vector3 **)** | | [int](class_int#class-int) | [find](#class-poolvector3array-method-find) **(** [Vector3](class_vector3#class-vector3) value, [int](class_int#class-int) from=0 **)** | | [bool](class_bool#class-bool) | [has](#class-poolvector3array-method-has) **(** [Vector3](class_vector3#class-vector3) value **)** | | [int](class_int#class-int) | [insert](#class-poolvector3array-method-insert) **(** [int](class_int#class-int) idx, [Vector3](class_vector3#class-vector3) vector3 **)** | | void | [invert](#class-poolvector3array-method-invert) **(** **)** | | void | [push\_back](#class-poolvector3array-method-push-back) **(** [Vector3](class_vector3#class-vector3) vector3 **)** | | void | [remove](#class-poolvector3array-method-remove) **(** [int](class_int#class-int) idx **)** | | void | [resize](#class-poolvector3array-method-resize) **(** [int](class_int#class-int) idx **)** | | [int](class_int#class-int) | [rfind](#class-poolvector3array-method-rfind) **(** [Vector3](class_vector3#class-vector3) value, [int](class_int#class-int) from=-1 **)** | | void | [set](#class-poolvector3array-method-set) **(** [int](class_int#class-int) idx, [Vector3](class_vector3#class-vector3) vector3 **)** | | [int](class_int#class-int) | [size](#class-poolvector3array-method-size) **(** **)** | | void | [sort](#class-poolvector3array-method-sort) **(** **)** | Method Descriptions ------------------- ### [PoolVector3Array](#class-poolvector3array) PoolVector3Array ( [Array](class_array#class-array) from ) Constructs a new `PoolVector3Array`. Optionally, you can pass in a generic [Array](class_array#class-array) that will be converted. ### void append ( [Vector3](class_vector3#class-vector3) vector3 ) Appends an element at the end of the array (alias of [push\_back](#class-poolvector3array-method-push-back)). ### void append\_array ( [PoolVector3Array](#class-poolvector3array) array ) Appends a `PoolVector3Array` at the end of this array. ### [int](class_int#class-int) count ( [Vector3](class_vector3#class-vector3) value ) Returns the number of times an element is in the array. ### [bool](class_bool#class-bool) empty ( ) Returns `true` if the array is empty. ### void fill ( [Vector3](class_vector3#class-vector3) vector3 ) Assigns the given value to all elements in the array. This can typically be used together with [resize](#class-poolvector3array-method-resize) to create an array with a given size and initialized elements. ### [int](class_int#class-int) find ( [Vector3](class_vector3#class-vector3) value, [int](class_int#class-int) from=0 ) Searches the array for a value and returns its index or `-1` if not found. Optionally, the initial search index can be passed. Returns `-1` if `from` is out of bounds. ### [bool](class_bool#class-bool) has ( [Vector3](class_vector3#class-vector3) value ) Returns `true` if the array contains the given value. **Note:** This is equivalent to using the `in` operator. ### [int](class_int#class-int) insert ( [int](class_int#class-int) idx, [Vector3](class_vector3#class-vector3) vector3 ) Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (`idx == size()`). ### void invert ( ) Reverses the order of the elements in the array. ### void push\_back ( [Vector3](class_vector3#class-vector3) vector3 ) Inserts a [Vector3](class_vector3#class-vector3) at the end. ### void remove ( [int](class_int#class-int) idx ) Removes an element from the array by index. ### void resize ( [int](class_int#class-int) idx ) Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. ### [int](class_int#class-int) rfind ( [Vector3](class_vector3#class-vector3) value, [int](class_int#class-int) from=-1 ) Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. ### void set ( [int](class_int#class-int) idx, [Vector3](class_vector3#class-vector3) vector3 ) Changes the [Vector3](class_vector3#class-vector3) at the given index. ### [int](class_int#class-int) size ( ) Returns the number of elements in the array. ### void sort ( ) Sorts the elements of the array in ascending order. godot Color Color ===== Color in RGBA format using floats on the range of 0 to 1. Description ----------- A color represented by red, green, blue, and alpha (RGBA) components. The alpha component is often used for opacity. Values are in floating-point and usually range from 0 to 1. Some properties (such as CanvasItem.modulate) may accept values greater than 1 (overbright or HDR colors). You can also create a color from standardized color names by using [@GDScript.ColorN](class_%40gdscript#class-gdscript-method-colorn) or directly using the color constants defined here. The standardized color set is based on the [X11 color names](https://en.wikipedia.org/wiki/X11_color_names). If you want to supply values in a range of 0 to 255, you should use [@GDScript.Color8](class_%40gdscript#class-gdscript-method-color8). **Note:** In a boolean context, a Color will evaluate to `false` if it's equal to `Color(0, 0, 0, 1)` (opaque black). Otherwise, a Color will always evaluate to `true`. [Color constants cheatsheet](https://raw.githubusercontent.com/godotengine/godot-docs/master/img/color_constants.png) Tutorials --------- * [2D GD Paint Demo](https://godotengine.org/asset-library/asset/517) * [Tween Demo](https://godotengine.org/asset-library/asset/146) * [GUI Drag And Drop Demo](https://godotengine.org/asset-library/asset/133) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [a](#class-color-property-a) | `1.0` | | [int](class_int#class-int) | [a8](#class-color-property-a8) | `255` | | [float](class_float#class-float) | [b](#class-color-property-b) | `0.0` | | [int](class_int#class-int) | [b8](#class-color-property-b8) | `0` | | [float](class_float#class-float) | [g](#class-color-property-g) | `0.0` | | [int](class_int#class-int) | [g8](#class-color-property-g8) | `0` | | [float](class_float#class-float) | [h](#class-color-property-h) | `0.0` | | [float](class_float#class-float) | [r](#class-color-property-r) | `0.0` | | [int](class_int#class-int) | [r8](#class-color-property-r8) | `0` | | [float](class_float#class-float) | [s](#class-color-property-s) | `0.0` | | [float](class_float#class-float) | [v](#class-color-property-v) | `0.0` | Methods ------- | | | | --- | --- | | [Color](#class-color) | [Color](#class-color-method-color) **(** [String](class_string#class-string) from **)** | | [Color](#class-color) | [Color](#class-color-method-color) **(** [int](class_int#class-int) from **)** | | [Color](#class-color) | [Color](#class-color-method-color) **(** [float](class_float#class-float) r, [float](class_float#class-float) g, [float](class_float#class-float) b **)** | | [Color](#class-color) | [Color](#class-color-method-color) **(** [float](class_float#class-float) r, [float](class_float#class-float) g, [float](class_float#class-float) b, [float](class_float#class-float) a **)** | | [Color](#class-color) | [blend](#class-color-method-blend) **(** [Color](#class-color) over **)** | | [Color](#class-color) | [contrasted](#class-color-method-contrasted) **(** **)** | | [Color](#class-color) | [darkened](#class-color-method-darkened) **(** [float](class_float#class-float) amount **)** | | [Color](#class-color) | [from\_hsv](#class-color-method-from-hsv) **(** [float](class_float#class-float) h, [float](class_float#class-float) s, [float](class_float#class-float) v, [float](class_float#class-float) a=1.0 **)** | | [float](class_float#class-float) | [get\_luminance](#class-color-method-get-luminance) **(** **)** | | [float](class_float#class-float) | [gray](#class-color-method-gray) **(** **)** | | [Color](#class-color) | [inverted](#class-color-method-inverted) **(** **)** | | [bool](class_bool#class-bool) | [is\_equal\_approx](#class-color-method-is-equal-approx) **(** [Color](#class-color) color **)** | | [Color](#class-color) | [lightened](#class-color-method-lightened) **(** [float](class_float#class-float) amount **)** | | [Color](#class-color) | [linear\_interpolate](#class-color-method-linear-interpolate) **(** [Color](#class-color) to, [float](class_float#class-float) weight **)** | | [int](class_int#class-int) | [to\_abgr32](#class-color-method-to-abgr32) **(** **)** | | [int](class_int#class-int) | [to\_abgr64](#class-color-method-to-abgr64) **(** **)** | | [int](class_int#class-int) | [to\_argb32](#class-color-method-to-argb32) **(** **)** | | [int](class_int#class-int) | [to\_argb64](#class-color-method-to-argb64) **(** **)** | | [String](class_string#class-string) | [to\_html](#class-color-method-to-html) **(** [bool](class_bool#class-bool) with\_alpha=true **)** | | [int](class_int#class-int) | [to\_rgba32](#class-color-method-to-rgba32) **(** **)** | | [int](class_int#class-int) | [to\_rgba64](#class-color-method-to-rgba64) **(** **)** | Constants --------- * **aliceblue** = **Color( 0.941176, 0.972549, 1, 1 )** --- Alice blue color. * **antiquewhite** = **Color( 0.980392, 0.921569, 0.843137, 1 )** --- Antique white color. * **aqua** = **Color( 0, 1, 1, 1 )** --- Aqua color. * **aquamarine** = **Color( 0.498039, 1, 0.831373, 1 )** --- Aquamarine color. * **azure** = **Color( 0.941176, 1, 1, 1 )** --- Azure color. * **beige** = **Color( 0.960784, 0.960784, 0.862745, 1 )** --- Beige color. * **bisque** = **Color( 1, 0.894118, 0.768627, 1 )** --- Bisque color. * **black** = **Color( 0, 0, 0, 1 )** --- Black color. * **blanchedalmond** = **Color( 1, 0.921569, 0.803922, 1 )** --- Blanche almond color. * **blue** = **Color( 0, 0, 1, 1 )** --- Blue color. * **blueviolet** = **Color( 0.541176, 0.168627, 0.886275, 1 )** --- Blue violet color. * **brown** = **Color( 0.647059, 0.164706, 0.164706, 1 )** --- Brown color. * **burlywood** = **Color( 0.870588, 0.721569, 0.529412, 1 )** --- Burly wood color. * **cadetblue** = **Color( 0.372549, 0.619608, 0.627451, 1 )** --- Cadet blue color. * **chartreuse** = **Color( 0.498039, 1, 0, 1 )** --- Chartreuse color. * **chocolate** = **Color( 0.823529, 0.411765, 0.117647, 1 )** --- Chocolate color. * **coral** = **Color( 1, 0.498039, 0.313726, 1 )** --- Coral color. * **cornflower** = **Color( 0.392157, 0.584314, 0.929412, 1 )** --- Cornflower color. * **cornsilk** = **Color( 1, 0.972549, 0.862745, 1 )** --- Corn silk color. * **crimson** = **Color( 0.862745, 0.0784314, 0.235294, 1 )** --- Crimson color. * **cyan** = **Color( 0, 1, 1, 1 )** --- Cyan color. * **darkblue** = **Color( 0, 0, 0.545098, 1 )** --- Dark blue color. * **darkcyan** = **Color( 0, 0.545098, 0.545098, 1 )** --- Dark cyan color. * **darkgoldenrod** = **Color( 0.721569, 0.52549, 0.0431373, 1 )** --- Dark goldenrod color. * **darkgray** = **Color( 0.662745, 0.662745, 0.662745, 1 )** --- Dark gray color. * **darkgreen** = **Color( 0, 0.392157, 0, 1 )** --- Dark green color. * **darkkhaki** = **Color( 0.741176, 0.717647, 0.419608, 1 )** --- Dark khaki color. * **darkmagenta** = **Color( 0.545098, 0, 0.545098, 1 )** --- Dark magenta color. * **darkolivegreen** = **Color( 0.333333, 0.419608, 0.184314, 1 )** --- Dark olive green color. * **darkorange** = **Color( 1, 0.54902, 0, 1 )** --- Dark orange color. * **darkorchid** = **Color( 0.6, 0.196078, 0.8, 1 )** --- Dark orchid color. * **darkred** = **Color( 0.545098, 0, 0, 1 )** --- Dark red color. * **darksalmon** = **Color( 0.913725, 0.588235, 0.478431, 1 )** --- Dark salmon color. * **darkseagreen** = **Color( 0.560784, 0.737255, 0.560784, 1 )** --- Dark sea green color. * **darkslateblue** = **Color( 0.282353, 0.239216, 0.545098, 1 )** --- Dark slate blue color. * **darkslategray** = **Color( 0.184314, 0.309804, 0.309804, 1 )** --- Dark slate gray color. * **darkturquoise** = **Color( 0, 0.807843, 0.819608, 1 )** --- Dark turquoise color. * **darkviolet** = **Color( 0.580392, 0, 0.827451, 1 )** --- Dark violet color. * **deeppink** = **Color( 1, 0.0784314, 0.576471, 1 )** --- Deep pink color. * **deepskyblue** = **Color( 0, 0.74902, 1, 1 )** --- Deep sky blue color. * **dimgray** = **Color( 0.411765, 0.411765, 0.411765, 1 )** --- Dim gray color. * **dodgerblue** = **Color( 0.117647, 0.564706, 1, 1 )** --- Dodger blue color. * **firebrick** = **Color( 0.698039, 0.133333, 0.133333, 1 )** --- Firebrick color. * **floralwhite** = **Color( 1, 0.980392, 0.941176, 1 )** --- Floral white color. * **forestgreen** = **Color( 0.133333, 0.545098, 0.133333, 1 )** --- Forest green color. * **fuchsia** = **Color( 1, 0, 1, 1 )** --- Fuchsia color. * **gainsboro** = **Color( 0.862745, 0.862745, 0.862745, 1 )** --- Gainsboro color. * **ghostwhite** = **Color( 0.972549, 0.972549, 1, 1 )** --- Ghost white color. * **gold** = **Color( 1, 0.843137, 0, 1 )** --- Gold color. * **goldenrod** = **Color( 0.854902, 0.647059, 0.12549, 1 )** --- Goldenrod color. * **gray** = **Color( 0.745098, 0.745098, 0.745098, 1 )** --- Gray color. * **green** = **Color( 0, 1, 0, 1 )** --- Green color. * **greenyellow** = **Color( 0.678431, 1, 0.184314, 1 )** --- Green yellow color. * **honeydew** = **Color( 0.941176, 1, 0.941176, 1 )** --- Honeydew color. * **hotpink** = **Color( 1, 0.411765, 0.705882, 1 )** --- Hot pink color. * **indianred** = **Color( 0.803922, 0.360784, 0.360784, 1 )** --- Indian red color. * **indigo** = **Color( 0.294118, 0, 0.509804, 1 )** --- Indigo color. * **ivory** = **Color( 1, 1, 0.941176, 1 )** --- Ivory color. * **khaki** = **Color( 0.941176, 0.901961, 0.54902, 1 )** --- Khaki color. * **lavender** = **Color( 0.901961, 0.901961, 0.980392, 1 )** --- Lavender color. * **lavenderblush** = **Color( 1, 0.941176, 0.960784, 1 )** --- Lavender blush color. * **lawngreen** = **Color( 0.486275, 0.988235, 0, 1 )** --- Lawn green color. * **lemonchiffon** = **Color( 1, 0.980392, 0.803922, 1 )** --- Lemon chiffon color. * **lightblue** = **Color( 0.678431, 0.847059, 0.901961, 1 )** --- Light blue color. * **lightcoral** = **Color( 0.941176, 0.501961, 0.501961, 1 )** --- Light coral color. * **lightcyan** = **Color( 0.878431, 1, 1, 1 )** --- Light cyan color. * **lightgoldenrod** = **Color( 0.980392, 0.980392, 0.823529, 1 )** --- Light goldenrod color. * **lightgray** = **Color( 0.827451, 0.827451, 0.827451, 1 )** --- Light gray color. * **lightgreen** = **Color( 0.564706, 0.933333, 0.564706, 1 )** --- Light green color. * **lightpink** = **Color( 1, 0.713726, 0.756863, 1 )** --- Light pink color. * **lightsalmon** = **Color( 1, 0.627451, 0.478431, 1 )** --- Light salmon color. * **lightseagreen** = **Color( 0.12549, 0.698039, 0.666667, 1 )** --- Light sea green color. * **lightskyblue** = **Color( 0.529412, 0.807843, 0.980392, 1 )** --- Light sky blue color. * **lightslategray** = **Color( 0.466667, 0.533333, 0.6, 1 )** --- Light slate gray color. * **lightsteelblue** = **Color( 0.690196, 0.768627, 0.870588, 1 )** --- Light steel blue color. * **lightyellow** = **Color( 1, 1, 0.878431, 1 )** --- Light yellow color. * **lime** = **Color( 0, 1, 0, 1 )** --- Lime color. * **limegreen** = **Color( 0.196078, 0.803922, 0.196078, 1 )** --- Lime green color. * **linen** = **Color( 0.980392, 0.941176, 0.901961, 1 )** --- Linen color. * **magenta** = **Color( 1, 0, 1, 1 )** --- Magenta color. * **maroon** = **Color( 0.690196, 0.188235, 0.376471, 1 )** --- Maroon color. * **mediumaquamarine** = **Color( 0.4, 0.803922, 0.666667, 1 )** --- Medium aquamarine color. * **mediumblue** = **Color( 0, 0, 0.803922, 1 )** --- Medium blue color. * **mediumorchid** = **Color( 0.729412, 0.333333, 0.827451, 1 )** --- Medium orchid color. * **mediumpurple** = **Color( 0.576471, 0.439216, 0.858824, 1 )** --- Medium purple color. * **mediumseagreen** = **Color( 0.235294, 0.701961, 0.443137, 1 )** --- Medium sea green color. * **mediumslateblue** = **Color( 0.482353, 0.407843, 0.933333, 1 )** --- Medium slate blue color. * **mediumspringgreen** = **Color( 0, 0.980392, 0.603922, 1 )** --- Medium spring green color. * **mediumturquoise** = **Color( 0.282353, 0.819608, 0.8, 1 )** --- Medium turquoise color. * **mediumvioletred** = **Color( 0.780392, 0.0823529, 0.521569, 1 )** --- Medium violet red color. * **midnightblue** = **Color( 0.0980392, 0.0980392, 0.439216, 1 )** --- Midnight blue color. * **mintcream** = **Color( 0.960784, 1, 0.980392, 1 )** --- Mint cream color. * **mistyrose** = **Color( 1, 0.894118, 0.882353, 1 )** --- Misty rose color. * **moccasin** = **Color( 1, 0.894118, 0.709804, 1 )** --- Moccasin color. * **navajowhite** = **Color( 1, 0.870588, 0.678431, 1 )** --- Navajo white color. * **navyblue** = **Color( 0, 0, 0.501961, 1 )** --- Navy blue color. * **oldlace** = **Color( 0.992157, 0.960784, 0.901961, 1 )** --- Old lace color. * **olive** = **Color( 0.501961, 0.501961, 0, 1 )** --- Olive color. * **olivedrab** = **Color( 0.419608, 0.556863, 0.137255, 1 )** --- Olive drab color. * **orange** = **Color( 1, 0.647059, 0, 1 )** --- Orange color. * **orangered** = **Color( 1, 0.270588, 0, 1 )** --- Orange red color. * **orchid** = **Color( 0.854902, 0.439216, 0.839216, 1 )** --- Orchid color. * **palegoldenrod** = **Color( 0.933333, 0.909804, 0.666667, 1 )** --- Pale goldenrod color. * **palegreen** = **Color( 0.596078, 0.984314, 0.596078, 1 )** --- Pale green color. * **paleturquoise** = **Color( 0.686275, 0.933333, 0.933333, 1 )** --- Pale turquoise color. * **palevioletred** = **Color( 0.858824, 0.439216, 0.576471, 1 )** --- Pale violet red color. * **papayawhip** = **Color( 1, 0.937255, 0.835294, 1 )** --- Papaya whip color. * **peachpuff** = **Color( 1, 0.854902, 0.72549, 1 )** --- Peach puff color. * **peru** = **Color( 0.803922, 0.521569, 0.247059, 1 )** --- Peru color. * **pink** = **Color( 1, 0.752941, 0.796078, 1 )** --- Pink color. * **plum** = **Color( 0.866667, 0.627451, 0.866667, 1 )** --- Plum color. * **powderblue** = **Color( 0.690196, 0.878431, 0.901961, 1 )** --- Powder blue color. * **purple** = **Color( 0.627451, 0.12549, 0.941176, 1 )** --- Purple color. * **rebeccapurple** = **Color( 0.4, 0.2, 0.6, 1 )** --- Rebecca purple color. * **red** = **Color( 1, 0, 0, 1 )** --- Red color. * **rosybrown** = **Color( 0.737255, 0.560784, 0.560784, 1 )** --- Rosy brown color. * **royalblue** = **Color( 0.254902, 0.411765, 0.882353, 1 )** --- Royal blue color. * **saddlebrown** = **Color( 0.545098, 0.270588, 0.0745098, 1 )** --- Saddle brown color. * **salmon** = **Color( 0.980392, 0.501961, 0.447059, 1 )** --- Salmon color. * **sandybrown** = **Color( 0.956863, 0.643137, 0.376471, 1 )** --- Sandy brown color. * **seagreen** = **Color( 0.180392, 0.545098, 0.341176, 1 )** --- Sea green color. * **seashell** = **Color( 1, 0.960784, 0.933333, 1 )** --- Seashell color. * **sienna** = **Color( 0.627451, 0.321569, 0.176471, 1 )** --- Sienna color. * **silver** = **Color( 0.752941, 0.752941, 0.752941, 1 )** --- Silver color. * **skyblue** = **Color( 0.529412, 0.807843, 0.921569, 1 )** --- Sky blue color. * **slateblue** = **Color( 0.415686, 0.352941, 0.803922, 1 )** --- Slate blue color. * **slategray** = **Color( 0.439216, 0.501961, 0.564706, 1 )** --- Slate gray color. * **snow** = **Color( 1, 0.980392, 0.980392, 1 )** --- Snow color. * **springgreen** = **Color( 0, 1, 0.498039, 1 )** --- Spring green color. * **steelblue** = **Color( 0.27451, 0.509804, 0.705882, 1 )** --- Steel blue color. * **tan** = **Color( 0.823529, 0.705882, 0.54902, 1 )** --- Tan color. * **teal** = **Color( 0, 0.501961, 0.501961, 1 )** --- Teal color. * **thistle** = **Color( 0.847059, 0.74902, 0.847059, 1 )** --- Thistle color. * **tomato** = **Color( 1, 0.388235, 0.278431, 1 )** --- Tomato color. * **transparent** = **Color( 1, 1, 1, 0 )** --- Transparent color (white with no alpha). * **turquoise** = **Color( 0.25098, 0.878431, 0.815686, 1 )** --- Turquoise color. * **violet** = **Color( 0.933333, 0.509804, 0.933333, 1 )** --- Violet color. * **webgray** = **Color( 0.501961, 0.501961, 0.501961, 1 )** --- Web gray color. * **webgreen** = **Color( 0, 0.501961, 0, 1 )** --- Web green color. * **webmaroon** = **Color( 0.501961, 0, 0, 1 )** --- Web maroon color. * **webpurple** = **Color( 0.501961, 0, 0.501961, 1 )** --- Web purple color. * **wheat** = **Color( 0.960784, 0.870588, 0.701961, 1 )** --- Wheat color. * **white** = **Color( 1, 1, 1, 1 )** --- White color. * **whitesmoke** = **Color( 0.960784, 0.960784, 0.960784, 1 )** --- White smoke color. * **yellow** = **Color( 1, 1, 0, 1 )** --- Yellow color. * **yellowgreen** = **Color( 0.603922, 0.803922, 0.196078, 1 )** --- Yellow green color. Property Descriptions --------------------- ### [float](class_float#class-float) a | | | | --- | --- | | *Default* | `1.0` | The color's alpha component, typically on the range of 0 to 1. A value of 0 means that the color is fully transparent. A value of 1 means that the color is fully opaque. ### [int](class_int#class-int) a8 | | | | --- | --- | | *Default* | `255` | Wrapper for [a](#class-color-property-a) that uses the range 0 to 255 instead of 0 to 1. ### [float](class_float#class-float) b | | | | --- | --- | | *Default* | `0.0` | The color's blue component, typically on the range of 0 to 1. ### [int](class_int#class-int) b8 | | | | --- | --- | | *Default* | `0` | Wrapper for [b](#class-color-property-b) that uses the range 0 to 255 instead of 0 to 1. ### [float](class_float#class-float) g | | | | --- | --- | | *Default* | `0.0` | The color's green component, typically on the range of 0 to 1. ### [int](class_int#class-int) g8 | | | | --- | --- | | *Default* | `0` | Wrapper for [g](#class-color-property-g) that uses the range 0 to 255 instead of 0 to 1. ### [float](class_float#class-float) h | | | | --- | --- | | *Default* | `0.0` | The HSV hue of this color, on the range 0 to 1. ### [float](class_float#class-float) r | | | | --- | --- | | *Default* | `0.0` | The color's red component, typically on the range of 0 to 1. ### [int](class_int#class-int) r8 | | | | --- | --- | | *Default* | `0` | Wrapper for [r](#class-color-property-r) that uses the range 0 to 255 instead of 0 to 1. ### [float](class_float#class-float) s | | | | --- | --- | | *Default* | `0.0` | The HSV saturation of this color, on the range 0 to 1. ### [float](class_float#class-float) v | | | | --- | --- | | *Default* | `0.0` | The HSV value (brightness) of this color, on the range 0 to 1. Method Descriptions ------------------- ### [Color](#class-color) Color ( [String](class_string#class-string) from ) Constructs a color from an HTML hexadecimal color string in ARGB or RGB format. See also [@GDScript.ColorN](class_%40gdscript#class-gdscript-method-colorn). ``` # Each of the following creates the same color RGBA(178, 217, 10, 255). var c1 = Color("#ffb2d90a") # ARGB format with "#". var c2 = Color("ffb2d90a") # ARGB format. var c3 = Color("#b2d90a") # RGB format with "#". var c4 = Color("b2d90a") # RGB format. ``` * [Color](#class-color) **Color** **(** [int](class_int#class-int) from **)** Constructs a color from a 32-bit integer in RGBA format (each byte represents a color channel). ``` var color = Color(274) # Similar to Color(0.0, 0.0, 0.004, 0.07) ``` * [Color](#class-color) **Color** **(** [float](class_float#class-float) r, [float](class_float#class-float) g, [float](class_float#class-float) b **)** Constructs a color from RGB values, typically between 0 and 1. Alpha will be 1. ``` var color = Color(0.2, 1.0, 0.7) # Similar to Color8(51, 255, 178, 255) ``` * [Color](#class-color) **Color** **(** [float](class_float#class-float) r, [float](class_float#class-float) g, [float](class_float#class-float) b, [float](class_float#class-float) a **)** Constructs a color from RGBA values, typically between 0 and 1. ``` var color = Color(0.2, 1.0, 0.7, 0.8) # Similar to Color8(51, 255, 178, 204) ``` ### [Color](#class-color) blend ( [Color](#class-color) over ) Returns a new color resulting from blending this color over another. If the color is opaque, the result is also opaque. The second color may have a range of alpha values. ``` var bg = Color(0.0, 1.0, 0.0, 0.5) # Green with alpha of 50% var fg = Color(1.0, 0.0, 0.0, 0.5) # Red with alpha of 50% var blended_color = bg.blend(fg) # Brown with alpha of 75% ``` ### [Color](#class-color) contrasted ( ) Returns the most contrasting color. ``` var color = Color(0.3, 0.4, 0.9) var contrasted_color = color.contrasted() # Equivalent to RGBA(204, 229, 102, 255) ``` ### [Color](#class-color) darkened ( [float](class_float#class-float) amount ) Returns a new color resulting from making this color darker by the specified percentage (ratio from 0 to 1). ``` var green = Color(0.0, 1.0, 0.0) var darkgreen = green.darkened(0.2) # 20% darker than regular green ``` ### [Color](#class-color) from\_hsv ( [float](class_float#class-float) h, [float](class_float#class-float) s, [float](class_float#class-float) v, [float](class_float#class-float) a=1.0 ) Constructs a color from an HSV profile. `h`, `s`, and `v` are values between 0 and 1. ``` var color = Color.from_hsv(0.58, 0.5, 0.79, 0.8) # Equivalent to HSV(210, 50, 79, 0.8) or Color8(100, 151, 201, 0.8) ``` ### [float](class_float#class-float) get\_luminance ( ) Returns the luminance of the color in the `[0.0, 1.0]` range. This is useful when determining light or dark color. Colors with a luminance smaller than 0.5 can be generally considered dark. ### [float](class_float#class-float) gray ( ) Returns the color's grayscale representation. The gray value is calculated as `(r + g + b) / 3`. ``` var color = Color(0.2, 0.45, 0.82) var gray = color.gray() # A value of 0.466667 ``` ### [Color](#class-color) inverted ( ) Returns the inverted color `(1 - r, 1 - g, 1 - b, a)`. ``` var color = Color(0.3, 0.4, 0.9) var inverted_color = color.inverted() # Equivalent to Color(0.7, 0.6, 0.1) ``` ### [bool](class_bool#class-bool) is\_equal\_approx ( [Color](#class-color) color ) Returns `true` if this color and `color` are approximately equal, by running [@GDScript.is\_equal\_approx](class_%40gdscript#class-gdscript-method-is-equal-approx) on each component. ### [Color](#class-color) lightened ( [float](class_float#class-float) amount ) Returns a new color resulting from making this color lighter by the specified percentage (ratio from 0 to 1). ``` var green = Color(0.0, 1.0, 0.0) var lightgreen = green.lightened(0.2) # 20% lighter than regular green ``` ### [Color](#class-color) linear\_interpolate ( [Color](#class-color) to, [float](class_float#class-float) weight ) Returns the linear interpolation with another color. The interpolation factor `weight` is between 0 and 1. ``` var c1 = Color(1.0, 0.0, 0.0) var c2 = Color(0.0, 1.0, 0.0) var li_c = c1.linear_interpolate(c2, 0.5) # Equivalent to Color(0.5, 0.5, 0.0) ``` ### [int](class_int#class-int) to\_abgr32 ( ) Returns the color converted to a 32-bit integer in ABGR format (each byte represents a color channel). ABGR is the reversed version of the default format. ``` var color = Color(1, 0.5, 0.2) print(color.to_abgr32()) # Prints 4281565439 ``` ### [int](class_int#class-int) to\_abgr64 ( ) Returns the color converted to a 64-bit integer in ABGR format (each word represents a color channel). ABGR is the reversed version of the default format. ``` var color = Color(1, 0.5, 0.2) print(color.to_abgr64()) # Prints -225178692812801 ``` ### [int](class_int#class-int) to\_argb32 ( ) Returns the color converted to a 32-bit integer in ARGB format (each byte represents a color channel). ARGB is more compatible with DirectX. ``` var color = Color(1, 0.5, 0.2) print(color.to_argb32()) # Prints 4294934323 ``` ### [int](class_int#class-int) to\_argb64 ( ) Returns the color converted to a 64-bit integer in ARGB format (each word represents a color channel). ARGB is more compatible with DirectX. ``` var color = Color(1, 0.5, 0.2) print(color.to_argb64()) # Prints -2147470541 ``` ### [String](class_string#class-string) to\_html ( [bool](class_bool#class-bool) with\_alpha=true ) Returns the color's HTML hexadecimal color string in ARGB format (ex: `ff34f822`). Setting `with_alpha` to `false` excludes alpha from the hexadecimal string. ``` var color = Color(1, 1, 1, 0.5) var s1 = color.to_html() # Returns "7fffffff" var s2 = color.to_html(false) # Returns "ffffff" ``` ### [int](class_int#class-int) to\_rgba32 ( ) Returns the color converted to a 32-bit integer in RGBA format (each byte represents a color channel). RGBA is Godot's default format. ``` var color = Color(1, 0.5, 0.2) print(color.to_rgba32()) # Prints 4286526463 ``` ### [int](class_int#class-int) to\_rgba64 ( ) Returns the color converted to a 64-bit integer in RGBA format (each word represents a color channel). RGBA is Godot's default format. ``` var color = Color(1, 0.5, 0.2) print(color.to_rgba64()) # Prints -140736629309441 ```
programming_docs
godot PackedSceneGLTF PackedSceneGLTF =============== **Inherits:** [PackedScene](class_packedscene#class-packedscene) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Description ----------- **Note:** This class is only compiled in editor builds. Run-time glTF loading and saving is *not* available in exported projects. References to `PackedSceneGLTF` within a script will cause an error in an exported project. Properties ---------- | | | | | --- | --- | --- | | [Dictionary](class_dictionary#class-dictionary) | \_bundled | `{"conn_count": 0,"conns": PoolIntArray(  ),"editable_instances": [  ],"names": PoolStringArray(  ),"node_count": 0,"node_paths": [  ],"nodes": PoolIntArray(  ),"variants": [  ],"version": 2}` (overrides [PackedScene](class_packedscene#class-packedscene-property-bundled)) | Methods ------- | | | | --- | --- | | [Error](class_%40globalscope#enum-globalscope-error) | [export\_gltf](#class-packedscenegltf-method-export-gltf) **(** [Node](class_node#class-node) node, [String](class_string#class-string) path, [int](class_int#class-int) flags=0, [float](class_float#class-float) bake\_fps=1000.0 **)** | | [Node](class_node#class-node) | [import\_gltf\_scene](#class-packedscenegltf-method-import-gltf-scene) **(** [String](class_string#class-string) path, [int](class_int#class-int) flags=0, [float](class_float#class-float) bake\_fps=1000.0, [int](class_int#class-int) compress\_flags=2194432, [GLTFState](class_gltfstate#class-gltfstate) state=null **)** | | void | [pack\_gltf](#class-packedscenegltf-method-pack-gltf) **(** [String](class_string#class-string) path, [int](class_int#class-int) flags=0, [float](class_float#class-float) bake\_fps=1000.0, [int](class_int#class-int) compress\_flags=2194432, [GLTFState](class_gltfstate#class-gltfstate) state=null **)** | Method Descriptions ------------------- ### [Error](class_%40globalscope#enum-globalscope-error) export\_gltf ( [Node](class_node#class-node) node, [String](class_string#class-string) path, [int](class_int#class-int) flags=0, [float](class_float#class-float) bake\_fps=1000.0 ) ### [Node](class_node#class-node) import\_gltf\_scene ( [String](class_string#class-string) path, [int](class_int#class-int) flags=0, [float](class_float#class-float) bake\_fps=1000.0, [int](class_int#class-int) compress\_flags=2194432, [GLTFState](class_gltfstate#class-gltfstate) state=null ) ### void pack\_gltf ( [String](class_string#class-string) path, [int](class_int#class-int) flags=0, [float](class_float#class-float) bake\_fps=1000.0, [int](class_int#class-int) compress\_flags=2194432, [GLTFState](class_gltfstate#class-gltfstate) state=null ) godot ConvexPolygonShape ConvexPolygonShape ================== **Inherits:** [Shape](class_shape#class-shape) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Convex polygon shape for 3D physics. Description ----------- Convex polygon shape resource, which can be added to a [PhysicsBody](class_physicsbody#class-physicsbody) or area. Tutorials --------- * [3D Physics Tests Demo](https://godotengine.org/asset-library/asset/675) Properties ---------- | | | | | --- | --- | --- | | [PoolVector3Array](class_poolvector3array#class-poolvector3array) | [points](#class-convexpolygonshape-property-points) | `PoolVector3Array(  )` | Property Descriptions --------------------- ### [PoolVector3Array](class_poolvector3array#class-poolvector3array) points | | | | --- | --- | | *Default* | `PoolVector3Array(  )` | | *Setter* | set\_points(value) | | *Getter* | get\_points() | The list of 3D points forming the convex polygon shape. godot HBoxContainer HBoxContainer ============= **Inherits:** [BoxContainer](class_boxcontainer#class-boxcontainer) **<** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [EditorResourcePicker](class_editorresourcepicker#class-editorresourcepicker) Horizontal box container. Description ----------- Horizontal box container. See [BoxContainer](class_boxcontainer#class-boxcontainer). Tutorials --------- * [GUI containers](https://docs.godotengine.org/en/3.5/tutorials/ui/gui_containers.html) Theme Properties ---------------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [separation](#class-hboxcontainer-theme-constant-separation) | `4` | Theme Property Descriptions --------------------------- ### [int](class_int#class-int) separation | | | | --- | --- | | *Default* | `4` | The horizontal space between the `HBoxContainer`'s elements. godot Shape Shape ===== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [BoxShape](class_boxshape#class-boxshape), [CapsuleShape](class_capsuleshape#class-capsuleshape), [ConcavePolygonShape](class_concavepolygonshape#class-concavepolygonshape), [ConvexPolygonShape](class_convexpolygonshape#class-convexpolygonshape), [CylinderShape](class_cylindershape#class-cylindershape), [HeightMapShape](class_heightmapshape#class-heightmapshape), [PlaneShape](class_planeshape#class-planeshape), [RayShape](class_rayshape#class-rayshape), [SphereShape](class_sphereshape#class-sphereshape) Base class for all 3D shape resources. Description ----------- Base class for all 3D shape resources. Nodes that inherit from this can be used as shapes for a [PhysicsBody](class_physicsbody#class-physicsbody) or [Area](class_area#class-area) objects. Tutorials --------- * [Physics introduction](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [margin](#class-shape-property-margin) | `0.04` | Methods ------- | | | | --- | --- | | [ArrayMesh](class_arraymesh#class-arraymesh) | [get\_debug\_mesh](#class-shape-method-get-debug-mesh) **(** **)** | Property Descriptions --------------------- ### [float](class_float#class-float) margin | | | | --- | --- | | *Default* | `0.04` | | *Setter* | set\_margin(value) | | *Getter* | get\_margin() | The collision margin for the shape. Used in Bullet Physics only. Collision margins allow collision detection to be more efficient by adding an extra shell around shapes. Collision algorithms are more expensive when objects overlap by more than their margin, so a higher value for margins is better for performance, at the cost of accuracy around edges as it makes them less sharp. Method Descriptions ------------------- ### [ArrayMesh](class_arraymesh#class-arraymesh) get\_debug\_mesh ( ) Returns the [ArrayMesh](class_arraymesh#class-arraymesh) used to draw the debug collision for this `Shape`. godot ViewportContainer ViewportContainer ================= **Inherits:** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Control for holding [Viewport](class_viewport#class-viewport)s. Description ----------- A [Container](class_container#class-container) node that holds a [Viewport](class_viewport#class-viewport), automatically setting its size. **Note:** Changing a ViewportContainer's [Control.rect\_scale](class_control#class-control-property-rect-scale) will cause its contents to appear distorted. To change its visual size without causing distortion, adjust the node's margins instead (if it's not already in a container). Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [stretch](#class-viewportcontainer-property-stretch) | `false` | | [int](class_int#class-int) | [stretch\_shrink](#class-viewportcontainer-property-stretch-shrink) | `1` | Property Descriptions --------------------- ### [bool](class_bool#class-bool) stretch | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_stretch(value) | | *Getter* | is\_stretch\_enabled() | If `true`, the viewport will be scaled to the control's size. ### [int](class_int#class-int) stretch\_shrink | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_stretch\_shrink(value) | | *Getter* | get\_stretch\_shrink() | Divides the viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering. For example, a 1280×720 viewport with [stretch\_shrink](#class-viewportcontainer-property-stretch-shrink) set to `2` will be rendered at 640×360 while occupying the same size in the container. **Note:** [stretch](#class-viewportcontainer-property-stretch) must be `true` for this property to work. godot VisualScriptLists VisualScriptLists ================= **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [VisualScriptComposeArray](class_visualscriptcomposearray#class-visualscriptcomposearray) A Visual Script virtual class for in-graph editable nodes. Description ----------- A Visual Script virtual class that defines the shape and the default behavior of the nodes that have to be in-graph editable nodes. Methods ------- | | | | --- | --- | | void | [add\_input\_data\_port](#class-visualscriptlists-method-add-input-data-port) **(** [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type, [String](class_string#class-string) name, [int](class_int#class-int) index **)** | | void | [add\_output\_data\_port](#class-visualscriptlists-method-add-output-data-port) **(** [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type, [String](class_string#class-string) name, [int](class_int#class-int) index **)** | | void | [remove\_input\_data\_port](#class-visualscriptlists-method-remove-input-data-port) **(** [int](class_int#class-int) index **)** | | void | [remove\_output\_data\_port](#class-visualscriptlists-method-remove-output-data-port) **(** [int](class_int#class-int) index **)** | | void | [set\_input\_data\_port\_name](#class-visualscriptlists-method-set-input-data-port-name) **(** [int](class_int#class-int) index, [String](class_string#class-string) name **)** | | void | [set\_input\_data\_port\_type](#class-visualscriptlists-method-set-input-data-port-type) **(** [int](class_int#class-int) index, [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type **)** | | void | [set\_output\_data\_port\_name](#class-visualscriptlists-method-set-output-data-port-name) **(** [int](class_int#class-int) index, [String](class_string#class-string) name **)** | | void | [set\_output\_data\_port\_type](#class-visualscriptlists-method-set-output-data-port-type) **(** [int](class_int#class-int) index, [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type **)** | Method Descriptions ------------------- ### void add\_input\_data\_port ( [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type, [String](class_string#class-string) name, [int](class_int#class-int) index ) Adds an input port to the Visual Script node. ### void add\_output\_data\_port ( [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type, [String](class_string#class-string) name, [int](class_int#class-int) index ) Adds an output port to the Visual Script node. ### void remove\_input\_data\_port ( [int](class_int#class-int) index ) Removes an input port from the Visual Script node. ### void remove\_output\_data\_port ( [int](class_int#class-int) index ) Removes an output port from the Visual Script node. ### void set\_input\_data\_port\_name ( [int](class_int#class-int) index, [String](class_string#class-string) name ) Sets the name of an input port. ### void set\_input\_data\_port\_type ( [int](class_int#class-int) index, [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type ) Sets the type of an input port. ### void set\_output\_data\_port\_name ( [int](class_int#class-int) index, [String](class_string#class-string) name ) Sets the name of an output port. ### void set\_output\_data\_port\_type ( [int](class_int#class-int) index, [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type ) Sets the type of an output port. godot Animation Animation ========= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Contains data used to animate everything in the engine. Description ----------- An Animation resource contains data used to animate everything in the engine. Animations are divided into tracks, and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track. ``` # This creates an animation that makes the node "Enemy" move to the right by # 100 pixels in 0.5 seconds. var animation = Animation.new() var track_index = animation.add_track(Animation.TYPE_VALUE) animation.track_set_path(track_index, "Enemy:position:x") animation.track_insert_key(track_index, 0.0, 0) animation.track_insert_key(track_index, 0.5, 100) ``` Animations are just data containers, and must be added to nodes such as an [AnimationPlayer](class_animationplayer#class-animationplayer) or [AnimationTreePlayer](class_animationtreeplayer#class-animationtreeplayer) to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check [TrackType](#enum-animation-tracktype) to see available types. Tutorials --------- * [Animation](https://docs.godotengine.org/en/3.5/tutorials/animation/index.html) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [length](#class-animation-property-length) | `1.0` | | [bool](class_bool#class-bool) | [loop](#class-animation-property-loop) | `false` | | [float](class_float#class-float) | [step](#class-animation-property-step) | `0.1` | Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [add\_track](#class-animation-method-add-track) **(** [TrackType](#enum-animation-tracktype) type, [int](class_int#class-int) at\_position=-1 **)** | | [String](class_string#class-string) | [animation\_track\_get\_key\_animation](#class-animation-method-animation-track-get-key-animation) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx **)** const | | [int](class_int#class-int) | [animation\_track\_insert\_key](#class-animation-method-animation-track-insert-key) **(** [int](class_int#class-int) track\_idx, [float](class_float#class-float) time, [String](class_string#class-string) animation **)** | | void | [animation\_track\_set\_key\_animation](#class-animation-method-animation-track-set-key-animation) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [String](class_string#class-string) animation **)** | | [float](class_float#class-float) | [audio\_track\_get\_key\_end\_offset](#class-animation-method-audio-track-get-key-end-offset) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx **)** const | | [float](class_float#class-float) | [audio\_track\_get\_key\_start\_offset](#class-animation-method-audio-track-get-key-start-offset) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx **)** const | | [Resource](class_resource#class-resource) | [audio\_track\_get\_key\_stream](#class-animation-method-audio-track-get-key-stream) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx **)** const | | [int](class_int#class-int) | [audio\_track\_insert\_key](#class-animation-method-audio-track-insert-key) **(** [int](class_int#class-int) track\_idx, [float](class_float#class-float) time, [Resource](class_resource#class-resource) stream, [float](class_float#class-float) start\_offset=0, [float](class_float#class-float) end\_offset=0 **)** | | void | [audio\_track\_set\_key\_end\_offset](#class-animation-method-audio-track-set-key-end-offset) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [float](class_float#class-float) offset **)** | | void | [audio\_track\_set\_key\_start\_offset](#class-animation-method-audio-track-set-key-start-offset) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [float](class_float#class-float) offset **)** | | void | [audio\_track\_set\_key\_stream](#class-animation-method-audio-track-set-key-stream) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [Resource](class_resource#class-resource) stream **)** | | [Vector2](class_vector2#class-vector2) | [bezier\_track\_get\_key\_in\_handle](#class-animation-method-bezier-track-get-key-in-handle) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx **)** const | | [Vector2](class_vector2#class-vector2) | [bezier\_track\_get\_key\_out\_handle](#class-animation-method-bezier-track-get-key-out-handle) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx **)** const | | [float](class_float#class-float) | [bezier\_track\_get\_key\_value](#class-animation-method-bezier-track-get-key-value) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx **)** const | | [int](class_int#class-int) | [bezier\_track\_insert\_key](#class-animation-method-bezier-track-insert-key) **(** [int](class_int#class-int) track\_idx, [float](class_float#class-float) time, [float](class_float#class-float) value, [Vector2](class_vector2#class-vector2) in\_handle=Vector2( 0, 0 ), [Vector2](class_vector2#class-vector2) out\_handle=Vector2( 0, 0 ) **)** | | [float](class_float#class-float) | [bezier\_track\_interpolate](#class-animation-method-bezier-track-interpolate) **(** [int](class_int#class-int) track\_idx, [float](class_float#class-float) time **)** const | | void | [bezier\_track\_set\_key\_in\_handle](#class-animation-method-bezier-track-set-key-in-handle) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [Vector2](class_vector2#class-vector2) in\_handle **)** | | void | [bezier\_track\_set\_key\_out\_handle](#class-animation-method-bezier-track-set-key-out-handle) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [Vector2](class_vector2#class-vector2) out\_handle **)** | | void | [bezier\_track\_set\_key\_value](#class-animation-method-bezier-track-set-key-value) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [float](class_float#class-float) value **)** | | void | [clear](#class-animation-method-clear) **(** **)** | | void | [copy\_track](#class-animation-method-copy-track) **(** [int](class_int#class-int) track\_idx, [Animation](#class-animation) to\_animation **)** | | [int](class_int#class-int) | [find\_track](#class-animation-method-find-track) **(** [NodePath](class_nodepath#class-nodepath) path **)** const | | [int](class_int#class-int) | [get\_track\_count](#class-animation-method-get-track-count) **(** **)** const | | [PoolIntArray](class_poolintarray#class-poolintarray) | [method\_track\_get\_key\_indices](#class-animation-method-method-track-get-key-indices) **(** [int](class_int#class-int) track\_idx, [float](class_float#class-float) time\_sec, [float](class_float#class-float) delta **)** const | | [String](class_string#class-string) | [method\_track\_get\_name](#class-animation-method-method-track-get-name) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx **)** const | | [Array](class_array#class-array) | [method\_track\_get\_params](#class-animation-method-method-track-get-params) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx **)** const | | void | [remove\_track](#class-animation-method-remove-track) **(** [int](class_int#class-int) track\_idx **)** | | [int](class_int#class-int) | [track\_find\_key](#class-animation-method-track-find-key) **(** [int](class_int#class-int) track\_idx, [float](class_float#class-float) time, [bool](class_bool#class-bool) exact=false **)** const | | [bool](class_bool#class-bool) | [track\_get\_interpolation\_loop\_wrap](#class-animation-method-track-get-interpolation-loop-wrap) **(** [int](class_int#class-int) track\_idx **)** const | | [InterpolationType](#enum-animation-interpolationtype) | [track\_get\_interpolation\_type](#class-animation-method-track-get-interpolation-type) **(** [int](class_int#class-int) track\_idx **)** const | | [int](class_int#class-int) | [track\_get\_key\_count](#class-animation-method-track-get-key-count) **(** [int](class_int#class-int) track\_idx **)** const | | [float](class_float#class-float) | [track\_get\_key\_time](#class-animation-method-track-get-key-time) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx **)** const | | [float](class_float#class-float) | [track\_get\_key\_transition](#class-animation-method-track-get-key-transition) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx **)** const | | [Variant](class_variant#class-variant) | [track\_get\_key\_value](#class-animation-method-track-get-key-value) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx **)** const | | [NodePath](class_nodepath#class-nodepath) | [track\_get\_path](#class-animation-method-track-get-path) **(** [int](class_int#class-int) track\_idx **)** const | | [TrackType](#enum-animation-tracktype) | [track\_get\_type](#class-animation-method-track-get-type) **(** [int](class_int#class-int) track\_idx **)** const | | void | [track\_insert\_key](#class-animation-method-track-insert-key) **(** [int](class_int#class-int) track\_idx, [float](class_float#class-float) time, [Variant](class_variant#class-variant) key, [float](class_float#class-float) transition=1 **)** | | [bool](class_bool#class-bool) | [track\_is\_enabled](#class-animation-method-track-is-enabled) **(** [int](class_int#class-int) track\_idx **)** const | | [bool](class_bool#class-bool) | [track\_is\_imported](#class-animation-method-track-is-imported) **(** [int](class_int#class-int) track\_idx **)** const | | void | [track\_move\_down](#class-animation-method-track-move-down) **(** [int](class_int#class-int) track\_idx **)** | | void | [track\_move\_to](#class-animation-method-track-move-to) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) to\_idx **)** | | void | [track\_move\_up](#class-animation-method-track-move-up) **(** [int](class_int#class-int) track\_idx **)** | | void | [track\_remove\_key](#class-animation-method-track-remove-key) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx **)** | | void | [track\_remove\_key\_at\_position](#class-animation-method-track-remove-key-at-position) **(** [int](class_int#class-int) track\_idx, [float](class_float#class-float) position **)** | | void | [track\_set\_enabled](#class-animation-method-track-set-enabled) **(** [int](class_int#class-int) track\_idx, [bool](class_bool#class-bool) enabled **)** | | void | [track\_set\_imported](#class-animation-method-track-set-imported) **(** [int](class_int#class-int) track\_idx, [bool](class_bool#class-bool) imported **)** | | void | [track\_set\_interpolation\_loop\_wrap](#class-animation-method-track-set-interpolation-loop-wrap) **(** [int](class_int#class-int) track\_idx, [bool](class_bool#class-bool) interpolation **)** | | void | [track\_set\_interpolation\_type](#class-animation-method-track-set-interpolation-type) **(** [int](class_int#class-int) track\_idx, [InterpolationType](#enum-animation-interpolationtype) interpolation **)** | | void | [track\_set\_key\_time](#class-animation-method-track-set-key-time) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [float](class_float#class-float) time **)** | | void | [track\_set\_key\_transition](#class-animation-method-track-set-key-transition) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [float](class_float#class-float) transition **)** | | void | [track\_set\_key\_value](#class-animation-method-track-set-key-value) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) key, [Variant](class_variant#class-variant) value **)** | | void | [track\_set\_path](#class-animation-method-track-set-path) **(** [int](class_int#class-int) track\_idx, [NodePath](class_nodepath#class-nodepath) path **)** | | void | [track\_swap](#class-animation-method-track-swap) **(** [int](class_int#class-int) track\_idx, [int](class_int#class-int) with\_idx **)** | | [int](class_int#class-int) | [transform\_track\_insert\_key](#class-animation-method-transform-track-insert-key) **(** [int](class_int#class-int) track\_idx, [float](class_float#class-float) time, [Vector3](class_vector3#class-vector3) location, [Quat](class_quat#class-quat) rotation, [Vector3](class_vector3#class-vector3) scale **)** | | [Array](class_array#class-array) | [transform\_track\_interpolate](#class-animation-method-transform-track-interpolate) **(** [int](class_int#class-int) track\_idx, [float](class_float#class-float) time\_sec **)** const | | [PoolIntArray](class_poolintarray#class-poolintarray) | [value\_track\_get\_key\_indices](#class-animation-method-value-track-get-key-indices) **(** [int](class_int#class-int) track\_idx, [float](class_float#class-float) time\_sec, [float](class_float#class-float) delta **)** const | | [UpdateMode](#enum-animation-updatemode) | [value\_track\_get\_update\_mode](#class-animation-method-value-track-get-update-mode) **(** [int](class_int#class-int) track\_idx **)** const | | [Variant](class_variant#class-variant) | [value\_track\_interpolate](#class-animation-method-value-track-interpolate) **(** [int](class_int#class-int) track\_idx, [float](class_float#class-float) time\_sec **)** const | | void | [value\_track\_set\_update\_mode](#class-animation-method-value-track-set-update-mode) **(** [int](class_int#class-int) track\_idx, [UpdateMode](#enum-animation-updatemode) mode **)** | Signals ------- ### tracks\_changed ( ) Emitted when there's a change in the list of tracks, e.g. tracks are added, moved or have changed paths. Enumerations ------------ enum **TrackType**: * **TYPE\_VALUE** = **0** --- Value tracks set values in node properties, but only those which can be Interpolated. * **TYPE\_TRANSFORM** = **1** --- Transform tracks are used to change node local transforms or skeleton pose bones. Transitions are interpolated. * **TYPE\_METHOD** = **2** --- Method tracks call functions with given arguments per key. * **TYPE\_BEZIER** = **3** --- Bezier tracks are used to interpolate a value using custom curves. They can also be used to animate sub-properties of vectors and colors (e.g. alpha value of a [Color](class_color#class-color)). * **TYPE\_AUDIO** = **4** --- Audio tracks are used to play an audio stream with either type of [AudioStreamPlayer](class_audiostreamplayer#class-audiostreamplayer). The stream can be trimmed and previewed in the animation. * **TYPE\_ANIMATION** = **5** --- Animation tracks play animations in other [AnimationPlayer](class_animationplayer#class-animationplayer) nodes. enum **InterpolationType**: * **INTERPOLATION\_NEAREST** = **0** --- No interpolation (nearest value). * **INTERPOLATION\_LINEAR** = **1** --- Linear interpolation. * **INTERPOLATION\_CUBIC** = **2** --- Cubic interpolation. enum **UpdateMode**: * **UPDATE\_CONTINUOUS** = **0** --- Update between keyframes. * **UPDATE\_DISCRETE** = **1** --- Update at the keyframes and hold the value. * **UPDATE\_TRIGGER** = **2** --- Update at the keyframes. * **UPDATE\_CAPTURE** = **3** --- Same as linear interpolation, but also interpolates from the current value (i.e. dynamically at runtime) if the first key isn't at 0 seconds. Property Descriptions --------------------- ### [float](class_float#class-float) length | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_length(value) | | *Getter* | get\_length() | The total length of the animation (in seconds). **Note:** Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping. ### [bool](class_bool#class-bool) loop | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_loop(value) | | *Getter* | has\_loop() | A flag indicating that the animation must loop. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation. ### [float](class_float#class-float) step | | | | --- | --- | | *Default* | `0.1` | | *Setter* | set\_step(value) | | *Getter* | get\_step() | The animation step value. Method Descriptions ------------------- ### [int](class_int#class-int) add\_track ( [TrackType](#enum-animation-tracktype) type, [int](class_int#class-int) at\_position=-1 ) Adds a track to the Animation. ### [String](class_string#class-string) animation\_track\_get\_key\_animation ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx ) const Returns the animation name at the key identified by `key_idx`. The `track_idx` must be the index of an Animation Track. ### [int](class_int#class-int) animation\_track\_insert\_key ( [int](class_int#class-int) track\_idx, [float](class_float#class-float) time, [String](class_string#class-string) animation ) Inserts a key with value `animation` at the given `time` (in seconds). The `track_idx` must be the index of an Animation Track. ### void animation\_track\_set\_key\_animation ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [String](class_string#class-string) animation ) Sets the key identified by `key_idx` to value `animation`. The `track_idx` must be the index of an Animation Track. ### [float](class_float#class-float) audio\_track\_get\_key\_end\_offset ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx ) const Returns the end offset of the key identified by `key_idx`. The `track_idx` must be the index of an Audio Track. End offset is the number of seconds cut off at the ending of the audio stream. ### [float](class_float#class-float) audio\_track\_get\_key\_start\_offset ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx ) const Returns the start offset of the key identified by `key_idx`. The `track_idx` must be the index of an Audio Track. Start offset is the number of seconds cut off at the beginning of the audio stream. ### [Resource](class_resource#class-resource) audio\_track\_get\_key\_stream ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx ) const Returns the audio stream of the key identified by `key_idx`. The `track_idx` must be the index of an Audio Track. ### [int](class_int#class-int) audio\_track\_insert\_key ( [int](class_int#class-int) track\_idx, [float](class_float#class-float) time, [Resource](class_resource#class-resource) stream, [float](class_float#class-float) start\_offset=0, [float](class_float#class-float) end\_offset=0 ) Inserts an Audio Track key at the given `time` in seconds. The `track_idx` must be the index of an Audio Track. `stream` is the [AudioStream](class_audiostream#class-audiostream) resource to play. `start_offset` is the number of seconds cut off at the beginning of the audio stream, while `end_offset` is at the ending. ### void audio\_track\_set\_key\_end\_offset ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [float](class_float#class-float) offset ) Sets the end offset of the key identified by `key_idx` to value `offset`. The `track_idx` must be the index of an Audio Track. ### void audio\_track\_set\_key\_start\_offset ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [float](class_float#class-float) offset ) Sets the start offset of the key identified by `key_idx` to value `offset`. The `track_idx` must be the index of an Audio Track. ### void audio\_track\_set\_key\_stream ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [Resource](class_resource#class-resource) stream ) Sets the stream of the key identified by `key_idx` to value `stream`. The `track_idx` must be the index of an Audio Track. ### [Vector2](class_vector2#class-vector2) bezier\_track\_get\_key\_in\_handle ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx ) const Returns the in handle of the key identified by `key_idx`. The `track_idx` must be the index of a Bezier Track. ### [Vector2](class_vector2#class-vector2) bezier\_track\_get\_key\_out\_handle ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx ) const Returns the out handle of the key identified by `key_idx`. The `track_idx` must be the index of a Bezier Track. ### [float](class_float#class-float) bezier\_track\_get\_key\_value ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx ) const Returns the value of the key identified by `key_idx`. The `track_idx` must be the index of a Bezier Track. ### [int](class_int#class-int) bezier\_track\_insert\_key ( [int](class_int#class-int) track\_idx, [float](class_float#class-float) time, [float](class_float#class-float) value, [Vector2](class_vector2#class-vector2) in\_handle=Vector2( 0, 0 ), [Vector2](class_vector2#class-vector2) out\_handle=Vector2( 0, 0 ) ) Inserts a Bezier Track key at the given `time` in seconds. The `track_idx` must be the index of a Bezier Track. `in_handle` is the left-side weight of the added Bezier curve point, `out_handle` is the right-side one, while `value` is the actual value at this point. ### [float](class_float#class-float) bezier\_track\_interpolate ( [int](class_int#class-int) track\_idx, [float](class_float#class-float) time ) const Returns the interpolated value at the given `time` (in seconds). The `track_idx` must be the index of a Bezier Track. ### void bezier\_track\_set\_key\_in\_handle ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [Vector2](class_vector2#class-vector2) in\_handle ) Sets the in handle of the key identified by `key_idx` to value `in_handle`. The `track_idx` must be the index of a Bezier Track. ### void bezier\_track\_set\_key\_out\_handle ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [Vector2](class_vector2#class-vector2) out\_handle ) Sets the out handle of the key identified by `key_idx` to value `out_handle`. The `track_idx` must be the index of a Bezier Track. ### void bezier\_track\_set\_key\_value ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [float](class_float#class-float) value ) Sets the value of the key identified by `key_idx` to the given value. The `track_idx` must be the index of a Bezier Track. ### void clear ( ) Clear the animation (clear all tracks and reset all). ### void copy\_track ( [int](class_int#class-int) track\_idx, [Animation](#class-animation) to\_animation ) Adds a new track that is a copy of the given track from `to_animation`. ### [int](class_int#class-int) find\_track ( [NodePath](class_nodepath#class-nodepath) path ) const Returns the index of the specified track. If the track is not found, return -1. ### [int](class_int#class-int) get\_track\_count ( ) const Returns the amount of tracks in the animation. ### [PoolIntArray](class_poolintarray#class-poolintarray) method\_track\_get\_key\_indices ( [int](class_int#class-int) track\_idx, [float](class_float#class-float) time\_sec, [float](class_float#class-float) delta ) const Returns all the key indices of a method track, given a position and delta time. ### [String](class_string#class-string) method\_track\_get\_name ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx ) const Returns the method name of a method track. ### [Array](class_array#class-array) method\_track\_get\_params ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx ) const Returns the arguments values to be called on a method track for a given key in a given track. ### void remove\_track ( [int](class_int#class-int) track\_idx ) Removes a track by specifying the track index. ### [int](class_int#class-int) track\_find\_key ( [int](class_int#class-int) track\_idx, [float](class_float#class-float) time, [bool](class_bool#class-bool) exact=false ) const Finds the key index by time in a given track. Optionally, only find it if the exact time is given. ### [bool](class_bool#class-bool) track\_get\_interpolation\_loop\_wrap ( [int](class_int#class-int) track\_idx ) const Returns `true` if the track at `idx` wraps the interpolation loop. New tracks wrap the interpolation loop by default. ### [InterpolationType](#enum-animation-interpolationtype) track\_get\_interpolation\_type ( [int](class_int#class-int) track\_idx ) const Returns the interpolation type of a given track. ### [int](class_int#class-int) track\_get\_key\_count ( [int](class_int#class-int) track\_idx ) const Returns the amount of keys in a given track. ### [float](class_float#class-float) track\_get\_key\_time ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx ) const Returns the time at which the key is located. ### [float](class_float#class-float) track\_get\_key\_transition ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx ) const Returns the transition curve (easing) for a specific key (see the built-in math function [@GDScript.ease](class_%40gdscript#class-gdscript-method-ease)). ### [Variant](class_variant#class-variant) track\_get\_key\_value ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx ) const Returns the value of a given key in a given track. ### [NodePath](class_nodepath#class-nodepath) track\_get\_path ( [int](class_int#class-int) track\_idx ) const Gets the path of a track. For more information on the path format, see [track\_set\_path](#class-animation-method-track-set-path). ### [TrackType](#enum-animation-tracktype) track\_get\_type ( [int](class_int#class-int) track\_idx ) const Gets the type of a track. ### void track\_insert\_key ( [int](class_int#class-int) track\_idx, [float](class_float#class-float) time, [Variant](class_variant#class-variant) key, [float](class_float#class-float) transition=1 ) Insert a generic key in a given track. ### [bool](class_bool#class-bool) track\_is\_enabled ( [int](class_int#class-int) track\_idx ) const Returns `true` if the track at index `idx` is enabled. ### [bool](class_bool#class-bool) track\_is\_imported ( [int](class_int#class-int) track\_idx ) const Returns `true` if the given track is imported. Else, return `false`. ### void track\_move\_down ( [int](class_int#class-int) track\_idx ) Moves a track down. ### void track\_move\_to ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) to\_idx ) Changes the index position of track `idx` to the one defined in `to_idx`. ### void track\_move\_up ( [int](class_int#class-int) track\_idx ) Moves a track up. ### void track\_remove\_key ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx ) Removes a key by index in a given track. ### void track\_remove\_key\_at\_position ( [int](class_int#class-int) track\_idx, [float](class_float#class-float) position ) Removes a key by position (seconds) in a given track. ### void track\_set\_enabled ( [int](class_int#class-int) track\_idx, [bool](class_bool#class-bool) enabled ) Enables/disables the given track. Tracks are enabled by default. ### void track\_set\_imported ( [int](class_int#class-int) track\_idx, [bool](class_bool#class-bool) imported ) Sets the given track as imported or not. ### void track\_set\_interpolation\_loop\_wrap ( [int](class_int#class-int) track\_idx, [bool](class_bool#class-bool) interpolation ) If `true`, the track at `idx` wraps the interpolation loop. ### void track\_set\_interpolation\_type ( [int](class_int#class-int) track\_idx, [InterpolationType](#enum-animation-interpolationtype) interpolation ) Sets the interpolation type of a given track. ### void track\_set\_key\_time ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [float](class_float#class-float) time ) Sets the time of an existing key. ### void track\_set\_key\_transition ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key\_idx, [float](class_float#class-float) transition ) Sets the transition curve (easing) for a specific key (see the built-in math function [@GDScript.ease](class_%40gdscript#class-gdscript-method-ease)). ### void track\_set\_key\_value ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) key, [Variant](class_variant#class-variant) value ) Sets the value of an existing key. ### void track\_set\_path ( [int](class_int#class-int) track\_idx, [NodePath](class_nodepath#class-nodepath) path ) Sets the path of a track. Paths must be valid scene-tree paths to a node and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by `":"`. For example, `"character/skeleton:ankle"` or `"character/mesh:transform/local"`. ### void track\_swap ( [int](class_int#class-int) track\_idx, [int](class_int#class-int) with\_idx ) Swaps the track `idx`'s index position with the track `with_idx`. ### [int](class_int#class-int) transform\_track\_insert\_key ( [int](class_int#class-int) track\_idx, [float](class_float#class-float) time, [Vector3](class_vector3#class-vector3) location, [Quat](class_quat#class-quat) rotation, [Vector3](class_vector3#class-vector3) scale ) Insert a transform key for a transform track. ### [Array](class_array#class-array) transform\_track\_interpolate ( [int](class_int#class-int) track\_idx, [float](class_float#class-float) time\_sec ) const Returns the interpolated value of a transform track at a given time (in seconds). An array consisting of 3 elements: position ([Vector3](class_vector3#class-vector3)), rotation ([Quat](class_quat#class-quat)) and scale ([Vector3](class_vector3#class-vector3)). ### [PoolIntArray](class_poolintarray#class-poolintarray) value\_track\_get\_key\_indices ( [int](class_int#class-int) track\_idx, [float](class_float#class-float) time\_sec, [float](class_float#class-float) delta ) const Returns all the key indices of a value track, given a position and delta time. ### [UpdateMode](#enum-animation-updatemode) value\_track\_get\_update\_mode ( [int](class_int#class-int) track\_idx ) const Returns the update mode of a value track. ### [Variant](class_variant#class-variant) value\_track\_interpolate ( [int](class_int#class-int) track\_idx, [float](class_float#class-float) time\_sec ) const Returns the interpolated value at the given time (in seconds). The `track_idx` must be the index of a value track. ### void value\_track\_set\_update\_mode ( [int](class_int#class-int) track\_idx, [UpdateMode](#enum-animation-updatemode) mode ) Sets the update mode (see [UpdateMode](#enum-animation-updatemode)) of a value track.
programming_docs
godot X509Certificate X509Certificate =============== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) An X509 certificate (e.g. for SSL). Description ----------- The X509Certificate class represents an X509 certificate. Certificates can be loaded and saved like any other [Resource](class_resource#class-resource). They can be used as the server certificate in [StreamPeerSSL.accept\_stream](class_streampeerssl#class-streampeerssl-method-accept-stream) (along with the proper [CryptoKey](class_cryptokey#class-cryptokey)), and to specify the only certificate that should be accepted when connecting to an SSL server via [StreamPeerSSL.connect\_to\_stream](class_streampeerssl#class-streampeerssl-method-connect-to-stream). Methods ------- | | | | --- | --- | | [Error](class_%40globalscope#enum-globalscope-error) | [load](#class-x509certificate-method-load) **(** [String](class_string#class-string) path **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [save](#class-x509certificate-method-save) **(** [String](class_string#class-string) path **)** | Method Descriptions ------------------- ### [Error](class_%40globalscope#enum-globalscope-error) load ( [String](class_string#class-string) path ) Loads a certificate from `path` ("\*.crt" file). ### [Error](class_%40globalscope#enum-globalscope-error) save ( [String](class_string#class-string) path ) Saves a certificate to the given `path` (should be a "\*.crt" file). godot VisualShaderNodeCustom VisualShaderNodeCustom ====================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Virtual class to define custom [VisualShaderNode](class_visualshadernode#class-visualshadernode)s for use in the Visual Shader Editor. Description ----------- By inheriting this class you can create a custom [VisualShader](class_visualshader#class-visualshader) script addon which will be automatically added to the Visual Shader Editor. The [VisualShaderNode](class_visualshadernode#class-visualshadernode)'s behavior is defined by overriding the provided virtual methods. In order for the node to be registered as an editor addon, you must use the `tool` keyword and provide a `class_name` for your custom script. For example: ``` tool extends VisualShaderNodeCustom class_name VisualShaderNodeNoise ``` Tutorials --------- * [Visual Shader plugins](https://docs.godotengine.org/en/3.5/tutorials/plugins/editor/visual_shader_plugins.html) Methods ------- | | | | --- | --- | | [String](class_string#class-string) | [\_get\_category](#class-visualshadernodecustom-method-get-category) **(** **)** virtual | | [String](class_string#class-string) | [\_get\_code](#class-visualshadernodecustom-method-get-code) **(** [Array](class_array#class-array) input\_vars, [Array](class_array#class-array) output\_vars, [int](class_int#class-int) mode, [int](class_int#class-int) type **)** virtual | | [String](class_string#class-string) | [\_get\_description](#class-visualshadernodecustom-method-get-description) **(** **)** virtual | | [String](class_string#class-string) | [\_get\_global\_code](#class-visualshadernodecustom-method-get-global-code) **(** [int](class_int#class-int) mode **)** virtual | | [int](class_int#class-int) | [\_get\_input\_port\_count](#class-visualshadernodecustom-method-get-input-port-count) **(** **)** virtual | | [String](class_string#class-string) | [\_get\_input\_port\_name](#class-visualshadernodecustom-method-get-input-port-name) **(** [int](class_int#class-int) port **)** virtual | | [int](class_int#class-int) | [\_get\_input\_port\_type](#class-visualshadernodecustom-method-get-input-port-type) **(** [int](class_int#class-int) port **)** virtual | | [String](class_string#class-string) | [\_get\_name](#class-visualshadernodecustom-method-get-name) **(** **)** virtual | | [int](class_int#class-int) | [\_get\_output\_port\_count](#class-visualshadernodecustom-method-get-output-port-count) **(** **)** virtual | | [String](class_string#class-string) | [\_get\_output\_port\_name](#class-visualshadernodecustom-method-get-output-port-name) **(** [int](class_int#class-int) port **)** virtual | | [int](class_int#class-int) | [\_get\_output\_port\_type](#class-visualshadernodecustom-method-get-output-port-type) **(** [int](class_int#class-int) port **)** virtual | | [int](class_int#class-int) | [\_get\_return\_icon\_type](#class-visualshadernodecustom-method-get-return-icon-type) **(** **)** virtual | | [String](class_string#class-string) | [\_get\_subcategory](#class-visualshadernodecustom-method-get-subcategory) **(** **)** virtual | Method Descriptions ------------------- ### [String](class_string#class-string) \_get\_category ( ) virtual Override this method to define the category of the associated custom node in the Visual Shader Editor's members dialog. The path may look like `"MyGame/MyFunctions/Noise"`. Defining this method is **optional**. If not overridden, the node will be filed under the "Custom" category. ### [String](class_string#class-string) \_get\_code ( [Array](class_array#class-array) input\_vars, [Array](class_array#class-array) output\_vars, [int](class_int#class-int) mode, [int](class_int#class-int) type ) virtual Override this method to define the actual shader code of the associated custom node. The shader code should be returned as a string, which can have multiple lines (the `"""` multiline string construct can be used for convenience). The `input_vars` and `output_vars` arrays contain the string names of the various input and output variables, as defined by `_get_input_*` and `_get_output_*` virtual methods in this class. The output ports can be assigned values in the shader code. For example, `return output_vars[0] + " = " + input_vars[0] + ";"`. You can customize the generated code based on the shader `mode` (see [Mode](class_shader#enum-shader-mode)) and/or `type` (see [Type](class_visualshader#enum-visualshader-type)). Defining this method is **required**. ### [String](class_string#class-string) \_get\_description ( ) virtual Override this method to define the description of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is **optional**. ### [String](class_string#class-string) \_get\_global\_code ( [int](class_int#class-int) mode ) virtual Override this method to add shader code on top of the global shader, to define your own standard library of reusable methods, varyings, constants, uniforms, etc. The shader code should be returned as a string, which can have multiple lines (the `"""` multiline string construct can be used for convenience). Be careful with this functionality as it can cause name conflicts with other custom nodes, so be sure to give the defined entities unique names. You can customize the generated code based on the shader `mode` (see [Mode](class_shader#enum-shader-mode)). Defining this method is **optional**. ### [int](class_int#class-int) \_get\_input\_port\_count ( ) virtual Override this method to define the amount of input ports of the associated custom node. Defining this method is **required**. If not overridden, the node has no input ports. ### [String](class_string#class-string) \_get\_input\_port\_name ( [int](class_int#class-int) port ) virtual Override this method to define the names of input ports of the associated custom node. The names are used both for the input slots in the editor and as identifiers in the shader code, and are passed in the `input_vars` array in [\_get\_code](#class-visualshadernodecustom-method-get-code). Defining this method is **optional**, but recommended. If not overridden, input ports are named as `"in" + str(port)`. ### [int](class_int#class-int) \_get\_input\_port\_type ( [int](class_int#class-int) port ) virtual Override this method to define the returned type of each input port of the associated custom node (see [PortType](class_visualshadernode#enum-visualshadernode-porttype) for possible types). Defining this method is **optional**, but recommended. If not overridden, input ports will return the [VisualShaderNode.PORT\_TYPE\_SCALAR](class_visualshadernode#class-visualshadernode-constant-port-type-scalar) type. ### [String](class_string#class-string) \_get\_name ( ) virtual Override this method to define the name of the associated custom node in the Visual Shader Editor's members dialog and graph. Defining this method is **optional**, but recommended. If not overridden, the node will be named as "Unnamed". ### [int](class_int#class-int) \_get\_output\_port\_count ( ) virtual Override this method to define the amount of output ports of the associated custom node. Defining this method is **required**. If not overridden, the node has no output ports. ### [String](class_string#class-string) \_get\_output\_port\_name ( [int](class_int#class-int) port ) virtual Override this method to define the names of output ports of the associated custom node. The names are used both for the output slots in the editor and as identifiers in the shader code, and are passed in the `output_vars` array in [\_get\_code](#class-visualshadernodecustom-method-get-code). Defining this method is **optional**, but recommended. If not overridden, output ports are named as `"out" + str(port)`. ### [int](class_int#class-int) \_get\_output\_port\_type ( [int](class_int#class-int) port ) virtual Override this method to define the returned type of each output port of the associated custom node (see [PortType](class_visualshadernode#enum-visualshadernode-porttype) for possible types). Defining this method is **optional**, but recommended. If not overridden, output ports will return the [VisualShaderNode.PORT\_TYPE\_SCALAR](class_visualshadernode#class-visualshadernode-constant-port-type-scalar) type. ### [int](class_int#class-int) \_get\_return\_icon\_type ( ) virtual Override this method to define the return icon of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is **optional**. If not overridden, no return icon is shown. ### [String](class_string#class-string) \_get\_subcategory ( ) virtual Override this method to define the subcategory of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is **optional**. If not overridden, the node will be filed under the root of the main category (see [\_get\_category](#class-visualshadernodecustom-method-get-category)). godot StreamTexture StreamTexture ============= **Inherits:** [Texture](class_texture#class-texture) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A `.stex` texture. Description ----------- A texture that is loaded from a `.stex` file. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | flags | `0` (overrides [Texture](class_texture#class-texture-property-flags)) | | [String](class_string#class-string) | [load\_path](#class-streamtexture-property-load-path) | `""` | Methods ------- | | | | --- | --- | | [Error](class_%40globalscope#enum-globalscope-error) | [load](#class-streamtexture-method-load) **(** [String](class_string#class-string) path **)** | Property Descriptions --------------------- ### [String](class_string#class-string) load\_path | | | | --- | --- | | *Default* | `""` | | *Setter* | load(value) | | *Getter* | get\_load\_path() | The StreamTexture's file path to a `.stex` file. Method Descriptions ------------------- ### [Error](class_%40globalscope#enum-globalscope-error) load ( [String](class_string#class-string) path ) Loads the texture from the given path. godot Light2D Light2D ======= **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Casts light in a 2D environment. Description ----------- Casts light in a 2D environment. Light is defined by a (usually grayscale) texture, a color, an energy value, a mode (see constants), and various other parameters (range and shadows-related). **Note:** Light2D can also be used as a mask. Tutorials --------- * [2D lights and shadows](https://docs.godotengine.org/en/3.5/tutorials/2d/2d_lights_and_shadows.html) Properties ---------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [color](#class-light2d-property-color) | `Color( 1, 1, 1, 1 )` | | [bool](class_bool#class-bool) | [editor\_only](#class-light2d-property-editor-only) | `false` | | [bool](class_bool#class-bool) | [enabled](#class-light2d-property-enabled) | `true` | | [float](class_float#class-float) | [energy](#class-light2d-property-energy) | `1.0` | | [Mode](#enum-light2d-mode) | [mode](#class-light2d-property-mode) | `0` | | [Vector2](class_vector2#class-vector2) | [offset](#class-light2d-property-offset) | `Vector2( 0, 0 )` | | [float](class_float#class-float) | [range\_height](#class-light2d-property-range-height) | `0.0` | | [int](class_int#class-int) | [range\_item\_cull\_mask](#class-light2d-property-range-item-cull-mask) | `1` | | [int](class_int#class-int) | [range\_layer\_max](#class-light2d-property-range-layer-max) | `0` | | [int](class_int#class-int) | [range\_layer\_min](#class-light2d-property-range-layer-min) | `0` | | [int](class_int#class-int) | [range\_z\_max](#class-light2d-property-range-z-max) | `1024` | | [int](class_int#class-int) | [range\_z\_min](#class-light2d-property-range-z-min) | `-1024` | | [int](class_int#class-int) | [shadow\_buffer\_size](#class-light2d-property-shadow-buffer-size) | `2048` | | [Color](class_color#class-color) | [shadow\_color](#class-light2d-property-shadow-color) | `Color( 0, 0, 0, 0 )` | | [bool](class_bool#class-bool) | [shadow\_enabled](#class-light2d-property-shadow-enabled) | `false` | | [ShadowFilter](#enum-light2d-shadowfilter) | [shadow\_filter](#class-light2d-property-shadow-filter) | `0` | | [float](class_float#class-float) | [shadow\_filter\_smooth](#class-light2d-property-shadow-filter-smooth) | `0.0` | | [float](class_float#class-float) | [shadow\_gradient\_length](#class-light2d-property-shadow-gradient-length) | `0.0` | | [int](class_int#class-int) | [shadow\_item\_cull\_mask](#class-light2d-property-shadow-item-cull-mask) | `1` | | [Texture](class_texture#class-texture) | [texture](#class-light2d-property-texture) | | | [float](class_float#class-float) | [texture\_scale](#class-light2d-property-texture-scale) | `1.0` | Enumerations ------------ enum **Mode**: * **MODE\_ADD** = **0** --- Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light. * **MODE\_SUB** = **1** --- Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect. * **MODE\_MIX** = **2** --- Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation. * **MODE\_MASK** = **3** --- The light texture of the Light2D is used as a mask, hiding or revealing parts of the screen underneath depending on the value of each pixel of the light (mask) texture. enum **ShadowFilter**: * **SHADOW\_FILTER\_NONE** = **0** --- No filter applies to the shadow map. See [shadow\_filter](#class-light2d-property-shadow-filter). * **SHADOW\_FILTER\_PCF3** = **1** --- Percentage closer filtering (3 samples) applies to the shadow map. See [shadow\_filter](#class-light2d-property-shadow-filter). * **SHADOW\_FILTER\_PCF5** = **2** --- Percentage closer filtering (5 samples) applies to the shadow map. See [shadow\_filter](#class-light2d-property-shadow-filter). * **SHADOW\_FILTER\_PCF7** = **3** --- Percentage closer filtering (7 samples) applies to the shadow map. See [shadow\_filter](#class-light2d-property-shadow-filter). * **SHADOW\_FILTER\_PCF9** = **4** --- Percentage closer filtering (9 samples) applies to the shadow map. See [shadow\_filter](#class-light2d-property-shadow-filter). * **SHADOW\_FILTER\_PCF13** = **5** --- Percentage closer filtering (13 samples) applies to the shadow map. See [shadow\_filter](#class-light2d-property-shadow-filter). Property Descriptions --------------------- ### [Color](class_color#class-color) color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_color(value) | | *Getter* | get\_color() | The Light2D's [Color](class_color#class-color). ### [bool](class_bool#class-bool) editor\_only | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_editor\_only(value) | | *Getter* | is\_editor\_only() | If `true`, Light2D will only appear when editing the scene. ### [bool](class_bool#class-bool) enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_enabled(value) | | *Getter* | is\_enabled() | If `true`, Light2D will emit light. ### [float](class_float#class-float) energy | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_energy(value) | | *Getter* | get\_energy() | The Light2D's energy value. The larger the value, the stronger the light. ### [Mode](#enum-light2d-mode) mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_mode(value) | | *Getter* | get\_mode() | The Light2D's mode. See [Mode](#enum-light2d-mode) constants for values. ### [Vector2](class_vector2#class-vector2) offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_texture\_offset(value) | | *Getter* | get\_texture\_offset() | The offset of the Light2D's `texture`. ### [float](class_float#class-float) range\_height | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_height(value) | | *Getter* | get\_height() | The height of the Light2D. Used with 2D normal mapping. ### [int](class_int#class-int) range\_item\_cull\_mask | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_item\_cull\_mask(value) | | *Getter* | get\_item\_cull\_mask() | The layer mask. Only objects with a matching mask will be affected by the Light2D. ### [int](class_int#class-int) range\_layer\_max | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_layer\_range\_max(value) | | *Getter* | get\_layer\_range\_max() | Maximum layer value of objects that are affected by the Light2D. ### [int](class_int#class-int) range\_layer\_min | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_layer\_range\_min(value) | | *Getter* | get\_layer\_range\_min() | Minimum layer value of objects that are affected by the Light2D. ### [int](class_int#class-int) range\_z\_max | | | | --- | --- | | *Default* | `1024` | | *Setter* | set\_z\_range\_max(value) | | *Getter* | get\_z\_range\_max() | Maximum `z` value of objects that are affected by the Light2D. ### [int](class_int#class-int) range\_z\_min | | | | --- | --- | | *Default* | `-1024` | | *Setter* | set\_z\_range\_min(value) | | *Getter* | get\_z\_range\_min() | Minimum `z` value of objects that are affected by the Light2D. ### [int](class_int#class-int) shadow\_buffer\_size | | | | --- | --- | | *Default* | `2048` | | *Setter* | set\_shadow\_buffer\_size(value) | | *Getter* | get\_shadow\_buffer\_size() | Shadow buffer size. ### [Color](class_color#class-color) shadow\_color | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 0 )` | | *Setter* | set\_shadow\_color(value) | | *Getter* | get\_shadow\_color() | [Color](class_color#class-color) of shadows cast by the Light2D. ### [bool](class_bool#class-bool) shadow\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_shadow\_enabled(value) | | *Getter* | is\_shadow\_enabled() | If `true`, the Light2D will cast shadows. ### [ShadowFilter](#enum-light2d-shadowfilter) shadow\_filter | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_shadow\_filter(value) | | *Getter* | get\_shadow\_filter() | Shadow filter type. See [ShadowFilter](#enum-light2d-shadowfilter) for possible values. ### [float](class_float#class-float) shadow\_filter\_smooth | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_shadow\_smooth(value) | | *Getter* | get\_shadow\_smooth() | Smoothing value for shadows. ### [float](class_float#class-float) shadow\_gradient\_length | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_shadow\_gradient\_length(value) | | *Getter* | get\_shadow\_gradient\_length() | Smooth shadow gradient length. ### [int](class_int#class-int) shadow\_item\_cull\_mask | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_item\_shadow\_cull\_mask(value) | | *Getter* | get\_item\_shadow\_cull\_mask() | The shadow mask. Used with [LightOccluder2D](class_lightoccluder2d#class-lightoccluder2d) to cast shadows. Only occluders with a matching light mask will cast shadows. ### [Texture](class_texture#class-texture) texture | | | | --- | --- | | *Setter* | set\_texture(value) | | *Getter* | get\_texture() | [Texture](class_texture#class-texture) used for the Light2D's appearance. ### [float](class_float#class-float) texture\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_texture\_scale(value) | | *Getter* | get\_texture\_scale() | The `texture`'s scale factor.
programming_docs
godot AudioBusLayout AudioBusLayout ============== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Stores information about the audio buses. Description ----------- Stores position, muting, solo, bypass, effects, effect position, volume, and the connections between buses. See [AudioServer](class_audioserver#class-audioserver) for usage. godot DTLSServer DTLSServer ========== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Helper class to implement a DTLS server. Description ----------- This class is used to store the state of a DTLS server. Upon [setup](#class-dtlsserver-method-setup) it converts connected [PacketPeerUDP](class_packetpeerudp#class-packetpeerudp) to [PacketPeerDTLS](class_packetpeerdtls#class-packetpeerdtls) accepting them via [take\_connection](#class-dtlsserver-method-take-connection) as DTLS clients. Under the hood, this class is used to store the DTLS state and cookies of the server. The reason of why the state and cookies are needed is outside of the scope of this documentation. Below a small example of how to use it: ``` # server.gd extends Node var dtls := DTLSServer.new() var server := UDPServer.new() var peers = [] func _ready(): server.listen(4242) var key = load("key.key") # Your private key. var cert = load("cert.crt") # Your X509 certificate. dtls.setup(key, cert) func _process(delta): while server.is_connection_available(): var peer : PacketPeerUDP = server.take_connection() var dtls_peer : PacketPeerDTLS = dtls.take_connection(peer) if dtls_peer.get_status() != PacketPeerDTLS.STATUS_HANDSHAKING: continue # It is normal that 50% of the connections fails due to cookie exchange. print("Peer connected!") peers.append(dtls_peer) for p in peers: p.poll() # Must poll to update the state. if p.get_status() == PacketPeerDTLS.STATUS_CONNECTED: while p.get_available_packet_count() > 0: print("Received message from client: %s" % p.get_packet().get_string_from_utf8()) p.put_packet("Hello DTLS client".to_utf8()) ``` ``` # client.gd extends Node var dtls := PacketPeerDTLS.new() var udp := PacketPeerUDP.new() var connected = false func _ready(): udp.connect_to_host("127.0.0.1", 4242) dtls.connect_to_peer(udp, false) # Use true in production for certificate validation! func _process(delta): dtls.poll() if dtls.get_status() == PacketPeerDTLS.STATUS_CONNECTED: if !connected: # Try to contact server dtls.put_packet("The answer is... 42!".to_utf8()) while dtls.get_available_packet_count() > 0: print("Connected: %s" % dtls.get_packet().get_string_from_utf8()) connected = true ``` Methods ------- | | | | --- | --- | | [Error](class_%40globalscope#enum-globalscope-error) | [setup](#class-dtlsserver-method-setup) **(** [CryptoKey](class_cryptokey#class-cryptokey) key, [X509Certificate](class_x509certificate#class-x509certificate) certificate, [X509Certificate](class_x509certificate#class-x509certificate) chain=null **)** | | [PacketPeerDTLS](class_packetpeerdtls#class-packetpeerdtls) | [take\_connection](#class-dtlsserver-method-take-connection) **(** [PacketPeerUDP](class_packetpeerudp#class-packetpeerudp) udp\_peer **)** | Method Descriptions ------------------- ### [Error](class_%40globalscope#enum-globalscope-error) setup ( [CryptoKey](class_cryptokey#class-cryptokey) key, [X509Certificate](class_x509certificate#class-x509certificate) certificate, [X509Certificate](class_x509certificate#class-x509certificate) chain=null ) Setup the DTLS server to use the given `private_key` and provide the given `certificate` to clients. You can pass the optional `chain` parameter to provide additional CA chain information along with the certificate. ### [PacketPeerDTLS](class_packetpeerdtls#class-packetpeerdtls) take\_connection ( [PacketPeerUDP](class_packetpeerudp#class-packetpeerudp) udp\_peer ) Try to initiate the DTLS handshake with the given `udp_peer` which must be already connected (see [PacketPeerUDP.connect\_to\_host](class_packetpeerudp#class-packetpeerudp-method-connect-to-host)). **Note:** You must check that the state of the return PacketPeerUDP is [PacketPeerDTLS.STATUS\_HANDSHAKING](class_packetpeerdtls#class-packetpeerdtls-constant-status-handshaking), as it is normal that 50% of the new connections will be invalid due to cookie exchange. godot EditorExportPlugin EditorExportPlugin ================== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A script that is executed when exporting the project. Description ----------- `EditorExportPlugin`s are automatically invoked whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, [\_export\_begin](#class-editorexportplugin-method-export-begin) is called at the beginning of the export process and then [\_export\_file](#class-editorexportplugin-method-export-file) is called for each exported file. To use `EditorExportPlugin`, register it using the [EditorPlugin.add\_export\_plugin](class_editorplugin#class-editorplugin-method-add-export-plugin) method first. Methods ------- | | | | --- | --- | | void | [\_export\_begin](#class-editorexportplugin-method-export-begin) **(** [PoolStringArray](class_poolstringarray#class-poolstringarray) features, [bool](class_bool#class-bool) is\_debug, [String](class_string#class-string) path, [int](class_int#class-int) flags **)** virtual | | void | [\_export\_end](#class-editorexportplugin-method-export-end) **(** **)** virtual | | void | [\_export\_file](#class-editorexportplugin-method-export-file) **(** [String](class_string#class-string) path, [String](class_string#class-string) type, [PoolStringArray](class_poolstringarray#class-poolstringarray) features **)** virtual | | void | [add\_file](#class-editorexportplugin-method-add-file) **(** [String](class_string#class-string) path, [PoolByteArray](class_poolbytearray#class-poolbytearray) file, [bool](class_bool#class-bool) remap **)** | | void | [add\_ios\_bundle\_file](#class-editorexportplugin-method-add-ios-bundle-file) **(** [String](class_string#class-string) path **)** | | void | [add\_ios\_cpp\_code](#class-editorexportplugin-method-add-ios-cpp-code) **(** [String](class_string#class-string) code **)** | | void | [add\_ios\_embedded\_framework](#class-editorexportplugin-method-add-ios-embedded-framework) **(** [String](class_string#class-string) path **)** | | void | [add\_ios\_framework](#class-editorexportplugin-method-add-ios-framework) **(** [String](class_string#class-string) path **)** | | void | [add\_ios\_linker\_flags](#class-editorexportplugin-method-add-ios-linker-flags) **(** [String](class_string#class-string) flags **)** | | void | [add\_ios\_plist\_content](#class-editorexportplugin-method-add-ios-plist-content) **(** [String](class_string#class-string) plist\_content **)** | | void | [add\_ios\_project\_static\_lib](#class-editorexportplugin-method-add-ios-project-static-lib) **(** [String](class_string#class-string) path **)** | | void | [add\_osx\_plugin\_file](#class-editorexportplugin-method-add-osx-plugin-file) **(** [String](class_string#class-string) path **)** | | void | [add\_shared\_object](#class-editorexportplugin-method-add-shared-object) **(** [String](class_string#class-string) path, [PoolStringArray](class_poolstringarray#class-poolstringarray) tags **)** | | void | [skip](#class-editorexportplugin-method-skip) **(** **)** | Method Descriptions ------------------- ### void \_export\_begin ( [PoolStringArray](class_poolstringarray#class-poolstringarray) features, [bool](class_bool#class-bool) is\_debug, [String](class_string#class-string) path, [int](class_int#class-int) flags ) virtual Virtual method to be overridden by the user. It is called when the export starts and provides all information about the export. `features` is the list of features for the export, `is_debug` is `true` for debug builds, `path` is the target path for the exported project. `flags` is only used when running a runnable profile, e.g. when using native run on Android. ### void \_export\_end ( ) virtual Virtual method to be overridden by the user. Called when the export is finished. ### void \_export\_file ( [String](class_string#class-string) path, [String](class_string#class-string) type, [PoolStringArray](class_poolstringarray#class-poolstringarray) features ) virtual Virtual method to be overridden by the user. Called for each exported file, providing arguments that can be used to identify the file. `path` is the path of the file, `type` is the [Resource](class_resource#class-resource) represented by the file (e.g. [PackedScene](class_packedscene#class-packedscene)) and `features` is the list of features for the export. Calling [skip](#class-editorexportplugin-method-skip) inside this callback will make the file not included in the export. ### void add\_file ( [String](class_string#class-string) path, [PoolByteArray](class_poolbytearray#class-poolbytearray) file, [bool](class_bool#class-bool) remap ) Adds a custom file to be exported. `path` is the virtual path that can be used to load the file, `file` is the binary data of the file. If `remap` is `true`, file will not be exported, but instead remapped to the given `path`. ### void add\_ios\_bundle\_file ( [String](class_string#class-string) path ) Adds an iOS bundle file from the given `path` to the exported project. ### void add\_ios\_cpp\_code ( [String](class_string#class-string) code ) Adds a C++ code to the iOS export. The final code is created from the code appended by each active export plugin. ### void add\_ios\_embedded\_framework ( [String](class_string#class-string) path ) Adds a dynamic library (\*.dylib, \*.framework) to Linking Phase in iOS's Xcode project and embeds it into resulting binary. **Note:** For static libraries (\*.a) works in same way as [add\_ios\_framework](#class-editorexportplugin-method-add-ios-framework). This method should not be used for System libraries as they are already present on the device. ### void add\_ios\_framework ( [String](class_string#class-string) path ) Adds a static library (\*.a) or dynamic library (\*.dylib, \*.framework) to Linking Phase in iOS's Xcode project. ### void add\_ios\_linker\_flags ( [String](class_string#class-string) flags ) Adds linker flags for the iOS export. ### void add\_ios\_plist\_content ( [String](class_string#class-string) plist\_content ) Adds content for iOS Property List files. ### void add\_ios\_project\_static\_lib ( [String](class_string#class-string) path ) Adds a static lib from the given `path` to the iOS project. ### void add\_osx\_plugin\_file ( [String](class_string#class-string) path ) Adds file or directory matching `path` to `PlugIns` directory of macOS app bundle. **Note:** This is useful only for macOS exports. ### void add\_shared\_object ( [String](class_string#class-string) path, [PoolStringArray](class_poolstringarray#class-poolstringarray) tags ) Adds a shared object or a directory containing only shared objects with the given `tags` and destination `path`. **Note:** In case of macOS exports, those shared objects will be added to `Frameworks` directory of app bundle. In case of a directory code-sign will error if you place non code object in directory. ### void skip ( ) To be called inside [\_export\_file](#class-editorexportplugin-method-export-file). Skips the current file, so it's not included in the export. godot AudioEffectLowPassFilter AudioEffectLowPassFilter ======================== **Inherits:** [AudioEffectFilter](class_audioeffectfilter#class-audioeffectfilter) **<** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Adds a low-pass filter to the Audio bus. Description ----------- Cuts frequencies higher than the [AudioEffectFilter.cutoff\_hz](class_audioeffectfilter#class-audioeffectfilter-property-cutoff-hz) and allows lower frequencies to pass. godot WebRTCDataChannelGDNative WebRTCDataChannelGDNative ========================= **Inherits:** [WebRTCDataChannel](class_webrtcdatachannel#class-webrtcdatachannel) **<** [PacketPeer](class_packetpeer#class-packetpeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) godot AnimationNodeStateMachineTransition AnimationNodeStateMachineTransition =================================== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Tutorials --------- * [Using AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html) Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [advance\_condition](#class-animationnodestatemachinetransition-property-advance-condition) | `""` | | [bool](class_bool#class-bool) | [auto\_advance](#class-animationnodestatemachinetransition-property-auto-advance) | `false` | | [bool](class_bool#class-bool) | [disabled](#class-animationnodestatemachinetransition-property-disabled) | `false` | | [int](class_int#class-int) | [priority](#class-animationnodestatemachinetransition-property-priority) | `1` | | [SwitchMode](#enum-animationnodestatemachinetransition-switchmode) | [switch\_mode](#class-animationnodestatemachinetransition-property-switch-mode) | `0` | | [float](class_float#class-float) | [xfade\_time](#class-animationnodestatemachinetransition-property-xfade-time) | `0.0` | Signals ------- ### advance\_condition\_changed ( ) Emitted when [advance\_condition](#class-animationnodestatemachinetransition-property-advance-condition) is changed. Enumerations ------------ enum **SwitchMode**: * **SWITCH\_MODE\_IMMEDIATE** = **0** --- Switch to the next state immediately. The current state will end and blend into the beginning of the new one. * **SWITCH\_MODE\_SYNC** = **1** --- Switch to the next state immediately, but will seek the new state to the playback position of the old state. * **SWITCH\_MODE\_AT\_END** = **2** --- Wait for the current state playback to end, then switch to the beginning of the next state animation. Property Descriptions --------------------- ### [String](class_string#class-string) advance\_condition | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_advance\_condition(value) | | *Getter* | get\_advance\_condition() | Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the [AnimationTree](class_animationtree#class-animationtree) that can be controlled from code (see [Using AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html#controlling-from-code)). For example, if [AnimationTree.tree\_root](class_animationtree#class-animationtree-property-tree-root) is an [AnimationNodeStateMachine](class_animationnodestatemachine#class-animationnodestatemachine) and [advance\_condition](#class-animationnodestatemachinetransition-property-advance-condition) is set to `"idle"`: ``` $animation_tree["parameters/conditions/idle"] = is_on_floor and (linear_velocity.x == 0) ``` ### [bool](class_bool#class-bool) auto\_advance | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_auto\_advance(value) | | *Getter* | has\_auto\_advance() | Turn on the transition automatically when this state is reached. This works best with [SWITCH\_MODE\_AT\_END](#class-animationnodestatemachinetransition-constant-switch-mode-at-end). ### [bool](class_bool#class-bool) disabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_disabled(value) | | *Getter* | is\_disabled() | Don't use this transition during [AnimationNodeStateMachinePlayback.travel](class_animationnodestatemachineplayback#class-animationnodestatemachineplayback-method-travel) or [auto\_advance](#class-animationnodestatemachinetransition-property-auto-advance). ### [int](class_int#class-int) priority | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_priority(value) | | *Getter* | get\_priority() | Lower priority transitions are preferred when travelling through the tree via [AnimationNodeStateMachinePlayback.travel](class_animationnodestatemachineplayback#class-animationnodestatemachineplayback-method-travel) or [auto\_advance](#class-animationnodestatemachinetransition-property-auto-advance). ### [SwitchMode](#enum-animationnodestatemachinetransition-switchmode) switch\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_switch\_mode(value) | | *Getter* | get\_switch\_mode() | The transition type. ### [float](class_float#class-float) xfade\_time | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_xfade\_time(value) | | *Getter* | get\_xfade\_time() | The time to cross-fade between this state and the next. godot VisualScriptFunctionCall VisualScriptFunctionCall ======================== **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A Visual Script node for calling a function. Description ----------- `VisualScriptFunctionCall` is created when you add or drag and drop a function onto the Visual Script graph. It allows to tweak parameters of the call, e.g. what object the function is called on. Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [base\_script](#class-visualscriptfunctioncall-property-base-script) | | | [String](class_string#class-string) | [base\_type](#class-visualscriptfunctioncall-property-base-type) | `"Object"` | | [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) | [basic\_type](#class-visualscriptfunctioncall-property-basic-type) | | | [CallMode](#enum-visualscriptfunctioncall-callmode) | [call\_mode](#class-visualscriptfunctioncall-property-call-mode) | `0` | | [String](class_string#class-string) | [function](#class-visualscriptfunctioncall-property-function) | `""` | | [NodePath](class_nodepath#class-nodepath) | [node\_path](#class-visualscriptfunctioncall-property-node-path) | | | [RPCCallMode](#enum-visualscriptfunctioncall-rpccallmode) | [rpc\_call\_mode](#class-visualscriptfunctioncall-property-rpc-call-mode) | `0` | | [String](class_string#class-string) | [singleton](#class-visualscriptfunctioncall-property-singleton) | | | [int](class_int#class-int) | [use\_default\_args](#class-visualscriptfunctioncall-property-use-default-args) | | | [bool](class_bool#class-bool) | [validate](#class-visualscriptfunctioncall-property-validate) | `true` | Enumerations ------------ enum **CallMode**: * **CALL\_MODE\_SELF** = **0** --- The method will be called on this [Object](class_object#class-object). * **CALL\_MODE\_NODE\_PATH** = **1** --- The method will be called on the given [Node](class_node#class-node) in the scene tree. * **CALL\_MODE\_INSTANCE** = **2** --- The method will be called on an instanced node with the given type and script. * **CALL\_MODE\_BASIC\_TYPE** = **3** --- The method will be called on a GDScript basic type (e.g. [Vector2](class_vector2#class-vector2)). * **CALL\_MODE\_SINGLETON** = **4** --- The method will be called on a singleton. enum **RPCCallMode**: * **RPC\_DISABLED** = **0** --- The method will be called locally. * **RPC\_RELIABLE** = **1** --- The method will be called remotely. * **RPC\_UNRELIABLE** = **2** --- The method will be called remotely using an unreliable protocol. * **RPC\_RELIABLE\_TO\_ID** = **3** --- The method will be called remotely for the given peer. * **RPC\_UNRELIABLE\_TO\_ID** = **4** --- The method will be called remotely for the given peer, using an unreliable protocol. Property Descriptions --------------------- ### [String](class_string#class-string) base\_script | | | | --- | --- | | *Setter* | set\_base\_script(value) | | *Getter* | get\_base\_script() | The script to be used when [call\_mode](#class-visualscriptfunctioncall-property-call-mode) is set to [CALL\_MODE\_INSTANCE](#class-visualscriptfunctioncall-constant-call-mode-instance). ### [String](class_string#class-string) base\_type | | | | --- | --- | | *Default* | `"Object"` | | *Setter* | set\_base\_type(value) | | *Getter* | get\_base\_type() | The base type to be used when [call\_mode](#class-visualscriptfunctioncall-property-call-mode) is set to [CALL\_MODE\_INSTANCE](#class-visualscriptfunctioncall-constant-call-mode-instance). ### [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) basic\_type | | | | --- | --- | | *Setter* | set\_basic\_type(value) | | *Getter* | get\_basic\_type() | The type to be used when [call\_mode](#class-visualscriptfunctioncall-property-call-mode) is set to [CALL\_MODE\_BASIC\_TYPE](#class-visualscriptfunctioncall-constant-call-mode-basic-type). ### [CallMode](#enum-visualscriptfunctioncall-callmode) call\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_call\_mode(value) | | *Getter* | get\_call\_mode() | `call_mode` determines the target object on which the method will be called. See [CallMode](#enum-visualscriptfunctioncall-callmode) for options. ### [String](class_string#class-string) function | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_function(value) | | *Getter* | get\_function() | The name of the function to be called. ### [NodePath](class_nodepath#class-nodepath) node\_path | | | | --- | --- | | *Setter* | set\_base\_path(value) | | *Getter* | get\_base\_path() | The node path to use when [call\_mode](#class-visualscriptfunctioncall-property-call-mode) is set to [CALL\_MODE\_NODE\_PATH](#class-visualscriptfunctioncall-constant-call-mode-node-path). ### [RPCCallMode](#enum-visualscriptfunctioncall-rpccallmode) rpc\_call\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_rpc\_call\_mode(value) | | *Getter* | get\_rpc\_call\_mode() | The mode for RPC calls. See [Node.rpc](class_node#class-node-method-rpc) for more details and [RPCCallMode](#enum-visualscriptfunctioncall-rpccallmode) for available options. ### [String](class_string#class-string) singleton | | | | --- | --- | | *Setter* | set\_singleton(value) | | *Getter* | get\_singleton() | The singleton to call the method on. Used when [call\_mode](#class-visualscriptfunctioncall-property-call-mode) is set to [CALL\_MODE\_SINGLETON](#class-visualscriptfunctioncall-constant-call-mode-singleton). ### [int](class_int#class-int) use\_default\_args | | | | --- | --- | | *Setter* | set\_use\_default\_args(value) | | *Getter* | get\_use\_default\_args() | Number of default arguments that will be used when calling the function. Can't be higher than the number of available default arguments in the method's declaration. ### [bool](class_bool#class-bool) validate | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_validate(value) | | *Getter* | get\_validate() | If `false`, call errors (e.g. wrong number of arguments) will be ignored.
programming_docs
godot CSGCombiner CSGCombiner =========== **Inherits:** [CSGShape](class_csgshape#class-csgshape) **<** [GeometryInstance](class_geometryinstance#class-geometryinstance) **<** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) A CSG node that allows you to combine other CSG modifiers. Description ----------- For complex arrangements of shapes, it is sometimes needed to add structure to your CSG nodes. The CSGCombiner node allows you to create this structure. The node encapsulates the result of the CSG operations of its children. In this way, it is possible to do operations on one set of shapes that are children of one CSGCombiner node, and a set of separate operations on a second set of shapes that are children of a second CSGCombiner node, and then do an operation that takes the two end results as its input to create the final shape. **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a [MeshInstance](class_meshinstance#class-meshinstance) with a [PrimitiveMesh](class_primitivemesh#class-primitivemesh). Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. Tutorials --------- * [Prototyping levels with CSG](https://docs.godotengine.org/en/3.5/tutorials/3d/csg_tools.html) godot WindowDialog WindowDialog ============ **Inherits:** [Popup](class_popup#class-popup) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [AcceptDialog](class_acceptdialog#class-acceptdialog) Base class for window dialogs. Description ----------- Windowdialog is the base class for all window-based dialogs. It's a by-default toplevel [Control](class_control#class-control) that draws a window decoration and allows motion and resizing. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [resizable](#class-windowdialog-property-resizable) | `false` | | [String](class_string#class-string) | [window\_title](#class-windowdialog-property-window-title) | `""` | Methods ------- | | | | --- | --- | | [TextureButton](class_texturebutton#class-texturebutton) | [get\_close\_button](#class-windowdialog-method-get-close-button) **(** **)** | Theme Properties ---------------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [title\_color](#class-windowdialog-theme-color-title-color) | `Color( 0, 0, 0, 1 )` | | [int](class_int#class-int) | [close\_h\_ofs](#class-windowdialog-theme-constant-close-h-ofs) | `18` | | [int](class_int#class-int) | [close\_v\_ofs](#class-windowdialog-theme-constant-close-v-ofs) | `18` | | [int](class_int#class-int) | [scaleborder\_size](#class-windowdialog-theme-constant-scaleborder-size) | `4` | | [int](class_int#class-int) | [title\_height](#class-windowdialog-theme-constant-title-height) | `20` | | [Font](class_font#class-font) | [title\_font](#class-windowdialog-theme-font-title-font) | | | [Texture](class_texture#class-texture) | [close](#class-windowdialog-theme-icon-close) | | | [Texture](class_texture#class-texture) | [close\_highlight](#class-windowdialog-theme-icon-close-highlight) | | | [StyleBox](class_stylebox#class-stylebox) | [panel](#class-windowdialog-theme-style-panel) | | Property Descriptions --------------------- ### [bool](class_bool#class-bool) resizable | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_resizable(value) | | *Getter* | get\_resizable() | If `true`, the user can resize the window. ### [String](class_string#class-string) window\_title | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_title(value) | | *Getter* | get\_title() | The text displayed in the window's title bar. Method Descriptions ------------------- ### [TextureButton](class_texturebutton#class-texturebutton) get\_close\_button ( ) Returns the close [TextureButton](class_texturebutton#class-texturebutton). **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. Theme Property Descriptions --------------------------- ### [Color](class_color#class-color) title\_color | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 1 )` | The color of the title text. ### [int](class_int#class-int) close\_h\_ofs | | | | --- | --- | | *Default* | `18` | The horizontal offset of the close button. ### [int](class_int#class-int) close\_v\_ofs | | | | --- | --- | | *Default* | `18` | The vertical offset of the close button. ### [int](class_int#class-int) scaleborder\_size | | | | --- | --- | | *Default* | `4` | The thickness of the border that can be dragged when scaling the window (if [resizable](#class-windowdialog-property-resizable) is enabled). ### [int](class_int#class-int) title\_height | | | | --- | --- | | *Default* | `20` | The vertical offset of the title text. ### [Font](class_font#class-font) title\_font The font used to draw the title. ### [Texture](class_texture#class-texture) close The icon for the close button. ### [Texture](class_texture#class-texture) close\_highlight The icon used for the close button when it's hovered with the mouse cursor. ### [StyleBox](class_stylebox#class-stylebox) panel The style for both the content background of the `WindowDialog` and the title bar. The title bar is created with a top border and an expand margin using the `panel` stylebox. godot RayShape RayShape ======== **Inherits:** [Shape](class_shape#class-shape) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Ray shape for 3D collisions. Description ----------- Ray shape for 3D collisions, which can be set into a [PhysicsBody](class_physicsbody#class-physicsbody) or [Area](class_area#class-area). A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [length](#class-rayshape-property-length) | `1.0` | | [bool](class_bool#class-bool) | [slips\_on\_slope](#class-rayshape-property-slips-on-slope) | `false` | Property Descriptions --------------------- ### [float](class_float#class-float) length | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_length(value) | | *Getter* | get\_length() | The ray's length. ### [bool](class_bool#class-bool) slips\_on\_slope | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_slips\_on\_slope(value) | | *Getter* | get\_slips\_on\_slope() | If `true`, allow the shape to return the correct normal. godot VisualShaderNodeTransformConstant VisualShaderNodeTransformConstant ================================= **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A [Transform](class_transform#class-transform) constant for use within the visual shader graph. Description ----------- A constant [Transform](class_transform#class-transform), which can be used as an input node. Properties ---------- | | | | | --- | --- | --- | | [Transform](class_transform#class-transform) | [constant](#class-visualshadernodetransformconstant-property-constant) | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | Property Descriptions --------------------- ### [Transform](class_transform#class-transform) constant | | | | --- | --- | | *Default* | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | | *Setter* | set\_constant(value) | | *Getter* | get\_constant() | A [Transform](class_transform#class-transform) constant which represents the state of this node. godot ConfirmationDialog ConfirmationDialog ================== **Inherits:** [AcceptDialog](class_acceptdialog#class-acceptdialog) **<** [WindowDialog](class_windowdialog#class-windowdialog) **<** [Popup](class_popup#class-popup) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [EditorFileDialog](class_editorfiledialog#class-editorfiledialog), [FileDialog](class_filedialog#class-filedialog), [ScriptCreateDialog](class_scriptcreatedialog#class-scriptcreatedialog) Dialog for confirmation of actions. Description ----------- Dialog for confirmation of actions. This dialog inherits from [AcceptDialog](class_acceptdialog#class-acceptdialog), but has by default an OK and Cancel button (in host OS order). To get cancel action, you can use: ``` get_cancel().connect("pressed", self, "cancelled"). ``` Properties ---------- | | | | | --- | --- | --- | | [Vector2](class_vector2#class-vector2) | rect\_min\_size | `Vector2( 200, 70 )` (overrides [Control](class_control#class-control-property-rect-min-size)) | | [String](class_string#class-string) | window\_title | `"Please Confirm..."` (overrides [WindowDialog](class_windowdialog#class-windowdialog-property-window-title)) | Methods ------- | | | | --- | --- | | [Button](class_button#class-button) | [get\_cancel](#class-confirmationdialog-method-get-cancel) **(** **)** | Method Descriptions ------------------- ### [Button](class_button#class-button) get\_cancel ( ) Returns the cancel button. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. godot AtlasTexture AtlasTexture ============ **Inherits:** [Texture](class_texture#class-texture) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Crops out one part of a texture, such as a texture from a texture atlas. Description ----------- [Texture](class_texture#class-texture) resource that crops out one part of the [atlas](#class-atlastexture-property-atlas) texture, defined by [region](#class-atlastexture-property-region). The main use case is cropping out textures from a texture atlas, which is a big texture file that packs multiple smaller textures. Consists of a [Texture](class_texture#class-texture) for the [atlas](#class-atlastexture-property-atlas), a [region](#class-atlastexture-property-region) that defines the area of [atlas](#class-atlastexture-property-atlas) to use, and a [margin](#class-atlastexture-property-margin) that defines the border width. `AtlasTexture` cannot be used in an [AnimatedTexture](class_animatedtexture#class-animatedtexture), cannot be tiled in nodes such as [TextureRect](class_texturerect#class-texturerect), and does not work properly if used inside of other `AtlasTexture` resources. Multiple `AtlasTexture` resources can be used to crop multiple textures from the atlas. Using a texture atlas helps to optimize video memory costs and render calls compared to using multiple small files. **Note:** AtlasTextures don't support repetition. The [Texture.FLAG\_REPEAT](class_texture#class-texture-constant-flag-repeat) and [Texture.FLAG\_MIRRORED\_REPEAT](class_texture#class-texture-constant-flag-mirrored-repeat) flags are ignored when using an AtlasTexture. Properties ---------- | | | | | --- | --- | --- | | [Texture](class_texture#class-texture) | [atlas](#class-atlastexture-property-atlas) | | | [bool](class_bool#class-bool) | [filter\_clip](#class-atlastexture-property-filter-clip) | `false` | | [int](class_int#class-int) | flags | `0` (overrides [Texture](class_texture#class-texture-property-flags)) | | [Rect2](class_rect2#class-rect2) | [margin](#class-atlastexture-property-margin) | `Rect2( 0, 0, 0, 0 )` | | [Rect2](class_rect2#class-rect2) | [region](#class-atlastexture-property-region) | `Rect2( 0, 0, 0, 0 )` | Property Descriptions --------------------- ### [Texture](class_texture#class-texture) atlas | | | | --- | --- | | *Setter* | set\_atlas(value) | | *Getter* | get\_atlas() | The texture that contains the atlas. Can be any [Texture](class_texture#class-texture) subtype. ### [bool](class_bool#class-bool) filter\_clip | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_filter\_clip(value) | | *Getter* | has\_filter\_clip() | If `true`, clips the area outside of the region to avoid bleeding of the surrounding texture pixels. ### [Rect2](class_rect2#class-rect2) margin | | | | --- | --- | | *Default* | `Rect2( 0, 0, 0, 0 )` | | *Setter* | set\_margin(value) | | *Getter* | get\_margin() | The margin around the region. The [Rect2](class_rect2#class-rect2)'s [Rect2.size](class_rect2#class-rect2-property-size) parameter ("w" and "h" in the editor) resizes the texture so it fits within the margin. ### [Rect2](class_rect2#class-rect2) region | | | | --- | --- | | *Default* | `Rect2( 0, 0, 0, 0 )` | | *Setter* | set\_region(value) | | *Getter* | get\_region() | The AtlasTexture's used region. godot AnimationNodeOutput AnimationNodeOutput =================== **Inherits:** [AnimationNode](class_animationnode#class-animationnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Generic output node to be added to [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). Tutorials --------- * [AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html) * [3D Platformer Demo](https://godotengine.org/asset-library/asset/125) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) godot NavigationMesh NavigationMesh ============== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A mesh to approximate the walkable areas and obstacles. Description ----------- A navigation mesh is a collection of polygons that define which areas of an environment are traversable to aid agents in pathfinding through complicated spaces. Tutorials --------- * [3D Navmesh Demo](https://godotengine.org/asset-library/asset/124) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [agent\_height](#class-navigationmesh-property-agent-height) | `1.5` | | [float](class_float#class-float) | [agent\_max\_climb](#class-navigationmesh-property-agent-max-climb) | `0.25` | | [float](class_float#class-float) | [agent\_max\_slope](#class-navigationmesh-property-agent-max-slope) | `45.0` | | [float](class_float#class-float) | [agent\_radius](#class-navigationmesh-property-agent-radius) | `0.5` | | [float](class_float#class-float) | [cell\_height](#class-navigationmesh-property-cell-height) | `0.25` | | [float](class_float#class-float) | [cell\_size](#class-navigationmesh-property-cell-size) | `0.25` | | [float](class_float#class-float) | [detail\_sample\_distance](#class-navigationmesh-property-detail-sample-distance) | `6.0` | | [float](class_float#class-float) | [detail\_sample\_max\_error](#class-navigationmesh-property-detail-sample-max-error) | `1.0` | | [float](class_float#class-float) | [edge\_max\_error](#class-navigationmesh-property-edge-max-error) | `1.3` | | [float](class_float#class-float) | [edge\_max\_length](#class-navigationmesh-property-edge-max-length) | `12.0` | | [AABB](class_aabb#class-aabb) | [filter\_baking\_aabb](#class-navigationmesh-property-filter-baking-aabb) | `AABB( 0, 0, 0, 0, 0, 0 )` | | [Vector3](class_vector3#class-vector3) | [filter\_baking\_aabb\_offset](#class-navigationmesh-property-filter-baking-aabb-offset) | `Vector3( 0, 0, 0 )` | | [bool](class_bool#class-bool) | [filter\_ledge\_spans](#class-navigationmesh-property-filter-ledge-spans) | `false` | | [bool](class_bool#class-bool) | [filter\_low\_hanging\_obstacles](#class-navigationmesh-property-filter-low-hanging-obstacles) | `false` | | [bool](class_bool#class-bool) | [filter\_walkable\_low\_height\_spans](#class-navigationmesh-property-filter-walkable-low-height-spans) | `false` | | [int](class_int#class-int) | [geometry\_collision\_mask](#class-navigationmesh-property-geometry-collision-mask) | `4294967295` | | [ParsedGeometryType](#enum-navigationmesh-parsedgeometrytype) | [geometry\_parsed\_geometry\_type](#class-navigationmesh-property-geometry-parsed-geometry-type) | `0` | | [SourceGeometryMode](#enum-navigationmesh-sourcegeometrymode) | [geometry\_source\_geometry\_mode](#class-navigationmesh-property-geometry-source-geometry-mode) | `0` | | [String](class_string#class-string) | [geometry\_source\_group\_name](#class-navigationmesh-property-geometry-source-group-name) | `"navmesh"` | | [float](class_float#class-float) | [polygon\_verts\_per\_poly](#class-navigationmesh-property-polygon-verts-per-poly) | `6.0` | | [float](class_float#class-float) | [region\_merge\_size](#class-navigationmesh-property-region-merge-size) | `20.0` | | [float](class_float#class-float) | [region\_min\_size](#class-navigationmesh-property-region-min-size) | `2.0` | | [SamplePartitionType](#enum-navigationmesh-samplepartitiontype) | [sample\_partition\_type](#class-navigationmesh-property-sample-partition-type) | `0` | Methods ------- | | | | --- | --- | | void | [add\_polygon](#class-navigationmesh-method-add-polygon) **(** [PoolIntArray](class_poolintarray#class-poolintarray) polygon **)** | | void | [clear\_polygons](#class-navigationmesh-method-clear-polygons) **(** **)** | | void | [create\_from\_mesh](#class-navigationmesh-method-create-from-mesh) **(** [Mesh](class_mesh#class-mesh) mesh **)** | | [bool](class_bool#class-bool) | [get\_collision\_mask\_bit](#class-navigationmesh-method-get-collision-mask-bit) **(** [int](class_int#class-int) bit **)** const | | [PoolIntArray](class_poolintarray#class-poolintarray) | [get\_polygon](#class-navigationmesh-method-get-polygon) **(** [int](class_int#class-int) idx **)** | | [int](class_int#class-int) | [get\_polygon\_count](#class-navigationmesh-method-get-polygon-count) **(** **)** const | | [PoolVector3Array](class_poolvector3array#class-poolvector3array) | [get\_vertices](#class-navigationmesh-method-get-vertices) **(** **)** const | | void | [set\_collision\_mask\_bit](#class-navigationmesh-method-set-collision-mask-bit) **(** [int](class_int#class-int) bit, [bool](class_bool#class-bool) value **)** | | void | [set\_vertices](#class-navigationmesh-method-set-vertices) **(** [PoolVector3Array](class_poolvector3array#class-poolvector3array) vertices **)** | Enumerations ------------ enum **SamplePartitionType**: * **SAMPLE\_PARTITION\_WATERSHED** = **0** --- Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas. * **SAMPLE\_PARTITION\_MONOTONE** = **1** --- Monotone partitioning. Use this if you want fast navigation mesh generation. * **SAMPLE\_PARTITION\_LAYERS** = **2** --- Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles. * **SAMPLE\_PARTITION\_MAX** = **3** --- Represents the size of the [SamplePartitionType](#enum-navigationmesh-samplepartitiontype) enum. enum **ParsedGeometryType**: * **PARSED\_GEOMETRY\_MESH\_INSTANCES** = **0** --- Parses mesh instances as geometry. This includes [MeshInstance](class_meshinstance#class-meshinstance), [CSGShape](class_csgshape#class-csgshape), and [GridMap](class_gridmap#class-gridmap) nodes. * **PARSED\_GEOMETRY\_STATIC\_COLLIDERS** = **1** --- Parses [StaticBody](class_staticbody#class-staticbody) colliders as geometry. The collider should be in any of the layers specified by [geometry\_collision\_mask](#class-navigationmesh-property-geometry-collision-mask). * **PARSED\_GEOMETRY\_BOTH** = **2** --- Both [PARSED\_GEOMETRY\_MESH\_INSTANCES](#class-navigationmesh-constant-parsed-geometry-mesh-instances) and [PARSED\_GEOMETRY\_STATIC\_COLLIDERS](#class-navigationmesh-constant-parsed-geometry-static-colliders). * **PARSED\_GEOMETRY\_MAX** = **3** --- Represents the size of the [ParsedGeometryType](#enum-navigationmesh-parsedgeometrytype) enum. enum **SourceGeometryMode**: * **SOURCE\_GEOMETRY\_NAVMESH\_CHILDREN** = **0** --- Scans the child nodes of [NavigationMeshInstance](class_navigationmeshinstance#class-navigationmeshinstance) recursively for geometry. * **SOURCE\_GEOMETRY\_GROUPS\_WITH\_CHILDREN** = **1** --- Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [geometry\_source\_group\_name](#class-navigationmesh-property-geometry-source-group-name). * **SOURCE\_GEOMETRY\_GROUPS\_EXPLICIT** = **2** --- Uses nodes in a group for geometry. The group is specified by [geometry\_source\_group\_name](#class-navigationmesh-property-geometry-source-group-name). * **SOURCE\_GEOMETRY\_MAX** = **3** --- Represents the size of the [SourceGeometryMode](#enum-navigationmesh-sourcegeometrymode) enum. Property Descriptions --------------------- ### [float](class_float#class-float) agent\_height | | | | --- | --- | | *Default* | `1.5` | | *Setter* | set\_agent\_height(value) | | *Getter* | get\_agent\_height() | The minimum floor to ceiling height that will still allow the floor area to be considered walkable. **Note:** While baking, this value will be rounded up to the nearest multiple of [cell\_height](#class-navigationmesh-property-cell-height). ### [float](class_float#class-float) agent\_max\_climb | | | | --- | --- | | *Default* | `0.25` | | *Setter* | set\_agent\_max\_climb(value) | | *Getter* | get\_agent\_max\_climb() | The minimum ledge height that is considered to still be traversable. **Note:** While baking, this value will be rounded down to the nearest multiple of [cell\_height](#class-navigationmesh-property-cell-height). ### [float](class_float#class-float) agent\_max\_slope | | | | --- | --- | | *Default* | `45.0` | | *Setter* | set\_agent\_max\_slope(value) | | *Getter* | get\_agent\_max\_slope() | The maximum slope that is considered walkable, in degrees. ### [float](class_float#class-float) agent\_radius | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_agent\_radius(value) | | *Getter* | get\_agent\_radius() | The distance to erode/shrink the walkable area of the heightfield away from obstructions. **Note:** While baking, this value will be rounded up to the nearest multiple of [cell\_size](#class-navigationmesh-property-cell-size). ### [float](class_float#class-float) cell\_height | | | | --- | --- | | *Default* | `0.25` | | *Setter* | set\_cell\_height(value) | | *Getter* | get\_cell\_height() | The Y axis cell size to use for fields. ### [float](class_float#class-float) cell\_size | | | | --- | --- | | *Default* | `0.25` | | *Setter* | set\_cell\_size(value) | | *Getter* | get\_cell\_size() | The XZ plane cell size to use for fields. ### [float](class_float#class-float) detail\_sample\_distance | | | | --- | --- | | *Default* | `6.0` | | *Setter* | set\_detail\_sample\_distance(value) | | *Getter* | get\_detail\_sample\_distance() | The sampling distance to use when generating the detail mesh, in cell unit. ### [float](class_float#class-float) detail\_sample\_max\_error | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_detail\_sample\_max\_error(value) | | *Getter* | get\_detail\_sample\_max\_error() | The maximum distance the detail mesh surface should deviate from heightfield, in cell unit. ### [float](class_float#class-float) edge\_max\_error | | | | --- | --- | | *Default* | `1.3` | | *Setter* | set\_edge\_max\_error(value) | | *Getter* | get\_edge\_max\_error() | The maximum distance a simplfied contour's border edges should deviate the original raw contour. ### [float](class_float#class-float) edge\_max\_length | | | | --- | --- | | *Default* | `12.0` | | *Setter* | set\_edge\_max\_length(value) | | *Getter* | get\_edge\_max\_length() | The maximum allowed length for contour edges along the border of the mesh. **Note:** While baking, this value will be rounded up to the nearest multiple of [cell\_size](#class-navigationmesh-property-cell-size). ### [AABB](class_aabb#class-aabb) filter\_baking\_aabb | | | | --- | --- | | *Default* | `AABB( 0, 0, 0, 0, 0, 0 )` | | *Setter* | set\_filter\_baking\_aabb(value) | | *Getter* | get\_filter\_baking\_aabb() | If the baking [AABB](class_aabb#class-aabb) has a volume the navigation mesh baking will be restricted to its enclosing area. ### [Vector3](class_vector3#class-vector3) filter\_baking\_aabb\_offset | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_filter\_baking\_aabb\_offset(value) | | *Getter* | get\_filter\_baking\_aabb\_offset() | The position offset applied to the [filter\_baking\_aabb](#class-navigationmesh-property-filter-baking-aabb) [AABB](class_aabb#class-aabb). ### [bool](class_bool#class-bool) filter\_ledge\_spans | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_filter\_ledge\_spans(value) | | *Getter* | get\_filter\_ledge\_spans() | If `true`, marks spans that are ledges as non-walkable. ### [bool](class_bool#class-bool) filter\_low\_hanging\_obstacles | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_filter\_low\_hanging\_obstacles(value) | | *Getter* | get\_filter\_low\_hanging\_obstacles() | If `true`, marks non-walkable spans as walkable if their maximum is within [agent\_max\_climb](#class-navigationmesh-property-agent-max-climb) of a walkable neighbor. ### [bool](class_bool#class-bool) filter\_walkable\_low\_height\_spans | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_filter\_walkable\_low\_height\_spans(value) | | *Getter* | get\_filter\_walkable\_low\_height\_spans() | If `true`, marks walkable spans as not walkable if the clearance above the span is less than [agent\_height](#class-navigationmesh-property-agent-height). ### [int](class_int#class-int) geometry\_collision\_mask | | | | --- | --- | | *Default* | `4294967295` | | *Setter* | set\_collision\_mask(value) | | *Getter* | get\_collision\_mask() | The physics layers to scan for static colliders. Only used when [geometry\_parsed\_geometry\_type](#class-navigationmesh-property-geometry-parsed-geometry-type) is [PARSED\_GEOMETRY\_STATIC\_COLLIDERS](#class-navigationmesh-constant-parsed-geometry-static-colliders) or [PARSED\_GEOMETRY\_BOTH](#class-navigationmesh-constant-parsed-geometry-both). ### [ParsedGeometryType](#enum-navigationmesh-parsedgeometrytype) geometry\_parsed\_geometry\_type | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_parsed\_geometry\_type(value) | | *Getter* | get\_parsed\_geometry\_type() | Determines which type of nodes will be parsed as geometry. See [ParsedGeometryType](#enum-navigationmesh-parsedgeometrytype) for possible values. ### [SourceGeometryMode](#enum-navigationmesh-sourcegeometrymode) geometry\_source\_geometry\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_source\_geometry\_mode(value) | | *Getter* | get\_source\_geometry\_mode() | The source of the geometry used when baking. See [SourceGeometryMode](#enum-navigationmesh-sourcegeometrymode) for possible values. ### [String](class_string#class-string) geometry\_source\_group\_name | | | | --- | --- | | *Default* | `"navmesh"` | | *Setter* | set\_source\_group\_name(value) | | *Getter* | get\_source\_group\_name() | The name of the group to scan for geometry. Only used when [geometry\_source\_geometry\_mode](#class-navigationmesh-property-geometry-source-geometry-mode) is [SOURCE\_GEOMETRY\_GROUPS\_WITH\_CHILDREN](#class-navigationmesh-constant-source-geometry-groups-with-children) or [SOURCE\_GEOMETRY\_GROUPS\_EXPLICIT](#class-navigationmesh-constant-source-geometry-groups-explicit). ### [float](class_float#class-float) polygon\_verts\_per\_poly | | | | --- | --- | | *Default* | `6.0` | | *Setter* | set\_verts\_per\_poly(value) | | *Getter* | get\_verts\_per\_poly() | The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. ### [float](class_float#class-float) region\_merge\_size | | | | --- | --- | | *Default* | `20.0` | | *Setter* | set\_region\_merge\_size(value) | | *Getter* | get\_region\_merge\_size() | Any regions with a size smaller than this will be merged with larger regions if possible. **Note:** This value will be squared to calculate the number of cells. For example, a value of 20 will set the number of cells to 400. ### [float](class_float#class-float) region\_min\_size | | | | --- | --- | | *Default* | `2.0` | | *Setter* | set\_region\_min\_size(value) | | *Getter* | get\_region\_min\_size() | The minimum size of a region for it to be created. **Note:** This value will be squared to calculate the minimum number of cells allowed to form isolated island areas. For example, a value of 8 will set the number of cells to 64. ### [SamplePartitionType](#enum-navigationmesh-samplepartitiontype) sample\_partition\_type | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_sample\_partition\_type(value) | | *Getter* | get\_sample\_partition\_type() | Partitioning algorithm for creating the navigation mesh polys. See [SamplePartitionType](#enum-navigationmesh-samplepartitiontype) for possible values. Method Descriptions ------------------- ### void add\_polygon ( [PoolIntArray](class_poolintarray#class-poolintarray) polygon ) Adds a polygon using the indices of the vertices you get when calling [get\_vertices](#class-navigationmesh-method-get-vertices). ### void clear\_polygons ( ) Clears the array of polygons, but it doesn't clear the array of vertices. ### void create\_from\_mesh ( [Mesh](class_mesh#class-mesh) mesh ) Initializes the navigation mesh by setting the vertices and indices according to a [Mesh](class_mesh#class-mesh). ### [bool](class_bool#class-bool) get\_collision\_mask\_bit ( [int](class_int#class-int) bit ) const Returns whether the specified `bit` of the [geometry\_collision\_mask](#class-navigationmesh-property-geometry-collision-mask) is set. ### [PoolIntArray](class_poolintarray#class-poolintarray) get\_polygon ( [int](class_int#class-int) idx ) Returns a [PoolIntArray](class_poolintarray#class-poolintarray) containing the indices of the vertices of a created polygon. ### [int](class_int#class-int) get\_polygon\_count ( ) const Returns the number of polygons in the navigation mesh. ### [PoolVector3Array](class_poolvector3array#class-poolvector3array) get\_vertices ( ) const Returns a [PoolVector3Array](class_poolvector3array#class-poolvector3array) containing all the vertices being used to create the polygons. ### void set\_collision\_mask\_bit ( [int](class_int#class-int) bit, [bool](class_bool#class-bool) value ) If `value` is `true`, sets the specified `bit` in the [geometry\_collision\_mask](#class-navigationmesh-property-geometry-collision-mask). If `value` is `false`, clears the specified `bit` in the [geometry\_collision\_mask](#class-navigationmesh-property-geometry-collision-mask). ### void set\_vertices ( [PoolVector3Array](class_poolvector3array#class-poolvector3array) vertices ) Sets the vertices that can be then indexed to create polygons with the [add\_polygon](#class-navigationmesh-method-add-polygon) method.
programming_docs
godot VisualShaderNodeIs VisualShaderNodeIs ================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A boolean comparison operator to be used within the visual shader graph. Description ----------- Returns the boolean result of the comparison between `INF` or `NaN` and a scalar parameter. Properties ---------- | | | | | --- | --- | --- | | [Function](#enum-visualshadernodeis-function) | [function](#class-visualshadernodeis-property-function) | `0` | Enumerations ------------ enum **Function**: * **FUNC\_IS\_INF** = **0** --- Comparison with `INF` (Infinity). * **FUNC\_IS\_NAN** = **1** --- Comparison with `NaN` (Not a Number; denotes invalid numeric results, e.g. division by zero). Property Descriptions --------------------- ### [Function](#enum-visualshadernodeis-function) function | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_function(value) | | *Getter* | get\_function() | The comparison function. See [Function](#enum-visualshadernodeis-function) for options. godot AESContext AESContext ========== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Interface to low level AES encryption features. Description ----------- This class provides access to AES encryption/decryption of raw data. Both AES-ECB and AES-CBC mode are supported. ``` extends Node var aes = AESContext.new() func _ready(): var key = "My secret key!!!" # Key must be either 16 or 32 bytes. var data = "My secret text!!" # Data size must be multiple of 16 bytes, apply padding if needed. # Encrypt ECB aes.start(AESContext.MODE_ECB_ENCRYPT, key.to_utf8()) var encrypted = aes.update(data.to_utf8()) aes.finish() # Decrypt ECB aes.start(AESContext.MODE_ECB_DECRYPT, key.to_utf8()) var decrypted = aes.update(encrypted) aes.finish() # Check ECB assert(decrypted == data.to_utf8()) var iv = "My secret iv!!!!" # IV must be of exactly 16 bytes. # Encrypt CBC aes.start(AESContext.MODE_CBC_ENCRYPT, key.to_utf8(), iv.to_utf8()) encrypted = aes.update(data.to_utf8()) aes.finish() # Decrypt CBC aes.start(AESContext.MODE_CBC_DECRYPT, key.to_utf8(), iv.to_utf8()) decrypted = aes.update(encrypted) aes.finish() # Check CBC assert(decrypted == data.to_utf8()) ``` Methods ------- | | | | --- | --- | | void | [finish](#class-aescontext-method-finish) **(** **)** | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [get\_iv\_state](#class-aescontext-method-get-iv-state) **(** **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [start](#class-aescontext-method-start) **(** [Mode](#enum-aescontext-mode) mode, [PoolByteArray](class_poolbytearray#class-poolbytearray) key, [PoolByteArray](class_poolbytearray#class-poolbytearray) iv=PoolByteArray( ) **)** | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [update](#class-aescontext-method-update) **(** [PoolByteArray](class_poolbytearray#class-poolbytearray) src **)** | Enumerations ------------ enum **Mode**: * **MODE\_ECB\_ENCRYPT** = **0** --- AES electronic codebook encryption mode. * **MODE\_ECB\_DECRYPT** = **1** --- AES electronic codebook decryption mode. * **MODE\_CBC\_ENCRYPT** = **2** --- AES cipher blocker chaining encryption mode. * **MODE\_CBC\_DECRYPT** = **3** --- AES cipher blocker chaining decryption mode. * **MODE\_MAX** = **4** --- Maximum value for the mode enum. Method Descriptions ------------------- ### void finish ( ) Close this AES context so it can be started again. See [start](#class-aescontext-method-start). ### [PoolByteArray](class_poolbytearray#class-poolbytearray) get\_iv\_state ( ) Get the current IV state for this context (IV gets updated when calling [update](#class-aescontext-method-update)). You normally don't need this function. **Note:** This function only makes sense when the context is started with [MODE\_CBC\_ENCRYPT](#class-aescontext-constant-mode-cbc-encrypt) or [MODE\_CBC\_DECRYPT](#class-aescontext-constant-mode-cbc-decrypt). ### [Error](class_%40globalscope#enum-globalscope-error) start ( [Mode](#enum-aescontext-mode) mode, [PoolByteArray](class_poolbytearray#class-poolbytearray) key, [PoolByteArray](class_poolbytearray#class-poolbytearray) iv=PoolByteArray( ) ) Start the AES context in the given `mode`. A `key` of either 16 or 32 bytes must always be provided, while an `iv` (initialization vector) of exactly 16 bytes, is only needed when `mode` is either [MODE\_CBC\_ENCRYPT](#class-aescontext-constant-mode-cbc-encrypt) or [MODE\_CBC\_DECRYPT](#class-aescontext-constant-mode-cbc-decrypt). ### [PoolByteArray](class_poolbytearray#class-poolbytearray) update ( [PoolByteArray](class_poolbytearray#class-poolbytearray) src ) Run the desired operation for this AES context. Will return a [PoolByteArray](class_poolbytearray#class-poolbytearray) containing the result of encrypting (or decrypting) the given `src`. See [start](#class-aescontext-method-start) for mode of operation. **Note:** The size of `src` must be a multiple of 16. Apply some padding if needed. godot BitMap BitMap ====== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Boolean matrix. Description ----------- A two-dimensional array of boolean values, can be used to efficiently store a binary matrix (every matrix element takes only one bit) and query the values using natural cartesian coordinates. Methods ------- | | | | --- | --- | | [Image](class_image#class-image) | [convert\_to\_image](#class-bitmap-method-convert-to-image) **(** **)** const | | void | [create](#class-bitmap-method-create) **(** [Vector2](class_vector2#class-vector2) size **)** | | void | [create\_from\_image\_alpha](#class-bitmap-method-create-from-image-alpha) **(** [Image](class_image#class-image) image, [float](class_float#class-float) threshold=0.1 **)** | | [bool](class_bool#class-bool) | [get\_bit](#class-bitmap-method-get-bit) **(** [Vector2](class_vector2#class-vector2) position **)** const | | [Vector2](class_vector2#class-vector2) | [get\_size](#class-bitmap-method-get-size) **(** **)** const | | [int](class_int#class-int) | [get\_true\_bit\_count](#class-bitmap-method-get-true-bit-count) **(** **)** const | | void | [grow\_mask](#class-bitmap-method-grow-mask) **(** [int](class_int#class-int) pixels, [Rect2](class_rect2#class-rect2) rect **)** | | [Array](class_array#class-array) | [opaque\_to\_polygons](#class-bitmap-method-opaque-to-polygons) **(** [Rect2](class_rect2#class-rect2) rect, [float](class_float#class-float) epsilon=2.0 **)** const | | void | [resize](#class-bitmap-method-resize) **(** [Vector2](class_vector2#class-vector2) new\_size **)** | | void | [set\_bit](#class-bitmap-method-set-bit) **(** [Vector2](class_vector2#class-vector2) position, [bool](class_bool#class-bool) bit **)** | | void | [set\_bit\_rect](#class-bitmap-method-set-bit-rect) **(** [Rect2](class_rect2#class-rect2) rect, [bool](class_bool#class-bool) bit **)** | Method Descriptions ------------------- ### [Image](class_image#class-image) convert\_to\_image ( ) const Returns an image of the same size as the bitmap and with a [Format](class_image#enum-image-format) of type `FORMAT_L8`. `true` bits of the bitmap are being converted into white pixels, and `false` bits into black. ### void create ( [Vector2](class_vector2#class-vector2) size ) Creates a bitmap with the specified size, filled with `false`. ### void create\_from\_image\_alpha ( [Image](class_image#class-image) image, [float](class_float#class-float) threshold=0.1 ) Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to `false` if the alpha value of the image at that position is equal to `threshold` or less, and `true` in other case. ### [bool](class_bool#class-bool) get\_bit ( [Vector2](class_vector2#class-vector2) position ) const Returns bitmap's value at the specified position. ### [Vector2](class_vector2#class-vector2) get\_size ( ) const Returns bitmap's dimensions. ### [int](class_int#class-int) get\_true\_bit\_count ( ) const Returns the amount of bitmap elements that are set to `true`. ### void grow\_mask ( [int](class_int#class-int) pixels, [Rect2](class_rect2#class-rect2) rect ) Applies morphological dilation or erosion to the bitmap. If `pixels` is positive, dilation is applied to the bitmap. If `pixels` is negative, erosion is applied to the bitmap. `rect` defines the area where the morphological operation is applied. Pixels located outside the `rect` are unaffected by [grow\_mask](#class-bitmap-method-grow-mask). ### [Array](class_array#class-array) opaque\_to\_polygons ( [Rect2](class_rect2#class-rect2) rect, [float](class_float#class-float) epsilon=2.0 ) const ### void resize ( [Vector2](class_vector2#class-vector2) new\_size ) Resizes the image to `new_size`. ### void set\_bit ( [Vector2](class_vector2#class-vector2) position, [bool](class_bool#class-bool) bit ) Sets the bitmap's element at the specified position, to the specified value. ### void set\_bit\_rect ( [Rect2](class_rect2#class-rect2) rect, [bool](class_bool#class-bool) bit ) Sets a rectangular portion of the bitmap to the specified value. godot RoomManager RoomManager =========== **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) The RoomManager node is used to control the portal culling system. Description ----------- In order to utilize the portal occlusion culling system, you must build your level using [Room](class_room#class-room)s and [Portal](class_portal#class-portal)s. Before these can be used at runtime, they must undergo a short conversion process to build the `room graph`, runtime data needed for portal culling. The `room graph` is controlled by the `RoomManager` node, and the `RoomManager` also contains settings that are common throughout the portal system. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [active](#class-roommanager-property-active) | `true` | | [bool](class_bool#class-bool) | [debug\_sprawl](#class-roommanager-property-debug-sprawl) | `false` | | [float](class_float#class-float) | [default\_portal\_margin](#class-roommanager-property-default-portal-margin) | `1.0` | | [bool](class_bool#class-bool) | [gameplay\_monitor](#class-roommanager-property-gameplay-monitor) | `false` | | [bool](class_bool#class-bool) | [merge\_meshes](#class-roommanager-property-merge-meshes) | `false` | | [int](class_int#class-int) | [overlap\_warning\_threshold](#class-roommanager-property-overlap-warning-threshold) | `1` | | [int](class_int#class-int) | [portal\_depth\_limit](#class-roommanager-property-portal-depth-limit) | `16` | | [NodePath](class_nodepath#class-nodepath) | [preview\_camera](#class-roommanager-property-preview-camera) | `NodePath("")` | | [int](class_int#class-int) | process\_priority | `10000` (overrides [Node](class_node#class-node-property-process-priority)) | | [PVSMode](#enum-roommanager-pvsmode) | [pvs\_mode](#class-roommanager-property-pvs-mode) | `1` | | [float](class_float#class-float) | [roaming\_expansion\_margin](#class-roommanager-property-roaming-expansion-margin) | `1.0` | | [float](class_float#class-float) | [room\_simplify](#class-roommanager-property-room-simplify) | `0.5` | | [NodePath](class_nodepath#class-nodepath) | [roomlist](#class-roommanager-property-roomlist) | `NodePath("")` | | [bool](class_bool#class-bool) | [show\_margins](#class-roommanager-property-show-margins) | `true` | | [bool](class_bool#class-bool) | [use\_secondary\_pvs](#class-roommanager-property-use-secondary-pvs) | `false` | Methods ------- | | | | --- | --- | | void | [rooms\_clear](#class-roommanager-method-rooms-clear) **(** **)** | | void | [rooms\_convert](#class-roommanager-method-rooms-convert) **(** **)** | Enumerations ------------ enum **PVSMode**: * **PVS\_MODE\_DISABLED** = **0** --- Use only [Portal](class_portal#class-portal)s at runtime to determine visibility. PVS will not be generated at [Room](class_room#class-room)s conversion, and gameplay notifications cannot be used. * **PVS\_MODE\_PARTIAL** = **1** --- Use a combination of PVS and [Portal](class_portal#class-portal)s to determine visibility (this is usually fastest and most accurate). * **PVS\_MODE\_FULL** = **2** --- Use only the PVS (potentially visible set) of [Room](class_room#class-room)s to determine visibility. Property Descriptions --------------------- ### [bool](class_bool#class-bool) active | | | | --- | --- | | *Default* | `true` | | *Setter* | rooms\_set\_active(value) | | *Getter* | rooms\_get\_active() | Switches the portal culling system on and off. It is important to note that when portal culling is active, it is responsible for **all** the 3d culling. Some editor visual debugging helpers may not be available when active, so switching the active flag is intended to be used to ensure your [Room](class_room#class-room) / [Portal](class_portal#class-portal) layout works within the editor. Switching to `active` will have no effect when the `room graph` is unloaded (the rooms have not yet been converted). **Note:** For efficiency, the portal system is designed to work with only the core visual object types. In particular, only nodes derived from [VisualInstance](class_visualinstance#class-visualinstance) are expected to show when the system is active. ### [bool](class_bool#class-bool) debug\_sprawl | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_debug\_sprawl(value) | | *Getter* | get\_debug\_sprawl() | Large objects can 'sprawl' over (be present in) more than one room. It can be useful to visualize which objects are sprawling outside the current room. Toggling this setting turns this debug view on and off. ### [float](class_float#class-float) default\_portal\_margin | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_default\_portal\_margin(value) | | *Getter* | get\_default\_portal\_margin() | Usually we don't want objects that only **just** cross a boundary into an adjacent [Room](class_room#class-room) to sprawl into that room. To prevent this, each [Portal](class_portal#class-portal) has an extra margin, or tolerance zone where objects can enter without sprawling to a neighbouring room. In most cases you can set this here for all portals. It is possible to override the margin for each portal. ### [bool](class_bool#class-bool) gameplay\_monitor | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_gameplay\_monitor\_enabled(value) | | *Getter* | get\_gameplay\_monitor\_enabled() | When using a partial or full PVS, the gameplay monitor allows you to receive callbacks when roaming objects or rooms enter or exit the **gameplay area**. The gameplay area is defined as either the primary, or secondary PVS. These callbacks allow you to, for example, reduce processing for objects that are far from the player, or turn on and off AI. You can either choose to receive callbacks as notifications through the `_notification` function, or as signals. `NOTIFICATION_ENTER_GAMEPLAY` `NOTIFICATION_EXIT_GAMEPLAY` Signals: `"gameplay_entered"`, `"gameplay_exited"` ### [bool](class_bool#class-bool) merge\_meshes | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_merge\_meshes(value) | | *Getter* | get\_merge\_meshes() | If enabled, the system will attempt to merge similar meshes (particularly in terms of materials) within [Room](class_room#class-room)s during conversion. This can significantly reduce the number of drawcalls and state changes required during rendering, albeit at a cost of reduced culling granularity. **Note:** This operates at runtime during the conversion process, and will only operate on exported or running projects, in order to prevent accidental alteration to the scene and loss of data. ### [int](class_int#class-int) overlap\_warning\_threshold | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_overlap\_warning\_threshold(value) | | *Getter* | get\_overlap\_warning\_threshold() | When converting rooms, the editor will warn you if overlap is detected between rooms. Overlap can interfere with determining the room that cameras and objects are within. A small amount can be acceptable, depending on your level. Here you can alter the threshold at which the editor warning appears. There are no other side effects. ### [int](class_int#class-int) portal\_depth\_limit | | | | --- | --- | | *Default* | `16` | | *Setter* | set\_portal\_depth\_limit(value) | | *Getter* | get\_portal\_depth\_limit() | Portal rendering is recursive - each time a portal is seen through an earlier portal there is some cost. For this reason, and to prevent the possibility of infinite loops, this setting provides a hard limit on the recursion depth. **Note:** This value is unused when using `Full` PVS mode. ### [NodePath](class_nodepath#class-nodepath) preview\_camera | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_preview\_camera\_path(value) | | *Getter* | get\_preview\_camera\_path() | Portal culling normally operates using the current [Camera](class_camera#class-camera) / [Camera](class_camera#class-camera)s, however for debugging purposes within the editor, you can use this setting to override this behavior and force it to use a particular camera to get a better idea of what the occlusion culling is doing. ### [PVSMode](#enum-roommanager-pvsmode) pvs\_mode | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_pvs\_mode(value) | | *Getter* | get\_pvs\_mode() | Optionally during conversion the potentially visible set (PVS) of rooms that are potentially visible from each room can be calculated. This can be used either to aid in dynamic portal culling, or to totally replace portal culling. In `Full` PVS Mode, all objects within the potentially visible rooms will be frustum culled, and rendered if they are within the view frustum. ### [float](class_float#class-float) roaming\_expansion\_margin | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_roaming\_expansion\_margin(value) | | *Getter* | get\_roaming\_expansion\_margin() | In order to reduce processing for roaming objects, an expansion is applied to their AABB as they move. This expanded volume is used to calculate which rooms the roaming object is within. If the object's exact AABB is still within this expanded volume on the next move, there is no need to reprocess the object, which can save considerable CPU. The downside is that if the expansion is too much, the object may end up unexpectedly sprawling into neighbouring rooms and showing up where it might otherwise be culled. In order to balance roaming performance against culling accuracy, this expansion margin can be customized by the user. It will typically depend on your room and object sizes, and movement speeds. The default value should work reasonably in most circumstances. ### [float](class_float#class-float) room\_simplify | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_room\_simplify(value) | | *Getter* | get\_room\_simplify() | During the conversion process, the geometry of objects within [Room](class_room#class-room)s, or a custom specified manual bound, are used to generate a **convex hull bound**. This convex hull is **required** in the visibility system, and is used for many purposes. Most importantly, it is used to decide whether the [Camera](class_camera#class-camera) (or an object) is within a [Room](class_room#class-room). The convex hull generating algorithm is good, but occasionally it can create too many (or too few) planes to give a good representation of the room volume. The `room_simplify` value can be used to gain fine control over this process. It determines how similar planes can be for them to be considered the same (and duplicates removed). The value can be set between 0 (no simplification) and 1 (maximum simplification). The value set here is the default for all rooms, but individual rooms can override this value if desired. The room convex hulls are shown as a wireframe in the editor. ### [NodePath](class_nodepath#class-nodepath) roomlist | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_roomlist\_path(value) | | *Getter* | get\_roomlist\_path() | For the [Room](class_room#class-room) conversion process to succeed, you must point the `RoomManager` to the parent [Node](class_node#class-node) of your [Room](class_room#class-room)s and [RoomGroup](class_roomgroup#class-roomgroup)s, which we refer to as the `roomlist` (the roomlist is not a special node type, it is normally just a [Spatial](class_spatial#class-spatial)). ### [bool](class_bool#class-bool) show\_margins | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_show\_margins(value) | | *Getter* | get\_show\_margins() | Shows the [Portal](class_portal#class-portal) margins when the portal gizmo is used in the editor. ### [bool](class_bool#class-bool) use\_secondary\_pvs | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_secondary\_pvs(value) | | *Getter* | get\_use\_secondary\_pvs() | When receiving gameplay callbacks when objects enter and exit gameplay, the **gameplay area** can be defined by either the primary PVS (potentially visible set) of [Room](class_room#class-room)s, or the secondary PVS (the primary PVS and their neighbouring [Room](class_room#class-room)s). Sometimes using the larger gameplay area of the secondary PVS may be preferable. Method Descriptions ------------------- ### void rooms\_clear ( ) This function clears all converted data from the **room graph**. Use this before unloading a level, when transitioning from level to level, or returning to a main menu. ### void rooms\_convert ( ) This is the most important function in the whole portal culling system. Without it, the system cannot function. First it goes through every [Room](class_room#class-room) that is a child of the `room list` node (and [RoomGroup](class_roomgroup#class-roomgroup)s within) and converts and adds it to the `room graph`. This works for both [Room](class_room#class-room) nodes, and [Spatial](class_spatial#class-spatial) nodes that follow a special naming convention. They should begin with the prefix *'Room\_'*, followed by the name you wish to give the room, e.g. *'Room\_lounge'*. This will automatically convert such [Spatial](class_spatial#class-spatial)s to [Room](class_room#class-room) nodes for you. This is useful if you want to build you entire room system in e.g. Blender, and reimport multiple times as you work on the level. The conversion will try to assign [VisualInstance](class_visualinstance#class-visualinstance)s that are children and grandchildren of the [Room](class_room#class-room) to the room. These should be given a suitable `portal mode` (see the [CullInstance](class_cullinstance#class-cullinstance) documentation). The default `portal mode` is `STATIC` - objects which are not expected to move while the level is played, which will typically be most objects. The conversion will usually use the geometry of these [VisualInstance](class_visualinstance#class-visualinstance)s (and the [Portal](class_portal#class-portal)s) to calculate a convex hull bound for the room. These bounds will be shown in the editor with a wireframe. Alternatively you can specify a manual custom bound for any room, see the [Room](class_room#class-room) documentation. By definition, [Camera](class_camera#class-camera)s within a room can see everything else within the room (that is one advantage to using convex hulls). However, in order to see from one room into adjacent rooms, you must place [Portal](class_portal#class-portal)s, which represent openings that the camera can see through, like windows and doors. [Portal](class_portal#class-portal)s are really just specialized [MeshInstance](class_meshinstance#class-meshinstance)s. In fact you will usually first create a portal by creating a [MeshInstance](class_meshinstance#class-meshinstance), especially a `plane` mesh instance. You would move the plane in the editor to cover a window or doorway, with the front face pointing outward from the room. To let the conversion process know you want this mesh to be a portal, again we use a special naming convention. [MeshInstance](class_meshinstance#class-meshinstance)s to be converted to a [Portal](class_portal#class-portal) should start with the prefix *'Portal\_'*. You now have a choice - you can leave the name as *'Portal\_'* and allow the system to automatically detect the nearest [Room](class_room#class-room) to link. In most cases this will work fine. An alternative method is to specify the [Room](class_room#class-room) to link to manually, appending a suffix to the portal name, which should be the name of the room you intend to link to. For example *'Portal\_lounge'* will attempt to link to the room named *'Room\_lounge'*. There is a special case here - Godot does not allow two nodes to share the same name. What if you want to manually have more than one portal leading into the same room? Surely they will need to both be called, e.g. *'Portal\_lounge'*? The solution is a wildcard character. After the room name, if you use the character *'\*'*, this character and anything following it will be ignored. So you can use for example *'Portal\_lounge\*0'*, *'Portal\_lounge\*1'* etc. Note that [Portal](class_portal#class-portal)s that have already been converted to [Portal](class_portal#class-portal) nodes (rather than [MeshInstance](class_meshinstance#class-meshinstance)s) still need to follow the same naming convention, as they will be relinked each time during conversion. It is recommended that you only place objects in rooms that are desired to stay within those rooms - i.e. `portal mode`s `STATIC` or `DYNAMIC` (not crossing portals). `GLOBAL` and `ROAMING` objects are best placed in another part of the scene tree, to avoid confusion. See [CullInstance](class_cullinstance#class-cullinstance) for a full description of portal modes.
programming_docs
godot Path Path ==== **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Contains a [Curve3D](class_curve3d#class-curve3d) path for [PathFollow](class_pathfollow#class-pathfollow) nodes to follow. Description ----------- Can have [PathFollow](class_pathfollow#class-pathfollow) child nodes moving along the [Curve3D](class_curve3d#class-curve3d). See [PathFollow](class_pathfollow#class-pathfollow) for more information on the usage. Note that the path is considered as relative to the moved nodes (children of [PathFollow](class_pathfollow#class-pathfollow)). As such, the curve should usually start with a zero vector `(0, 0, 0)`. Properties ---------- | | | | --- | --- | | [Curve3D](class_curve3d#class-curve3d) | [curve](#class-path-property-curve) | Signals ------- ### curve\_changed ( ) Emitted when the [curve](#class-path-property-curve) changes. Property Descriptions --------------------- ### [Curve3D](class_curve3d#class-curve3d) curve | | | | --- | --- | | *Setter* | set\_curve(value) | | *Getter* | get\_curve() | A [Curve3D](class_curve3d#class-curve3d) describing the path. godot MeshTexture MeshTexture =========== **Inherits:** [Texture](class_texture#class-texture) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Simple texture that uses a mesh to draw itself. Description ----------- Simple texture that uses a mesh to draw itself. It's limited because flags can't be changed and region drawing is not supported. Properties ---------- | | | | | --- | --- | --- | | [Texture](class_texture#class-texture) | [base\_texture](#class-meshtexture-property-base-texture) | | | [int](class_int#class-int) | flags | `0` (overrides [Texture](class_texture#class-texture-property-flags)) | | [Vector2](class_vector2#class-vector2) | [image\_size](#class-meshtexture-property-image-size) | `Vector2( 0, 0 )` | | [Mesh](class_mesh#class-mesh) | [mesh](#class-meshtexture-property-mesh) | | Property Descriptions --------------------- ### [Texture](class_texture#class-texture) base\_texture | | | | --- | --- | | *Setter* | set\_base\_texture(value) | | *Getter* | get\_base\_texture() | Sets the base texture that the Mesh will use to draw. ### [Vector2](class_vector2#class-vector2) image\_size | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_image\_size(value) | | *Getter* | get\_image\_size() | Sets the size of the image, needed for reference. ### [Mesh](class_mesh#class-mesh) mesh | | | | --- | --- | | *Setter* | set\_mesh(value) | | *Getter* | get\_mesh() | Sets the mesh used to draw. It must be a mesh using 2D vertices. godot RectangleShape2D RectangleShape2D ================ **Inherits:** [Shape2D](class_shape2d#class-shape2d) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Rectangle shape for 2D collisions. Description ----------- Rectangle shape for 2D collisions. This shape is useful for modeling box-like 2D objects. Tutorials --------- * [2D Pong Demo](https://godotengine.org/asset-library/asset/121) * [2D Kinematic Character Demo](https://godotengine.org/asset-library/asset/113) Properties ---------- | | | | | --- | --- | --- | | [Vector2](class_vector2#class-vector2) | [extents](#class-rectangleshape2d-property-extents) | `Vector2( 10, 10 )` | Property Descriptions --------------------- ### [Vector2](class_vector2#class-vector2) extents | | | | --- | --- | | *Default* | `Vector2( 10, 10 )` | | *Setter* | set\_extents(value) | | *Getter* | get\_extents() | The rectangle's half extents. The width and height of this shape is twice the half extents. godot AudioEffectStereoEnhance AudioEffectStereoEnhance ======================== **Inherits:** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [pan\_pullout](#class-audioeffectstereoenhance-property-pan-pullout) | `1.0` | | [float](class_float#class-float) | [surround](#class-audioeffectstereoenhance-property-surround) | `0.0` | | [float](class_float#class-float) | [time\_pullout\_ms](#class-audioeffectstereoenhance-property-time-pullout-ms) | `0.0` | Property Descriptions --------------------- ### [float](class_float#class-float) pan\_pullout | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_pan\_pullout(value) | | *Getter* | get\_pan\_pullout() | ### [float](class_float#class-float) surround | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_surround(value) | | *Getter* | get\_surround() | ### [float](class_float#class-float) time\_pullout\_ms | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_time\_pullout(value) | | *Getter* | get\_time\_pullout() | godot ProceduralSky ProceduralSky ============= **Inherits:** [Sky](class_sky#class-sky) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Type of [Sky](class_sky#class-sky) that is generated procedurally based on user input parameters. Description ----------- ProceduralSky provides a way to create an effective background quickly by defining procedural parameters for the sun, the sky and the ground. The sky and ground are very similar, they are defined by a color at the horizon, another color, and finally an easing curve to interpolate between these two colors. Similarly, the sun is described by a position in the sky, a color, and an easing curve. However, the sun also defines a minimum and maximum angle, these two values define at what distance the easing curve begins and ends from the sun, and thus end up defining the size of the sun in the sky. The ProceduralSky is updated on the CPU after the parameters change. It is stored in a texture and then displayed as a background in the scene. This makes it relatively unsuitable for real-time updates during gameplay. However, with a small enough texture size, it can still be updated relatively frequently, as it is updated on a background thread when multi-threading is available. Properties ---------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [ground\_bottom\_color](#class-proceduralsky-property-ground-bottom-color) | `Color( 0.156863, 0.184314, 0.211765, 1 )` | | [float](class_float#class-float) | [ground\_curve](#class-proceduralsky-property-ground-curve) | `0.02` | | [float](class_float#class-float) | [ground\_energy](#class-proceduralsky-property-ground-energy) | `1.0` | | [Color](class_color#class-color) | [ground\_horizon\_color](#class-proceduralsky-property-ground-horizon-color) | `Color( 0.423529, 0.396078, 0.372549, 1 )` | | [float](class_float#class-float) | [sky\_curve](#class-proceduralsky-property-sky-curve) | `0.09` | | [float](class_float#class-float) | [sky\_energy](#class-proceduralsky-property-sky-energy) | `1.0` | | [Color](class_color#class-color) | [sky\_horizon\_color](#class-proceduralsky-property-sky-horizon-color) | `Color( 0.839216, 0.917647, 0.980392, 1 )` | | [Color](class_color#class-color) | [sky\_top\_color](#class-proceduralsky-property-sky-top-color) | `Color( 0.647059, 0.839216, 0.945098, 1 )` | | [float](class_float#class-float) | [sun\_angle\_max](#class-proceduralsky-property-sun-angle-max) | `100.0` | | [float](class_float#class-float) | [sun\_angle\_min](#class-proceduralsky-property-sun-angle-min) | `1.0` | | [Color](class_color#class-color) | [sun\_color](#class-proceduralsky-property-sun-color) | `Color( 1, 1, 1, 1 )` | | [float](class_float#class-float) | [sun\_curve](#class-proceduralsky-property-sun-curve) | `0.05` | | [float](class_float#class-float) | [sun\_energy](#class-proceduralsky-property-sun-energy) | `1.0` | | [float](class_float#class-float) | [sun\_latitude](#class-proceduralsky-property-sun-latitude) | `35.0` | | [float](class_float#class-float) | [sun\_longitude](#class-proceduralsky-property-sun-longitude) | `0.0` | | [TextureSize](#enum-proceduralsky-texturesize) | [texture\_size](#class-proceduralsky-property-texture-size) | `2` | Enumerations ------------ enum **TextureSize**: * **TEXTURE\_SIZE\_256** = **0** --- Sky texture will be 256x128. * **TEXTURE\_SIZE\_512** = **1** --- Sky texture will be 512x256. * **TEXTURE\_SIZE\_1024** = **2** --- Sky texture will be 1024x512. This is the default size. * **TEXTURE\_SIZE\_2048** = **3** --- Sky texture will be 2048x1024. * **TEXTURE\_SIZE\_4096** = **4** --- Sky texture will be 4096x2048. * **TEXTURE\_SIZE\_MAX** = **5** --- Represents the size of the [TextureSize](#enum-proceduralsky-texturesize) enum. Property Descriptions --------------------- ### [Color](class_color#class-color) ground\_bottom\_color | | | | --- | --- | | *Default* | `Color( 0.156863, 0.184314, 0.211765, 1 )` | | *Setter* | set\_ground\_bottom\_color(value) | | *Getter* | get\_ground\_bottom\_color() | Color of the ground at the bottom. ### [float](class_float#class-float) ground\_curve | | | | --- | --- | | *Default* | `0.02` | | *Setter* | set\_ground\_curve(value) | | *Getter* | get\_ground\_curve() | How quickly the [ground\_horizon\_color](#class-proceduralsky-property-ground-horizon-color) fades into the [ground\_bottom\_color](#class-proceduralsky-property-ground-bottom-color). ### [float](class_float#class-float) ground\_energy | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_ground\_energy(value) | | *Getter* | get\_ground\_energy() | Amount of energy contribution from the ground. ### [Color](class_color#class-color) ground\_horizon\_color | | | | --- | --- | | *Default* | `Color( 0.423529, 0.396078, 0.372549, 1 )` | | *Setter* | set\_ground\_horizon\_color(value) | | *Getter* | get\_ground\_horizon\_color() | Color of the ground at the horizon. ### [float](class_float#class-float) sky\_curve | | | | --- | --- | | *Default* | `0.09` | | *Setter* | set\_sky\_curve(value) | | *Getter* | get\_sky\_curve() | How quickly the [sky\_horizon\_color](#class-proceduralsky-property-sky-horizon-color) fades into the [sky\_top\_color](#class-proceduralsky-property-sky-top-color). ### [float](class_float#class-float) sky\_energy | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_sky\_energy(value) | | *Getter* | get\_sky\_energy() | Amount of energy contribution from the sky. ### [Color](class_color#class-color) sky\_horizon\_color | | | | --- | --- | | *Default* | `Color( 0.839216, 0.917647, 0.980392, 1 )` | | *Setter* | set\_sky\_horizon\_color(value) | | *Getter* | get\_sky\_horizon\_color() | Color of the sky at the horizon. ### [Color](class_color#class-color) sky\_top\_color | | | | --- | --- | | *Default* | `Color( 0.647059, 0.839216, 0.945098, 1 )` | | *Setter* | set\_sky\_top\_color(value) | | *Getter* | get\_sky\_top\_color() | Color of the sky at the top. ### [float](class_float#class-float) sun\_angle\_max | | | | --- | --- | | *Default* | `100.0` | | *Setter* | set\_sun\_angle\_max(value) | | *Getter* | get\_sun\_angle\_max() | Distance from center of sun where it fades out completely. ### [float](class_float#class-float) sun\_angle\_min | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_sun\_angle\_min(value) | | *Getter* | get\_sun\_angle\_min() | Distance from sun where it goes from solid to starting to fade. ### [Color](class_color#class-color) sun\_color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_sun\_color(value) | | *Getter* | get\_sun\_color() | The sun's color. ### [float](class_float#class-float) sun\_curve | | | | --- | --- | | *Default* | `0.05` | | *Setter* | set\_sun\_curve(value) | | *Getter* | get\_sun\_curve() | How quickly the sun fades away between [sun\_angle\_min](#class-proceduralsky-property-sun-angle-min) and [sun\_angle\_max](#class-proceduralsky-property-sun-angle-max). ### [float](class_float#class-float) sun\_energy | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_sun\_energy(value) | | *Getter* | get\_sun\_energy() | Amount of energy contribution from the sun. ### [float](class_float#class-float) sun\_latitude | | | | --- | --- | | *Default* | `35.0` | | *Setter* | set\_sun\_latitude(value) | | *Getter* | get\_sun\_latitude() | The sun's height using polar coordinates. ### [float](class_float#class-float) sun\_longitude | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_sun\_longitude(value) | | *Getter* | get\_sun\_longitude() | The direction of the sun using polar coordinates. ### [TextureSize](#enum-proceduralsky-texturesize) texture\_size | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_texture\_size(value) | | *Getter* | get\_texture\_size() | Size of [Texture](class_texture#class-texture) that the ProceduralSky will generate. The size is set using [TextureSize](#enum-proceduralsky-texturesize). godot EncodedObjectAsID EncodedObjectAsID ================= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Holds a reference to an [Object](class_object#class-object)'s instance ID. Description ----------- Utility class which holds a reference to the internal identifier of an [Object](class_object#class-object) instance, as given by [Object.get\_instance\_id](class_object#class-object-method-get-instance-id). This ID can then be used to retrieve the object instance with [@GDScript.instance\_from\_id](class_%40gdscript#class-gdscript-method-instance-from-id). This class is used internally by the editor inspector and script debugger, but can also be used in plugins to pass and display objects as their IDs. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [object\_id](#class-encodedobjectasid-property-object-id) | `0` | Property Descriptions --------------------- ### [int](class_int#class-int) object\_id | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_object\_id(value) | | *Getter* | get\_object\_id() | The [Object](class_object#class-object) identifier stored in this `EncodedObjectAsID` instance. The object instance can be retrieved with [@GDScript.instance\_from\_id](class_%40gdscript#class-gdscript-method-instance-from-id). godot CryptoKey CryptoKey ========= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A cryptographic key (RSA). Description ----------- The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other [Resource](class_resource#class-resource). They can be used to generate a self-signed [X509Certificate](class_x509certificate#class-x509certificate) via [Crypto.generate\_self\_signed\_certificate](class_crypto#class-crypto-method-generate-self-signed-certificate) and as private key in [StreamPeerSSL.accept\_stream](class_streampeerssl#class-streampeerssl-method-accept-stream) along with the appropriate certificate. Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [is\_public\_only](#class-cryptokey-method-is-public-only) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [load](#class-cryptokey-method-load) **(** [String](class_string#class-string) path, [bool](class_bool#class-bool) public\_only=false **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [load\_from\_string](#class-cryptokey-method-load-from-string) **(** [String](class_string#class-string) string\_key, [bool](class_bool#class-bool) public\_only=false **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [save](#class-cryptokey-method-save) **(** [String](class_string#class-string) path, [bool](class_bool#class-bool) public\_only=false **)** | | [String](class_string#class-string) | [save\_to\_string](#class-cryptokey-method-save-to-string) **(** [bool](class_bool#class-bool) public\_only=false **)** | Method Descriptions ------------------- ### [bool](class_bool#class-bool) is\_public\_only ( ) const Return `true` if this CryptoKey only has the public part, and not the private one. ### [Error](class_%40globalscope#enum-globalscope-error) load ( [String](class_string#class-string) path, [bool](class_bool#class-bool) public\_only=false ) Loads a key from `path`. If `public_only` is `true`, only the public key will be loaded. **Note:** `path` should be a "\*.pub" file if `public_only` is `true`, a "\*.key" file otherwise. ### [Error](class_%40globalscope#enum-globalscope-error) load\_from\_string ( [String](class_string#class-string) string\_key, [bool](class_bool#class-bool) public\_only=false ) Loads a key from the given `string`. If `public_only` is `true`, only the public key will be loaded. ### [Error](class_%40globalscope#enum-globalscope-error) save ( [String](class_string#class-string) path, [bool](class_bool#class-bool) public\_only=false ) Saves a key to the given `path`. If `public_only` is `true`, only the public key will be saved. **Note:** `path` should be a "\*.pub" file if `public_only` is `true`, a "\*.key" file otherwise. ### [String](class_string#class-string) save\_to\_string ( [bool](class_bool#class-bool) public\_only=false ) Returns a string containing the key in PEM format. If `public_only` is `true`, only the public key will be included. godot TextMesh TextMesh ======== **Inherits:** [PrimitiveMesh](class_primitivemesh#class-primitivemesh) **<** [Mesh](class_mesh#class-mesh) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Generate an [PrimitiveMesh](class_primitivemesh#class-primitivemesh) from the text. Description ----------- Generate an [PrimitiveMesh](class_primitivemesh#class-primitivemesh) from the text. TextMesh can be generated only when using dynamic fonts with vector glyph contours. Bitmap fonts (including bitmap data in the TrueType/OpenType containers, like color emoji fonts) are not supported. The UV layout is arranged in 4 horizontal strips, top to bottom: 40% of the height for the front face, 40% for the back face, 10% for the outer edges and 10% for the inner edges. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [curve\_step](#class-textmesh-property-curve-step) | `0.5` | | [float](class_float#class-float) | [depth](#class-textmesh-property-depth) | `0.05` | | [Font](class_font#class-font) | [font](#class-textmesh-property-font) | | | [Align](#enum-textmesh-align) | [horizontal\_alignment](#class-textmesh-property-horizontal-alignment) | `1` | | [float](class_float#class-float) | [pixel\_size](#class-textmesh-property-pixel-size) | `0.01` | | [String](class_string#class-string) | [text](#class-textmesh-property-text) | `""` | | [bool](class_bool#class-bool) | [uppercase](#class-textmesh-property-uppercase) | `false` | Enumerations ------------ enum **Align**: * **ALIGN\_LEFT** = **0** --- Align rows to the left (default). * **ALIGN\_CENTER** = **1** --- Align rows centered. * **ALIGN\_RIGHT** = **2** --- Align rows to the right. Property Descriptions --------------------- ### [float](class_float#class-float) curve\_step | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_curve\_step(value) | | *Getter* | get\_curve\_step() | Step (in pixels) used to approximate Bézier curves. ### [float](class_float#class-float) depth | | | | --- | --- | | *Default* | `0.05` | | *Setter* | set\_depth(value) | | *Getter* | get\_depth() | Depths of the mesh, if set to `0.0` only front surface, is generated, and UV layout is changed to use full texture for the front face only. ### [Font](class_font#class-font) font | | | | --- | --- | | *Setter* | set\_font(value) | | *Getter* | get\_font() | [Font](class_font#class-font) used for the `TextMesh`'s text. ### [Align](#enum-textmesh-align) horizontal\_alignment | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_horizontal\_alignment(value) | | *Getter* | get\_horizontal\_alignment() | Controls the text's horizontal alignment. Supports left, center and right. Set it to one of the [Align](#enum-textmesh-align) constants. ### [float](class_float#class-float) pixel\_size | | | | --- | --- | | *Default* | `0.01` | | *Setter* | set\_pixel\_size(value) | | *Getter* | get\_pixel\_size() | The size of one pixel's width on the text to scale it in 3D. ### [String](class_string#class-string) text | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_text(value) | | *Getter* | get\_text() | The text to generate mesh from. ### [bool](class_bool#class-bool) uppercase | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_uppercase(value) | | *Getter* | is\_uppercase() | If `true`, all the text displays as UPPERCASE.
programming_docs
godot Curve3D Curve3D ======= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Describes a Bézier curve in 3D space. Description ----------- This class describes a Bézier curve in 3D space. It is mainly used to give a shape to a [Path](class_path#class-path), but can be manually sampled for other purposes. It keeps a cache of precalculated points along the curve, to speed up further calculations. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [bake\_interval](#class-curve3d-property-bake-interval) | `0.2` | | [bool](class_bool#class-bool) | [up\_vector\_enabled](#class-curve3d-property-up-vector-enabled) | `true` | Methods ------- | | | | --- | --- | | void | [add\_point](#class-curve3d-method-add-point) **(** [Vector3](class_vector3#class-vector3) position, [Vector3](class_vector3#class-vector3) in=Vector3( 0, 0, 0 ), [Vector3](class_vector3#class-vector3) out=Vector3( 0, 0, 0 ), [int](class_int#class-int) index=-1 **)** | | void | [clear\_points](#class-curve3d-method-clear-points) **(** **)** | | [float](class_float#class-float) | [get\_baked\_length](#class-curve3d-method-get-baked-length) **(** **)** const | | [PoolVector3Array](class_poolvector3array#class-poolvector3array) | [get\_baked\_points](#class-curve3d-method-get-baked-points) **(** **)** const | | [PoolRealArray](class_poolrealarray#class-poolrealarray) | [get\_baked\_tilts](#class-curve3d-method-get-baked-tilts) **(** **)** const | | [PoolVector3Array](class_poolvector3array#class-poolvector3array) | [get\_baked\_up\_vectors](#class-curve3d-method-get-baked-up-vectors) **(** **)** const | | [float](class_float#class-float) | [get\_closest\_offset](#class-curve3d-method-get-closest-offset) **(** [Vector3](class_vector3#class-vector3) to\_point **)** const | | [Vector3](class_vector3#class-vector3) | [get\_closest\_point](#class-curve3d-method-get-closest-point) **(** [Vector3](class_vector3#class-vector3) to\_point **)** const | | [int](class_int#class-int) | [get\_point\_count](#class-curve3d-method-get-point-count) **(** **)** const | | [Vector3](class_vector3#class-vector3) | [get\_point\_in](#class-curve3d-method-get-point-in) **(** [int](class_int#class-int) idx **)** const | | [Vector3](class_vector3#class-vector3) | [get\_point\_out](#class-curve3d-method-get-point-out) **(** [int](class_int#class-int) idx **)** const | | [Vector3](class_vector3#class-vector3) | [get\_point\_position](#class-curve3d-method-get-point-position) **(** [int](class_int#class-int) idx **)** const | | [float](class_float#class-float) | [get\_point\_tilt](#class-curve3d-method-get-point-tilt) **(** [int](class_int#class-int) idx **)** const | | [Vector3](class_vector3#class-vector3) | [interpolate](#class-curve3d-method-interpolate) **(** [int](class_int#class-int) idx, [float](class_float#class-float) t **)** const | | [Vector3](class_vector3#class-vector3) | [interpolate\_baked](#class-curve3d-method-interpolate-baked) **(** [float](class_float#class-float) offset, [bool](class_bool#class-bool) cubic=false **)** const | | [Vector3](class_vector3#class-vector3) | [interpolate\_baked\_up\_vector](#class-curve3d-method-interpolate-baked-up-vector) **(** [float](class_float#class-float) offset, [bool](class_bool#class-bool) apply\_tilt=false **)** const | | [Vector3](class_vector3#class-vector3) | [interpolatef](#class-curve3d-method-interpolatef) **(** [float](class_float#class-float) fofs **)** const | | void | [remove\_point](#class-curve3d-method-remove-point) **(** [int](class_int#class-int) idx **)** | | void | [set\_point\_in](#class-curve3d-method-set-point-in) **(** [int](class_int#class-int) idx, [Vector3](class_vector3#class-vector3) position **)** | | void | [set\_point\_out](#class-curve3d-method-set-point-out) **(** [int](class_int#class-int) idx, [Vector3](class_vector3#class-vector3) position **)** | | void | [set\_point\_position](#class-curve3d-method-set-point-position) **(** [int](class_int#class-int) idx, [Vector3](class_vector3#class-vector3) position **)** | | void | [set\_point\_tilt](#class-curve3d-method-set-point-tilt) **(** [int](class_int#class-int) idx, [float](class_float#class-float) tilt **)** | | [PoolVector3Array](class_poolvector3array#class-poolvector3array) | [tessellate](#class-curve3d-method-tessellate) **(** [int](class_int#class-int) max\_stages=5, [float](class_float#class-float) tolerance\_degrees=4 **)** const | Property Descriptions --------------------- ### [float](class_float#class-float) bake\_interval | | | | --- | --- | | *Default* | `0.2` | | *Setter* | set\_bake\_interval(value) | | *Getter* | get\_bake\_interval() | The distance in meters between two adjacent cached points. Changing it forces the cache to be recomputed the next time the [get\_baked\_points](#class-curve3d-method-get-baked-points) or [get\_baked\_length](#class-curve3d-method-get-baked-length) function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. ### [bool](class_bool#class-bool) up\_vector\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_up\_vector\_enabled(value) | | *Getter* | is\_up\_vector\_enabled() | If `true`, the curve will bake up vectors used for orientation. This is used when [PathFollow.rotation\_mode](class_pathfollow#class-pathfollow-property-rotation-mode) is set to [PathFollow.ROTATION\_ORIENTED](class_pathfollow#class-pathfollow-constant-rotation-oriented). Changing it forces the cache to be recomputed. Method Descriptions ------------------- ### void add\_point ( [Vector3](class_vector3#class-vector3) position, [Vector3](class_vector3#class-vector3) in=Vector3( 0, 0, 0 ), [Vector3](class_vector3#class-vector3) out=Vector3( 0, 0, 0 ), [int](class_int#class-int) index=-1 ) Adds a point with the specified `position` relative to the curve's own position, with control points `in` and `out`. Appends the new point at the end of the point list. If `index` is given, the new point is inserted before the existing point identified by index `index`. Every existing point starting from `index` is shifted further down the list of points. The index must be greater than or equal to `0` and must not exceed the number of existing points in the line. See [get\_point\_count](#class-curve3d-method-get-point-count). ### void clear\_points ( ) Removes all points from the curve. ### [float](class_float#class-float) get\_baked\_length ( ) const Returns the total length of the curve, based on the cached points. Given enough density (see [bake\_interval](#class-curve3d-property-bake-interval)), it should be approximate enough. ### [PoolVector3Array](class_poolvector3array#class-poolvector3array) get\_baked\_points ( ) const Returns the cache of points as a [PoolVector3Array](class_poolvector3array#class-poolvector3array). ### [PoolRealArray](class_poolrealarray#class-poolrealarray) get\_baked\_tilts ( ) const Returns the cache of tilts as a [PoolRealArray](class_poolrealarray#class-poolrealarray). ### [PoolVector3Array](class_poolvector3array#class-poolvector3array) get\_baked\_up\_vectors ( ) const Returns the cache of up vectors as a [PoolVector3Array](class_poolvector3array#class-poolvector3array). If [up\_vector\_enabled](#class-curve3d-property-up-vector-enabled) is `false`, the cache will be empty. ### [float](class_float#class-float) get\_closest\_offset ( [Vector3](class_vector3#class-vector3) to\_point ) const Returns the closest offset to `to_point`. This offset is meant to be used in [interpolate\_baked](#class-curve3d-method-interpolate-baked) or [interpolate\_baked\_up\_vector](#class-curve3d-method-interpolate-baked-up-vector). `to_point` must be in this curve's local space. ### [Vector3](class_vector3#class-vector3) get\_closest\_point ( [Vector3](class_vector3#class-vector3) to\_point ) const Returns the closest baked point (in curve's local space) to `to_point`. `to_point` must be in this curve's local space. ### [int](class_int#class-int) get\_point\_count ( ) const Returns the number of points describing the curve. ### [Vector3](class_vector3#class-vector3) get\_point\_in ( [int](class_int#class-int) idx ) const Returns the position of the control point leading to the vertex `idx`. The returned position is relative to the vertex `idx`. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0, 0)`. ### [Vector3](class_vector3#class-vector3) get\_point\_out ( [int](class_int#class-int) idx ) const Returns the position of the control point leading out of the vertex `idx`. The returned position is relative to the vertex `idx`. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0, 0)`. ### [Vector3](class_vector3#class-vector3) get\_point\_position ( [int](class_int#class-int) idx ) const Returns the position of the vertex `idx`. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0, 0)`. ### [float](class_float#class-float) get\_point\_tilt ( [int](class_int#class-int) idx ) const Returns the tilt angle in radians for the point `idx`. If the index is out of bounds, the function sends an error to the console, and returns `0`. ### [Vector3](class_vector3#class-vector3) interpolate ( [int](class_int#class-int) idx, [float](class_float#class-float) t ) const Returns the position between the vertex `idx` and the vertex `idx + 1`, where `t` controls if the point is the first vertex (`t = 0.0`), the last vertex (`t = 1.0`), or in between. Values of `t` outside the range (`0.0 >= t <=1`) give strange, but predictable results. If `idx` is out of bounds it is truncated to the first or last vertex, and `t` is ignored. If the curve has no points, the function sends an error to the console, and returns `(0, 0, 0)`. ### [Vector3](class_vector3#class-vector3) interpolate\_baked ( [float](class_float#class-float) offset, [bool](class_bool#class-bool) cubic=false ) const Returns a point within the curve at position `offset`, where `offset` is measured as a distance in 3D units along the curve. To do that, it finds the two cached points where the `offset` lies between, then interpolates the values. This interpolation is cubic if `cubic` is set to `true`, or linear if set to `false`. Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough). ### [Vector3](class_vector3#class-vector3) interpolate\_baked\_up\_vector ( [float](class_float#class-float) offset, [bool](class_bool#class-bool) apply\_tilt=false ) const Returns an up vector within the curve at position `offset`, where `offset` is measured as a distance in 3D units along the curve. To do that, it finds the two cached up vectors where the `offset` lies between, then interpolates the values. If `apply_tilt` is `true`, an interpolated tilt is applied to the interpolated up vector. If the curve has no up vectors, the function sends an error to the console, and returns `(0, 1, 0)`. ### [Vector3](class_vector3#class-vector3) interpolatef ( [float](class_float#class-float) fofs ) const Returns the position at the vertex `fofs`. It calls [interpolate](#class-curve3d-method-interpolate) using the integer part of `fofs` as `idx`, and its fractional part as `t`. ### void remove\_point ( [int](class_int#class-int) idx ) Deletes the point `idx` from the curve. Sends an error to the console if `idx` is out of bounds. ### void set\_point\_in ( [int](class_int#class-int) idx, [Vector3](class_vector3#class-vector3) position ) Sets the position of the control point leading to the vertex `idx`. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. ### void set\_point\_out ( [int](class_int#class-int) idx, [Vector3](class_vector3#class-vector3) position ) Sets the position of the control point leading out of the vertex `idx`. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. ### void set\_point\_position ( [int](class_int#class-int) idx, [Vector3](class_vector3#class-vector3) position ) Sets the position for the vertex `idx`. If the index is out of bounds, the function sends an error to the console. ### void set\_point\_tilt ( [int](class_int#class-int) idx, [float](class_float#class-float) tilt ) Sets the tilt angle in radians for the point `idx`. If the index is out of bounds, the function sends an error to the console. The tilt controls the rotation along the look-at axis an object traveling the path would have. In the case of a curve controlling a [PathFollow](class_pathfollow#class-pathfollow), this tilt is an offset over the natural tilt the [PathFollow](class_pathfollow#class-pathfollow) calculates. ### [PoolVector3Array](class_poolvector3array#class-poolvector3array) tessellate ( [int](class_int#class-int) max\_stages=5, [float](class_float#class-float) tolerance\_degrees=4 ) const Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts. This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough. `max_stages` controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! `tolerance_degrees` controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. godot ColorRect ColorRect ========= **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Colored rectangle. Description ----------- Displays a rectangle filled with a solid [color](#class-colorrect-property-color). If you need to display the border alone, consider using [ReferenceRect](class_referencerect#class-referencerect) instead. Tutorials --------- * [2D Dodge The Creeps Demo](https://godotengine.org/asset-library/asset/515) Properties ---------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [color](#class-colorrect-property-color) | `Color( 1, 1, 1, 1 )` | Property Descriptions --------------------- ### [Color](class_color#class-color) color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_frame\_color(value) | | *Getter* | get\_frame\_color() | The fill color. ``` $ColorRect.color = Color(1, 0, 0, 1) # Set ColorRect's color to red. ``` godot CanvasItemMaterial CanvasItemMaterial ================== **Inherits:** [Material](class_material#class-material) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A material for [CanvasItem](class_canvasitem#class-canvasitem)s. Description ----------- `CanvasItemMaterial`s provide a means of modifying the textures associated with a CanvasItem. They specialize in describing blend and lighting behaviors for textures. Use a [ShaderMaterial](class_shadermaterial#class-shadermaterial) to more fully customize a material's interactions with a [CanvasItem](class_canvasitem#class-canvasitem). Properties ---------- | | | | | --- | --- | --- | | [BlendMode](#enum-canvasitemmaterial-blendmode) | [blend\_mode](#class-canvasitemmaterial-property-blend-mode) | `0` | | [LightMode](#enum-canvasitemmaterial-lightmode) | [light\_mode](#class-canvasitemmaterial-property-light-mode) | `0` | | [int](class_int#class-int) | [particles\_anim\_h\_frames](#class-canvasitemmaterial-property-particles-anim-h-frames) | | | [bool](class_bool#class-bool) | [particles\_anim\_loop](#class-canvasitemmaterial-property-particles-anim-loop) | | | [int](class_int#class-int) | [particles\_anim\_v\_frames](#class-canvasitemmaterial-property-particles-anim-v-frames) | | | [bool](class_bool#class-bool) | [particles\_animation](#class-canvasitemmaterial-property-particles-animation) | `false` | Enumerations ------------ enum **BlendMode**: * **BLEND\_MODE\_MIX** = **0** --- Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value. * **BLEND\_MODE\_ADD** = **1** --- Additive blending mode. * **BLEND\_MODE\_SUB** = **2** --- Subtractive blending mode. * **BLEND\_MODE\_MUL** = **3** --- Multiplicative blending mode. * **BLEND\_MODE\_PREMULT\_ALPHA** = **4** --- Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value. enum **LightMode**: * **LIGHT\_MODE\_NORMAL** = **0** --- Render the material using both light and non-light sensitive material properties. * **LIGHT\_MODE\_UNSHADED** = **1** --- Render the material as if there were no light. * **LIGHT\_MODE\_LIGHT\_ONLY** = **2** --- Render the material as if there were only light. Property Descriptions --------------------- ### [BlendMode](#enum-canvasitemmaterial-blendmode) blend\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_blend\_mode(value) | | *Getter* | get\_blend\_mode() | The manner in which a material's rendering is applied to underlying textures. ### [LightMode](#enum-canvasitemmaterial-lightmode) light\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_light\_mode(value) | | *Getter* | get\_light\_mode() | The manner in which material reacts to lighting. ### [int](class_int#class-int) particles\_anim\_h\_frames | | | | --- | --- | | *Setter* | set\_particles\_anim\_h\_frames(value) | | *Getter* | get\_particles\_anim\_h\_frames() | The number of columns in the spritesheet assigned as [Texture](class_texture#class-texture) for a [Particles2D](class_particles2d#class-particles2d) or [CPUParticles2D](class_cpuparticles2d#class-cpuparticles2d). **Note:** This property is only used and visible in the editor if [particles\_animation](#class-canvasitemmaterial-property-particles-animation) is `true`. ### [bool](class_bool#class-bool) particles\_anim\_loop | | | | --- | --- | | *Setter* | set\_particles\_anim\_loop(value) | | *Getter* | get\_particles\_anim\_loop() | If `true`, the particles animation will loop. **Note:** This property is only used and visible in the editor if [particles\_animation](#class-canvasitemmaterial-property-particles-animation) is `true`. ### [int](class_int#class-int) particles\_anim\_v\_frames | | | | --- | --- | | *Setter* | set\_particles\_anim\_v\_frames(value) | | *Getter* | get\_particles\_anim\_v\_frames() | The number of rows in the spritesheet assigned as [Texture](class_texture#class-texture) for a [Particles2D](class_particles2d#class-particles2d) or [CPUParticles2D](class_cpuparticles2d#class-cpuparticles2d). **Note:** This property is only used and visible in the editor if [particles\_animation](#class-canvasitemmaterial-property-particles-animation) is `true`. ### [bool](class_bool#class-bool) particles\_animation | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_particles\_animation(value) | | *Getter* | get\_particles\_animation() | If `true`, enable spritesheet-based animation features when assigned to [Particles2D](class_particles2d#class-particles2d) and [CPUParticles2D](class_cpuparticles2d#class-cpuparticles2d) nodes. The [ParticlesMaterial.anim\_speed](class_particlesmaterial#class-particlesmaterial-property-anim-speed) or [CPUParticles2D.anim\_speed](class_cpuparticles2d#class-cpuparticles2d-property-anim-speed) should also be set to a positive value for the animation to play. This property (and other `particles_anim_*` properties that depend on it) has no effect on other types of nodes.
programming_docs
godot HScrollBar HScrollBar ========== **Inherits:** [ScrollBar](class_scrollbar#class-scrollbar) **<** [Range](class_range#class-range) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Horizontal scroll bar. Description ----------- Horizontal version of [ScrollBar](class_scrollbar#class-scrollbar), which goes from left (min) to right (max). Theme Properties ---------------- | | | | --- | --- | | [Texture](class_texture#class-texture) | [decrement](#class-hscrollbar-theme-icon-decrement) | | [Texture](class_texture#class-texture) | [decrement\_highlight](#class-hscrollbar-theme-icon-decrement-highlight) | | [Texture](class_texture#class-texture) | [decrement\_pressed](#class-hscrollbar-theme-icon-decrement-pressed) | | [Texture](class_texture#class-texture) | [increment](#class-hscrollbar-theme-icon-increment) | | [Texture](class_texture#class-texture) | [increment\_highlight](#class-hscrollbar-theme-icon-increment-highlight) | | [Texture](class_texture#class-texture) | [increment\_pressed](#class-hscrollbar-theme-icon-increment-pressed) | | [StyleBox](class_stylebox#class-stylebox) | [grabber](#class-hscrollbar-theme-style-grabber) | | [StyleBox](class_stylebox#class-stylebox) | [grabber\_highlight](#class-hscrollbar-theme-style-grabber-highlight) | | [StyleBox](class_stylebox#class-stylebox) | [grabber\_pressed](#class-hscrollbar-theme-style-grabber-pressed) | | [StyleBox](class_stylebox#class-stylebox) | [scroll](#class-hscrollbar-theme-style-scroll) | | [StyleBox](class_stylebox#class-stylebox) | [scroll\_focus](#class-hscrollbar-theme-style-scroll-focus) | Theme Property Descriptions --------------------------- ### [Texture](class_texture#class-texture) decrement Icon used as a button to scroll the [ScrollBar](class_scrollbar#class-scrollbar) left. Supports custom step using the [ScrollBar.custom\_step](class_scrollbar#class-scrollbar-property-custom-step) property. ### [Texture](class_texture#class-texture) decrement\_highlight Displayed when the mouse cursor hovers over the decrement button. ### [Texture](class_texture#class-texture) decrement\_pressed Displayed when the decrement button is being pressed. ### [Texture](class_texture#class-texture) increment Icon used as a button to scroll the [ScrollBar](class_scrollbar#class-scrollbar) right. Supports custom step using the [ScrollBar.custom\_step](class_scrollbar#class-scrollbar-property-custom-step) property. ### [Texture](class_texture#class-texture) increment\_highlight Displayed when the mouse cursor hovers over the increment button. ### [Texture](class_texture#class-texture) increment\_pressed Displayed when the increment button is being pressed. ### [StyleBox](class_stylebox#class-stylebox) grabber Used as texture for the grabber, the draggable element representing current scroll. ### [StyleBox](class_stylebox#class-stylebox) grabber\_highlight Used when the mouse hovers over the grabber. ### [StyleBox](class_stylebox#class-stylebox) grabber\_pressed Used when the grabber is being dragged. ### [StyleBox](class_stylebox#class-stylebox) scroll Used as background of this [ScrollBar](class_scrollbar#class-scrollbar). ### [StyleBox](class_stylebox#class-stylebox) scroll\_focus Used as background when the [ScrollBar](class_scrollbar#class-scrollbar) has the GUI focus. godot PacketPeerDTLS PacketPeerDTLS ============== **Inherits:** [PacketPeer](class_packetpeer#class-packetpeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) DTLS packet peer. Description ----------- This class represents a DTLS peer connection. It can be used to connect to a DTLS server, and is returned by [DTLSServer.take\_connection](class_dtlsserver#class-dtlsserver-method-take-connection). **Warning:** SSL/TLS certificate revocation and certificate pinning are currently not supported. Revoked certificates are accepted as long as they are otherwise valid. If this is a concern, you may want to use automatically managed certificates with a short validity period. Methods ------- | | | | --- | --- | | [Error](class_%40globalscope#enum-globalscope-error) | [connect\_to\_peer](#class-packetpeerdtls-method-connect-to-peer) **(** [PacketPeerUDP](class_packetpeerudp#class-packetpeerudp) packet\_peer, [bool](class_bool#class-bool) validate\_certs=true, [String](class_string#class-string) for\_hostname="", [X509Certificate](class_x509certificate#class-x509certificate) valid\_certificate=null **)** | | void | [disconnect\_from\_peer](#class-packetpeerdtls-method-disconnect-from-peer) **(** **)** | | [Status](#enum-packetpeerdtls-status) | [get\_status](#class-packetpeerdtls-method-get-status) **(** **)** const | | void | [poll](#class-packetpeerdtls-method-poll) **(** **)** | Enumerations ------------ enum **Status**: * **STATUS\_DISCONNECTED** = **0** --- A status representing a `PacketPeerDTLS` that is disconnected. * **STATUS\_HANDSHAKING** = **1** --- A status representing a `PacketPeerDTLS` that is currently performing the handshake with a remote peer. * **STATUS\_CONNECTED** = **2** --- A status representing a `PacketPeerDTLS` that is connected to a remote peer. * **STATUS\_ERROR** = **3** --- A status representing a `PacketPeerDTLS` in a generic error state. * **STATUS\_ERROR\_HOSTNAME\_MISMATCH** = **4** --- An error status that shows a mismatch in the DTLS certificate domain presented by the host and the domain requested for validation. Method Descriptions ------------------- ### [Error](class_%40globalscope#enum-globalscope-error) connect\_to\_peer ( [PacketPeerUDP](class_packetpeerudp#class-packetpeerudp) packet\_peer, [bool](class_bool#class-bool) validate\_certs=true, [String](class_string#class-string) for\_hostname="", [X509Certificate](class_x509certificate#class-x509certificate) valid\_certificate=null ) Connects a `peer` beginning the DTLS handshake using the underlying [PacketPeerUDP](class_packetpeerudp#class-packetpeerudp) which must be connected (see [PacketPeerUDP.connect\_to\_host](class_packetpeerudp#class-packetpeerudp-method-connect-to-host)). If `validate_certs` is `true`, `PacketPeerDTLS` will validate that the certificate presented by the remote peer and match it with the `for_hostname` argument. You can specify a custom [X509Certificate](class_x509certificate#class-x509certificate) to use for validation via the `valid_certificate` argument. ### void disconnect\_from\_peer ( ) Disconnects this peer, terminating the DTLS session. ### [Status](#enum-packetpeerdtls-status) get\_status ( ) const Returns the status of the connection. See [Status](#enum-packetpeerdtls-status) for values. ### void poll ( ) Poll the connection to check for incoming packets. Call this frequently to update the status and keep the connection working. godot AudioEffectBandPassFilter AudioEffectBandPassFilter ========================= **Inherits:** [AudioEffectFilter](class_audioeffectfilter#class-audioeffectfilter) **<** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Adds a band pass filter to the audio bus. Description ----------- Attenuates the frequencies inside of a range around the [AudioEffectFilter.cutoff\_hz](class_audioeffectfilter#class-audioeffectfilter-property-cutoff-hz) and cuts frequencies outside of this band. godot Plane Plane ===== Plane in hessian form. Description ----------- Plane represents a normalized plane equation. Basically, "normal" is the normal of the plane (a,b,c normalized), and "d" is the distance from the origin to the plane (in the direction of "normal"). "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing. Tutorials --------- * [Math](https://docs.godotengine.org/en/3.5/tutorials/math/index.html) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [d](#class-plane-property-d) | `0.0` | | [Vector3](class_vector3#class-vector3) | [normal](#class-plane-property-normal) | `Vector3( 0, 0, 0 )` | | [float](class_float#class-float) | [x](#class-plane-property-x) | `0.0` | | [float](class_float#class-float) | [y](#class-plane-property-y) | `0.0` | | [float](class_float#class-float) | [z](#class-plane-property-z) | `0.0` | Methods ------- | | | | --- | --- | | [Plane](#class-plane) | [Plane](#class-plane-method-plane) **(** [float](class_float#class-float) a, [float](class_float#class-float) b, [float](class_float#class-float) c, [float](class_float#class-float) d **)** | | [Plane](#class-plane) | [Plane](#class-plane-method-plane) **(** [Vector3](class_vector3#class-vector3) v1, [Vector3](class_vector3#class-vector3) v2, [Vector3](class_vector3#class-vector3) v3 **)** | | [Plane](#class-plane) | [Plane](#class-plane-method-plane) **(** [Vector3](class_vector3#class-vector3) normal, [float](class_float#class-float) d **)** | | [Vector3](class_vector3#class-vector3) | [center](#class-plane-method-center) **(** **)** | | [float](class_float#class-float) | [distance\_to](#class-plane-method-distance-to) **(** [Vector3](class_vector3#class-vector3) point **)** | | [Vector3](class_vector3#class-vector3) | [get\_any\_point](#class-plane-method-get-any-point) **(** **)** | | [bool](class_bool#class-bool) | [has\_point](#class-plane-method-has-point) **(** [Vector3](class_vector3#class-vector3) point, [float](class_float#class-float) epsilon=1e-05 **)** | | [Vector3](class_vector3#class-vector3) | [intersect\_3](#class-plane-method-intersect-3) **(** [Plane](#class-plane) b, [Plane](#class-plane) c **)** | | [Vector3](class_vector3#class-vector3) | [intersects\_ray](#class-plane-method-intersects-ray) **(** [Vector3](class_vector3#class-vector3) from, [Vector3](class_vector3#class-vector3) dir **)** | | [Vector3](class_vector3#class-vector3) | [intersects\_segment](#class-plane-method-intersects-segment) **(** [Vector3](class_vector3#class-vector3) begin, [Vector3](class_vector3#class-vector3) end **)** | | [bool](class_bool#class-bool) | [is\_equal\_approx](#class-plane-method-is-equal-approx) **(** [Plane](#class-plane) plane **)** | | [bool](class_bool#class-bool) | [is\_point\_over](#class-plane-method-is-point-over) **(** [Vector3](class_vector3#class-vector3) point **)** | | [Plane](#class-plane) | [normalized](#class-plane-method-normalized) **(** **)** | | [Vector3](class_vector3#class-vector3) | [project](#class-plane-method-project) **(** [Vector3](class_vector3#class-vector3) point **)** | Constants --------- * **PLANE\_YZ** = **Plane( 1, 0, 0, 0 )** --- A plane that extends in the Y and Z axes (normal vector points +X). * **PLANE\_XZ** = **Plane( 0, 1, 0, 0 )** --- A plane that extends in the X and Z axes (normal vector points +Y). * **PLANE\_XY** = **Plane( 0, 0, 1, 0 )** --- A plane that extends in the X and Y axes (normal vector points +Z). Property Descriptions --------------------- ### [float](class_float#class-float) d | | | | --- | --- | | *Default* | `0.0` | The distance from the origin to the plane, in the direction of [normal](#class-plane-property-normal). This value is typically non-negative. In the scalar equation of the plane `ax + by + cz = d`, this is `d`, while the `(a, b, c)` coordinates are represented by the [normal](#class-plane-property-normal) property. ### [Vector3](class_vector3#class-vector3) normal | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | The normal of the plane, which must be normalized. In the scalar equation of the plane `ax + by + cz = d`, this is the vector `(a, b, c)`, where `d` is the [d](#class-plane-property-d) property. ### [float](class_float#class-float) x | | | | --- | --- | | *Default* | `0.0` | The X component of the plane's [normal](#class-plane-property-normal) vector. ### [float](class_float#class-float) y | | | | --- | --- | | *Default* | `0.0` | The Y component of the plane's [normal](#class-plane-property-normal) vector. ### [float](class_float#class-float) z | | | | --- | --- | | *Default* | `0.0` | The Z component of the plane's [normal](#class-plane-property-normal) vector. Method Descriptions ------------------- ### [Plane](#class-plane) Plane ( [float](class_float#class-float) a, [float](class_float#class-float) b, [float](class_float#class-float) c, [float](class_float#class-float) d ) Creates a plane from the four parameters. The three components of the resulting plane's [normal](#class-plane-property-normal) are `a`, `b` and `c`, and the plane has a distance of `d` from the origin. * [Plane](#class-plane) **Plane** **(** [Vector3](class_vector3#class-vector3) v1, [Vector3](class_vector3#class-vector3) v2, [Vector3](class_vector3#class-vector3) v3 **)** Creates a plane from the three points, given in clockwise order. * [Plane](#class-plane) **Plane** **(** [Vector3](class_vector3#class-vector3) normal, [float](class_float#class-float) d **)** Creates a plane from the normal and the plane's distance to the origin. ### [Vector3](class_vector3#class-vector3) center ( ) Returns the center of the plane. ### [float](class_float#class-float) distance\_to ( [Vector3](class_vector3#class-vector3) point ) Returns the shortest distance from the plane to the position `point`. ### [Vector3](class_vector3#class-vector3) get\_any\_point ( ) Returns the center of the plane. This method is deprecated, please use [center](#class-plane-method-center) instead. ### [bool](class_bool#class-bool) has\_point ( [Vector3](class_vector3#class-vector3) point, [float](class_float#class-float) epsilon=1e-05 ) Returns `true` if `point` is inside the plane. Comparison uses a custom minimum `epsilon` threshold. ### [Vector3](class_vector3#class-vector3) intersect\_3 ( [Plane](#class-plane) b, [Plane](#class-plane) c ) Returns the intersection point of the three planes `b`, `c` and this plane. If no intersection is found, `null` is returned. ### [Vector3](class_vector3#class-vector3) intersects\_ray ( [Vector3](class_vector3#class-vector3) from, [Vector3](class_vector3#class-vector3) dir ) Returns the intersection point of a ray consisting of the position `from` and the direction normal `dir` with this plane. If no intersection is found, `null` is returned. ### [Vector3](class_vector3#class-vector3) intersects\_segment ( [Vector3](class_vector3#class-vector3) begin, [Vector3](class_vector3#class-vector3) end ) Returns the intersection point of a segment from position `begin` to position `end` with this plane. If no intersection is found, `null` is returned. ### [bool](class_bool#class-bool) is\_equal\_approx ( [Plane](#class-plane) plane ) Returns `true` if this plane and `plane` are approximately equal, by running [@GDScript.is\_equal\_approx](class_%40gdscript#class-gdscript-method-is-equal-approx) on each component. ### [bool](class_bool#class-bool) is\_point\_over ( [Vector3](class_vector3#class-vector3) point ) Returns `true` if `point` is located above the plane. ### [Plane](#class-plane) normalized ( ) Returns a copy of the plane, normalized. ### [Vector3](class_vector3#class-vector3) project ( [Vector3](class_vector3#class-vector3) point ) Returns the orthogonal projection of `point` into a point in the plane. godot BackBufferCopy BackBufferCopy ============== **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Copies a region of the screen (or the whole screen) to a buffer so it can be accessed in your shader scripts through the `texture(SCREEN_TEXTURE, ...)` function. Description ----------- Node for back-buffering the currently-displayed screen. The region defined in the BackBufferCopy node is buffered with the content of the screen it covers, or the entire screen according to the copy mode set. Use the `texture(SCREEN_TEXTURE, ...)` function in your shader scripts to access the buffer. **Note:** Since this node inherits from [Node2D](class_node2d#class-node2d) (and not [Control](class_control#class-control)), anchors and margins won't apply to child [Control](class_control#class-control)-derived nodes. This can be problematic when resizing the window. To avoid this, add [Control](class_control#class-control)-derived nodes as *siblings* to the BackBufferCopy node instead of adding them as children. Properties ---------- | | | | | --- | --- | --- | | [CopyMode](#enum-backbuffercopy-copymode) | [copy\_mode](#class-backbuffercopy-property-copy-mode) | `1` | | [Rect2](class_rect2#class-rect2) | [rect](#class-backbuffercopy-property-rect) | `Rect2( -100, -100, 200, 200 )` | Enumerations ------------ enum **CopyMode**: * **COPY\_MODE\_DISABLED** = **0** --- Disables the buffering mode. This means the BackBufferCopy node will directly use the portion of screen it covers. * **COPY\_MODE\_RECT** = **1** --- BackBufferCopy buffers a rectangular region. * **COPY\_MODE\_VIEWPORT** = **2** --- BackBufferCopy buffers the entire screen. Property Descriptions --------------------- ### [CopyMode](#enum-backbuffercopy-copymode) copy\_mode | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_copy\_mode(value) | | *Getter* | get\_copy\_mode() | Buffer mode. See [CopyMode](#enum-backbuffercopy-copymode) constants. ### [Rect2](class_rect2#class-rect2) rect | | | | --- | --- | | *Default* | `Rect2( -100, -100, 200, 200 )` | | *Setter* | set\_rect(value) | | *Getter* | get\_rect() | The area covered by the BackBufferCopy. Only used if [copy\_mode](#class-backbuffercopy-property-copy-mode) is [COPY\_MODE\_RECT](#class-backbuffercopy-constant-copy-mode-rect). godot SpriteFrames SpriteFrames ============ **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Sprite frame library for AnimatedSprite and AnimatedSprite3D. Description ----------- Sprite frame library for an [AnimatedSprite](class_animatedsprite#class-animatedsprite) or [AnimatedSprite3D](class_animatedsprite3d#class-animatedsprite3d) node. Contains frames and animation data for playback. **Note:** You can associate a set of normal maps by creating additional `SpriteFrames` resources with a `_normal` suffix. For example, having 2 `SpriteFrames` resources `run` and `run_normal` will make it so the `run` animation uses the normal map. Properties ---------- | | | | --- | --- | | [Array](class_array#class-array) | [frames](#class-spriteframes-property-frames) | Methods ------- | | | | --- | --- | | void | [add\_animation](#class-spriteframes-method-add-animation) **(** [String](class_string#class-string) anim **)** | | void | [add\_frame](#class-spriteframes-method-add-frame) **(** [String](class_string#class-string) anim, [Texture](class_texture#class-texture) frame, [int](class_int#class-int) at\_position=-1 **)** | | void | [clear](#class-spriteframes-method-clear) **(** [String](class_string#class-string) anim **)** | | void | [clear\_all](#class-spriteframes-method-clear-all) **(** **)** | | [bool](class_bool#class-bool) | [get\_animation\_loop](#class-spriteframes-method-get-animation-loop) **(** [String](class_string#class-string) anim **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_animation\_names](#class-spriteframes-method-get-animation-names) **(** **)** const | | [float](class_float#class-float) | [get\_animation\_speed](#class-spriteframes-method-get-animation-speed) **(** [String](class_string#class-string) anim **)** const | | [Texture](class_texture#class-texture) | [get\_frame](#class-spriteframes-method-get-frame) **(** [String](class_string#class-string) anim, [int](class_int#class-int) idx **)** const | | [int](class_int#class-int) | [get\_frame\_count](#class-spriteframes-method-get-frame-count) **(** [String](class_string#class-string) anim **)** const | | [bool](class_bool#class-bool) | [has\_animation](#class-spriteframes-method-has-animation) **(** [String](class_string#class-string) anim **)** const | | void | [remove\_animation](#class-spriteframes-method-remove-animation) **(** [String](class_string#class-string) anim **)** | | void | [remove\_frame](#class-spriteframes-method-remove-frame) **(** [String](class_string#class-string) anim, [int](class_int#class-int) idx **)** | | void | [rename\_animation](#class-spriteframes-method-rename-animation) **(** [String](class_string#class-string) anim, [String](class_string#class-string) newname **)** | | void | [set\_animation\_loop](#class-spriteframes-method-set-animation-loop) **(** [String](class_string#class-string) anim, [bool](class_bool#class-bool) loop **)** | | void | [set\_animation\_speed](#class-spriteframes-method-set-animation-speed) **(** [String](class_string#class-string) anim, [float](class_float#class-float) speed **)** | | void | [set\_frame](#class-spriteframes-method-set-frame) **(** [String](class_string#class-string) anim, [int](class_int#class-int) idx, [Texture](class_texture#class-texture) txt **)** | Property Descriptions --------------------- ### [Array](class_array#class-array) frames Compatibility property, always equals to an empty array. Method Descriptions ------------------- ### void add\_animation ( [String](class_string#class-string) anim ) Adds a new animation to the library. ### void add\_frame ( [String](class_string#class-string) anim, [Texture](class_texture#class-texture) frame, [int](class_int#class-int) at\_position=-1 ) Adds a frame to the given animation. ### void clear ( [String](class_string#class-string) anim ) Removes all frames from the given animation. ### void clear\_all ( ) Removes all animations. A "default" animation will be created. ### [bool](class_bool#class-bool) get\_animation\_loop ( [String](class_string#class-string) anim ) const Returns `true` if the given animation is configured to loop when it finishes playing. Otherwise, returns `false`. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_animation\_names ( ) const Returns an array containing the names associated to each animation. Values are placed in alphabetical order. ### [float](class_float#class-float) get\_animation\_speed ( [String](class_string#class-string) anim ) const The animation's speed in frames per second. ### [Texture](class_texture#class-texture) get\_frame ( [String](class_string#class-string) anim, [int](class_int#class-int) idx ) const Returns the animation's selected frame. ### [int](class_int#class-int) get\_frame\_count ( [String](class_string#class-string) anim ) const Returns the number of frames in the animation. ### [bool](class_bool#class-bool) has\_animation ( [String](class_string#class-string) anim ) const If `true`, the named animation exists. ### void remove\_animation ( [String](class_string#class-string) anim ) Removes the given animation. ### void remove\_frame ( [String](class_string#class-string) anim, [int](class_int#class-int) idx ) Removes the animation's selected frame. ### void rename\_animation ( [String](class_string#class-string) anim, [String](class_string#class-string) newname ) Changes the animation's name to `newname`. ### void set\_animation\_loop ( [String](class_string#class-string) anim, [bool](class_bool#class-bool) loop ) If `true`, the animation will loop. ### void set\_animation\_speed ( [String](class_string#class-string) anim, [float](class_float#class-float) speed ) The animation's speed in frames per second. ### void set\_frame ( [String](class_string#class-string) anim, [int](class_int#class-int) idx, [Texture](class_texture#class-texture) txt ) Sets the texture of the given frame.
programming_docs
godot VisualShaderNodeIf VisualShaderNodeIf ================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) godot ARVRPositionalTracker ARVRPositionalTracker ===================== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A tracked object. Description ----------- An instance of this object represents a device that is tracked, such as a controller or anchor point. HMDs aren't represented here as they are handled internally. As controllers are turned on and the AR/VR interface detects them, instances of this object are automatically added to this list of active tracking objects accessible through the [ARVRServer](class_arvrserver#class-arvrserver). The [ARVRController](class_arvrcontroller#class-arvrcontroller) and [ARVRAnchor](class_arvranchor#class-arvranchor) both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDNative-based interfaces can interact with them. Tutorials --------- * [XR (AR/VR)](https://docs.godotengine.org/en/3.5/tutorials/vr/index.html) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [rumble](#class-arvrpositionaltracker-property-rumble) | `0.0` | Methods ------- | | | | --- | --- | | [TrackerHand](#enum-arvrpositionaltracker-trackerhand) | [get\_hand](#class-arvrpositionaltracker-method-get-hand) **(** **)** const | | [int](class_int#class-int) | [get\_joy\_id](#class-arvrpositionaltracker-method-get-joy-id) **(** **)** const | | [Mesh](class_mesh#class-mesh) | [get\_mesh](#class-arvrpositionaltracker-method-get-mesh) **(** **)** const | | [String](class_string#class-string) | [get\_name](#class-arvrpositionaltracker-method-get-name) **(** **)** const | | [Basis](class_basis#class-basis) | [get\_orientation](#class-arvrpositionaltracker-method-get-orientation) **(** **)** const | | [Vector3](class_vector3#class-vector3) | [get\_position](#class-arvrpositionaltracker-method-get-position) **(** **)** const | | [int](class_int#class-int) | [get\_tracker\_id](#class-arvrpositionaltracker-method-get-tracker-id) **(** **)** const | | [bool](class_bool#class-bool) | [get\_tracks\_orientation](#class-arvrpositionaltracker-method-get-tracks-orientation) **(** **)** const | | [bool](class_bool#class-bool) | [get\_tracks\_position](#class-arvrpositionaltracker-method-get-tracks-position) **(** **)** const | | [Transform](class_transform#class-transform) | [get\_transform](#class-arvrpositionaltracker-method-get-transform) **(** [bool](class_bool#class-bool) adjust\_by\_reference\_frame **)** const | | [TrackerType](class_arvrserver#enum-arvrserver-trackertype) | [get\_type](#class-arvrpositionaltracker-method-get-type) **(** **)** const | Enumerations ------------ enum **TrackerHand**: * **TRACKER\_HAND\_UNKNOWN** = **0** --- The hand this tracker is held in is unknown or not applicable. * **TRACKER\_LEFT\_HAND** = **1** --- This tracker is the left hand controller. * **TRACKER\_RIGHT\_HAND** = **2** --- This tracker is the right hand controller. Property Descriptions --------------------- ### [float](class_float#class-float) rumble | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_rumble(value) | | *Getter* | get\_rumble() | The degree to which the tracker rumbles. Ranges from `0.0` to `1.0` with precision `.01`. Method Descriptions ------------------- ### [TrackerHand](#enum-arvrpositionaltracker-trackerhand) get\_hand ( ) const Returns the hand holding this tracker, if known. See [TrackerHand](#enum-arvrpositionaltracker-trackerhand) constants. ### [int](class_int#class-int) get\_joy\_id ( ) const If this is a controller that is being tracked, the controller will also be represented by a joystick entry with this ID. ### [Mesh](class_mesh#class-mesh) get\_mesh ( ) const Returns the mesh related to a controller or anchor point if one is available. ### [String](class_string#class-string) get\_name ( ) const Returns the controller or anchor point's name if available. ### [Basis](class_basis#class-basis) get\_orientation ( ) const Returns the controller's orientation matrix. ### [Vector3](class_vector3#class-vector3) get\_position ( ) const Returns the world-space controller position. ### [int](class_int#class-int) get\_tracker\_id ( ) const Returns the internal tracker ID. This uniquely identifies the tracker per tracker type and matches the ID you need to specify for nodes such as the [ARVRController](class_arvrcontroller#class-arvrcontroller) and [ARVRAnchor](class_arvranchor#class-arvranchor) nodes. ### [bool](class_bool#class-bool) get\_tracks\_orientation ( ) const Returns `true` if this device tracks orientation. ### [bool](class_bool#class-bool) get\_tracks\_position ( ) const Returns `true` if this device tracks position. ### [Transform](class_transform#class-transform) get\_transform ( [bool](class_bool#class-bool) adjust\_by\_reference\_frame ) const Returns the transform combining this device's orientation and position. ### [TrackerType](class_arvrserver#enum-arvrserver-trackertype) get\_type ( ) const Returns the tracker's type. godot EditorSceneImporterGLTF EditorSceneImporterGLTF ======================= **Inherits:** [EditorSceneImporter](class_editorsceneimporter#class-editorsceneimporter) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Description ----------- **Note:** This class is only compiled in editor builds. Run-time glTF loading and saving is *not* available in exported projects. References to `EditorSceneImporterGLTF` within a script will cause an error in an exported project. godot CapsuleMesh CapsuleMesh =========== **Inherits:** [PrimitiveMesh](class_primitivemesh#class-primitivemesh) **<** [Mesh](class_mesh#class-mesh) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Class representing a capsule-shaped [PrimitiveMesh](class_primitivemesh#class-primitivemesh). Description ----------- Class representing a capsule-shaped [PrimitiveMesh](class_primitivemesh#class-primitivemesh). Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [mid\_height](#class-capsulemesh-property-mid-height) | `1.0` | | [int](class_int#class-int) | [radial\_segments](#class-capsulemesh-property-radial-segments) | `64` | | [float](class_float#class-float) | [radius](#class-capsulemesh-property-radius) | `1.0` | | [int](class_int#class-int) | [rings](#class-capsulemesh-property-rings) | `8` | Property Descriptions --------------------- ### [float](class_float#class-float) mid\_height | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_mid\_height(value) | | *Getter* | get\_mid\_height() | Height of the middle cylindrical part of the capsule (without the hemispherical ends). **Note:** The capsule's total height is equal to [mid\_height](#class-capsulemesh-property-mid-height) + 2 \* [radius](#class-capsulemesh-property-radius). ### [int](class_int#class-int) radial\_segments | | | | --- | --- | | *Default* | `64` | | *Setter* | set\_radial\_segments(value) | | *Getter* | get\_radial\_segments() | Number of radial segments on the capsule mesh. ### [float](class_float#class-float) radius | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_radius(value) | | *Getter* | get\_radius() | Radius of the capsule mesh. ### [int](class_int#class-int) rings | | | | --- | --- | | *Default* | `8` | | *Setter* | set\_rings(value) | | *Getter* | get\_rings() | Number of rings along the height of the capsule. godot WebRTCPeerConnectionGDNative WebRTCPeerConnectionGDNative ============================ **Inherits:** [WebRTCPeerConnection](class_webrtcpeerconnection#class-webrtcpeerconnection) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) godot Sprite3D Sprite3D ======== **Inherits:** [SpriteBase3D](class_spritebase3d#class-spritebase3d) **<** [GeometryInstance](class_geometryinstance#class-geometryinstance) **<** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) 2D sprite node in a 3D world. Description ----------- A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [frame](#class-sprite3d-property-frame) | `0` | | [Vector2](class_vector2#class-vector2) | [frame\_coords](#class-sprite3d-property-frame-coords) | `Vector2( 0, 0 )` | | [int](class_int#class-int) | [hframes](#class-sprite3d-property-hframes) | `1` | | [bool](class_bool#class-bool) | [region\_enabled](#class-sprite3d-property-region-enabled) | `false` | | [Rect2](class_rect2#class-rect2) | [region\_rect](#class-sprite3d-property-region-rect) | `Rect2( 0, 0, 0, 0 )` | | [Texture](class_texture#class-texture) | [texture](#class-sprite3d-property-texture) | | | [int](class_int#class-int) | [vframes](#class-sprite3d-property-vframes) | `1` | Signals ------- ### frame\_changed ( ) Emitted when the [frame](#class-sprite3d-property-frame) changes. Property Descriptions --------------------- ### [int](class_int#class-int) frame | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_frame(value) | | *Getter* | get\_frame() | Current frame to display from sprite sheet. [hframes](#class-sprite3d-property-hframes) or [vframes](#class-sprite3d-property-vframes) must be greater than 1. ### [Vector2](class_vector2#class-vector2) frame\_coords | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_frame\_coords(value) | | *Getter* | get\_frame\_coords() | Coordinates of the frame to display from sprite sheet. This is as an alias for the [frame](#class-sprite3d-property-frame) property. [hframes](#class-sprite3d-property-hframes) or [vframes](#class-sprite3d-property-vframes) must be greater than 1. ### [int](class_int#class-int) hframes | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_hframes(value) | | *Getter* | get\_hframes() | The number of columns in the sprite sheet. ### [bool](class_bool#class-bool) region\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_region(value) | | *Getter* | is\_region() | If `true`, texture will be cut from a larger atlas texture. See [region\_rect](#class-sprite3d-property-region-rect). ### [Rect2](class_rect2#class-rect2) region\_rect | | | | --- | --- | | *Default* | `Rect2( 0, 0, 0, 0 )` | | *Setter* | set\_region\_rect(value) | | *Getter* | get\_region\_rect() | The region of the atlas texture to display. [region\_enabled](#class-sprite3d-property-region-enabled) must be `true`. ### [Texture](class_texture#class-texture) texture | | | | --- | --- | | *Setter* | set\_texture(value) | | *Getter* | get\_texture() | [Texture](class_texture#class-texture) object to draw. If [GeometryInstance.material\_override](class_geometryinstance#class-geometryinstance-property-material-override) is used, this will be overridden. The size information is still used. ### [int](class_int#class-int) vframes | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_vframes(value) | | *Getter* | get\_vframes() | The number of rows in the sprite sheet. godot Polygon2D Polygon2D ========= **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) A 2D polygon. Description ----------- A Polygon2D is defined by a set of points. Each point is connected to the next, with the final point being connected to the first, resulting in a closed polygon. Polygon2Ds can be filled with color (solid or gradient) or filled with a given texture. **Note:** By default, Godot can only draw up to 4,096 polygon points at a time. To increase this limit, open the Project Settings and increase [ProjectSettings.rendering/limits/buffers/canvas\_polygon\_buffer\_size\_kb](class_projectsettings#class-projectsettings-property-rendering-limits-buffers-canvas-polygon-buffer-size-kb) and [ProjectSettings.rendering/limits/buffers/canvas\_polygon\_index\_buffer\_size\_kb](class_projectsettings#class-projectsettings-property-rendering-limits-buffers-canvas-polygon-index-buffer-size-kb). Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [antialiased](#class-polygon2d-property-antialiased) | `false` | | [Array](class_array#class-array) | [bones](#class-polygon2d-property-bones) | `[  ]` | | [Color](class_color#class-color) | [color](#class-polygon2d-property-color) | `Color( 1, 1, 1, 1 )` | | [int](class_int#class-int) | [internal\_vertex\_count](#class-polygon2d-property-internal-vertex-count) | `0` | | [float](class_float#class-float) | [invert\_border](#class-polygon2d-property-invert-border) | `100.0` | | [bool](class_bool#class-bool) | [invert\_enable](#class-polygon2d-property-invert-enable) | `false` | | [Vector2](class_vector2#class-vector2) | [offset](#class-polygon2d-property-offset) | `Vector2( 0, 0 )` | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [polygon](#class-polygon2d-property-polygon) | `PoolVector2Array(  )` | | [Array](class_array#class-array) | [polygons](#class-polygon2d-property-polygons) | `[  ]` | | [NodePath](class_nodepath#class-nodepath) | [skeleton](#class-polygon2d-property-skeleton) | `NodePath("")` | | [Texture](class_texture#class-texture) | [texture](#class-polygon2d-property-texture) | | | [Vector2](class_vector2#class-vector2) | [texture\_offset](#class-polygon2d-property-texture-offset) | `Vector2( 0, 0 )` | | [float](class_float#class-float) | [texture\_rotation](#class-polygon2d-property-texture-rotation) | | | [float](class_float#class-float) | [texture\_rotation\_degrees](#class-polygon2d-property-texture-rotation-degrees) | `0.0` | | [Vector2](class_vector2#class-vector2) | [texture\_scale](#class-polygon2d-property-texture-scale) | `Vector2( 1, 1 )` | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [uv](#class-polygon2d-property-uv) | `PoolVector2Array(  )` | | [PoolColorArray](class_poolcolorarray#class-poolcolorarray) | [vertex\_colors](#class-polygon2d-property-vertex-colors) | `PoolColorArray(  )` | Methods ------- | | | | --- | --- | | void | [add\_bone](#class-polygon2d-method-add-bone) **(** [NodePath](class_nodepath#class-nodepath) path, [PoolRealArray](class_poolrealarray#class-poolrealarray) weights **)** | | void | [clear\_bones](#class-polygon2d-method-clear-bones) **(** **)** | | void | [erase\_bone](#class-polygon2d-method-erase-bone) **(** [int](class_int#class-int) index **)** | | [int](class_int#class-int) | [get\_bone\_count](#class-polygon2d-method-get-bone-count) **(** **)** const | | [NodePath](class_nodepath#class-nodepath) | [get\_bone\_path](#class-polygon2d-method-get-bone-path) **(** [int](class_int#class-int) index **)** const | | [PoolRealArray](class_poolrealarray#class-poolrealarray) | [get\_bone\_weights](#class-polygon2d-method-get-bone-weights) **(** [int](class_int#class-int) index **)** const | | void | [set\_bone\_path](#class-polygon2d-method-set-bone-path) **(** [int](class_int#class-int) index, [NodePath](class_nodepath#class-nodepath) path **)** | | void | [set\_bone\_weights](#class-polygon2d-method-set-bone-weights) **(** [int](class_int#class-int) index, [PoolRealArray](class_poolrealarray#class-poolrealarray) weights **)** | Property Descriptions --------------------- ### [bool](class_bool#class-bool) antialiased | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_antialiased(value) | | *Getter* | get\_antialiased() | If `true`, attempts to perform antialiasing for polygon edges by drawing a thin OpenGL smooth line on the edges. **Note:** Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the [Antialiased Line2D](https://github.com/godot-extended-libraries/godot-antialiased-line2d) add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. ### [Array](class_array#class-array) bones | | | | --- | --- | | *Default* | `[  ]` | ### [Color](class_color#class-color) color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_color(value) | | *Getter* | get\_color() | The polygon's fill color. If `texture` is defined, it will be multiplied by this color. It will also be the default color for vertices not set in `vertex_colors`. ### [int](class_int#class-int) internal\_vertex\_count | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_internal\_vertex\_count(value) | | *Getter* | get\_internal\_vertex\_count() | ### [float](class_float#class-float) invert\_border | | | | --- | --- | | *Default* | `100.0` | | *Setter* | set\_invert\_border(value) | | *Getter* | get\_invert\_border() | Added padding applied to the bounding box when using `invert`. Setting this value too small may result in a "Bad Polygon" error. ### [bool](class_bool#class-bool) invert\_enable | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_invert(value) | | *Getter* | get\_invert() | If `true`, polygon will be inverted, containing the area outside the defined points and extending to the `invert_border`. ### [Vector2](class_vector2#class-vector2) offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_offset(value) | | *Getter* | get\_offset() | The offset applied to each vertex. ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) polygon | | | | --- | --- | | *Default* | `PoolVector2Array(  )` | | *Setter* | set\_polygon(value) | | *Getter* | get\_polygon() | The polygon's list of vertices. The final point will be connected to the first. **Note:** This returns a copy of the [PoolVector2Array](class_poolvector2array#class-poolvector2array) rather than a reference. ### [Array](class_array#class-array) polygons | | | | --- | --- | | *Default* | `[  ]` | | *Setter* | set\_polygons(value) | | *Getter* | get\_polygons() | ### [NodePath](class_nodepath#class-nodepath) skeleton | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_skeleton(value) | | *Getter* | get\_skeleton() | ### [Texture](class_texture#class-texture) texture | | | | --- | --- | | *Setter* | set\_texture(value) | | *Getter* | get\_texture() | The polygon's fill texture. Use `uv` to set texture coordinates. ### [Vector2](class_vector2#class-vector2) texture\_offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_texture\_offset(value) | | *Getter* | get\_texture\_offset() | Amount to offset the polygon's `texture`. If `(0, 0)` the texture's origin (its top-left corner) will be placed at the polygon's `position`. ### [float](class_float#class-float) texture\_rotation | | | | --- | --- | | *Setter* | set\_texture\_rotation(value) | | *Getter* | get\_texture\_rotation() | The texture's rotation in radians. ### [float](class_float#class-float) texture\_rotation\_degrees | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_texture\_rotation\_degrees(value) | | *Getter* | get\_texture\_rotation\_degrees() | The texture's rotation in degrees. ### [Vector2](class_vector2#class-vector2) texture\_scale | | | | --- | --- | | *Default* | `Vector2( 1, 1 )` | | *Setter* | set\_texture\_scale(value) | | *Getter* | get\_texture\_scale() | Amount to multiply the `uv` coordinates when using a `texture`. Larger values make the texture smaller, and vice versa. ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) uv | | | | --- | --- | | *Default* | `PoolVector2Array(  )` | | *Setter* | set\_uv(value) | | *Getter* | get\_uv() | Texture coordinates for each vertex of the polygon. There should be one `uv` per polygon vertex. If there are fewer, undefined vertices will use `(0, 0)`. ### [PoolColorArray](class_poolcolorarray#class-poolcolorarray) vertex\_colors | | | | --- | --- | | *Default* | `PoolColorArray(  )` | | *Setter* | set\_vertex\_colors(value) | | *Getter* | get\_vertex\_colors() | Color for each vertex. Colors are interpolated between vertices, resulting in smooth gradients. There should be one per polygon vertex. If there are fewer, undefined vertices will use `color`. Method Descriptions ------------------- ### void add\_bone ( [NodePath](class_nodepath#class-nodepath) path, [PoolRealArray](class_poolrealarray#class-poolrealarray) weights ) Adds a bone with the specified `path` and `weights`. ### void clear\_bones ( ) Removes all bones from this `Polygon2D`. ### void erase\_bone ( [int](class_int#class-int) index ) Removes the specified bone from this `Polygon2D`. ### [int](class_int#class-int) get\_bone\_count ( ) const Returns the number of bones in this `Polygon2D`. ### [NodePath](class_nodepath#class-nodepath) get\_bone\_path ( [int](class_int#class-int) index ) const Returns the path to the node associated with the specified bone. ### [PoolRealArray](class_poolrealarray#class-poolrealarray) get\_bone\_weights ( [int](class_int#class-int) index ) const Returns the height values of the specified bone. ### void set\_bone\_path ( [int](class_int#class-int) index, [NodePath](class_nodepath#class-nodepath) path ) Sets the path to the node associated with the specified bone. ### void set\_bone\_weights ( [int](class_int#class-int) index, [PoolRealArray](class_poolrealarray#class-poolrealarray) weights ) Sets the weight values for the specified bone.
programming_docs
godot DynamicFont DynamicFont =========== **Inherits:** [Font](class_font#class-font) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) DynamicFont renders vector font files at runtime. Description ----------- DynamicFont renders vector font files dynamically at runtime instead of using a prerendered texture atlas like [BitmapFont](class_bitmapfont#class-bitmapfont). This trades the faster loading time of [BitmapFont](class_bitmapfont#class-bitmapfont)s for the ability to change font parameters like size and spacing during runtime. [DynamicFontData](class_dynamicfontdata#class-dynamicfontdata) is used for referencing the font file paths. DynamicFont also supports defining one or more fallback fonts, which will be used when displaying a character not supported by the main font. DynamicFont uses the [FreeType](https://www.freetype.org/) library for rasterization. Supported formats are TrueType (`.ttf`), OpenType (`.otf`), Web Open Font Format 1 (`.woff`), and Web Open Font Format 2 (`.woff2`). ``` var dynamic_font = DynamicFont.new() dynamic_font.font_data = load("res://BarlowCondensed-Bold.ttf") dynamic_font.size = 64 $"Label".set("custom_fonts/font", dynamic_font) ``` **Note:** DynamicFont doesn't support features such as kerning, right-to-left typesetting, ligatures, text shaping, variable fonts and optional font features yet. If you wish to "bake" an optional font feature into a TTF font file, you can use [FontForge](https://fontforge.org/) to do so. In FontForge, use **File > Generate Fonts**, click **Options**, choose the desired features then generate the font. Tutorials --------- * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [extra\_spacing\_bottom](#class-dynamicfont-property-extra-spacing-bottom) | `0` | | [int](class_int#class-int) | [extra\_spacing\_char](#class-dynamicfont-property-extra-spacing-char) | `0` | | [int](class_int#class-int) | [extra\_spacing\_space](#class-dynamicfont-property-extra-spacing-space) | `0` | | [int](class_int#class-int) | [extra\_spacing\_top](#class-dynamicfont-property-extra-spacing-top) | `0` | | [DynamicFontData](class_dynamicfontdata#class-dynamicfontdata) | [font\_data](#class-dynamicfont-property-font-data) | | | [Color](class_color#class-color) | [outline\_color](#class-dynamicfont-property-outline-color) | `Color( 1, 1, 1, 1 )` | | [int](class_int#class-int) | [outline\_size](#class-dynamicfont-property-outline-size) | `0` | | [int](class_int#class-int) | [size](#class-dynamicfont-property-size) | `16` | | [bool](class_bool#class-bool) | [use\_filter](#class-dynamicfont-property-use-filter) | `false` | | [bool](class_bool#class-bool) | [use\_mipmaps](#class-dynamicfont-property-use-mipmaps) | `false` | Methods ------- | | | | --- | --- | | void | [add\_fallback](#class-dynamicfont-method-add-fallback) **(** [DynamicFontData](class_dynamicfontdata#class-dynamicfontdata) data **)** | | [String](class_string#class-string) | [get\_available\_chars](#class-dynamicfont-method-get-available-chars) **(** **)** const | | [DynamicFontData](class_dynamicfontdata#class-dynamicfontdata) | [get\_fallback](#class-dynamicfont-method-get-fallback) **(** [int](class_int#class-int) idx **)** const | | [int](class_int#class-int) | [get\_fallback\_count](#class-dynamicfont-method-get-fallback-count) **(** **)** const | | [int](class_int#class-int) | [get\_spacing](#class-dynamicfont-method-get-spacing) **(** [int](class_int#class-int) type **)** const | | void | [remove\_fallback](#class-dynamicfont-method-remove-fallback) **(** [int](class_int#class-int) idx **)** | | void | [set\_fallback](#class-dynamicfont-method-set-fallback) **(** [int](class_int#class-int) idx, [DynamicFontData](class_dynamicfontdata#class-dynamicfontdata) data **)** | | void | [set\_spacing](#class-dynamicfont-method-set-spacing) **(** [int](class_int#class-int) type, [int](class_int#class-int) value **)** | Enumerations ------------ enum **SpacingType**: * **SPACING\_TOP** = **0** --- Spacing at the top. * **SPACING\_BOTTOM** = **1** --- Spacing at the bottom. * **SPACING\_CHAR** = **2** --- Spacing for each character. * **SPACING\_SPACE** = **3** --- Spacing for the space character. Property Descriptions --------------------- ### [int](class_int#class-int) extra\_spacing\_bottom | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_spacing(value) | | *Getter* | get\_spacing() | Extra spacing at the bottom in pixels. ### [int](class_int#class-int) extra\_spacing\_char | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_spacing(value) | | *Getter* | get\_spacing() | Extra spacing for each character in pixels. This can be a negative number to make the distance between characters smaller. ### [int](class_int#class-int) extra\_spacing\_space | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_spacing(value) | | *Getter* | get\_spacing() | Extra spacing for the space character (in addition to [extra\_spacing\_char](#class-dynamicfont-property-extra-spacing-char)) in pixels. This can be a negative number to make the distance between words smaller. ### [int](class_int#class-int) extra\_spacing\_top | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_spacing(value) | | *Getter* | get\_spacing() | Extra spacing at the top in pixels. ### [DynamicFontData](class_dynamicfontdata#class-dynamicfontdata) font\_data | | | | --- | --- | | *Setter* | set\_font\_data(value) | | *Getter* | get\_font\_data() | The font data. ### [Color](class_color#class-color) outline\_color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_outline\_color(value) | | *Getter* | get\_outline\_color() | The font outline's color. **Note:** It's recommended to leave this at the default value so that you can adjust it in individual controls. For example, if the outline is made black here, it won't be possible to change its color using a Label's font outline modulate theme item. ### [int](class_int#class-int) outline\_size | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_outline\_size(value) | | *Getter* | get\_outline\_size() | The font outline's thickness in pixels (not relative to the font size). ### [int](class_int#class-int) size | | | | --- | --- | | *Default* | `16` | | *Setter* | set\_size(value) | | *Getter* | get\_size() | The font size in pixels. ### [bool](class_bool#class-bool) use\_filter | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_filter(value) | | *Getter* | get\_use\_filter() | If `true`, filtering is used. This makes the font blurry instead of pixelated when scaling it if font oversampling is disabled or ineffective. It's recommended to enable this when using the font in a control whose size changes over time, unless a pixel art aesthetic is desired. ### [bool](class_bool#class-bool) use\_mipmaps | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_mipmaps(value) | | *Getter* | get\_use\_mipmaps() | If `true`, mipmapping is used. This improves the font's appearance when downscaling it if font oversampling is disabled or ineffective. Method Descriptions ------------------- ### void add\_fallback ( [DynamicFontData](class_dynamicfontdata#class-dynamicfontdata) data ) Adds a fallback font. ### [String](class_string#class-string) get\_available\_chars ( ) const Returns a string containing all the characters available in the main and all the fallback fonts. If a given character is included in more than one font, it appears only once in the returned string. ### [DynamicFontData](class_dynamicfontdata#class-dynamicfontdata) get\_fallback ( [int](class_int#class-int) idx ) const Returns the fallback font at index `idx`. ### [int](class_int#class-int) get\_fallback\_count ( ) const Returns the number of fallback fonts. ### [int](class_int#class-int) get\_spacing ( [int](class_int#class-int) type ) const Returns the spacing for the given `type` (see [SpacingType](#enum-dynamicfont-spacingtype)). ### void remove\_fallback ( [int](class_int#class-int) idx ) Removes the fallback font at index `idx`. ### void set\_fallback ( [int](class_int#class-int) idx, [DynamicFontData](class_dynamicfontdata#class-dynamicfontdata) data ) Sets the fallback font at index `idx`. ### void set\_spacing ( [int](class_int#class-int) type, [int](class_int#class-int) value ) Sets the spacing for `type` (see [SpacingType](#enum-dynamicfont-spacingtype)) to `value` in pixels (not relative to the font size). godot EditorInterface EditorInterface =============== **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) Godot editor's interface. Description ----------- EditorInterface gives you control over Godot editor's window. It allows customizing the window, saving and (re-)loading scenes, rendering mesh previews, inspecting and editing resources and objects, and provides access to [EditorSettings](class_editorsettings#class-editorsettings), [EditorFileSystem](class_editorfilesystem#class-editorfilesystem), [EditorResourcePreview](class_editorresourcepreview#class-editorresourcepreview), [ScriptEditor](class_scripteditor#class-scripteditor), the editor viewport, and information about scenes. **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using [EditorPlugin.get\_editor\_interface](class_editorplugin#class-editorplugin-method-get-editor-interface). Properties ---------- | | | | --- | --- | | [bool](class_bool#class-bool) | [distraction\_free\_mode](#class-editorinterface-property-distraction-free-mode) | Methods ------- | | | | --- | --- | | void | [edit\_node](#class-editorinterface-method-edit-node) **(** [Node](class_node#class-node) node **)** | | void | [edit\_resource](#class-editorinterface-method-edit-resource) **(** [Resource](class_resource#class-resource) resource **)** | | void | [edit\_script](#class-editorinterface-method-edit-script) **(** [Script](class_script#class-script) script, [int](class_int#class-int) line=-1, [int](class_int#class-int) column=0, [bool](class_bool#class-bool) grab\_focus=true **)** | | [Control](class_control#class-control) | [get\_base\_control](#class-editorinterface-method-get-base-control) **(** **)** | | [String](class_string#class-string) | [get\_current\_path](#class-editorinterface-method-get-current-path) **(** **)** const | | [Node](class_node#class-node) | [get\_edited\_scene\_root](#class-editorinterface-method-get-edited-scene-root) **(** **)** | | [float](class_float#class-float) | [get\_editor\_scale](#class-editorinterface-method-get-editor-scale) **(** **)** const | | [EditorSettings](class_editorsettings#class-editorsettings) | [get\_editor\_settings](#class-editorinterface-method-get-editor-settings) **(** **)** | | [Control](class_control#class-control) | [get\_editor\_viewport](#class-editorinterface-method-get-editor-viewport) **(** **)** | | [FileSystemDock](class_filesystemdock#class-filesystemdock) | [get\_file\_system\_dock](#class-editorinterface-method-get-file-system-dock) **(** **)** | | [EditorInspector](class_editorinspector#class-editorinspector) | [get\_inspector](#class-editorinterface-method-get-inspector) **(** **)** const | | [Array](class_array#class-array) | [get\_open\_scenes](#class-editorinterface-method-get-open-scenes) **(** **)** const | | [String](class_string#class-string) | [get\_playing\_scene](#class-editorinterface-method-get-playing-scene) **(** **)** const | | [EditorFileSystem](class_editorfilesystem#class-editorfilesystem) | [get\_resource\_filesystem](#class-editorinterface-method-get-resource-filesystem) **(** **)** | | [EditorResourcePreview](class_editorresourcepreview#class-editorresourcepreview) | [get\_resource\_previewer](#class-editorinterface-method-get-resource-previewer) **(** **)** | | [ScriptEditor](class_scripteditor#class-scripteditor) | [get\_script\_editor](#class-editorinterface-method-get-script-editor) **(** **)** | | [String](class_string#class-string) | [get\_selected\_path](#class-editorinterface-method-get-selected-path) **(** **)** const | | [EditorSelection](class_editorselection#class-editorselection) | [get\_selection](#class-editorinterface-method-get-selection) **(** **)** | | void | [inspect\_object](#class-editorinterface-method-inspect-object) **(** [Object](class_object#class-object) object, [String](class_string#class-string) for\_property="", [bool](class_bool#class-bool) inspector\_only=false **)** | | [bool](class_bool#class-bool) | [is\_playing\_scene](#class-editorinterface-method-is-playing-scene) **(** **)** const | | [bool](class_bool#class-bool) | [is\_plugin\_enabled](#class-editorinterface-method-is-plugin-enabled) **(** [String](class_string#class-string) plugin **)** const | | [Array](class_array#class-array) | [make\_mesh\_previews](#class-editorinterface-method-make-mesh-previews) **(** [Array](class_array#class-array) meshes, [int](class_int#class-int) preview\_size **)** | | void | [open\_scene\_from\_path](#class-editorinterface-method-open-scene-from-path) **(** [String](class_string#class-string) scene\_filepath **)** | | void | [play\_current\_scene](#class-editorinterface-method-play-current-scene) **(** **)** | | void | [play\_custom\_scene](#class-editorinterface-method-play-custom-scene) **(** [String](class_string#class-string) scene\_filepath **)** | | void | [play\_main\_scene](#class-editorinterface-method-play-main-scene) **(** **)** | | void | [reload\_scene\_from\_path](#class-editorinterface-method-reload-scene-from-path) **(** [String](class_string#class-string) scene\_filepath **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [save\_scene](#class-editorinterface-method-save-scene) **(** **)** | | void | [save\_scene\_as](#class-editorinterface-method-save-scene-as) **(** [String](class_string#class-string) path, [bool](class_bool#class-bool) with\_preview=true **)** | | void | [select\_file](#class-editorinterface-method-select-file) **(** [String](class_string#class-string) file **)** | | void | [set\_main\_screen\_editor](#class-editorinterface-method-set-main-screen-editor) **(** [String](class_string#class-string) name **)** | | void | [set\_plugin\_enabled](#class-editorinterface-method-set-plugin-enabled) **(** [String](class_string#class-string) plugin, [bool](class_bool#class-bool) enabled **)** | | void | [stop\_playing\_scene](#class-editorinterface-method-stop-playing-scene) **(** **)** | Property Descriptions --------------------- ### [bool](class_bool#class-bool) distraction\_free\_mode | | | | --- | --- | | *Setter* | set\_distraction\_free\_mode(value) | | *Getter* | is\_distraction\_free\_mode\_enabled() | If `true`, enables distraction-free mode which hides side docks to increase the space available for the main view. Method Descriptions ------------------- ### void edit\_node ( [Node](class_node#class-node) node ) Edits the given [Node](class_node#class-node). The node will be also selected if it's inside the scene tree. ### void edit\_resource ( [Resource](class_resource#class-resource) resource ) Edits the given [Resource](class_resource#class-resource). If the resource is a [Script](class_script#class-script) you can also edit it with [edit\_script](#class-editorinterface-method-edit-script) to specify the line and column position. ### void edit\_script ( [Script](class_script#class-script) script, [int](class_int#class-int) line=-1, [int](class_int#class-int) column=0, [bool](class_bool#class-bool) grab\_focus=true ) Edits the given [Script](class_script#class-script). The line and column on which to open the script can also be specified. The script will be open with the user-configured editor for the script's language which may be an external editor. ### [Control](class_control#class-control) get\_base\_control ( ) Returns the main container of Godot editor's window. For example, you can use it to retrieve the size of the container and place your controls accordingly. **Warning:** Removing and freeing this node will render the editor useless and may cause a crash. ### [String](class_string#class-string) get\_current\_path ( ) const Returns the current path being viewed in the [FileSystemDock](class_filesystemdock#class-filesystemdock). ### [Node](class_node#class-node) get\_edited\_scene\_root ( ) Returns the edited (current) scene's root [Node](class_node#class-node). ### [float](class_float#class-float) get\_editor\_scale ( ) const Returns the actual scale of the editor UI (`1.0` being 100% scale). This can be used to adjust position and dimensions of the UI added by plugins. **Note:** This value is set via the `interface/editor/display_scale` and `interface/editor/custom_display_scale` editor settings. Editor must be restarted for changes to be properly applied. ### [EditorSettings](class_editorsettings#class-editorsettings) get\_editor\_settings ( ) Returns the editor's [EditorSettings](class_editorsettings#class-editorsettings) instance. ### [Control](class_control#class-control) get\_editor\_viewport ( ) Returns the main editor control. Use this as a parent for main screens. **Note:** This returns the main editor control containing the whole editor, not the 2D or 3D viewports specifically. **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash. ### [FileSystemDock](class_filesystemdock#class-filesystemdock) get\_file\_system\_dock ( ) Returns the editor's [FileSystemDock](class_filesystemdock#class-filesystemdock) instance. **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash. ### [EditorInspector](class_editorinspector#class-editorinspector) get\_inspector ( ) const Returns the editor's [EditorInspector](class_editorinspector#class-editorinspector) instance. **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash. ### [Array](class_array#class-array) get\_open\_scenes ( ) const Returns an [Array](class_array#class-array) with the file paths of the currently opened scenes. ### [String](class_string#class-string) get\_playing\_scene ( ) const Returns the name of the scene that is being played. If no scene is currently being played, returns an empty string. ### [EditorFileSystem](class_editorfilesystem#class-editorfilesystem) get\_resource\_filesystem ( ) Returns the editor's [EditorFileSystem](class_editorfilesystem#class-editorfilesystem) instance. ### [EditorResourcePreview](class_editorresourcepreview#class-editorresourcepreview) get\_resource\_previewer ( ) Returns the editor's [EditorResourcePreview](class_editorresourcepreview#class-editorresourcepreview) instance. ### [ScriptEditor](class_scripteditor#class-scripteditor) get\_script\_editor ( ) Returns the editor's [ScriptEditor](class_scripteditor#class-scripteditor) instance. **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash. ### [String](class_string#class-string) get\_selected\_path ( ) const Returns the path of the directory currently selected in the [FileSystemDock](class_filesystemdock#class-filesystemdock). If a file is selected, its base directory will be returned using [String.get\_base\_dir](class_string#class-string-method-get-base-dir) instead. ### [EditorSelection](class_editorselection#class-editorselection) get\_selection ( ) Returns the editor's [EditorSelection](class_editorselection#class-editorselection) instance. ### void inspect\_object ( [Object](class_object#class-object) object, [String](class_string#class-string) for\_property="", [bool](class_bool#class-bool) inspector\_only=false ) Shows the given property on the given `object` in the editor's Inspector dock. If `inspector_only` is `true`, plugins will not attempt to edit `object`. ### [bool](class_bool#class-bool) is\_playing\_scene ( ) const Returns `true` if a scene is currently being played, `false` otherwise. Paused scenes are considered as being played. ### [bool](class_bool#class-bool) is\_plugin\_enabled ( [String](class_string#class-string) plugin ) const Returns `true` if the specified `plugin` is enabled. The plugin name is the same as its directory name. ### [Array](class_array#class-array) make\_mesh\_previews ( [Array](class_array#class-array) meshes, [int](class_int#class-int) preview\_size ) Returns mesh previews rendered at the given size as an [Array](class_array#class-array) of [Texture](class_texture#class-texture)s. ### void open\_scene\_from\_path ( [String](class_string#class-string) scene\_filepath ) Opens the scene at the given path. ### void play\_current\_scene ( ) Plays the currently active scene. ### void play\_custom\_scene ( [String](class_string#class-string) scene\_filepath ) Plays the scene specified by its filepath. ### void play\_main\_scene ( ) Plays the main scene. ### void reload\_scene\_from\_path ( [String](class_string#class-string) scene\_filepath ) Reloads the scene at the given path. ### [Error](class_%40globalscope#enum-globalscope-error) save\_scene ( ) Saves the scene. Returns either `OK` or `ERR_CANT_CREATE` (see [@GlobalScope](class_%40globalscope#class-globalscope) constants). ### void save\_scene\_as ( [String](class_string#class-string) path, [bool](class_bool#class-bool) with\_preview=true ) Saves the scene as a file at `path`. ### void select\_file ( [String](class_string#class-string) file ) Selects the file, with the path provided by `file`, in the FileSystem dock. ### void set\_main\_screen\_editor ( [String](class_string#class-string) name ) Sets the editor's current main screen to the one specified in `name`. `name` must match the text of the tab in question exactly (`2D`, `3D`, `Script`, `AssetLib`). ### void set\_plugin\_enabled ( [String](class_string#class-string) plugin, [bool](class_bool#class-bool) enabled ) Sets the enabled status of a plugin. The plugin name is the same as its directory name. ### void stop\_playing\_scene ( ) Stops the scene that is currently playing.
programming_docs
godot GLTFCamera GLTFCamera ========== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Description ----------- **Note:** This class is only compiled in editor builds. Run-time glTF loading and saving is *not* available in exported projects. References to `GLTFCamera` within a script will cause an error in an exported project. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [fov\_size](#class-gltfcamera-property-fov-size) | `75.0` | | [bool](class_bool#class-bool) | [perspective](#class-gltfcamera-property-perspective) | `true` | | [float](class_float#class-float) | [zfar](#class-gltfcamera-property-zfar) | `4000.0` | | [float](class_float#class-float) | [znear](#class-gltfcamera-property-znear) | `0.05` | Property Descriptions --------------------- ### [float](class_float#class-float) fov\_size | | | | --- | --- | | *Default* | `75.0` | | *Setter* | set\_fov\_size(value) | | *Getter* | get\_fov\_size() | ### [bool](class_bool#class-bool) perspective | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_perspective(value) | | *Getter* | get\_perspective() | ### [float](class_float#class-float) zfar | | | | --- | --- | | *Default* | `4000.0` | | *Setter* | set\_zfar(value) | | *Getter* | get\_zfar() | ### [float](class_float#class-float) znear | | | | --- | --- | | *Default* | `0.05` | | *Setter* | set\_znear(value) | | *Getter* | get\_znear() | godot InputEventPanGesture InputEventPanGesture ==================== **Inherits:** [InputEventGesture](class_inputeventgesture#class-inputeventgesture) **<** [InputEventWithModifiers](class_inputeventwithmodifiers#class-inputeventwithmodifiers) **<** [InputEvent](class_inputevent#class-inputevent) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [Vector2](class_vector2#class-vector2) | [delta](#class-inputeventpangesture-property-delta) | `Vector2( 0, 0 )` | Property Descriptions --------------------- ### [Vector2](class_vector2#class-vector2) delta | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_delta(value) | | *Getter* | get\_delta() | godot AnimationNodeAdd2 AnimationNodeAdd2 ================= **Inherits:** [AnimationNode](class_animationnode#class-animationnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Blends two animations additively inside of an [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). Description ----------- A resource to add to an [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). Blends two animations additively based on an amount value in the `[0.0, 1.0]` range. Tutorials --------- * [Using AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [sync](#class-animationnodeadd2-property-sync) | `false` | Property Descriptions --------------------- ### [bool](class_bool#class-bool) sync | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_sync(value) | | *Getter* | is\_using\_sync() | If `true`, sets the `optimization` to `false` when calling [AnimationNode.blend\_input](class_animationnode#class-animationnode-method-blend-input), forcing the blended animations to update every frame. godot VisualScript VisualScript ============ **Inherits:** [Script](class_script#class-script) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A script implemented in the Visual Script programming environment. Description ----------- A script implemented in the Visual Script programming environment. The script extends the functionality of all objects that instance it. [Object.set\_script](class_object#class-object-method-set-script) 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. Tutorials --------- * [VisualScript](https://docs.godotengine.org/en/3.5/tutorials/scripting/visual_script/index.html) Methods ------- | | | | --- | --- | | void | [add\_custom\_signal](#class-visualscript-method-add-custom-signal) **(** [String](class_string#class-string) name **)** | | void | [add\_function](#class-visualscript-method-add-function) **(** [String](class_string#class-string) name **)** | | void | [add\_node](#class-visualscript-method-add-node) **(** [String](class_string#class-string) func, [int](class_int#class-int) id, [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) node, [Vector2](class_vector2#class-vector2) position=Vector2( 0, 0 ) **)** | | void | [add\_variable](#class-visualscript-method-add-variable) **(** [String](class_string#class-string) name, [Variant](class_variant#class-variant) default\_value=null, [bool](class_bool#class-bool) export=false **)** | | void | [custom\_signal\_add\_argument](#class-visualscript-method-custom-signal-add-argument) **(** [String](class_string#class-string) name, [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type, [String](class_string#class-string) argname, [int](class_int#class-int) index=-1 **)** | | [int](class_int#class-int) | [custom\_signal\_get\_argument\_count](#class-visualscript-method-custom-signal-get-argument-count) **(** [String](class_string#class-string) name **)** const | | [String](class_string#class-string) | [custom\_signal\_get\_argument\_name](#class-visualscript-method-custom-signal-get-argument-name) **(** [String](class_string#class-string) name, [int](class_int#class-int) argidx **)** const | | [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) | [custom\_signal\_get\_argument\_type](#class-visualscript-method-custom-signal-get-argument-type) **(** [String](class_string#class-string) name, [int](class_int#class-int) argidx **)** const | | void | [custom\_signal\_remove\_argument](#class-visualscript-method-custom-signal-remove-argument) **(** [String](class_string#class-string) name, [int](class_int#class-int) argidx **)** | | void | [custom\_signal\_set\_argument\_name](#class-visualscript-method-custom-signal-set-argument-name) **(** [String](class_string#class-string) name, [int](class_int#class-int) argidx, [String](class_string#class-string) argname **)** | | void | [custom\_signal\_set\_argument\_type](#class-visualscript-method-custom-signal-set-argument-type) **(** [String](class_string#class-string) name, [int](class_int#class-int) argidx, [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type **)** | | void | [custom\_signal\_swap\_argument](#class-visualscript-method-custom-signal-swap-argument) **(** [String](class_string#class-string) name, [int](class_int#class-int) argidx, [int](class_int#class-int) withidx **)** | | void | [data\_connect](#class-visualscript-method-data-connect) **(** [String](class_string#class-string) func, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port **)** | | void | [data\_disconnect](#class-visualscript-method-data-disconnect) **(** [String](class_string#class-string) func, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port **)** | | [int](class_int#class-int) | [get\_function\_node\_id](#class-visualscript-method-get-function-node-id) **(** [String](class_string#class-string) name **)** const | | [Vector2](class_vector2#class-vector2) | [get\_function\_scroll](#class-visualscript-method-get-function-scroll) **(** [String](class_string#class-string) name **)** const | | [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) | [get\_node](#class-visualscript-method-get-node) **(** [String](class_string#class-string) func, [int](class_int#class-int) id **)** const | | [Vector2](class_vector2#class-vector2) | [get\_node\_position](#class-visualscript-method-get-node-position) **(** [String](class_string#class-string) func, [int](class_int#class-int) id **)** const | | [Variant](class_variant#class-variant) | [get\_variable\_default\_value](#class-visualscript-method-get-variable-default-value) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [get\_variable\_export](#class-visualscript-method-get-variable-export) **(** [String](class_string#class-string) name **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_variable\_info](#class-visualscript-method-get-variable-info) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [has\_custom\_signal](#class-visualscript-method-has-custom-signal) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [has\_data\_connection](#class-visualscript-method-has-data-connection) **(** [String](class_string#class-string) func, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port **)** const | | [bool](class_bool#class-bool) | [has\_function](#class-visualscript-method-has-function) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [has\_node](#class-visualscript-method-has-node) **(** [String](class_string#class-string) func, [int](class_int#class-int) id **)** const | | [bool](class_bool#class-bool) | [has\_sequence\_connection](#class-visualscript-method-has-sequence-connection) **(** [String](class_string#class-string) func, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_output, [int](class_int#class-int) to\_node **)** const | | [bool](class_bool#class-bool) | [has\_variable](#class-visualscript-method-has-variable) **(** [String](class_string#class-string) name **)** const | | void | [remove\_custom\_signal](#class-visualscript-method-remove-custom-signal) **(** [String](class_string#class-string) name **)** | | void | [remove\_function](#class-visualscript-method-remove-function) **(** [String](class_string#class-string) name **)** | | void | [remove\_node](#class-visualscript-method-remove-node) **(** [String](class_string#class-string) func, [int](class_int#class-int) id **)** | | void | [remove\_variable](#class-visualscript-method-remove-variable) **(** [String](class_string#class-string) name **)** | | void | [rename\_custom\_signal](#class-visualscript-method-rename-custom-signal) **(** [String](class_string#class-string) name, [String](class_string#class-string) new\_name **)** | | void | [rename\_function](#class-visualscript-method-rename-function) **(** [String](class_string#class-string) name, [String](class_string#class-string) new\_name **)** | | void | [rename\_variable](#class-visualscript-method-rename-variable) **(** [String](class_string#class-string) name, [String](class_string#class-string) new\_name **)** | | void | [sequence\_connect](#class-visualscript-method-sequence-connect) **(** [String](class_string#class-string) func, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_output, [int](class_int#class-int) to\_node **)** | | void | [sequence\_disconnect](#class-visualscript-method-sequence-disconnect) **(** [String](class_string#class-string) func, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_output, [int](class_int#class-int) to\_node **)** | | void | [set\_function\_scroll](#class-visualscript-method-set-function-scroll) **(** [String](class_string#class-string) name, [Vector2](class_vector2#class-vector2) ofs **)** | | void | [set\_instance\_base\_type](#class-visualscript-method-set-instance-base-type) **(** [String](class_string#class-string) type **)** | | void | [set\_node\_position](#class-visualscript-method-set-node-position) **(** [String](class_string#class-string) func, [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) position **)** | | void | [set\_variable\_default\_value](#class-visualscript-method-set-variable-default-value) **(** [String](class_string#class-string) name, [Variant](class_variant#class-variant) value **)** | | void | [set\_variable\_export](#class-visualscript-method-set-variable-export) **(** [String](class_string#class-string) name, [bool](class_bool#class-bool) enable **)** | | void | [set\_variable\_info](#class-visualscript-method-set-variable-info) **(** [String](class_string#class-string) name, [Dictionary](class_dictionary#class-dictionary) value **)** | Signals ------- ### node\_ports\_changed ( [String](class_string#class-string) function, [int](class_int#class-int) id ) Emitted when the ports of a node are changed. Method Descriptions ------------------- ### void add\_custom\_signal ( [String](class_string#class-string) name ) Add a custom signal with the specified name to the VisualScript. ### void add\_function ( [String](class_string#class-string) name ) Add a function with the specified name to the VisualScript. ### void add\_node ( [String](class_string#class-string) func, [int](class_int#class-int) id, [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) node, [Vector2](class_vector2#class-vector2) position=Vector2( 0, 0 ) ) Add a node to a function of the VisualScript. ### void add\_variable ( [String](class_string#class-string) name, [Variant](class_variant#class-variant) default\_value=null, [bool](class_bool#class-bool) export=false ) Add a variable to the VisualScript, optionally giving it a default value or marking it as exported. ### void custom\_signal\_add\_argument ( [String](class_string#class-string) name, [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type, [String](class_string#class-string) argname, [int](class_int#class-int) index=-1 ) Add an argument to a custom signal added with [add\_custom\_signal](#class-visualscript-method-add-custom-signal). ### [int](class_int#class-int) custom\_signal\_get\_argument\_count ( [String](class_string#class-string) name ) const Get the count of a custom signal's arguments. ### [String](class_string#class-string) custom\_signal\_get\_argument\_name ( [String](class_string#class-string) name, [int](class_int#class-int) argidx ) const Get the name of a custom signal's argument. ### [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) custom\_signal\_get\_argument\_type ( [String](class_string#class-string) name, [int](class_int#class-int) argidx ) const Get the type of a custom signal's argument. ### void custom\_signal\_remove\_argument ( [String](class_string#class-string) name, [int](class_int#class-int) argidx ) Remove a specific custom signal's argument. ### void custom\_signal\_set\_argument\_name ( [String](class_string#class-string) name, [int](class_int#class-int) argidx, [String](class_string#class-string) argname ) Rename a custom signal's argument. ### void custom\_signal\_set\_argument\_type ( [String](class_string#class-string) name, [int](class_int#class-int) argidx, [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type ) Change the type of a custom signal's argument. ### void custom\_signal\_swap\_argument ( [String](class_string#class-string) name, [int](class_int#class-int) argidx, [int](class_int#class-int) withidx ) Swap two of the arguments of a custom signal. ### void data\_connect ( [String](class_string#class-string) func, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port ) Connect two data ports. The value of `from_node`'s `from_port` would be fed into `to_node`'s `to_port`. ### void data\_disconnect ( [String](class_string#class-string) func, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port ) Disconnect two data ports previously connected with [data\_connect](#class-visualscript-method-data-connect). ### [int](class_int#class-int) get\_function\_node\_id ( [String](class_string#class-string) name ) const Returns the id of a function's entry point node. ### [Vector2](class_vector2#class-vector2) get\_function\_scroll ( [String](class_string#class-string) name ) const Returns the position of the center of the screen for a given function. ### [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) get\_node ( [String](class_string#class-string) func, [int](class_int#class-int) id ) const Returns a node given its id and its function. ### [Vector2](class_vector2#class-vector2) get\_node\_position ( [String](class_string#class-string) func, [int](class_int#class-int) id ) const Returns a node's position in pixels. ### [Variant](class_variant#class-variant) get\_variable\_default\_value ( [String](class_string#class-string) name ) const Returns the default (initial) value of a variable. ### [bool](class_bool#class-bool) get\_variable\_export ( [String](class_string#class-string) name ) const Returns whether a variable is exported. ### [Dictionary](class_dictionary#class-dictionary) get\_variable\_info ( [String](class_string#class-string) name ) const Returns the information for a given variable as a dictionary. The information includes its name, type, hint and usage. ### [bool](class_bool#class-bool) has\_custom\_signal ( [String](class_string#class-string) name ) const Returns whether a signal exists with the specified name. ### [bool](class_bool#class-bool) has\_data\_connection ( [String](class_string#class-string) func, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port ) const Returns whether the specified data ports are connected. ### [bool](class_bool#class-bool) has\_function ( [String](class_string#class-string) name ) const Returns whether a function exists with the specified name. ### [bool](class_bool#class-bool) has\_node ( [String](class_string#class-string) func, [int](class_int#class-int) id ) const Returns whether a node exists with the given id. ### [bool](class_bool#class-bool) has\_sequence\_connection ( [String](class_string#class-string) func, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_output, [int](class_int#class-int) to\_node ) const Returns whether the specified sequence ports are connected. ### [bool](class_bool#class-bool) has\_variable ( [String](class_string#class-string) name ) const Returns whether a variable exists with the specified name. ### void remove\_custom\_signal ( [String](class_string#class-string) name ) Remove a custom signal with the given name. ### void remove\_function ( [String](class_string#class-string) name ) Remove a specific function and its nodes from the script. ### void remove\_node ( [String](class_string#class-string) func, [int](class_int#class-int) id ) Remove a specific node. ### void remove\_variable ( [String](class_string#class-string) name ) Remove a variable with the given name. ### void rename\_custom\_signal ( [String](class_string#class-string) name, [String](class_string#class-string) new\_name ) Change the name of a custom signal. ### void rename\_function ( [String](class_string#class-string) name, [String](class_string#class-string) new\_name ) Change the name of a function. ### void rename\_variable ( [String](class_string#class-string) name, [String](class_string#class-string) new\_name ) Change the name of a variable. ### void sequence\_connect ( [String](class_string#class-string) func, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_output, [int](class_int#class-int) to\_node ) Connect two sequence ports. The execution will flow from of `from_node`'s `from_output` into `to_node`. Unlike [data\_connect](#class-visualscript-method-data-connect), there isn't a `to_port`, since the target node can have only one sequence port. ### void sequence\_disconnect ( [String](class_string#class-string) func, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_output, [int](class_int#class-int) to\_node ) Disconnect two sequence ports previously connected with [sequence\_connect](#class-visualscript-method-sequence-connect). ### void set\_function\_scroll ( [String](class_string#class-string) name, [Vector2](class_vector2#class-vector2) ofs ) Position the center of the screen for a function. ### void set\_instance\_base\_type ( [String](class_string#class-string) type ) Set the base type of the script. ### void set\_node\_position ( [String](class_string#class-string) func, [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) position ) Position a node on the screen. ### void set\_variable\_default\_value ( [String](class_string#class-string) name, [Variant](class_variant#class-variant) value ) Change the default (initial) value of a variable. ### void set\_variable\_export ( [String](class_string#class-string) name, [bool](class_bool#class-bool) enable ) Change whether a variable is exported. ### void set\_variable\_info ( [String](class_string#class-string) name, [Dictionary](class_dictionary#class-dictionary) value ) Set a variable's info, using the same format as [get\_variable\_info](#class-visualscript-method-get-variable-info).
programming_docs
godot BakedLightmapData BakedLightmapData ================= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [AABB](class_aabb#class-aabb) | [bounds](#class-bakedlightmapdata-property-bounds) | `AABB( 0, 0, 0, 0, 0, 0 )` | | [Transform](class_transform#class-transform) | [cell\_space\_transform](#class-bakedlightmapdata-property-cell-space-transform) | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | | [int](class_int#class-int) | [cell\_subdiv](#class-bakedlightmapdata-property-cell-subdiv) | `1` | | [float](class_float#class-float) | [energy](#class-bakedlightmapdata-property-energy) | `1.0` | | [bool](class_bool#class-bool) | [interior](#class-bakedlightmapdata-property-interior) | `false` | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [octree](#class-bakedlightmapdata-property-octree) | `PoolByteArray(  )` | Methods ------- | | | | --- | --- | | void | [add\_user](#class-bakedlightmapdata-method-add-user) **(** [NodePath](class_nodepath#class-nodepath) path, [Resource](class_resource#class-resource) lightmap, [int](class_int#class-int) lightmap\_slice, [Rect2](class_rect2#class-rect2) lightmap\_uv\_rect, [int](class_int#class-int) instance **)** | | void | [clear\_data](#class-bakedlightmapdata-method-clear-data) **(** **)** | | void | [clear\_users](#class-bakedlightmapdata-method-clear-users) **(** **)** | | [int](class_int#class-int) | [get\_user\_count](#class-bakedlightmapdata-method-get-user-count) **(** **)** const | | [Resource](class_resource#class-resource) | [get\_user\_lightmap](#class-bakedlightmapdata-method-get-user-lightmap) **(** [int](class_int#class-int) user\_idx **)** const | | [NodePath](class_nodepath#class-nodepath) | [get\_user\_path](#class-bakedlightmapdata-method-get-user-path) **(** [int](class_int#class-int) user\_idx **)** const | Property Descriptions --------------------- ### [AABB](class_aabb#class-aabb) bounds | | | | --- | --- | | *Default* | `AABB( 0, 0, 0, 0, 0, 0 )` | | *Setter* | set\_bounds(value) | | *Getter* | get\_bounds() | ### [Transform](class_transform#class-transform) cell\_space\_transform | | | | --- | --- | | *Default* | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | | *Setter* | set\_cell\_space\_transform(value) | | *Getter* | get\_cell\_space\_transform() | ### [int](class_int#class-int) cell\_subdiv | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_cell\_subdiv(value) | | *Getter* | get\_cell\_subdiv() | ### [float](class_float#class-float) energy | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_energy(value) | | *Getter* | get\_energy() | Global energy multiplier for baked and dynamic capture objects. This can be changed at run-time without having to bake lightmaps again. To adjust only the energy of indirect lighting (without affecting direct lighting or emissive materials), adjust [BakedLightmap.bounce\_indirect\_energy](class_bakedlightmap#class-bakedlightmap-property-bounce-indirect-energy) and bake lightmaps again. ### [bool](class_bool#class-bool) interior | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_interior(value) | | *Getter* | is\_interior() | Controls whether dynamic capture objects receive environment lighting or not. ### [PoolByteArray](class_poolbytearray#class-poolbytearray) octree | | | | --- | --- | | *Default* | `PoolByteArray(  )` | | *Setter* | set\_octree(value) | | *Getter* | get\_octree() | Method Descriptions ------------------- ### void add\_user ( [NodePath](class_nodepath#class-nodepath) path, [Resource](class_resource#class-resource) lightmap, [int](class_int#class-int) lightmap\_slice, [Rect2](class_rect2#class-rect2) lightmap\_uv\_rect, [int](class_int#class-int) instance ) ### void clear\_data ( ) ### void clear\_users ( ) ### [int](class_int#class-int) get\_user\_count ( ) const ### [Resource](class_resource#class-resource) get\_user\_lightmap ( [int](class_int#class-int) user\_idx ) const ### [NodePath](class_nodepath#class-nodepath) get\_user\_path ( [int](class_int#class-int) user\_idx ) const godot GLTFDocument GLTFDocument ============ **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Description ----------- **Note:** This class is only compiled in editor builds. Run-time glTF loading and saving is *not* available in exported projects. References to `GLTFDocument` within a script will cause an error in an exported project. godot VisualShaderNodeColorUniform VisualShaderNodeColorUniform ============================ **Inherits:** [VisualShaderNodeUniform](class_visualshadernodeuniform#class-visualshadernodeuniform) **<** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A [Color](class_color#class-color) uniform to be used within the visual shader graph. Description ----------- Translated to `uniform vec4` in the shader language. Properties ---------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [default\_value](#class-visualshadernodecoloruniform-property-default-value) | `Color( 1, 1, 1, 1 )` | | [bool](class_bool#class-bool) | [default\_value\_enabled](#class-visualshadernodecoloruniform-property-default-value-enabled) | `false` | Property Descriptions --------------------- ### [Color](class_color#class-color) default\_value | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_default\_value(value) | | *Getter* | get\_default\_value() | A default value to be assigned within the shader. ### [bool](class_bool#class-bool) default\_value\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_default\_value\_enabled(value) | | *Getter* | is\_default\_value\_enabled() | Enables usage of the [default\_value](#class-visualshadernodecoloruniform-property-default-value). godot NetworkedMultiplayerCustom NetworkedMultiplayerCustom ========================== **Inherits:** [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer) **<** [PacketPeer](class_packetpeer#class-packetpeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer) implementation that can be controlled from a script. Description ----------- A [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer) implementation that can be used as a [MultiplayerAPI.network\_peer](class_multiplayerapi#class-multiplayerapi-property-network-peer) and controlled from a script. Its purpose is to allow adding a new backend for the high-Level multiplayer API without needing to use GDNative. Methods ------- | | | | --- | --- | | void | [deliver\_packet](#class-networkedmultiplayercustom-method-deliver-packet) **(** [PoolByteArray](class_poolbytearray#class-poolbytearray) buffer, [int](class_int#class-int) from\_peer\_id **)** | | void | [initialize](#class-networkedmultiplayercustom-method-initialize) **(** [int](class_int#class-int) self\_peer\_id **)** | | void | [set\_connection\_status](#class-networkedmultiplayercustom-method-set-connection-status) **(** [ConnectionStatus](class_networkedmultiplayerpeer#enum-networkedmultiplayerpeer-connectionstatus) connection\_status **)** | | void | [set\_max\_packet\_size](#class-networkedmultiplayercustom-method-set-max-packet-size) **(** [int](class_int#class-int) max\_packet\_size **)** | Signals ------- ### packet\_generated ( [int](class_int#class-int) peer\_id, [PoolByteArray](class_poolbytearray#class-poolbytearray) buffer, [int](class_int#class-int) transfer\_mode ) Emitted when the local [MultiplayerAPI](class_multiplayerapi#class-multiplayerapi) generates a packet. Your script should take this packet and send it to the requested peer over the network (which should call [deliver\_packet](#class-networkedmultiplayercustom-method-deliver-packet) with the data when it's received). Method Descriptions ------------------- ### void deliver\_packet ( [PoolByteArray](class_poolbytearray#class-poolbytearray) buffer, [int](class_int#class-int) from\_peer\_id ) Deliver a packet to the local [MultiplayerAPI](class_multiplayerapi#class-multiplayerapi). When your script receives a packet from other peers over the network (originating from the [packet\_generated](#class-networkedmultiplayercustom-signal-packet-generated) signal on the sending peer), passing it to this method will deliver it locally. ### void initialize ( [int](class_int#class-int) self\_peer\_id ) Initialize the peer with the given `peer_id` (must be between 1 and 2147483647). Can only be called if the connection status is [NetworkedMultiplayerPeer.CONNECTION\_CONNECTING](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-constant-connection-connecting). See [set\_connection\_status](#class-networkedmultiplayercustom-method-set-connection-status). ### void set\_connection\_status ( [ConnectionStatus](class_networkedmultiplayerpeer#enum-networkedmultiplayerpeer-connectionstatus) connection\_status ) Set the state of the connection. See [ConnectionStatus](class_networkedmultiplayerpeer#enum-networkedmultiplayerpeer-connectionstatus). This will emit the [NetworkedMultiplayerPeer.connection\_succeeded](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-signal-connection-succeeded), [NetworkedMultiplayerPeer.connection\_failed](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-signal-connection-failed) or [NetworkedMultiplayerPeer.server\_disconnected](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-signal-server-disconnected) signals depending on the status and if the peer has the unique network id of `1`. You can only change to [NetworkedMultiplayerPeer.CONNECTION\_CONNECTING](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-constant-connection-connecting) from [NetworkedMultiplayerPeer.CONNECTION\_DISCONNECTED](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-constant-connection-disconnected) and to [NetworkedMultiplayerPeer.CONNECTION\_CONNECTED](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-constant-connection-connected) from [NetworkedMultiplayerPeer.CONNECTION\_CONNECTING](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-constant-connection-connecting). ### void set\_max\_packet\_size ( [int](class_int#class-int) max\_packet\_size ) Set the max packet size that this peer can handle. godot AudioEffectLimiter AudioEffectLimiter ================== **Inherits:** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Adds a soft-clip limiter audio effect to an Audio bus. Description ----------- A limiter is similar to a compressor, but it's less flexible and designed to disallow sound going over a given dB threshold. Adding one in the Master bus is always recommended to reduce the effects of clipping. Soft clipping starts to reduce the peaks a little below the threshold level and progressively increases its effect as the input level increases such that the threshold is never exceeded. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [ceiling\_db](#class-audioeffectlimiter-property-ceiling-db) | `-0.1` | | [float](class_float#class-float) | [soft\_clip\_db](#class-audioeffectlimiter-property-soft-clip-db) | `2.0` | | [float](class_float#class-float) | [soft\_clip\_ratio](#class-audioeffectlimiter-property-soft-clip-ratio) | `10.0` | | [float](class_float#class-float) | [threshold\_db](#class-audioeffectlimiter-property-threshold-db) | `0.0` | Property Descriptions --------------------- ### [float](class_float#class-float) ceiling\_db | | | | --- | --- | | *Default* | `-0.1` | | *Setter* | set\_ceiling\_db(value) | | *Getter* | get\_ceiling\_db() | The waveform's maximum allowed value, in decibels. Value can range from -20 to -0.1. ### [float](class_float#class-float) soft\_clip\_db | | | | --- | --- | | *Default* | `2.0` | | *Setter* | set\_soft\_clip\_db(value) | | *Getter* | get\_soft\_clip\_db() | Applies a gain to the limited waves, in decibels. Value can range from 0 to 6. ### [float](class_float#class-float) soft\_clip\_ratio | | | | --- | --- | | *Default* | `10.0` | | *Setter* | set\_soft\_clip\_ratio(value) | | *Getter* | get\_soft\_clip\_ratio() | ### [float](class_float#class-float) threshold\_db | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_threshold\_db(value) | | *Getter* | get\_threshold\_db() | Threshold from which the limiter begins to be active, in decibels. Value can range from -30 to 0. godot GridMap GridMap ======= **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Node for 3D tile-based maps. Description ----------- GridMap lets you place meshes on a grid interactively. It works both from the editor and from scripts, which can help you create in-game level editors. GridMaps use a [MeshLibrary](class_meshlibrary#class-meshlibrary) which contains a list of tiles. Each tile is a mesh with materials plus optional collision and navigation shapes. A GridMap contains a collection of cells. Each grid cell refers to a tile in the [MeshLibrary](class_meshlibrary#class-meshlibrary). All cells in the map have the same dimensions. Internally, a GridMap is split into a sparse collection of octants for efficient rendering and physics processing. Every octant has the same dimensions and can contain several cells. **Note:** GridMap doesn't extend [VisualInstance](class_visualinstance#class-visualinstance) and therefore can't be hidden or cull masked based on [VisualInstance.layers](class_visualinstance#class-visualinstance-property-layers). If you make a light not affect the first layer, the whole GridMap won't be lit by the light in question. Tutorials --------- * [Using gridmaps](https://docs.godotengine.org/en/3.5/tutorials/3d/using_gridmaps.html) * [3D Platformer Demo](https://godotengine.org/asset-library/asset/125) * [3D Kinematic Character Demo](https://godotengine.org/asset-library/asset/126) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [bake\_navigation](#class-gridmap-property-bake-navigation) | `false` | | [bool](class_bool#class-bool) | [cell\_center\_x](#class-gridmap-property-cell-center-x) | `true` | | [bool](class_bool#class-bool) | [cell\_center\_y](#class-gridmap-property-cell-center-y) | `true` | | [bool](class_bool#class-bool) | [cell\_center\_z](#class-gridmap-property-cell-center-z) | `true` | | [int](class_int#class-int) | [cell\_octant\_size](#class-gridmap-property-cell-octant-size) | `8` | | [float](class_float#class-float) | [cell\_scale](#class-gridmap-property-cell-scale) | `1.0` | | [Vector3](class_vector3#class-vector3) | [cell\_size](#class-gridmap-property-cell-size) | `Vector3( 2, 2, 2 )` | | [int](class_int#class-int) | [collision\_layer](#class-gridmap-property-collision-layer) | `1` | | [int](class_int#class-int) | [collision\_mask](#class-gridmap-property-collision-mask) | `1` | | [MeshLibrary](class_meshlibrary#class-meshlibrary) | [mesh\_library](#class-gridmap-property-mesh-library) | | | [int](class_int#class-int) | [navigation\_layers](#class-gridmap-property-navigation-layers) | `1` | | [PhysicsMaterial](class_physicsmaterial#class-physicsmaterial) | [physics\_material](#class-gridmap-property-physics-material) | | | [bool](class_bool#class-bool) | [use\_in\_baked\_light](#class-gridmap-property-use-in-baked-light) | `false` | Methods ------- | | | | --- | --- | | void | [clear](#class-gridmap-method-clear) **(** **)** | | void | [clear\_baked\_meshes](#class-gridmap-method-clear-baked-meshes) **(** **)** | | [RID](class_rid#class-rid) | [get\_bake\_mesh\_instance](#class-gridmap-method-get-bake-mesh-instance) **(** [int](class_int#class-int) idx **)** | | [Array](class_array#class-array) | [get\_bake\_meshes](#class-gridmap-method-get-bake-meshes) **(** **)** | | [int](class_int#class-int) | [get\_cell\_item](#class-gridmap-method-get-cell-item) **(** [int](class_int#class-int) x, [int](class_int#class-int) y, [int](class_int#class-int) z **)** const | | [int](class_int#class-int) | [get\_cell\_item\_orientation](#class-gridmap-method-get-cell-item-orientation) **(** [int](class_int#class-int) x, [int](class_int#class-int) y, [int](class_int#class-int) z **)** const | | [bool](class_bool#class-bool) | [get\_collision\_layer\_bit](#class-gridmap-method-get-collision-layer-bit) **(** [int](class_int#class-int) bit **)** const | | [bool](class_bool#class-bool) | [get\_collision\_mask\_bit](#class-gridmap-method-get-collision-mask-bit) **(** [int](class_int#class-int) bit **)** const | | [Array](class_array#class-array) | [get\_meshes](#class-gridmap-method-get-meshes) **(** **)** const | | [Array](class_array#class-array) | [get\_used\_cells](#class-gridmap-method-get-used-cells) **(** **)** const | | [Array](class_array#class-array) | [get\_used\_cells\_by\_item](#class-gridmap-method-get-used-cells-by-item) **(** [int](class_int#class-int) item **)** const | | void | [make\_baked\_meshes](#class-gridmap-method-make-baked-meshes) **(** [bool](class_bool#class-bool) gen\_lightmap\_uv=false, [float](class_float#class-float) lightmap\_uv\_texel\_size=0.1 **)** | | [Vector3](class_vector3#class-vector3) | [map\_to\_world](#class-gridmap-method-map-to-world) **(** [int](class_int#class-int) x, [int](class_int#class-int) y, [int](class_int#class-int) z **)** const | | void | [resource\_changed](#class-gridmap-method-resource-changed) **(** [Resource](class_resource#class-resource) resource **)** | | void | [set\_cell\_item](#class-gridmap-method-set-cell-item) **(** [int](class_int#class-int) x, [int](class_int#class-int) y, [int](class_int#class-int) z, [int](class_int#class-int) item, [int](class_int#class-int) orientation=0 **)** | | void | [set\_clip](#class-gridmap-method-set-clip) **(** [bool](class_bool#class-bool) enabled, [bool](class_bool#class-bool) clipabove=true, [int](class_int#class-int) floor=0, Vector3.Axis axis=0 **)** | | void | [set\_collision\_layer\_bit](#class-gridmap-method-set-collision-layer-bit) **(** [int](class_int#class-int) bit, [bool](class_bool#class-bool) value **)** | | void | [set\_collision\_mask\_bit](#class-gridmap-method-set-collision-mask-bit) **(** [int](class_int#class-int) bit, [bool](class_bool#class-bool) value **)** | | [Vector3](class_vector3#class-vector3) | [world\_to\_map](#class-gridmap-method-world-to-map) **(** [Vector3](class_vector3#class-vector3) pos **)** const | Signals ------- ### cell\_size\_changed ( [Vector3](class_vector3#class-vector3) cell\_size ) Emitted when [cell\_size](#class-gridmap-property-cell-size) changes. Constants --------- ### INVALID\_CELL\_ITEM = -1 --- Invalid cell item that can be used in [set\_cell\_item](#class-gridmap-method-set-cell-item) to clear cells (or represent an empty cell in [get\_cell\_item](#class-gridmap-method-get-cell-item)). Property Descriptions --------------------- ### [bool](class_bool#class-bool) bake\_navigation | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_bake\_navigation(value) | | *Getter* | is\_baking\_navigation() | If `true`, this GridMap uses cell navmesh resources to create navigation regions. ### [bool](class_bool#class-bool) cell\_center\_x | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_center\_x(value) | | *Getter* | get\_center\_x() | If `true`, grid items are centered on the X axis. ### [bool](class_bool#class-bool) cell\_center\_y | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_center\_y(value) | | *Getter* | get\_center\_y() | If `true`, grid items are centered on the Y axis. ### [bool](class_bool#class-bool) cell\_center\_z | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_center\_z(value) | | *Getter* | get\_center\_z() | If `true`, grid items are centered on the Z axis. ### [int](class_int#class-int) cell\_octant\_size | | | | --- | --- | | *Default* | `8` | | *Setter* | set\_octant\_size(value) | | *Getter* | get\_octant\_size() | The size of each octant measured in number of cells. This applies to all three axis. ### [float](class_float#class-float) cell\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_cell\_scale(value) | | *Getter* | get\_cell\_scale() | The scale of the cell items. This does not affect the size of the grid cells themselves, only the items in them. This can be used to make cell items overlap their neighbors. ### [Vector3](class_vector3#class-vector3) cell\_size | | | | --- | --- | | *Default* | `Vector3( 2, 2, 2 )` | | *Setter* | set\_cell\_size(value) | | *Getter* | get\_cell\_size() | The dimensions of the grid's cells. This does not affect the size of the meshes. See [cell\_scale](#class-gridmap-property-cell-scale). ### [int](class_int#class-int) collision\_layer | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_collision\_layer(value) | | *Getter* | get\_collision\_layer() | The physics layers this GridMap is in. GridMaps act as static bodies, meaning they aren't affected by gravity or other forces. They only affect other physics bodies that collide with them. ### [int](class_int#class-int) collision\_mask | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_collision\_mask(value) | | *Getter* | get\_collision\_mask() | The physics layers this GridMap detects collisions in. See [Collision layers and masks](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. ### [MeshLibrary](class_meshlibrary#class-meshlibrary) mesh\_library | | | | --- | --- | | *Setter* | set\_mesh\_library(value) | | *Getter* | get\_mesh\_library() | The assigned [MeshLibrary](class_meshlibrary#class-meshlibrary). ### [int](class_int#class-int) navigation\_layers | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_navigation\_layers(value) | | *Getter* | get\_navigation\_layers() | The navigation layers the GridMap generates its navigation regions in. ### [PhysicsMaterial](class_physicsmaterial#class-physicsmaterial) physics\_material | | | | --- | --- | | *Setter* | set\_physics\_material(value) | | *Getter* | get\_physics\_material() | Overrides the default friction and bounce physics properties for the whole `GridMap`. ### [bool](class_bool#class-bool) use\_in\_baked\_light | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_in\_baked\_light(value) | | *Getter* | get\_use\_in\_baked\_light() | Controls whether this GridMap will be baked in a [BakedLightmap](class_bakedlightmap#class-bakedlightmap) or not. Method Descriptions ------------------- ### void clear ( ) Clear all cells. ### void clear\_baked\_meshes ( ) ### [RID](class_rid#class-rid) get\_bake\_mesh\_instance ( [int](class_int#class-int) idx ) ### [Array](class_array#class-array) get\_bake\_meshes ( ) Returns an array of [ArrayMesh](class_arraymesh#class-arraymesh)es and [Transform](class_transform#class-transform) references of all bake meshes that exist within the current GridMap. ### [int](class_int#class-int) get\_cell\_item ( [int](class_int#class-int) x, [int](class_int#class-int) y, [int](class_int#class-int) z ) const The [MeshLibrary](class_meshlibrary#class-meshlibrary) item index located at the grid-based X, Y and Z coordinates. If the cell is empty, [INVALID\_CELL\_ITEM](#class-gridmap-constant-invalid-cell-item) will be returned. ### [int](class_int#class-int) get\_cell\_item\_orientation ( [int](class_int#class-int) x, [int](class_int#class-int) y, [int](class_int#class-int) z ) const The orientation of the cell at the grid-based X, Y and Z coordinates. -1 is returned if the cell is empty. ### [bool](class_bool#class-bool) get\_collision\_layer\_bit ( [int](class_int#class-int) bit ) const Returns an individual bit on the [collision\_layer](#class-gridmap-property-collision-layer). ### [bool](class_bool#class-bool) get\_collision\_mask\_bit ( [int](class_int#class-int) bit ) const Returns an individual bit on the [collision\_mask](#class-gridmap-property-collision-mask). ### [Array](class_array#class-array) get\_meshes ( ) const Returns an array of [Transform](class_transform#class-transform) and [Mesh](class_mesh#class-mesh) references corresponding to the non-empty cells in the grid. The transforms are specified in world space. ### [Array](class_array#class-array) get\_used\_cells ( ) const Returns an array of [Vector3](class_vector3#class-vector3) with the non-empty cell coordinates in the grid map. ### [Array](class_array#class-array) get\_used\_cells\_by\_item ( [int](class_int#class-int) item ) const Returns an array of all cells with the given item index specified in `item`. ### void make\_baked\_meshes ( [bool](class_bool#class-bool) gen\_lightmap\_uv=false, [float](class_float#class-float) lightmap\_uv\_texel\_size=0.1 ) ### [Vector3](class_vector3#class-vector3) map\_to\_world ( [int](class_int#class-int) x, [int](class_int#class-int) y, [int](class_int#class-int) z ) const Returns the position of a grid cell in the GridMap's local coordinate space. ### void resource\_changed ( [Resource](class_resource#class-resource) resource ) ### void set\_cell\_item ( [int](class_int#class-int) x, [int](class_int#class-int) y, [int](class_int#class-int) z, [int](class_int#class-int) item, [int](class_int#class-int) orientation=0 ) Sets the mesh index for the cell referenced by its grid-based X, Y and Z coordinates. A negative item index such as [INVALID\_CELL\_ITEM](#class-gridmap-constant-invalid-cell-item) will clear the cell. Optionally, the item's orientation can be passed. For valid orientation values, see [Basis.get\_orthogonal\_index](class_basis#class-basis-method-get-orthogonal-index). ### void set\_clip ( [bool](class_bool#class-bool) enabled, [bool](class_bool#class-bool) clipabove=true, [int](class_int#class-int) floor=0, Vector3.Axis axis=0 ) ### void set\_collision\_layer\_bit ( [int](class_int#class-int) bit, [bool](class_bool#class-bool) value ) Sets an individual bit on the [collision\_layer](#class-gridmap-property-collision-layer). ### void set\_collision\_mask\_bit ( [int](class_int#class-int) bit, [bool](class_bool#class-bool) value ) Sets an individual bit on the [collision\_mask](#class-gridmap-property-collision-mask). ### [Vector3](class_vector3#class-vector3) world\_to\_map ( [Vector3](class_vector3#class-vector3) pos ) const Returns the coordinates of the grid cell containing the given point. `pos` should be in the GridMap's local coordinate space.
programming_docs
godot VideoPlayer VideoPlayer =========== **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Control for playing video streams. Description ----------- Control node for playing video streams using [VideoStream](class_videostream#class-videostream) resources. Supported video formats are [WebM](https://www.webmproject.org/) (`.webm`, [VideoStreamWebm](class_videostreamwebm#class-videostreamwebm)), [Ogg Theora](https://www.theora.org/) (`.ogv`, [VideoStreamTheora](class_videostreamtheora#class-videostreamtheora)), and any format exposed via a GDNative plugin using [VideoStreamGDNative](class_videostreamgdnative#class-videostreamgdnative). **Note:** Due to a bug, VideoPlayer does not support localization remapping yet. **Warning:** On HTML5, video playback *will* perform poorly due to missing architecture-specific assembly optimizations, especially for VP8/VP9. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [audio\_track](#class-videoplayer-property-audio-track) | `0` | | [bool](class_bool#class-bool) | [autoplay](#class-videoplayer-property-autoplay) | `false` | | [int](class_int#class-int) | [buffering\_msec](#class-videoplayer-property-buffering-msec) | `500` | | [String](class_string#class-string) | [bus](#class-videoplayer-property-bus) | `"Master"` | | [bool](class_bool#class-bool) | [expand](#class-videoplayer-property-expand) | `true` | | [bool](class_bool#class-bool) | [paused](#class-videoplayer-property-paused) | `false` | | [VideoStream](class_videostream#class-videostream) | [stream](#class-videoplayer-property-stream) | | | [float](class_float#class-float) | [stream\_position](#class-videoplayer-property-stream-position) | | | [float](class_float#class-float) | [volume](#class-videoplayer-property-volume) | | | [float](class_float#class-float) | [volume\_db](#class-videoplayer-property-volume-db) | `0.0` | Methods ------- | | | | --- | --- | | [String](class_string#class-string) | [get\_stream\_name](#class-videoplayer-method-get-stream-name) **(** **)** const | | [Texture](class_texture#class-texture) | [get\_video\_texture](#class-videoplayer-method-get-video-texture) **(** **)** const | | [bool](class_bool#class-bool) | [is\_playing](#class-videoplayer-method-is-playing) **(** **)** const | | void | [play](#class-videoplayer-method-play) **(** **)** | | void | [stop](#class-videoplayer-method-stop) **(** **)** | Signals ------- ### finished ( ) Emitted when playback is finished. Property Descriptions --------------------- ### [int](class_int#class-int) audio\_track | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_audio\_track(value) | | *Getter* | get\_audio\_track() | The embedded audio track to play. ### [bool](class_bool#class-bool) autoplay | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_autoplay(value) | | *Getter* | has\_autoplay() | If `true`, playback starts when the scene loads. ### [int](class_int#class-int) buffering\_msec | | | | --- | --- | | *Default* | `500` | | *Setter* | set\_buffering\_msec(value) | | *Getter* | get\_buffering\_msec() | Amount of time in milliseconds to store in buffer while playing. ### [String](class_string#class-string) bus | | | | --- | --- | | *Default* | `"Master"` | | *Setter* | set\_bus(value) | | *Getter* | get\_bus() | Audio bus to use for sound playback. ### [bool](class_bool#class-bool) expand | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_expand(value) | | *Getter* | has\_expand() | If `true`, the video scales to the control size. Otherwise, the control minimum size will be automatically adjusted to match the video stream's dimensions. ### [bool](class_bool#class-bool) paused | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_paused(value) | | *Getter* | is\_paused() | If `true`, the video is paused. ### [VideoStream](class_videostream#class-videostream) stream | | | | --- | --- | | *Setter* | set\_stream(value) | | *Getter* | get\_stream() | The assigned video stream. See description for supported formats. ### [float](class_float#class-float) stream\_position | | | | --- | --- | | *Setter* | set\_stream\_position(value) | | *Getter* | get\_stream\_position() | The current position of the stream, in seconds. **Note:** Changing this value won't have any effect as seeking is not implemented yet, except in video formats implemented by a GDNative add-on. ### [float](class_float#class-float) volume | | | | --- | --- | | *Setter* | set\_volume(value) | | *Getter* | get\_volume() | Audio volume as a linear value. ### [float](class_float#class-float) volume\_db | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_volume\_db(value) | | *Getter* | get\_volume\_db() | Audio volume in dB. Method Descriptions ------------------- ### [String](class_string#class-string) get\_stream\_name ( ) const Returns the video stream's name, or `"<No Stream>"` if no video stream is assigned. ### [Texture](class_texture#class-texture) get\_video\_texture ( ) const Returns the current frame as a [Texture](class_texture#class-texture). ### [bool](class_bool#class-bool) is\_playing ( ) const Returns `true` if the video is playing. **Note:** The video is still considered playing if paused during playback. ### void play ( ) Starts the video playback from the beginning. If the video is paused, this will not unpause the video. ### void stop ( ) Stops the video playback and sets the stream position to 0. **Note:** Although the stream position will be set to 0, the first frame of the video stream won't become the current frame. godot VisualShaderNodeScalarClamp VisualShaderNodeScalarClamp =========================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Clamps a scalar value within the visual shader graph. Description ----------- Constrains a value to lie between `min` and `max` values. godot PhysicsShapeQueryParameters PhysicsShapeQueryParameters =========================== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Parameters to be sent to a 3D shape physics query. Description ----------- This class contains the shape and other parameters for 3D intersection/collision queries. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [collide\_with\_areas](#class-physicsshapequeryparameters-property-collide-with-areas) | `false` | | [bool](class_bool#class-bool) | [collide\_with\_bodies](#class-physicsshapequeryparameters-property-collide-with-bodies) | `true` | | [int](class_int#class-int) | [collision\_mask](#class-physicsshapequeryparameters-property-collision-mask) | `2147483647` | | [Array](class_array#class-array) | [exclude](#class-physicsshapequeryparameters-property-exclude) | `[  ]` | | [float](class_float#class-float) | [margin](#class-physicsshapequeryparameters-property-margin) | `0.0` | | [RID](class_rid#class-rid) | [shape\_rid](#class-physicsshapequeryparameters-property-shape-rid) | | | [Transform](class_transform#class-transform) | [transform](#class-physicsshapequeryparameters-property-transform) | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | Methods ------- | | | | --- | --- | | void | [set\_shape](#class-physicsshapequeryparameters-method-set-shape) **(** [Resource](class_resource#class-resource) shape **)** | Property Descriptions --------------------- ### [bool](class_bool#class-bool) collide\_with\_areas | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_collide\_with\_areas(value) | | *Getter* | is\_collide\_with\_areas\_enabled() | If `true`, the query will take [Area](class_area#class-area)s into account. ### [bool](class_bool#class-bool) collide\_with\_bodies | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_collide\_with\_bodies(value) | | *Getter* | is\_collide\_with\_bodies\_enabled() | If `true`, the query will take [PhysicsBody](class_physicsbody#class-physicsbody)s into account. ### [int](class_int#class-int) collision\_mask | | | | --- | --- | | *Default* | `2147483647` | | *Setter* | set\_collision\_mask(value) | | *Getter* | get\_collision\_mask() | The physics layer(s) the query will take into account (as a bitmask). See [Collision layers and masks](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. ### [Array](class_array#class-array) exclude | | | | --- | --- | | *Default* | `[  ]` | | *Setter* | set\_exclude(value) | | *Getter* | get\_exclude() | The list of objects or object [RID](class_rid#class-rid)s that will be excluded from collisions. ### [float](class_float#class-float) margin | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_margin(value) | | *Getter* | get\_margin() | The collision margin for the shape. ### [RID](class_rid#class-rid) shape\_rid | | | | --- | --- | | *Setter* | set\_shape\_rid(value) | | *Getter* | get\_shape\_rid() | The queried shape's [RID](class_rid#class-rid). See also [set\_shape](#class-physicsshapequeryparameters-method-set-shape). ### [Transform](class_transform#class-transform) transform | | | | --- | --- | | *Default* | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | | *Setter* | set\_transform(value) | | *Getter* | get\_transform() | The queried shape's transform matrix. Method Descriptions ------------------- ### void set\_shape ( [Resource](class_resource#class-resource) shape ) Sets the [Shape](class_shape#class-shape) that will be used for collision/intersection queries. godot EditorScript EditorScript ============ **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Base script that can be used to add extension functions to the editor. Description ----------- Scripts extending this class and implementing its [\_run](#class-editorscript-method-run) method can be executed from the Script Editor's **File > Run** menu option (or by pressing `Ctrl+Shift+X`) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using [EditorPlugin](class_editorplugin#class-editorplugin)s instead. **Note:** Extending scripts need to have `tool` mode enabled. **Example script:** ``` tool extends EditorScript func _run(): print("Hello from the Godot Editor!") ``` **Note:** The script is run in the Editor context, which means the output is visible in the console window started with the Editor (stdout) instead of the usual Godot **Output** dock. Methods ------- | | | | --- | --- | | void | [\_run](#class-editorscript-method-run) **(** **)** virtual | | void | [add\_root\_node](#class-editorscript-method-add-root-node) **(** [Node](class_node#class-node) node **)** | | [EditorInterface](class_editorinterface#class-editorinterface) | [get\_editor\_interface](#class-editorscript-method-get-editor-interface) **(** **)** | | [Node](class_node#class-node) | [get\_scene](#class-editorscript-method-get-scene) **(** **)** | Method Descriptions ------------------- ### void \_run ( ) virtual This method is executed by the Editor when **File > Run** is used. ### void add\_root\_node ( [Node](class_node#class-node) node ) Adds `node` as a child of the root node in the editor context. **Warning:** The implementation of this method is currently disabled. ### [EditorInterface](class_editorinterface#class-editorinterface) get\_editor\_interface ( ) Returns the [EditorInterface](class_editorinterface#class-editorinterface) singleton instance. ### [Node](class_node#class-node) get\_scene ( ) Returns the Editor's currently active scene. godot InterpolatedCamera InterpolatedCamera ================== **Inherits:** [Camera](class_camera#class-camera) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) *Deprecated.* Camera which moves toward another node. Description ----------- *Deprecated (will be removed in Godot 4.0).* InterpolatedCamera is a [Camera](class_camera#class-camera) which smoothly moves to match a target node's position and rotation. If it is not [enabled](#class-interpolatedcamera-property-enabled) or does not have a valid target set, InterpolatedCamera acts like a normal Camera. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [enabled](#class-interpolatedcamera-property-enabled) | `false` | | [InterpolatedCameraProcessMode](#enum-interpolatedcamera-interpolatedcameraprocessmode) | [process\_mode](#class-interpolatedcamera-property-process-mode) | `1` | | [float](class_float#class-float) | [speed](#class-interpolatedcamera-property-speed) | `1.0` | | [NodePath](class_nodepath#class-nodepath) | [target](#class-interpolatedcamera-property-target) | `NodePath("")` | Methods ------- | | | | --- | --- | | void | [set\_target](#class-interpolatedcamera-method-set-target) **(** [Object](class_object#class-object) target **)** | Enumerations ------------ enum **InterpolatedCameraProcessMode**: * **INTERPOLATED\_CAMERA\_PROCESS\_PHYSICS** = **0** --- The camera updates with the `_physics_process` callback. * **INTERPOLATED\_CAMERA\_PROCESS\_IDLE** = **1** --- The camera updates with the `_process` callback. Property Descriptions --------------------- ### [bool](class_bool#class-bool) enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_interpolation\_enabled(value) | | *Getter* | is\_interpolation\_enabled() | If `true`, and a target is set, the camera will move automatically. ### [InterpolatedCameraProcessMode](#enum-interpolatedcamera-interpolatedcameraprocessmode) process\_mode | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_process\_mode(value) | | *Getter* | get\_process\_mode() | The camera's process callback. See [InterpolatedCameraProcessMode](#enum-interpolatedcamera-interpolatedcameraprocessmode). ### [float](class_float#class-float) speed | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_speed(value) | | *Getter* | get\_speed() | How quickly the camera moves toward its target. Higher values will result in tighter camera motion. ### [NodePath](class_nodepath#class-nodepath) target | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_target\_path(value) | | *Getter* | get\_target\_path() | The target's [NodePath](class_nodepath#class-nodepath). Method Descriptions ------------------- ### void set\_target ( [Object](class_object#class-object) target ) Sets the node to move toward and orient with. godot EditorSelection EditorSelection =============== **Inherits:** [Object](class_object#class-object) Manages the SceneTree selection in the editor. Description ----------- This object manages the SceneTree selection in the editor. **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using [EditorInterface.get\_selection](class_editorinterface#class-editorinterface-method-get-selection). Methods ------- | | | | --- | --- | | void | [add\_node](#class-editorselection-method-add-node) **(** [Node](class_node#class-node) node **)** | | void | [clear](#class-editorselection-method-clear) **(** **)** | | [Array](class_array#class-array) | [get\_selected\_nodes](#class-editorselection-method-get-selected-nodes) **(** **)** | | [Array](class_array#class-array) | [get\_transformable\_selected\_nodes](#class-editorselection-method-get-transformable-selected-nodes) **(** **)** | | void | [remove\_node](#class-editorselection-method-remove-node) **(** [Node](class_node#class-node) node **)** | Signals ------- ### selection\_changed ( ) Emitted when the selection changes. Method Descriptions ------------------- ### void add\_node ( [Node](class_node#class-node) node ) Adds a node to the selection. **Note:** The newly selected node will not be automatically edited in the inspector. If you want to edit a node, use [EditorInterface.edit\_node](class_editorinterface#class-editorinterface-method-edit-node). ### void clear ( ) Clear the selection. ### [Array](class_array#class-array) get\_selected\_nodes ( ) Gets the list of selected nodes. ### [Array](class_array#class-array) get\_transformable\_selected\_nodes ( ) Gets the list of selected nodes, optimized for transform operations (i.e. moving them, rotating, etc). This list avoids situations where a node is selected and also child/grandchild. ### void remove\_node ( [Node](class_node#class-node) node ) Removes a node from the selection. godot Physics2DDirectSpaceState Physics2DDirectSpaceState ========================= **Inherits:** [Object](class_object#class-object) Direct access object to a space in the [Physics2DServer](class_physics2dserver#class-physics2dserver). Description ----------- Direct access object to a space in the [Physics2DServer](class_physics2dserver#class-physics2dserver). It's used mainly to do queries against objects and areas residing in a given space. Tutorials --------- * [Physics introduction](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html) * [Ray-casting](https://docs.godotengine.org/en/3.5/tutorials/physics/ray-casting.html) Methods ------- | | | | --- | --- | | [Array](class_array#class-array) | [cast\_motion](#class-physics2ddirectspacestate-method-cast-motion) **(** [Physics2DShapeQueryParameters](class_physics2dshapequeryparameters#class-physics2dshapequeryparameters) shape **)** | | [Array](class_array#class-array) | [collide\_shape](#class-physics2ddirectspacestate-method-collide-shape) **(** [Physics2DShapeQueryParameters](class_physics2dshapequeryparameters#class-physics2dshapequeryparameters) shape, [int](class_int#class-int) max\_results=32 **)** | | [Dictionary](class_dictionary#class-dictionary) | [get\_rest\_info](#class-physics2ddirectspacestate-method-get-rest-info) **(** [Physics2DShapeQueryParameters](class_physics2dshapequeryparameters#class-physics2dshapequeryparameters) shape **)** | | [Array](class_array#class-array) | [intersect\_point](#class-physics2ddirectspacestate-method-intersect-point) **(** [Vector2](class_vector2#class-vector2) point, [int](class_int#class-int) max\_results=32, [Array](class_array#class-array) exclude=[ ], [int](class_int#class-int) collision\_layer=2147483647, [bool](class_bool#class-bool) collide\_with\_bodies=true, [bool](class_bool#class-bool) collide\_with\_areas=false **)** | | [Array](class_array#class-array) | [intersect\_point\_on\_canvas](#class-physics2ddirectspacestate-method-intersect-point-on-canvas) **(** [Vector2](class_vector2#class-vector2) point, [int](class_int#class-int) canvas\_instance\_id, [int](class_int#class-int) max\_results=32, [Array](class_array#class-array) exclude=[ ], [int](class_int#class-int) collision\_layer=2147483647, [bool](class_bool#class-bool) collide\_with\_bodies=true, [bool](class_bool#class-bool) collide\_with\_areas=false **)** | | [Dictionary](class_dictionary#class-dictionary) | [intersect\_ray](#class-physics2ddirectspacestate-method-intersect-ray) **(** [Vector2](class_vector2#class-vector2) from, [Vector2](class_vector2#class-vector2) to, [Array](class_array#class-array) exclude=[ ], [int](class_int#class-int) collision\_layer=2147483647, [bool](class_bool#class-bool) collide\_with\_bodies=true, [bool](class_bool#class-bool) collide\_with\_areas=false **)** | | [Array](class_array#class-array) | [intersect\_shape](#class-physics2ddirectspacestate-method-intersect-shape) **(** [Physics2DShapeQueryParameters](class_physics2dshapequeryparameters#class-physics2dshapequeryparameters) shape, [int](class_int#class-int) max\_results=32 **)** | Method Descriptions ------------------- ### [Array](class_array#class-array) cast\_motion ( [Physics2DShapeQueryParameters](class_physics2dshapequeryparameters#class-physics2dshapequeryparameters) shape ) Checks how far a [Shape2D](class_shape2d#class-shape2d) can move without colliding. All the parameters for the query, including the shape and the motion, are supplied through a [Physics2DShapeQueryParameters](class_physics2dshapequeryparameters#class-physics2dshapequeryparameters) object. Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe proportion is the maximum fraction of the motion that can be made without a collision. The unsafe proportion is the minimum fraction of the distance that must be moved for a collision. If no collision is detected a result of `[1.0, 1.0]` will be returned. **Note:** Any [Shape2D](class_shape2d#class-shape2d)s that the shape is already colliding with e.g. inside of, will be ignored. Use [collide\_shape](#class-physics2ddirectspacestate-method-collide-shape) to determine the [Shape2D](class_shape2d#class-shape2d)s that the shape is already colliding with. ### [Array](class_array#class-array) collide\_shape ( [Physics2DShapeQueryParameters](class_physics2dshapequeryparameters#class-physics2dshapequeryparameters) shape, [int](class_int#class-int) max\_results=32 ) Checks the intersections of a shape, given through a [Physics2DShapeQueryParameters](class_physics2dshapequeryparameters#class-physics2dshapequeryparameters) object, against the space. The resulting array contains a list of points where the shape intersects another. Like with [intersect\_shape](#class-physics2ddirectspacestate-method-intersect-shape), the number of returned results can be limited to save processing time. ### [Dictionary](class_dictionary#class-dictionary) get\_rest\_info ( [Physics2DShapeQueryParameters](class_physics2dshapequeryparameters#class-physics2dshapequeryparameters) shape ) Checks the intersections of a shape, given through a [Physics2DShapeQueryParameters](class_physics2dshapequeryparameters#class-physics2dshapequeryparameters) object, against the space. If it collides with more than one shape, the nearest one is selected. If the shape did not intersect anything, then an empty dictionary is returned instead. **Note:** This method does not take into account the `motion` property of the object. The returned object is a dictionary containing the following fields: `collider_id`: The colliding object's ID. `linear_velocity`: The colliding object's velocity [Vector2](class_vector2#class-vector2). If the object is an [Area2D](class_area2d#class-area2d), the result is `(0, 0)`. `metadata`: The intersecting shape's metadata. This metadata is different from [Object.get\_meta](class_object#class-object-method-get-meta), and is set with [Physics2DServer.shape\_set\_data](class_physics2dserver#class-physics2dserver-method-shape-set-data). `normal`: The object's surface normal at the intersection point. `point`: The intersection point. `rid`: The intersecting object's [RID](class_rid#class-rid). `shape`: The shape index of the colliding shape. ### [Array](class_array#class-array) intersect\_point ( [Vector2](class_vector2#class-vector2) point, [int](class_int#class-int) max\_results=32, [Array](class_array#class-array) exclude=[ ], [int](class_int#class-int) collision\_layer=2147483647, [bool](class_bool#class-bool) collide\_with\_bodies=true, [bool](class_bool#class-bool) collide\_with\_areas=false ) Checks whether a point is inside any solid shape. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: `collider`: The colliding object. `collider_id`: The colliding object's ID. `metadata`: The intersecting shape's metadata. This metadata is different from [Object.get\_meta](class_object#class-object-method-get-meta), and is set with [Physics2DServer.shape\_set\_data](class_physics2dserver#class-physics2dserver-method-shape-set-data). `rid`: The intersecting object's [RID](class_rid#class-rid). `shape`: The shape index of the colliding shape. The number of intersections can be limited with the `max_results` parameter, to reduce the processing time. Additionally, the method can take an `exclude` array of objects or [RID](class_rid#class-rid)s that are to be excluded from collisions, a `collision_mask` bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d)s or [Area2D](class_area2d#class-area2d)s, respectively. **Note:** [ConcavePolygonShape2D](class_concavepolygonshape2d#class-concavepolygonshape2d)s and [CollisionPolygon2D](class_collisionpolygon2d#class-collisionpolygon2d)s in `Segments` build mode are not solid shapes. Therefore, they will not be detected. ### [Array](class_array#class-array) intersect\_point\_on\_canvas ( [Vector2](class_vector2#class-vector2) point, [int](class_int#class-int) canvas\_instance\_id, [int](class_int#class-int) max\_results=32, [Array](class_array#class-array) exclude=[ ], [int](class_int#class-int) collision\_layer=2147483647, [bool](class_bool#class-bool) collide\_with\_bodies=true, [bool](class_bool#class-bool) collide\_with\_areas=false ) Checks whether a point is inside any solid shape, in a specific canvas layer given by `canvas_instance_id`. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: `collider`: The colliding object. `collider_id`: The colliding object's ID. `metadata`: The intersecting shape's metadata. This metadata is different from [Object.get\_meta](class_object#class-object-method-get-meta), and is set with [Physics2DServer.shape\_set\_data](class_physics2dserver#class-physics2dserver-method-shape-set-data). `rid`: The intersecting object's [RID](class_rid#class-rid). `shape`: The shape index of the colliding shape. The number of intersections can be limited with the `max_results` parameter, to reduce the processing time. Additionally, the method can take an `exclude` array of objects or [RID](class_rid#class-rid)s that are to be excluded from collisions, a `collision_mask` bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d)s or [Area2D](class_area2d#class-area2d)s, respectively. **Note:** [ConcavePolygonShape2D](class_concavepolygonshape2d#class-concavepolygonshape2d)s and [CollisionPolygon2D](class_collisionpolygon2d#class-collisionpolygon2d)s in `Segments` build mode are not solid shapes. Therefore, they will not be detected. ### [Dictionary](class_dictionary#class-dictionary) intersect\_ray ( [Vector2](class_vector2#class-vector2) from, [Vector2](class_vector2#class-vector2) to, [Array](class_array#class-array) exclude=[ ], [int](class_int#class-int) collision\_layer=2147483647, [bool](class_bool#class-bool) collide\_with\_bodies=true, [bool](class_bool#class-bool) collide\_with\_areas=false ) Intersects a ray in a given space. The returned object is a dictionary with the following fields: `collider`: The colliding object. `collider_id`: The colliding object's ID. `metadata`: The intersecting shape's metadata. This metadata is different from [Object.get\_meta](class_object#class-object-method-get-meta), and is set with [Physics2DServer.shape\_set\_data](class_physics2dserver#class-physics2dserver-method-shape-set-data). `normal`: The object's surface normal at the intersection point. `position`: The intersection point. `rid`: The intersecting object's [RID](class_rid#class-rid). `shape`: The shape index of the colliding shape. If the ray did not intersect anything, then an empty dictionary is returned instead. Additionally, the method can take an `exclude` array of objects or [RID](class_rid#class-rid)s that are to be excluded from collisions, a `collision_mask` bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d)s or [Area2D](class_area2d#class-area2d)s, respectively. ### [Array](class_array#class-array) intersect\_shape ( [Physics2DShapeQueryParameters](class_physics2dshapequeryparameters#class-physics2dshapequeryparameters) shape, [int](class_int#class-int) max\_results=32 ) Checks the intersections of a shape, given through a [Physics2DShapeQueryParameters](class_physics2dshapequeryparameters#class-physics2dshapequeryparameters) object, against the space. The intersected shapes are returned in an array containing dictionaries with the following fields: `collider`: The colliding object. `collider_id`: The colliding object's ID. `metadata`: The intersecting shape's metadata. This metadata is different from [Object.get\_meta](class_object#class-object-method-get-meta), and is set with [Physics2DServer.shape\_set\_data](class_physics2dserver#class-physics2dserver-method-shape-set-data). `rid`: The intersecting object's [RID](class_rid#class-rid). `shape`: The shape index of the colliding shape. The number of intersections can be limited with the `max_results` parameter, to reduce the processing time.
programming_docs
godot VisualInstance VisualInstance ============== **Inherits:** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [BakedLightmap](class_bakedlightmap#class-bakedlightmap), [GIProbe](class_giprobe#class-giprobe), [GeometryInstance](class_geometryinstance#class-geometryinstance), [Light](class_light#class-light), [ReflectionProbe](class_reflectionprobe#class-reflectionprobe), [RootMotionView](class_rootmotionview#class-rootmotionview) Parent of all visual 3D nodes. Description ----------- The `VisualInstance` is used to connect a resource to a visual representation. All visual 3D nodes inherit from the `VisualInstance`. In general, you should not access the `VisualInstance` properties directly as they are accessed and managed by the nodes that inherit from `VisualInstance`. `VisualInstance` is the node representation of the [VisualServer](class_visualserver#class-visualserver) instance. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [layers](#class-visualinstance-property-layers) | `1` | Methods ------- | | | | --- | --- | | [AABB](class_aabb#class-aabb) | [get\_aabb](#class-visualinstance-method-get-aabb) **(** **)** const | | [RID](class_rid#class-rid) | [get\_base](#class-visualinstance-method-get-base) **(** **)** const | | [RID](class_rid#class-rid) | [get\_instance](#class-visualinstance-method-get-instance) **(** **)** const | | [bool](class_bool#class-bool) | [get\_layer\_mask\_bit](#class-visualinstance-method-get-layer-mask-bit) **(** [int](class_int#class-int) layer **)** const | | [AABB](class_aabb#class-aabb) | [get\_transformed\_aabb](#class-visualinstance-method-get-transformed-aabb) **(** **)** const | | void | [set\_base](#class-visualinstance-method-set-base) **(** [RID](class_rid#class-rid) base **)** | | void | [set\_layer\_mask\_bit](#class-visualinstance-method-set-layer-mask-bit) **(** [int](class_int#class-int) layer, [bool](class_bool#class-bool) enabled **)** | Property Descriptions --------------------- ### [int](class_int#class-int) layers | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_layer\_mask(value) | | *Getter* | get\_layer\_mask() | The render layer(s) this `VisualInstance` is drawn on. This object will only be visible for [Camera](class_camera#class-camera)s whose cull mask includes the render object this `VisualInstance` is set to. Method Descriptions ------------------- ### [AABB](class_aabb#class-aabb) get\_aabb ( ) const Returns the [AABB](class_aabb#class-aabb) (also known as the bounding box) for this `VisualInstance`. See also [get\_transformed\_aabb](#class-visualinstance-method-get-transformed-aabb). ### [RID](class_rid#class-rid) get\_base ( ) const Returns the RID of the resource associated with this `VisualInstance`. For example, if the Node is a [MeshInstance](class_meshinstance#class-meshinstance), this will return the RID of the associated [Mesh](class_mesh#class-mesh). ### [RID](class_rid#class-rid) get\_instance ( ) const Returns the RID of this instance. This RID is the same as the RID returned by [VisualServer.instance\_create](class_visualserver#class-visualserver-method-instance-create). This RID is needed if you want to call [VisualServer](class_visualserver#class-visualserver) functions directly on this `VisualInstance`. ### [bool](class_bool#class-bool) get\_layer\_mask\_bit ( [int](class_int#class-int) layer ) const Returns `true` when the specified layer is enabled in [layers](#class-visualinstance-property-layers) and `false` otherwise. ### [AABB](class_aabb#class-aabb) get\_transformed\_aabb ( ) const Returns the transformed [AABB](class_aabb#class-aabb) (also known as the bounding box) for this `VisualInstance`. Transformed in this case means the [AABB](class_aabb#class-aabb) plus the position, rotation, and scale of the [Spatial](class_spatial#class-spatial)'s [Transform](class_transform#class-transform). See also [get\_aabb](#class-visualinstance-method-get-aabb). ### void set\_base ( [RID](class_rid#class-rid) base ) Sets the resource that is instantiated by this `VisualInstance`, which changes how the engine handles the `VisualInstance` under the hood. Equivalent to [VisualServer.instance\_set\_base](class_visualserver#class-visualserver-method-instance-set-base). ### void set\_layer\_mask\_bit ( [int](class_int#class-int) layer, [bool](class_bool#class-bool) enabled ) Enables a particular layer in [layers](#class-visualinstance-property-layers). godot GLTFState GLTFState ========= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Description ----------- **Note:** This class is only compiled in editor builds. Run-time glTF loading and saving is *not* available in exported projects. References to `GLTFState` within a script will cause an error in an exported project. Properties ---------- | | | | | --- | --- | --- | | [Array](class_array#class-array) | [buffers](#class-gltfstate-property-buffers) | `[  ]` | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [glb\_data](#class-gltfstate-property-glb-data) | `PoolByteArray(  )` | | [Dictionary](class_dictionary#class-dictionary) | [json](#class-gltfstate-property-json) | `{}` | | [int](class_int#class-int) | [major\_version](#class-gltfstate-property-major-version) | `0` | | [int](class_int#class-int) | [minor\_version](#class-gltfstate-property-minor-version) | `0` | | [Array](class_array#class-array) | [root\_nodes](#class-gltfstate-property-root-nodes) | `[  ]` | | [String](class_string#class-string) | [scene\_name](#class-gltfstate-property-scene-name) | `""` | | [bool](class_bool#class-bool) | [use\_named\_skin\_binds](#class-gltfstate-property-use-named-skin-binds) | `false` | Methods ------- | | | | --- | --- | | [Array](class_array#class-array) | [get\_accessors](#class-gltfstate-method-get-accessors) **(** **)** | | [AnimationPlayer](class_animationplayer#class-animationplayer) | [get\_animation\_player](#class-gltfstate-method-get-animation-player) **(** [int](class_int#class-int) idx **)** | | [int](class_int#class-int) | [get\_animation\_players\_count](#class-gltfstate-method-get-animation-players-count) **(** [int](class_int#class-int) idx **)** | | [Array](class_array#class-array) | [get\_animations](#class-gltfstate-method-get-animations) **(** **)** | | [Array](class_array#class-array) | [get\_buffer\_views](#class-gltfstate-method-get-buffer-views) **(** **)** | | [Array](class_array#class-array) | [get\_cameras](#class-gltfstate-method-get-cameras) **(** **)** | | [Array](class_array#class-array) | [get\_images](#class-gltfstate-method-get-images) **(** **)** | | [Array](class_array#class-array) | [get\_lights](#class-gltfstate-method-get-lights) **(** **)** | | [Array](class_array#class-array) | [get\_materials](#class-gltfstate-method-get-materials) **(** **)** | | [Array](class_array#class-array) | [get\_meshes](#class-gltfstate-method-get-meshes) **(** **)** | | [Array](class_array#class-array) | [get\_nodes](#class-gltfstate-method-get-nodes) **(** **)** | | [Node](class_node#class-node) | [get\_scene\_node](#class-gltfstate-method-get-scene-node) **(** [int](class_int#class-int) idx **)** | | [Dictionary](class_dictionary#class-dictionary) | [get\_skeleton\_to\_node](#class-gltfstate-method-get-skeleton-to-node) **(** **)** | | [Array](class_array#class-array) | [get\_skeletons](#class-gltfstate-method-get-skeletons) **(** **)** | | [Array](class_array#class-array) | [get\_skins](#class-gltfstate-method-get-skins) **(** **)** | | [Array](class_array#class-array) | [get\_textures](#class-gltfstate-method-get-textures) **(** **)** | | [Array](class_array#class-array) | [get\_unique\_animation\_names](#class-gltfstate-method-get-unique-animation-names) **(** **)** | | [Array](class_array#class-array) | [get\_unique\_names](#class-gltfstate-method-get-unique-names) **(** **)** | | void | [set\_accessors](#class-gltfstate-method-set-accessors) **(** [Array](class_array#class-array) accessors **)** | | void | [set\_animations](#class-gltfstate-method-set-animations) **(** [Array](class_array#class-array) animations **)** | | void | [set\_buffer\_views](#class-gltfstate-method-set-buffer-views) **(** [Array](class_array#class-array) buffer\_views **)** | | void | [set\_cameras](#class-gltfstate-method-set-cameras) **(** [Array](class_array#class-array) cameras **)** | | void | [set\_images](#class-gltfstate-method-set-images) **(** [Array](class_array#class-array) images **)** | | void | [set\_lights](#class-gltfstate-method-set-lights) **(** [Array](class_array#class-array) lights **)** | | void | [set\_materials](#class-gltfstate-method-set-materials) **(** [Array](class_array#class-array) materials **)** | | void | [set\_meshes](#class-gltfstate-method-set-meshes) **(** [Array](class_array#class-array) meshes **)** | | void | [set\_nodes](#class-gltfstate-method-set-nodes) **(** [Array](class_array#class-array) nodes **)** | | void | [set\_skeleton\_to\_node](#class-gltfstate-method-set-skeleton-to-node) **(** [Dictionary](class_dictionary#class-dictionary) skeleton\_to\_node **)** | | void | [set\_skeletons](#class-gltfstate-method-set-skeletons) **(** [Array](class_array#class-array) skeletons **)** | | void | [set\_skins](#class-gltfstate-method-set-skins) **(** [Array](class_array#class-array) skins **)** | | void | [set\_textures](#class-gltfstate-method-set-textures) **(** [Array](class_array#class-array) textures **)** | | void | [set\_unique\_animation\_names](#class-gltfstate-method-set-unique-animation-names) **(** [Array](class_array#class-array) unique\_animation\_names **)** | | void | [set\_unique\_names](#class-gltfstate-method-set-unique-names) **(** [Array](class_array#class-array) unique\_names **)** | Property Descriptions --------------------- ### [Array](class_array#class-array) buffers | | | | --- | --- | | *Default* | `[  ]` | | *Setter* | set\_buffers(value) | | *Getter* | get\_buffers() | ### [PoolByteArray](class_poolbytearray#class-poolbytearray) glb\_data | | | | --- | --- | | *Default* | `PoolByteArray(  )` | | *Setter* | set\_glb\_data(value) | | *Getter* | get\_glb\_data() | ### [Dictionary](class_dictionary#class-dictionary) json | | | | --- | --- | | *Default* | `{}` | | *Setter* | set\_json(value) | | *Getter* | get\_json() | ### [int](class_int#class-int) major\_version | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_major\_version(value) | | *Getter* | get\_major\_version() | ### [int](class_int#class-int) minor\_version | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_minor\_version(value) | | *Getter* | get\_minor\_version() | ### [Array](class_array#class-array) root\_nodes | | | | --- | --- | | *Default* | `[  ]` | | *Setter* | set\_root\_nodes(value) | | *Getter* | get\_root\_nodes() | ### [String](class_string#class-string) scene\_name | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_scene\_name(value) | | *Getter* | get\_scene\_name() | ### [bool](class_bool#class-bool) use\_named\_skin\_binds | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_named\_skin\_binds(value) | | *Getter* | get\_use\_named\_skin\_binds() | Method Descriptions ------------------- ### [Array](class_array#class-array) get\_accessors ( ) ### [AnimationPlayer](class_animationplayer#class-animationplayer) get\_animation\_player ( [int](class_int#class-int) idx ) ### [int](class_int#class-int) get\_animation\_players\_count ( [int](class_int#class-int) idx ) ### [Array](class_array#class-array) get\_animations ( ) ### [Array](class_array#class-array) get\_buffer\_views ( ) ### [Array](class_array#class-array) get\_cameras ( ) ### [Array](class_array#class-array) get\_images ( ) ### [Array](class_array#class-array) get\_lights ( ) ### [Array](class_array#class-array) get\_materials ( ) ### [Array](class_array#class-array) get\_meshes ( ) ### [Array](class_array#class-array) get\_nodes ( ) ### [Node](class_node#class-node) get\_scene\_node ( [int](class_int#class-int) idx ) ### [Dictionary](class_dictionary#class-dictionary) get\_skeleton\_to\_node ( ) ### [Array](class_array#class-array) get\_skeletons ( ) ### [Array](class_array#class-array) get\_skins ( ) ### [Array](class_array#class-array) get\_textures ( ) ### [Array](class_array#class-array) get\_unique\_animation\_names ( ) ### [Array](class_array#class-array) get\_unique\_names ( ) ### void set\_accessors ( [Array](class_array#class-array) accessors ) ### void set\_animations ( [Array](class_array#class-array) animations ) ### void set\_buffer\_views ( [Array](class_array#class-array) buffer\_views ) ### void set\_cameras ( [Array](class_array#class-array) cameras ) ### void set\_images ( [Array](class_array#class-array) images ) ### void set\_lights ( [Array](class_array#class-array) lights ) ### void set\_materials ( [Array](class_array#class-array) materials ) ### void set\_meshes ( [Array](class_array#class-array) meshes ) ### void set\_nodes ( [Array](class_array#class-array) nodes ) ### void set\_skeleton\_to\_node ( [Dictionary](class_dictionary#class-dictionary) skeleton\_to\_node ) ### void set\_skeletons ( [Array](class_array#class-array) skeletons ) ### void set\_skins ( [Array](class_array#class-array) skins ) ### void set\_textures ( [Array](class_array#class-array) textures ) ### void set\_unique\_animation\_names ( [Array](class_array#class-array) unique\_animation\_names ) ### void set\_unique\_names ( [Array](class_array#class-array) unique\_names ) godot PathFollow PathFollow ========== **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Point sampler for a [Path](class_path#class-path). Description ----------- This node takes its parent [Path](class_path#class-path), and returns the coordinates of a point within it, given a distance from the first vertex. It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be children of this node. The descendant nodes will then move accordingly when setting an offset in this node. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [cubic\_interp](#class-pathfollow-property-cubic-interp) | `true` | | [float](class_float#class-float) | [h\_offset](#class-pathfollow-property-h-offset) | `0.0` | | [bool](class_bool#class-bool) | [loop](#class-pathfollow-property-loop) | `true` | | [float](class_float#class-float) | [offset](#class-pathfollow-property-offset) | `0.0` | | [RotationMode](#enum-pathfollow-rotationmode) | [rotation\_mode](#class-pathfollow-property-rotation-mode) | `3` | | [float](class_float#class-float) | [unit\_offset](#class-pathfollow-property-unit-offset) | `0.0` | | [float](class_float#class-float) | [v\_offset](#class-pathfollow-property-v-offset) | `0.0` | Enumerations ------------ enum **RotationMode**: * **ROTATION\_NONE** = **0** --- Forbids the PathFollow to rotate. * **ROTATION\_Y** = **1** --- Allows the PathFollow to rotate in the Y axis only. * **ROTATION\_XY** = **2** --- Allows the PathFollow to rotate in both the X, and Y axes. * **ROTATION\_XYZ** = **3** --- Allows the PathFollow to rotate in any axis. * **ROTATION\_ORIENTED** = **4** --- Uses the up vector information in a [Curve3D](class_curve3d#class-curve3d) to enforce orientation. This rotation mode requires the [Path](class_path#class-path)'s [Curve3D.up\_vector\_enabled](class_curve3d#class-curve3d-property-up-vector-enabled) property to be set to `true`. Property Descriptions --------------------- ### [bool](class_bool#class-bool) cubic\_interp | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_cubic\_interpolation(value) | | *Getter* | get\_cubic\_interpolation() | If `true`, the position between two cached points is interpolated cubically, and linearly otherwise. The points along the [Curve3D](class_curve3d#class-curve3d) of the [Path](class_path#class-path) are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough. There are two answers to this problem: either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations. ### [float](class_float#class-float) h\_offset | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_h\_offset(value) | | *Getter* | get\_h\_offset() | The node's offset along the curve. ### [bool](class_bool#class-bool) loop | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_loop(value) | | *Getter* | has\_loop() | If `true`, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths. ### [float](class_float#class-float) offset | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_offset(value) | | *Getter* | get\_offset() | The distance from the first vertex, measured in 3D units along the path. This sets this node's position to a point within the path. ### [RotationMode](#enum-pathfollow-rotationmode) rotation\_mode | | | | --- | --- | | *Default* | `3` | | *Setter* | set\_rotation\_mode(value) | | *Getter* | get\_rotation\_mode() | Allows or forbids rotation on one or more axes, depending on the [RotationMode](#enum-pathfollow-rotationmode) constants being used. ### [float](class_float#class-float) unit\_offset | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_unit\_offset(value) | | *Getter* | get\_unit\_offset() | The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the offset within the path, as the offset supplied is multiplied internally by the path's length. ### [float](class_float#class-float) v\_offset | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_v\_offset(value) | | *Getter* | get\_v\_offset() | The node's offset perpendicular to the curve. godot UPNP UPNP ==== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Universal Plug and Play (UPnP) functions for network device discovery, querying and port forwarding. Description ----------- This class can be used to discover compatible [UPNPDevice](class_upnpdevice#class-upnpdevice)s on the local network and execute commands on them, like managing port mappings (for port forwarding/NAT traversal) and querying the local and remote network IP address. Note that methods on this class are synchronous and block the calling thread. To forward a specific port (here `7777`, note both [discover](#class-upnp-method-discover) and [add\_port\_mapping](#class-upnp-method-add-port-mapping) can return errors that should be checked): ``` var upnp = UPNP.new() upnp.discover() upnp.add_port_mapping(7777) ``` To close a specific port (e.g. after you have finished using it): ``` upnp.delete_port_mapping(port) ``` **Note:** UPnP discovery blocks the current thread. To perform discovery without blocking the main thread, use [Thread](class_thread#class-thread)s like this: ``` # Emitted when UPnP port mapping setup is completed (regardless of success or failure). signal upnp_completed(error) # Replace this with your own server port number between 1024 and 65535. const SERVER_PORT = 3928 var thread = null func _upnp_setup(server_port): # UPNP queries take some time. var upnp = UPNP.new() var err = upnp.discover() if err != OK: push_error(str(err)) emit_signal("upnp_completed", err) return if upnp.get_gateway() and upnp.get_gateway().is_valid_gateway(): upnp.add_port_mapping(server_port, server_port, ProjectSettings.get_setting("application/config/name"), "UDP") upnp.add_port_mapping(server_port, server_port, ProjectSettings.get_setting("application/config/name"), "TCP") emit_signal("upnp_completed", OK) func _ready(): thread = Thread.new() thread.start(self, "_upnp_setup", SERVER_PORT) func _exit_tree(): # Wait for thread finish here to handle game exit while the thread is running. thread.wait_to_finish() ``` **Terminology:** In the context of UPnP networking, "gateway" (or "internet gateway device", short IGD) refers to network devices that allow computers in the local network to access the internet ("wide area network", WAN). These gateways are often also called "routers". **Pitfalls:** * As explained above, these calls are blocking and shouldn't be run on the main thread, especially as they can block for multiple seconds at a time. Use threading! * Networking is physical and messy. Packets get lost in transit or get filtered, addresses, free ports and assigned mappings change, and devices may leave or join the network at any time. Be mindful of this, be diligent when checking and handling errors, and handle these gracefully if you can: add clear error UI, timeouts and re-try handling. * Port mappings may change (and be removed) at any time, and the remote/external IP address of the gateway can change likewise. You should consider re-querying the external IP and try to update/refresh the port mapping periodically (for example, every 5 minutes and on networking failures). * Not all devices support UPnP, and some users disable UPnP support. You need to handle this (e.g. documenting and requiring the user to manually forward ports, or adding alternative methods of NAT traversal, like a relay/mirror server, or NAT hole punching, STUN/TURN, etc.). * Consider what happens on mapping conflicts. Maybe multiple users on the same network would like to play your game at the same time, or maybe another application uses the same port. Make the port configurable, and optimally choose a port automatically (re-trying with a different port on failure). **Further reading:** If you want to know more about UPnP (and the Internet Gateway Device (IGD) and Port Control Protocol (PCP) specifically), [Wikipedia](https://en.wikipedia.org/wiki/Universal_Plug_and_Play) is a good first stop, the specification can be found at the [Open Connectivity Foundation](https://openconnectivity.org/developer/specifications/upnp-resources/upnp/) and Godot's implementation is based on the [MiniUPnP client](https://github.com/miniupnp/miniupnp). Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [discover\_ipv6](#class-upnp-property-discover-ipv6) | `false` | | [int](class_int#class-int) | [discover\_local\_port](#class-upnp-property-discover-local-port) | `0` | | [String](class_string#class-string) | [discover\_multicast\_if](#class-upnp-property-discover-multicast-if) | `""` | Methods ------- | | | | --- | --- | | void | [add\_device](#class-upnp-method-add-device) **(** [UPNPDevice](class_upnpdevice#class-upnpdevice) device **)** | | [int](class_int#class-int) | [add\_port\_mapping](#class-upnp-method-add-port-mapping) **(** [int](class_int#class-int) port, [int](class_int#class-int) port\_internal=0, [String](class_string#class-string) desc="", [String](class_string#class-string) proto="UDP", [int](class_int#class-int) duration=0 **)** const | | void | [clear\_devices](#class-upnp-method-clear-devices) **(** **)** | | [int](class_int#class-int) | [delete\_port\_mapping](#class-upnp-method-delete-port-mapping) **(** [int](class_int#class-int) port, [String](class_string#class-string) proto="UDP" **)** const | | [int](class_int#class-int) | [discover](#class-upnp-method-discover) **(** [int](class_int#class-int) timeout=2000, [int](class_int#class-int) ttl=2, [String](class_string#class-string) device\_filter="InternetGatewayDevice" **)** | | [UPNPDevice](class_upnpdevice#class-upnpdevice) | [get\_device](#class-upnp-method-get-device) **(** [int](class_int#class-int) index **)** const | | [int](class_int#class-int) | [get\_device\_count](#class-upnp-method-get-device-count) **(** **)** const | | [UPNPDevice](class_upnpdevice#class-upnpdevice) | [get\_gateway](#class-upnp-method-get-gateway) **(** **)** const | | [String](class_string#class-string) | [query\_external\_address](#class-upnp-method-query-external-address) **(** **)** const | | void | [remove\_device](#class-upnp-method-remove-device) **(** [int](class_int#class-int) index **)** | | void | [set\_device](#class-upnp-method-set-device) **(** [int](class_int#class-int) index, [UPNPDevice](class_upnpdevice#class-upnpdevice) device **)** | Enumerations ------------ enum **UPNPResult**: * **UPNP\_RESULT\_SUCCESS** = **0** --- UPNP command or discovery was successful. * **UPNP\_RESULT\_NOT\_AUTHORIZED** = **1** --- Not authorized to use the command on the [UPNPDevice](class_upnpdevice#class-upnpdevice). May be returned when the user disabled UPNP on their router. * **UPNP\_RESULT\_PORT\_MAPPING\_NOT\_FOUND** = **2** --- No port mapping was found for the given port, protocol combination on the given [UPNPDevice](class_upnpdevice#class-upnpdevice). * **UPNP\_RESULT\_INCONSISTENT\_PARAMETERS** = **3** --- Inconsistent parameters. * **UPNP\_RESULT\_NO\_SUCH\_ENTRY\_IN\_ARRAY** = **4** --- No such entry in array. May be returned if a given port, protocol combination is not found on an [UPNPDevice](class_upnpdevice#class-upnpdevice). * **UPNP\_RESULT\_ACTION\_FAILED** = **5** --- The action failed. * **UPNP\_RESULT\_SRC\_IP\_WILDCARD\_NOT\_PERMITTED** = **6** --- The [UPNPDevice](class_upnpdevice#class-upnpdevice) does not allow wildcard values for the source IP address. * **UPNP\_RESULT\_EXT\_PORT\_WILDCARD\_NOT\_PERMITTED** = **7** --- The [UPNPDevice](class_upnpdevice#class-upnpdevice) does not allow wildcard values for the external port. * **UPNP\_RESULT\_INT\_PORT\_WILDCARD\_NOT\_PERMITTED** = **8** --- The [UPNPDevice](class_upnpdevice#class-upnpdevice) does not allow wildcard values for the internal port. * **UPNP\_RESULT\_REMOTE\_HOST\_MUST\_BE\_WILDCARD** = **9** --- The remote host value must be a wildcard. * **UPNP\_RESULT\_EXT\_PORT\_MUST\_BE\_WILDCARD** = **10** --- The external port value must be a wildcard. * **UPNP\_RESULT\_NO\_PORT\_MAPS\_AVAILABLE** = **11** --- No port maps are available. May also be returned if port mapping functionality is not available. * **UPNP\_RESULT\_CONFLICT\_WITH\_OTHER\_MECHANISM** = **12** --- Conflict with other mechanism. May be returned instead of [UPNP\_RESULT\_CONFLICT\_WITH\_OTHER\_MAPPING](#class-upnp-constant-upnp-result-conflict-with-other-mapping) if a port mapping conflicts with an existing one. * **UPNP\_RESULT\_CONFLICT\_WITH\_OTHER\_MAPPING** = **13** --- Conflict with an existing port mapping. * **UPNP\_RESULT\_SAME\_PORT\_VALUES\_REQUIRED** = **14** --- External and internal port values must be the same. * **UPNP\_RESULT\_ONLY\_PERMANENT\_LEASE\_SUPPORTED** = **15** --- Only permanent leases are supported. Do not use the `duration` parameter when adding port mappings. * **UPNP\_RESULT\_INVALID\_GATEWAY** = **16** --- Invalid gateway. * **UPNP\_RESULT\_INVALID\_PORT** = **17** --- Invalid port. * **UPNP\_RESULT\_INVALID\_PROTOCOL** = **18** --- Invalid protocol. * **UPNP\_RESULT\_INVALID\_DURATION** = **19** --- Invalid duration. * **UPNP\_RESULT\_INVALID\_ARGS** = **20** --- Invalid arguments. * **UPNP\_RESULT\_INVALID\_RESPONSE** = **21** --- Invalid response. * **UPNP\_RESULT\_INVALID\_PARAM** = **22** --- Invalid parameter. * **UPNP\_RESULT\_HTTP\_ERROR** = **23** --- HTTP error. * **UPNP\_RESULT\_SOCKET\_ERROR** = **24** --- Socket error. * **UPNP\_RESULT\_MEM\_ALLOC\_ERROR** = **25** --- Error allocating memory. * **UPNP\_RESULT\_NO\_GATEWAY** = **26** --- No gateway available. You may need to call [discover](#class-upnp-method-discover) first, or discovery didn't detect any valid IGDs (InternetGatewayDevices). * **UPNP\_RESULT\_NO\_DEVICES** = **27** --- No devices available. You may need to call [discover](#class-upnp-method-discover) first, or discovery didn't detect any valid [UPNPDevice](class_upnpdevice#class-upnpdevice)s. * **UPNP\_RESULT\_UNKNOWN\_ERROR** = **28** --- Unknown error. Property Descriptions --------------------- ### [bool](class_bool#class-bool) discover\_ipv6 | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_discover\_ipv6(value) | | *Getter* | is\_discover\_ipv6() | If `true`, IPv6 is used for [UPNPDevice](class_upnpdevice#class-upnpdevice) discovery. ### [int](class_int#class-int) discover\_local\_port | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_discover\_local\_port(value) | | *Getter* | get\_discover\_local\_port() | If `0`, the local port to use for discovery is chosen automatically by the system. If `1`, discovery will be done from the source port 1900 (same as destination port). Otherwise, the value will be used as the port. ### [String](class_string#class-string) discover\_multicast\_if | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_discover\_multicast\_if(value) | | *Getter* | get\_discover\_multicast\_if() | Multicast interface to use for discovery. Uses the default multicast interface if empty. Method Descriptions ------------------- ### void add\_device ( [UPNPDevice](class_upnpdevice#class-upnpdevice) device ) Adds the given [UPNPDevice](class_upnpdevice#class-upnpdevice) to the list of discovered devices. ### [int](class_int#class-int) add\_port\_mapping ( [int](class_int#class-int) port, [int](class_int#class-int) port\_internal=0, [String](class_string#class-string) desc="", [String](class_string#class-string) proto="UDP", [int](class_int#class-int) duration=0 ) const Adds a mapping to forward the external `port` (between 1 and 65535, although recommended to use port 1024 or above) on the default gateway (see [get\_gateway](#class-upnp-method-get-gateway)) to the `internal_port` on the local machine for the given protocol `proto` (either `TCP` or `UDP`, with UDP being the default). If a port mapping for the given port and protocol combination already exists on that gateway device, this method tries to overwrite it. If that is not desired, you can retrieve the gateway manually with [get\_gateway](#class-upnp-method-get-gateway) and call [add\_port\_mapping](#class-upnp-method-add-port-mapping) on it, if any. Note that forwarding a well-known port (below 1024) with UPnP may fail depending on the device. Depending on the gateway device, if a mapping for that port already exists, it will either be updated or it will refuse this command due to that conflict, especially if the existing mapping for that port wasn't created via UPnP or points to a different network address (or device) than this one. If `internal_port` is `0` (the default), the same port number is used for both the external and the internal port (the `port` value). The description (`desc`) is shown in some routers management UIs and can be used to point out which application added the mapping. The mapping's lease `duration` can be limited by specifying a duration in seconds. The default of `0` means no duration, i.e. a permanent lease and notably some devices only support these permanent leases. Note that whether permanent or not, this is only a request and the gateway may still decide at any point to remove the mapping (which usually happens on a reboot of the gateway, when its external IP address changes, or on some models when it detects a port mapping has become inactive, i.e. had no traffic for multiple minutes). If not `0` (permanent), the allowed range according to spec is between `120` (2 minutes) and `86400` seconds (24 hours). See [UPNPResult](#enum-upnp-upnpresult) for possible return values. ### void clear\_devices ( ) Clears the list of discovered devices. ### [int](class_int#class-int) delete\_port\_mapping ( [int](class_int#class-int) port, [String](class_string#class-string) proto="UDP" ) const Deletes the port mapping for the given port and protocol combination on the default gateway (see [get\_gateway](#class-upnp-method-get-gateway)) if one exists. `port` must be a valid port between 1 and 65535, `proto` can be either `TCP` or `UDP`. May be refused for mappings pointing to addresses other than this one, for well-known ports (below 1024), or for mappings not added via UPnP. See [UPNPResult](#enum-upnp-upnpresult) for possible return values. ### [int](class_int#class-int) discover ( [int](class_int#class-int) timeout=2000, [int](class_int#class-int) ttl=2, [String](class_string#class-string) device\_filter="InternetGatewayDevice" ) Discovers local [UPNPDevice](class_upnpdevice#class-upnpdevice)s. Clears the list of previously discovered devices. Filters for IGD (InternetGatewayDevice) type devices by default, as those manage port forwarding. `timeout` is the time to wait for responses in milliseconds. `ttl` is the time-to-live; only touch this if you know what you're doing. See [UPNPResult](#enum-upnp-upnpresult) for possible return values. ### [UPNPDevice](class_upnpdevice#class-upnpdevice) get\_device ( [int](class_int#class-int) index ) const Returns the [UPNPDevice](class_upnpdevice#class-upnpdevice) at the given `index`. ### [int](class_int#class-int) get\_device\_count ( ) const Returns the number of discovered [UPNPDevice](class_upnpdevice#class-upnpdevice)s. ### [UPNPDevice](class_upnpdevice#class-upnpdevice) get\_gateway ( ) const Returns the default gateway. That is the first discovered [UPNPDevice](class_upnpdevice#class-upnpdevice) that is also a valid IGD (InternetGatewayDevice). ### [String](class_string#class-string) query\_external\_address ( ) const Returns the external [IP](class_ip#class-ip) address of the default gateway (see [get\_gateway](#class-upnp-method-get-gateway)) as string. Returns an empty string on error. ### void remove\_device ( [int](class_int#class-int) index ) Removes the device at `index` from the list of discovered devices. ### void set\_device ( [int](class_int#class-int) index, [UPNPDevice](class_upnpdevice#class-upnpdevice) device ) Sets the device at `index` from the list of discovered devices to `device`.
programming_docs
godot IP IP == **Inherits:** [Object](class_object#class-object) Internet protocol (IP) support functions such as DNS resolution. Description ----------- IP contains support functions for the Internet Protocol (IP). TCP/IP support is in different classes (see [StreamPeerTCP](class_streampeertcp#class-streampeertcp) and [TCP\_Server](class_tcp_server#class-tcp-server)). IP provides DNS hostname resolution support, both blocking and threaded. Methods ------- | | | | --- | --- | | void | [clear\_cache](#class-ip-method-clear-cache) **(** [String](class_string#class-string) hostname="" **)** | | void | [erase\_resolve\_item](#class-ip-method-erase-resolve-item) **(** [int](class_int#class-int) id **)** | | [Array](class_array#class-array) | [get\_local\_addresses](#class-ip-method-get-local-addresses) **(** **)** const | | [Array](class_array#class-array) | [get\_local\_interfaces](#class-ip-method-get-local-interfaces) **(** **)** const | | [String](class_string#class-string) | [get\_resolve\_item\_address](#class-ip-method-get-resolve-item-address) **(** [int](class_int#class-int) id **)** const | | [Array](class_array#class-array) | [get\_resolve\_item\_addresses](#class-ip-method-get-resolve-item-addresses) **(** [int](class_int#class-int) id **)** const | | [ResolverStatus](#enum-ip-resolverstatus) | [get\_resolve\_item\_status](#class-ip-method-get-resolve-item-status) **(** [int](class_int#class-int) id **)** const | | [String](class_string#class-string) | [resolve\_hostname](#class-ip-method-resolve-hostname) **(** [String](class_string#class-string) host, [Type](#enum-ip-type) ip\_type=3 **)** | | [Array](class_array#class-array) | [resolve\_hostname\_addresses](#class-ip-method-resolve-hostname-addresses) **(** [String](class_string#class-string) host, [Type](#enum-ip-type) ip\_type=3 **)** | | [int](class_int#class-int) | [resolve\_hostname\_queue\_item](#class-ip-method-resolve-hostname-queue-item) **(** [String](class_string#class-string) host, [Type](#enum-ip-type) ip\_type=3 **)** | Enumerations ------------ enum **ResolverStatus**: * **RESOLVER\_STATUS\_NONE** = **0** --- DNS hostname resolver status: No status. * **RESOLVER\_STATUS\_WAITING** = **1** --- DNS hostname resolver status: Waiting. * **RESOLVER\_STATUS\_DONE** = **2** --- DNS hostname resolver status: Done. * **RESOLVER\_STATUS\_ERROR** = **3** --- DNS hostname resolver status: Error. enum **Type**: * **TYPE\_NONE** = **0** --- Address type: None. * **TYPE\_IPV4** = **1** --- Address type: Internet protocol version 4 (IPv4). * **TYPE\_IPV6** = **2** --- Address type: Internet protocol version 6 (IPv6). * **TYPE\_ANY** = **3** --- Address type: Any. Constants --------- * **RESOLVER\_MAX\_QUERIES** = **256** --- Maximum number of concurrent DNS resolver queries allowed, [RESOLVER\_INVALID\_ID](#class-ip-constant-resolver-invalid-id) is returned if exceeded. * **RESOLVER\_INVALID\_ID** = **-1** --- Invalid ID constant. Returned if [RESOLVER\_MAX\_QUERIES](#class-ip-constant-resolver-max-queries) is exceeded. Method Descriptions ------------------- ### void clear\_cache ( [String](class_string#class-string) hostname="" ) Removes all of a `hostname`'s cached references. If no `hostname` is given, all cached IP addresses are removed. ### void erase\_resolve\_item ( [int](class_int#class-int) id ) Removes a given item `id` from the queue. This should be used to free a queue after it has completed to enable more queries to happen. ### [Array](class_array#class-array) get\_local\_addresses ( ) const Returns all the user's current IPv4 and IPv6 addresses as an array. ### [Array](class_array#class-array) get\_local\_interfaces ( ) const Returns all network adapters as an array. Each adapter is a dictionary of the form: ``` { "index": "1", # Interface index. "name": "eth0", # Interface name. "friendly": "Ethernet One", # A friendly name (might be empty). "addresses": ["192.168.1.101"], # An array of IP addresses associated to this interface. } ``` ### [String](class_string#class-string) get\_resolve\_item\_address ( [int](class_int#class-int) id ) const Returns a queued hostname's IP address, given its queue `id`. Returns an empty string on error or if resolution hasn't happened yet (see [get\_resolve\_item\_status](#class-ip-method-get-resolve-item-status)). ### [Array](class_array#class-array) get\_resolve\_item\_addresses ( [int](class_int#class-int) id ) const Return resolved addresses, or an empty array if an error happened or resolution didn't happen yet (see [get\_resolve\_item\_status](#class-ip-method-get-resolve-item-status)). ### [ResolverStatus](#enum-ip-resolverstatus) get\_resolve\_item\_status ( [int](class_int#class-int) id ) const Returns a queued hostname's status as a [ResolverStatus](#enum-ip-resolverstatus) constant, given its queue `id`. ### [String](class_string#class-string) resolve\_hostname ( [String](class_string#class-string) host, [Type](#enum-ip-type) ip\_type=3 ) Returns a given hostname's IPv4 or IPv6 address when resolved (blocking-type method). The address type returned depends on the [Type](#enum-ip-type) constant given as `ip_type`. ### [Array](class_array#class-array) resolve\_hostname\_addresses ( [String](class_string#class-string) host, [Type](#enum-ip-type) ip\_type=3 ) Resolves a given hostname in a blocking way. Addresses are returned as an [Array](class_array#class-array) of IPv4 or IPv6 depending on `ip_type`. ### [int](class_int#class-int) resolve\_hostname\_queue\_item ( [String](class_string#class-string) host, [Type](#enum-ip-type) ip\_type=3 ) Creates a queue item to resolve a hostname to an IPv4 or IPv6 address depending on the [Type](#enum-ip-type) constant given as `ip_type`. Returns the queue ID if successful, or [RESOLVER\_INVALID\_ID](#class-ip-constant-resolver-invalid-id) on error. godot MeshLibrary MeshLibrary =========== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Library of meshes. Description ----------- A library of meshes. Contains a list of [Mesh](class_mesh#class-mesh) resources, each with a name and ID. Each item can also include collision and navigation shapes. This resource is used in [GridMap](class_gridmap#class-gridmap). Tutorials --------- * [3D Kinematic Character Demo](https://godotengine.org/asset-library/asset/126) * [3D Platformer Demo](https://godotengine.org/asset-library/asset/125) Methods ------- | | | | --- | --- | | void | [clear](#class-meshlibrary-method-clear) **(** **)** | | void | [create\_item](#class-meshlibrary-method-create-item) **(** [int](class_int#class-int) id **)** | | [int](class_int#class-int) | [find\_item\_by\_name](#class-meshlibrary-method-find-item-by-name) **(** [String](class_string#class-string) name **)** const | | [PoolIntArray](class_poolintarray#class-poolintarray) | [get\_item\_list](#class-meshlibrary-method-get-item-list) **(** **)** const | | [Mesh](class_mesh#class-mesh) | [get\_item\_mesh](#class-meshlibrary-method-get-item-mesh) **(** [int](class_int#class-int) id **)** const | | [Transform](class_transform#class-transform) | [get\_item\_mesh\_transform](#class-meshlibrary-method-get-item-mesh-transform) **(** [int](class_int#class-int) id **)** const | | [String](class_string#class-string) | [get\_item\_name](#class-meshlibrary-method-get-item-name) **(** [int](class_int#class-int) id **)** const | | [NavigationMesh](class_navigationmesh#class-navigationmesh) | [get\_item\_navmesh](#class-meshlibrary-method-get-item-navmesh) **(** [int](class_int#class-int) id **)** const | | [Transform](class_transform#class-transform) | [get\_item\_navmesh\_transform](#class-meshlibrary-method-get-item-navmesh-transform) **(** [int](class_int#class-int) id **)** const | | [Texture](class_texture#class-texture) | [get\_item\_preview](#class-meshlibrary-method-get-item-preview) **(** [int](class_int#class-int) id **)** const | | [Array](class_array#class-array) | [get\_item\_shapes](#class-meshlibrary-method-get-item-shapes) **(** [int](class_int#class-int) id **)** const | | [int](class_int#class-int) | [get\_last\_unused\_item\_id](#class-meshlibrary-method-get-last-unused-item-id) **(** **)** const | | void | [remove\_item](#class-meshlibrary-method-remove-item) **(** [int](class_int#class-int) id **)** | | void | [set\_item\_mesh](#class-meshlibrary-method-set-item-mesh) **(** [int](class_int#class-int) id, [Mesh](class_mesh#class-mesh) mesh **)** | | void | [set\_item\_mesh\_transform](#class-meshlibrary-method-set-item-mesh-transform) **(** [int](class_int#class-int) id, [Transform](class_transform#class-transform) mesh\_transform **)** | | void | [set\_item\_name](#class-meshlibrary-method-set-item-name) **(** [int](class_int#class-int) id, [String](class_string#class-string) name **)** | | void | [set\_item\_navmesh](#class-meshlibrary-method-set-item-navmesh) **(** [int](class_int#class-int) id, [NavigationMesh](class_navigationmesh#class-navigationmesh) navmesh **)** | | void | [set\_item\_navmesh\_transform](#class-meshlibrary-method-set-item-navmesh-transform) **(** [int](class_int#class-int) id, [Transform](class_transform#class-transform) navmesh **)** | | void | [set\_item\_preview](#class-meshlibrary-method-set-item-preview) **(** [int](class_int#class-int) id, [Texture](class_texture#class-texture) texture **)** | | void | [set\_item\_shapes](#class-meshlibrary-method-set-item-shapes) **(** [int](class_int#class-int) id, [Array](class_array#class-array) shapes **)** | Method Descriptions ------------------- ### void clear ( ) Clears the library. ### void create\_item ( [int](class_int#class-int) id ) Creates a new item in the library with the given ID. You can get an unused ID from [get\_last\_unused\_item\_id](#class-meshlibrary-method-get-last-unused-item-id). ### [int](class_int#class-int) find\_item\_by\_name ( [String](class_string#class-string) name ) const Returns the first item with the given name. ### [PoolIntArray](class_poolintarray#class-poolintarray) get\_item\_list ( ) const Returns the list of item IDs in use. ### [Mesh](class_mesh#class-mesh) get\_item\_mesh ( [int](class_int#class-int) id ) const Returns the item's mesh. ### [Transform](class_transform#class-transform) get\_item\_mesh\_transform ( [int](class_int#class-int) id ) const Returns the transform applied to the item's mesh. ### [String](class_string#class-string) get\_item\_name ( [int](class_int#class-int) id ) const Returns the item's name. ### [NavigationMesh](class_navigationmesh#class-navigationmesh) get\_item\_navmesh ( [int](class_int#class-int) id ) const Returns the item's navigation mesh. ### [Transform](class_transform#class-transform) get\_item\_navmesh\_transform ( [int](class_int#class-int) id ) const Returns the transform applied to the item's navigation mesh. ### [Texture](class_texture#class-texture) get\_item\_preview ( [int](class_int#class-int) id ) const When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using [set\_item\_preview](#class-meshlibrary-method-set-item-preview). Returns an empty [Texture](class_texture#class-texture) if no preview was manually set in a running project. ### [Array](class_array#class-array) get\_item\_shapes ( [int](class_int#class-int) id ) const Returns an item's collision shapes. The array consists of each [Shape](class_shape#class-shape) followed by its [Transform](class_transform#class-transform). ### [int](class_int#class-int) get\_last\_unused\_item\_id ( ) const Gets an unused ID for a new item. ### void remove\_item ( [int](class_int#class-int) id ) Removes the item. ### void set\_item\_mesh ( [int](class_int#class-int) id, [Mesh](class_mesh#class-mesh) mesh ) Sets the item's mesh. ### void set\_item\_mesh\_transform ( [int](class_int#class-int) id, [Transform](class_transform#class-transform) mesh\_transform ) Sets the transform to apply to the item's mesh. ### void set\_item\_name ( [int](class_int#class-int) id, [String](class_string#class-string) name ) Sets the item's name. This name is shown in the editor. It can also be used to look up the item later using [find\_item\_by\_name](#class-meshlibrary-method-find-item-by-name). ### void set\_item\_navmesh ( [int](class_int#class-int) id, [NavigationMesh](class_navigationmesh#class-navigationmesh) navmesh ) Sets the item's navigation mesh. ### void set\_item\_navmesh\_transform ( [int](class_int#class-int) id, [Transform](class_transform#class-transform) navmesh ) Sets the transform to apply to the item's navigation mesh. ### void set\_item\_preview ( [int](class_int#class-int) id, [Texture](class_texture#class-texture) texture ) Sets a texture to use as the item's preview icon in the editor. ### void set\_item\_shapes ( [int](class_int#class-int) id, [Array](class_array#class-array) shapes ) Sets an item's collision shapes. The array should consist of [Shape](class_shape#class-shape) objects, each followed by a [Transform](class_transform#class-transform) that will be applied to it. For shapes that should not have a transform, use [Transform.IDENTITY](class_transform#class-transform-constant-identity). godot AudioStreamMicrophone AudioStreamMicrophone ===================== **Inherits:** [AudioStream](class_audiostream#class-audiostream) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Plays real-time audio input data. Description ----------- When used directly in an [AudioStreamPlayer](class_audiostreamplayer#class-audiostreamplayer) node, `AudioStreamMicrophone` plays back microphone input in real-time. This can be used in conjunction with [AudioEffectCapture](class_audioeffectcapture#class-audioeffectcapture) to process the data or save it. **Note:** [ProjectSettings.audio/enable\_audio\_input](class_projectsettings#class-projectsettings-property-audio-enable-audio-input) must be `true` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings. Tutorials --------- * [Audio Mic Record Demo](https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record) godot SurfaceTool SurfaceTool =========== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Helper tool to create geometry. Description ----------- The `SurfaceTool` is used to construct a [Mesh](class_mesh#class-mesh) by specifying vertex attributes individually. It can be used to construct a [Mesh](class_mesh#class-mesh) from a script. All properties except indices need to be added before calling [add\_vertex](#class-surfacetool-method-add-vertex). For example, to add vertex colors and UVs: ``` var st = SurfaceTool.new() st.begin(Mesh.PRIMITIVE_TRIANGLES) st.add_color(Color(1, 0, 0)) st.add_uv(Vector2(0, 0)) st.add_vertex(Vector3(0, 0, 0)) ``` The above `SurfaceTool` now contains one vertex of a triangle which has a UV coordinate and a specified [Color](class_color#class-color). If another vertex were added without calling [add\_uv](#class-surfacetool-method-add-uv) or [add\_color](#class-surfacetool-method-add-color), then the last values would be used. Vertex attributes must be passed **before** calling [add\_vertex](#class-surfacetool-method-add-vertex). Failure to do so will result in an error when committing the vertex information to a mesh. Additionally, the attributes used before the first vertex is added determine the format of the mesh. For example, if you only add UVs to the first vertex, you cannot add color to any of the subsequent vertices. See also [ArrayMesh](class_arraymesh#class-arraymesh), [ImmediateGeometry](class_immediategeometry#class-immediategeometry) and [MeshDataTool](class_meshdatatool#class-meshdatatool) for procedural geometry generation. **Note:** Godot uses clockwise [winding order](https://learnopengl.com/Advanced-OpenGL/Face-culling) for front faces of triangle primitive modes. Tutorials --------- * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) Methods ------- | | | | --- | --- | | void | [add\_bones](#class-surfacetool-method-add-bones) **(** [PoolIntArray](class_poolintarray#class-poolintarray) bones **)** | | void | [add\_color](#class-surfacetool-method-add-color) **(** [Color](class_color#class-color) color **)** | | void | [add\_index](#class-surfacetool-method-add-index) **(** [int](class_int#class-int) index **)** | | void | [add\_normal](#class-surfacetool-method-add-normal) **(** [Vector3](class_vector3#class-vector3) normal **)** | | void | [add\_smooth\_group](#class-surfacetool-method-add-smooth-group) **(** [bool](class_bool#class-bool) smooth **)** | | void | [add\_tangent](#class-surfacetool-method-add-tangent) **(** [Plane](class_plane#class-plane) tangent **)** | | void | [add\_triangle\_fan](#class-surfacetool-method-add-triangle-fan) **(** [PoolVector3Array](class_poolvector3array#class-poolvector3array) vertices, [PoolVector2Array](class_poolvector2array#class-poolvector2array) uvs=PoolVector2Array( ), [PoolColorArray](class_poolcolorarray#class-poolcolorarray) colors=PoolColorArray( ), [PoolVector2Array](class_poolvector2array#class-poolvector2array) uv2s=PoolVector2Array( ), [PoolVector3Array](class_poolvector3array#class-poolvector3array) normals=PoolVector3Array( ), [Array](class_array#class-array) tangents=[ ] **)** | | void | [add\_uv](#class-surfacetool-method-add-uv) **(** [Vector2](class_vector2#class-vector2) uv **)** | | void | [add\_uv2](#class-surfacetool-method-add-uv2) **(** [Vector2](class_vector2#class-vector2) uv2 **)** | | void | [add\_vertex](#class-surfacetool-method-add-vertex) **(** [Vector3](class_vector3#class-vector3) vertex **)** | | void | [add\_weights](#class-surfacetool-method-add-weights) **(** [PoolRealArray](class_poolrealarray#class-poolrealarray) weights **)** | | void | [append\_from](#class-surfacetool-method-append-from) **(** [Mesh](class_mesh#class-mesh) existing, [int](class_int#class-int) surface, [Transform](class_transform#class-transform) transform **)** | | void | [begin](#class-surfacetool-method-begin) **(** [PrimitiveType](class_mesh#enum-mesh-primitivetype) primitive **)** | | void | [clear](#class-surfacetool-method-clear) **(** **)** | | [ArrayMesh](class_arraymesh#class-arraymesh) | [commit](#class-surfacetool-method-commit) **(** [ArrayMesh](class_arraymesh#class-arraymesh) existing=null, [int](class_int#class-int) flags=2194432 **)** | | [Array](class_array#class-array) | [commit\_to\_arrays](#class-surfacetool-method-commit-to-arrays) **(** **)** | | void | [create\_from](#class-surfacetool-method-create-from) **(** [Mesh](class_mesh#class-mesh) existing, [int](class_int#class-int) surface **)** | | void | [create\_from\_blend\_shape](#class-surfacetool-method-create-from-blend-shape) **(** [Mesh](class_mesh#class-mesh) existing, [int](class_int#class-int) surface, [String](class_string#class-string) blend\_shape **)** | | void | [deindex](#class-surfacetool-method-deindex) **(** **)** | | void | [generate\_normals](#class-surfacetool-method-generate-normals) **(** [bool](class_bool#class-bool) flip=false **)** | | void | [generate\_tangents](#class-surfacetool-method-generate-tangents) **(** **)** | | void | [index](#class-surfacetool-method-index) **(** **)** | | void | [set\_material](#class-surfacetool-method-set-material) **(** [Material](class_material#class-material) material **)** | Method Descriptions ------------------- ### void add\_bones ( [PoolIntArray](class_poolintarray#class-poolintarray) bones ) Specifies an array of bones to use for the *next* vertex. `bones` must contain 4 integers. ### void add\_color ( [Color](class_color#class-color) color ) Specifies a [Color](class_color#class-color) to use for the *next* vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. **Note:** The material must have [SpatialMaterial.vertex\_color\_use\_as\_albedo](class_spatialmaterial#class-spatialmaterial-property-vertex-color-use-as-albedo) enabled for the vertex color to be visible. ### void add\_index ( [int](class_int#class-int) index ) Adds an index to index array if you are using indexed vertices. Does not need to be called before adding vertices. ### void add\_normal ( [Vector3](class_vector3#class-vector3) normal ) Specifies a normal to use for the *next* vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. ### void add\_smooth\_group ( [bool](class_bool#class-bool) smooth ) Specifies whether the current vertex (if using only vertex arrays) or current index (if also using index arrays) should use smooth normals for normal calculation. ### void add\_tangent ( [Plane](class_plane#class-plane) tangent ) Specifies a tangent to use for the *next* vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. ### void add\_triangle\_fan ( [PoolVector3Array](class_poolvector3array#class-poolvector3array) vertices, [PoolVector2Array](class_poolvector2array#class-poolvector2array) uvs=PoolVector2Array( ), [PoolColorArray](class_poolcolorarray#class-poolcolorarray) colors=PoolColorArray( ), [PoolVector2Array](class_poolvector2array#class-poolvector2array) uv2s=PoolVector2Array( ), [PoolVector3Array](class_poolvector3array#class-poolvector3array) normals=PoolVector3Array( ), [Array](class_array#class-array) tangents=[ ] ) Inserts a triangle fan made of array data into [Mesh](class_mesh#class-mesh) being constructed. Requires the primitive type be set to [Mesh.PRIMITIVE\_TRIANGLES](class_mesh#class-mesh-constant-primitive-triangles). ### void add\_uv ( [Vector2](class_vector2#class-vector2) uv ) Specifies a set of UV coordinates to use for the *next* vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. ### void add\_uv2 ( [Vector2](class_vector2#class-vector2) uv2 ) Specifies an optional second set of UV coordinates to use for the *next* vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. ### void add\_vertex ( [Vector3](class_vector3#class-vector3) vertex ) Specifies the position of current vertex. Should be called after specifying other vertex properties (e.g. Color, UV). ### void add\_weights ( [PoolRealArray](class_poolrealarray#class-poolrealarray) weights ) Specifies weight values to use for the *next* vertex. `weights` must contain 4 values. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. ### void append\_from ( [Mesh](class_mesh#class-mesh) existing, [int](class_int#class-int) surface, [Transform](class_transform#class-transform) transform ) Append vertices from a given [Mesh](class_mesh#class-mesh) surface onto the current vertex array with specified [Transform](class_transform#class-transform). **Note:** Using [append\_from](#class-surfacetool-method-append-from) on a [Thread](class_thread#class-thread) is much slower as the GPU must communicate data back to the CPU, while also causing the main thread to stall (as OpenGL is not thread-safe). Consider requesting a copy of the mesh, converting it to an [ArrayMesh](class_arraymesh#class-arraymesh) and adding vertices manually instead. ### void begin ( [PrimitiveType](class_mesh#enum-mesh-primitivetype) primitive ) Called before adding any vertices. Takes the primitive type as an argument (e.g. [Mesh.PRIMITIVE\_TRIANGLES](class_mesh#class-mesh-constant-primitive-triangles)). ### void clear ( ) Clear all information passed into the surface tool so far. ### [ArrayMesh](class_arraymesh#class-arraymesh) commit ( [ArrayMesh](class_arraymesh#class-arraymesh) existing=null, [int](class_int#class-int) flags=2194432 ) Returns a constructed [ArrayMesh](class_arraymesh#class-arraymesh) from current information passed in. If an existing [ArrayMesh](class_arraymesh#class-arraymesh) is passed in as an argument, will add an extra surface to the existing [ArrayMesh](class_arraymesh#class-arraymesh). Default flag is [Mesh.ARRAY\_COMPRESS\_DEFAULT](class_mesh#class-mesh-constant-array-compress-default) if compression is enabled. If compression is disabled the default flag is [Mesh.ARRAY\_FLAG\_USE\_OCTAHEDRAL\_COMPRESSION](class_mesh#class-mesh-constant-array-flag-use-octahedral-compression). See `ARRAY_COMPRESS_*` constants in [ArrayFormat](class_mesh#enum-mesh-arrayformat) for other flags. ### [Array](class_array#class-array) commit\_to\_arrays ( ) Commits the data to the same format used by [ArrayMesh.add\_surface\_from\_arrays](class_arraymesh#class-arraymesh-method-add-surface-from-arrays). This way you can further process the mesh data using the [ArrayMesh](class_arraymesh#class-arraymesh) API. ### void create\_from ( [Mesh](class_mesh#class-mesh) existing, [int](class_int#class-int) surface ) Creates a vertex array from an existing [Mesh](class_mesh#class-mesh). ### void create\_from\_blend\_shape ( [Mesh](class_mesh#class-mesh) existing, [int](class_int#class-int) surface, [String](class_string#class-string) blend\_shape ) Creates a vertex array from the specified blend shape of an existing [Mesh](class_mesh#class-mesh). This can be used to extract a specific pose from a blend shape. ### void deindex ( ) Removes the index array by expanding the vertex array. ### void generate\_normals ( [bool](class_bool#class-bool) flip=false ) Generates normals from vertices so you do not have to do it manually. If `flip` is `true`, the resulting normals will be inverted. [generate\_normals](#class-surfacetool-method-generate-normals) should be called *after* generating geometry and *before* committing the mesh using [commit](#class-surfacetool-method-commit) or [commit\_to\_arrays](#class-surfacetool-method-commit-to-arrays). For correct display of normal-mapped surfaces, you will also have to generate tangents using [generate\_tangents](#class-surfacetool-method-generate-tangents). **Note:** [generate\_normals](#class-surfacetool-method-generate-normals) only works if the primitive type to be set to [Mesh.PRIMITIVE\_TRIANGLES](class_mesh#class-mesh-constant-primitive-triangles). ### void generate\_tangents ( ) Generates a tangent vector for each vertex. Requires that each vertex have UVs and normals set already (see [generate\_normals](#class-surfacetool-method-generate-normals)). ### void index ( ) Shrinks the vertex array by creating an index array. This can improve performance by avoiding vertex reuse. ### void set\_material ( [Material](class_material#class-material) material ) Sets [Material](class_material#class-material) to be used by the [Mesh](class_mesh#class-mesh) you are constructing.
programming_docs
godot ProgressBar ProgressBar =========== **Inherits:** [Range](class_range#class-range) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) General-purpose progress bar. Description ----------- General-purpose progress bar. Shows fill percentage from right to left. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [percent\_visible](#class-progressbar-property-percent-visible) | `true` | | [int](class_int#class-int) | size\_flags\_vertical | `0` (overrides [Control](class_control#class-control-property-size-flags-vertical)) | | [float](class_float#class-float) | step | `0.01` (overrides [Range](class_range#class-range-property-step)) | Theme Properties ---------------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [font\_color](#class-progressbar-theme-color-font-color) | `Color( 0.94, 0.94, 0.94, 1 )` | | [Color](class_color#class-color) | [font\_color\_shadow](#class-progressbar-theme-color-font-color-shadow) | `Color( 0, 0, 0, 1 )` | | [Font](class_font#class-font) | [font](#class-progressbar-theme-font-font) | | | [StyleBox](class_stylebox#class-stylebox) | [bg](#class-progressbar-theme-style-bg) | | | [StyleBox](class_stylebox#class-stylebox) | [fg](#class-progressbar-theme-style-fg) | | Property Descriptions --------------------- ### [bool](class_bool#class-bool) percent\_visible | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_percent\_visible(value) | | *Getter* | is\_percent\_visible() | If `true`, the fill percentage is displayed on the bar. Theme Property Descriptions --------------------------- ### [Color](class_color#class-color) font\_color | | | | --- | --- | | *Default* | `Color( 0.94, 0.94, 0.94, 1 )` | The color of the text. ### [Color](class_color#class-color) font\_color\_shadow | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 1 )` | The color of the text's shadow. ### [Font](class_font#class-font) font Font used to draw the fill percentage if [percent\_visible](#class-progressbar-property-percent-visible) is `true`. ### [StyleBox](class_stylebox#class-stylebox) bg The style of the background. ### [StyleBox](class_stylebox#class-stylebox) fg The style of the progress (i.e. the part that fills the bar). godot GrooveJoint2D GrooveJoint2D ============= **Inherits:** [Joint2D](class_joint2d#class-joint2d) **<** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Groove constraint for 2D physics. Description ----------- Groove constraint for 2D physics. This is useful for making a body "slide" through a segment placed in another. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [initial\_offset](#class-groovejoint2d-property-initial-offset) | `25.0` | | [float](class_float#class-float) | [length](#class-groovejoint2d-property-length) | `50.0` | Property Descriptions --------------------- ### [float](class_float#class-float) initial\_offset | | | | --- | --- | | *Default* | `25.0` | | *Setter* | set\_initial\_offset(value) | | *Getter* | get\_initial\_offset() | The body B's initial anchor position defined by the joint's origin and a local offset [initial\_offset](#class-groovejoint2d-property-initial-offset) along the joint's Y axis (along the groove). ### [float](class_float#class-float) length | | | | --- | --- | | *Default* | `50.0` | | *Setter* | set\_length(value) | | *Getter* | get\_length() | The groove's length. The groove is from the joint's origin towards [length](#class-groovejoint2d-property-length) along the joint's local Y axis. godot SkinReference SkinReference ============= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Methods ------- | | | | --- | --- | | [RID](class_rid#class-rid) | [get\_skeleton](#class-skinreference-method-get-skeleton) **(** **)** const | | [Skin](class_skin#class-skin) | [get\_skin](#class-skinreference-method-get-skin) **(** **)** const | Method Descriptions ------------------- ### [RID](class_rid#class-rid) get\_skeleton ( ) const ### [Skin](class_skin#class-skin) get\_skin ( ) const godot GLTFSpecGloss GLTFSpecGloss ============= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Description ----------- **Note:** This class is only compiled in editor builds. Run-time glTF loading and saving is *not* available in exported projects. References to `GLTFSpecGloss` within a script will cause an error in an exported project. Properties ---------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [diffuse\_factor](#class-gltfspecgloss-property-diffuse-factor) | `Color( 1, 1, 1, 1 )` | | [Image](class_image#class-image) | [diffuse\_img](#class-gltfspecgloss-property-diffuse-img) | | | [float](class_float#class-float) | [gloss\_factor](#class-gltfspecgloss-property-gloss-factor) | `1.0` | | [Image](class_image#class-image) | [spec\_gloss\_img](#class-gltfspecgloss-property-spec-gloss-img) | | | [Color](class_color#class-color) | [specular\_factor](#class-gltfspecgloss-property-specular-factor) | `Color( 1, 1, 1, 1 )` | Property Descriptions --------------------- ### [Color](class_color#class-color) diffuse\_factor | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_diffuse\_factor(value) | | *Getter* | get\_diffuse\_factor() | ### [Image](class_image#class-image) diffuse\_img | | | | --- | --- | | *Setter* | set\_diffuse\_img(value) | | *Getter* | get\_diffuse\_img() | ### [float](class_float#class-float) gloss\_factor | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_gloss\_factor(value) | | *Getter* | get\_gloss\_factor() | ### [Image](class_image#class-image) spec\_gloss\_img | | | | --- | --- | | *Setter* | set\_spec\_gloss\_img(value) | | *Getter* | get\_spec\_gloss\_img() | ### [Color](class_color#class-color) specular\_factor | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_specular\_factor(value) | | *Getter* | get\_specular\_factor() | godot Engine Engine ====== **Inherits:** [Object](class_object#class-object) Access to engine properties. Description ----------- The `Engine` singleton allows you to query and modify the project's run-time parameters, such as frames per second, time scale, and others. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [editor\_hint](#class-engine-property-editor-hint) | `true` | | [int](class_int#class-int) | [iterations\_per\_second](#class-engine-property-iterations-per-second) | `60` | | [float](class_float#class-float) | [physics\_jitter\_fix](#class-engine-property-physics-jitter-fix) | `0.5` | | [bool](class_bool#class-bool) | [print\_error\_messages](#class-engine-property-print-error-messages) | `true` | | [int](class_int#class-int) | [target\_fps](#class-engine-property-target-fps) | `0` | | [float](class_float#class-float) | [time\_scale](#class-engine-property-time-scale) | `1.0` | Methods ------- | | | | --- | --- | | [Dictionary](class_dictionary#class-dictionary) | [get\_author\_info](#class-engine-method-get-author-info) **(** **)** const | | [Array](class_array#class-array) | [get\_copyright\_info](#class-engine-method-get-copyright-info) **(** **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_donor\_info](#class-engine-method-get-donor-info) **(** **)** const | | [int](class_int#class-int) | [get\_frames\_drawn](#class-engine-method-get-frames-drawn) **(** **)** | | [float](class_float#class-float) | [get\_frames\_per\_second](#class-engine-method-get-frames-per-second) **(** **)** const | | [int](class_int#class-int) | [get\_idle\_frames](#class-engine-method-get-idle-frames) **(** **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_license\_info](#class-engine-method-get-license-info) **(** **)** const | | [String](class_string#class-string) | [get\_license\_text](#class-engine-method-get-license-text) **(** **)** const | | [MainLoop](class_mainloop#class-mainloop) | [get\_main\_loop](#class-engine-method-get-main-loop) **(** **)** const | | [int](class_int#class-int) | [get\_physics\_frames](#class-engine-method-get-physics-frames) **(** **)** const | | [float](class_float#class-float) | [get\_physics\_interpolation\_fraction](#class-engine-method-get-physics-interpolation-fraction) **(** **)** const | | [Object](class_object#class-object) | [get\_singleton](#class-engine-method-get-singleton) **(** [String](class_string#class-string) name **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_version\_info](#class-engine-method-get-version-info) **(** **)** const | | [bool](class_bool#class-bool) | [has\_singleton](#class-engine-method-has-singleton) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [is\_in\_physics\_frame](#class-engine-method-is-in-physics-frame) **(** **)** const | Property Descriptions --------------------- ### [bool](class_bool#class-bool) editor\_hint | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_editor\_hint(value) | | *Getter* | is\_editor\_hint() | If `true`, the script is currently running inside the editor. This is useful for `tool` scripts to conditionally draw editor helpers, or prevent accidentally running "game" code that would affect the scene state while in the editor: ``` if Engine.editor_hint: draw_gizmos() else: simulate_physics() ``` See [Running code in the editor](https://docs.godotengine.org/en/3.5/tutorials/plugins/running_code_in_the_editor.html) in the documentation for more information. **Note:** To detect whether the script is run from an editor *build* (e.g. when pressing `F5`), use [OS.has\_feature](class_os#class-os-method-has-feature) with the `"editor"` argument instead. `OS.has_feature("editor")` will evaluate to `true` both when the code is running in the editor and when running the project from the editor, but it will evaluate to `false` when the code is run from an exported project. ### [int](class_int#class-int) iterations\_per\_second | | | | --- | --- | | *Default* | `60` | | *Setter* | set\_iterations\_per\_second(value) | | *Getter* | get\_iterations\_per\_second() | The number of fixed iterations per second. This controls how often physics simulation and [Node.\_physics\_process](class_node#class-node-method-physics-process) methods are run. This value should generally always be set to `60` or above, as Godot doesn't interpolate the physics step. As a result, values lower than `60` will look stuttery. This value can be increased to make input more reactive or work around collision tunneling issues, but keep in mind doing so will increase CPU usage. See also [target\_fps](#class-engine-property-target-fps) and [ProjectSettings.physics/common/physics\_fps](class_projectsettings#class-projectsettings-property-physics-common-physics-fps). **Note:** Only 8 physics ticks may be simulated per rendered frame at most. If more than 8 physics ticks have to be simulated per rendered frame to keep up with rendering, the game will appear to slow down (even if `delta` is used consistently in physics calculations). Therefore, it is recommended not to increase [iterations\_per\_second](#class-engine-property-iterations-per-second) above 240. Otherwise, the game will slow down when the rendering framerate goes below 30 FPS. ### [float](class_float#class-float) physics\_jitter\_fix | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_physics\_jitter\_fix(value) | | *Getter* | get\_physics\_jitter\_fix() | Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of the in-game clock and real clock but smooth out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. **Note:** For best results, when using a custom physics interpolation solution, the physics jitter fix should be disabled by setting [physics\_jitter\_fix](#class-engine-property-physics-jitter-fix) to `0`. ### [bool](class_bool#class-bool) print\_error\_messages | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_print\_error\_messages(value) | | *Getter* | is\_printing\_error\_messages() | If `false`, stops printing error and warning messages to the console and editor Output log. This can be used to hide error and warning messages during unit test suite runs. This property is equivalent to the [ProjectSettings.application/run/disable\_stderr](class_projectsettings#class-projectsettings-property-application-run-disable-stderr) project setting. **Warning:** If you set this to `false` anywhere in the project, important error messages may be hidden even if they are emitted from other scripts. If this is set to `false` in a `tool` script, this will also impact the editor itself. Do *not* report bugs before ensuring error messages are enabled (as they are by default). **Note:** This property does not impact the editor's Errors tab when running a project from the editor. ### [int](class_int#class-int) target\_fps | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_target\_fps(value) | | *Getter* | get\_target\_fps() | The desired frames per second. If the hardware cannot keep up, this setting may not be respected. A value of 0 means no limit. ### [float](class_float#class-float) time\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_time\_scale(value) | | *Getter* | get\_time\_scale() | Controls how fast or slow the in-game clock ticks versus the real life one. It defaults to 1.0. A value of 2.0 means the game moves twice as fast as real life, whilst a value of 0.5 means the game moves at half the regular speed. Method Descriptions ------------------- ### [Dictionary](class_dictionary#class-dictionary) get\_author\_info ( ) const Returns engine author information in a Dictionary. `lead_developers` - Array of Strings, lead developer names `founders` - Array of Strings, founder names `project_managers` - Array of Strings, project manager names `developers` - Array of Strings, developer names ### [Array](class_array#class-array) get\_copyright\_info ( ) const Returns an Array of copyright information Dictionaries. `name` - String, component name `parts` - Array of Dictionaries {`files`, `copyright`, `license`} describing subsections of the component ### [Dictionary](class_dictionary#class-dictionary) get\_donor\_info ( ) const Returns a Dictionary of Arrays of donor names. {`platinum_sponsors`, `gold_sponsors`, `silver_sponsors`, `bronze_sponsors`, `mini_sponsors`, `gold_donors`, `silver_donors`, `bronze_donors`} ### [int](class_int#class-int) get\_frames\_drawn ( ) Returns the total number of frames drawn. On headless platforms, or if the render loop is disabled with `--disable-render-loop` via command line, [get\_frames\_drawn](#class-engine-method-get-frames-drawn) always returns `0`. See [get\_idle\_frames](#class-engine-method-get-idle-frames). ### [float](class_float#class-float) get\_frames\_per\_second ( ) const Returns the frames per second of the running game. ### [int](class_int#class-int) get\_idle\_frames ( ) const Returns the total number of frames passed since engine initialization which is advanced on each **idle frame**, regardless of whether the render loop is enabled. See also [get\_frames\_drawn](#class-engine-method-get-frames-drawn) and [get\_physics\_frames](#class-engine-method-get-physics-frames). [get\_idle\_frames](#class-engine-method-get-idle-frames) can be used to run expensive logic less often without relying on a [Timer](class_timer#class-timer): ``` func _process(_delta): if Engine.get_idle_frames() % 2 == 0: pass # Run expensive logic only once every 2 idle (render) frames here. ``` ### [Dictionary](class_dictionary#class-dictionary) get\_license\_info ( ) const Returns Dictionary of licenses used by Godot and included third party components. ### [String](class_string#class-string) get\_license\_text ( ) const Returns Godot license text. ### [MainLoop](class_mainloop#class-mainloop) get\_main\_loop ( ) const Returns the main loop object (see [MainLoop](class_mainloop#class-mainloop) and [SceneTree](class_scenetree#class-scenetree)). ### [int](class_int#class-int) get\_physics\_frames ( ) const Returns the total number of frames passed since engine initialization which is advanced on each **physics frame**. See also [get\_idle\_frames](#class-engine-method-get-idle-frames). [get\_physics\_frames](#class-engine-method-get-physics-frames) can be used to run expensive logic less often without relying on a [Timer](class_timer#class-timer): ``` func _physics_process(_delta): if Engine.get_physics_frames() % 2 == 0: pass # Run expensive logic only once every 2 physics frames here. ``` ### [float](class_float#class-float) get\_physics\_interpolation\_fraction ( ) const Returns the fraction through the current physics tick we are at the time of rendering the frame. This can be used to implement fixed timestep interpolation. ### [Object](class_object#class-object) get\_singleton ( [String](class_string#class-string) name ) const Returns a global singleton with given `name`. Often used for plugins, e.g. `GodotPayment` on Android. ### [Dictionary](class_dictionary#class-dictionary) get\_version\_info ( ) const Returns the current engine version information in a Dictionary. `major` - Holds the major version number as an int `minor` - Holds the minor version number as an int `patch` - Holds the patch version number as an int `hex` - Holds the full version number encoded as a hexadecimal int with one byte (2 places) per number (see example below) `status` - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String `build` - Holds the build name (e.g. "custom\_build") as a String `hash` - Holds the full Git commit hash as a String `year` - Holds the year the version was released in as an int `string` - `major` + `minor` + `patch` + `status` + `build` in a single String The `hex` value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be `0x03010C`. **Note:** It's still an int internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for easy version comparisons from code: ``` if Engine.get_version_info().hex >= 0x030200: # Do things specific to version 3.2 or later else: # Do things specific to versions before 3.2 ``` ### [bool](class_bool#class-bool) has\_singleton ( [String](class_string#class-string) name ) const Returns `true` if a singleton with given `name` exists in global scope. ### [bool](class_bool#class-bool) is\_in\_physics\_frame ( ) const Returns `true` if the game is inside the fixed process and physics phase of the game loop. godot Skin Skin ==== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Methods ------- | | | | --- | --- | | void | [add\_bind](#class-skin-method-add-bind) **(** [int](class_int#class-int) bone, [Transform](class_transform#class-transform) pose **)** | | void | [clear\_binds](#class-skin-method-clear-binds) **(** **)** | | [int](class_int#class-int) | [get\_bind\_bone](#class-skin-method-get-bind-bone) **(** [int](class_int#class-int) bind\_index **)** const | | [int](class_int#class-int) | [get\_bind\_count](#class-skin-method-get-bind-count) **(** **)** const | | [String](class_string#class-string) | [get\_bind\_name](#class-skin-method-get-bind-name) **(** [int](class_int#class-int) bind\_index **)** const | | [Transform](class_transform#class-transform) | [get\_bind\_pose](#class-skin-method-get-bind-pose) **(** [int](class_int#class-int) bind\_index **)** const | | void | [set\_bind\_bone](#class-skin-method-set-bind-bone) **(** [int](class_int#class-int) bind\_index, [int](class_int#class-int) bone **)** | | void | [set\_bind\_count](#class-skin-method-set-bind-count) **(** [int](class_int#class-int) bind\_count **)** | | void | [set\_bind\_name](#class-skin-method-set-bind-name) **(** [int](class_int#class-int) bind\_index, [String](class_string#class-string) name **)** | | void | [set\_bind\_pose](#class-skin-method-set-bind-pose) **(** [int](class_int#class-int) bind\_index, [Transform](class_transform#class-transform) pose **)** | Method Descriptions ------------------- ### void add\_bind ( [int](class_int#class-int) bone, [Transform](class_transform#class-transform) pose ) ### void clear\_binds ( ) ### [int](class_int#class-int) get\_bind\_bone ( [int](class_int#class-int) bind\_index ) const ### [int](class_int#class-int) get\_bind\_count ( ) const ### [String](class_string#class-string) get\_bind\_name ( [int](class_int#class-int) bind\_index ) const ### [Transform](class_transform#class-transform) get\_bind\_pose ( [int](class_int#class-int) bind\_index ) const ### void set\_bind\_bone ( [int](class_int#class-int) bind\_index, [int](class_int#class-int) bone ) ### void set\_bind\_count ( [int](class_int#class-int) bind\_count ) ### void set\_bind\_name ( [int](class_int#class-int) bind\_index, [String](class_string#class-string) name ) ### void set\_bind\_pose ( [int](class_int#class-int) bind\_index, [Transform](class_transform#class-transform) pose )
programming_docs
godot TextureLayered TextureLayered ============== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [Texture3D](class_texture3d#class-texture3d), [TextureArray](class_texturearray#class-texturearray) Base class for 3D texture types. Description ----------- Base class for [Texture3D](class_texture3d#class-texture3d) and [TextureArray](class_texturearray#class-texturearray). Cannot be used directly, but contains all the functions necessary for accessing and using [Texture3D](class_texture3d#class-texture3d) and [TextureArray](class_texturearray#class-texturearray). Data is set on a per-layer basis. For [Texture3D](class_texture3d#class-texture3d)s, the layer specifies the depth or Z-index, they can be treated as a bunch of 2D slices. Similarly, for [TextureArray](class_texturearray#class-texturearray)s, the layer specifies the array layer. Properties ---------- | | | | | --- | --- | --- | | [Dictionary](class_dictionary#class-dictionary) | [data](#class-texturelayered-property-data) | `{"depth": 0,"flags": 7,"format": 37,"height": 0,"layers": [  ],"width": 0}` | | [int](class_int#class-int) | [flags](#class-texturelayered-property-flags) | `7` | Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [get\_depth](#class-texturelayered-method-get-depth) **(** **)** const | | [Format](class_image#enum-image-format) | [get\_format](#class-texturelayered-method-get-format) **(** **)** const | | [int](class_int#class-int) | [get\_height](#class-texturelayered-method-get-height) **(** **)** const | | [Image](class_image#class-image) | [get\_layer\_data](#class-texturelayered-method-get-layer-data) **(** [int](class_int#class-int) layer **)** const | | [int](class_int#class-int) | [get\_width](#class-texturelayered-method-get-width) **(** **)** const | | void | [set\_data\_partial](#class-texturelayered-method-set-data-partial) **(** [Image](class_image#class-image) image, [int](class_int#class-int) x\_offset, [int](class_int#class-int) y\_offset, [int](class_int#class-int) layer, [int](class_int#class-int) mipmap=0 **)** | | void | [set\_layer\_data](#class-texturelayered-method-set-layer-data) **(** [Image](class_image#class-image) image, [int](class_int#class-int) layer **)** | Enumerations ------------ enum **Flags**: * **FLAGS\_DEFAULT\_TEXTURE\_ARRAY** = **7** --- Default flags for [TextureArray](class_texturearray#class-texturearray). [FLAG\_MIPMAPS](#class-texturelayered-constant-flag-mipmaps), [FLAG\_REPEAT](#class-texturelayered-constant-flag-repeat) and [FLAG\_FILTER](#class-texturelayered-constant-flag-filter) are enabled. * **FLAGS\_DEFAULT\_TEXTURE\_3D** = **4** --- Default flags for [Texture3D](class_texture3d#class-texture3d). [FLAG\_FILTER](#class-texturelayered-constant-flag-filter) is enabled. * **FLAG\_MIPMAPS** = **1** --- Texture will generate mipmaps on creation. * **FLAG\_REPEAT** = **2** --- Texture will repeat when UV used is outside the 0-1 range. * **FLAG\_FILTER** = **4** --- Use filtering when reading from texture. Filtering smooths out pixels. Turning filtering off is slightly faster and more appropriate when you need access to individual pixels. * **FLAG\_ANISOTROPIC\_FILTER** = **8** --- Uses anisotropic mipmap filtering. Generates smaller versions of the same texture with different aspect ratios. This results in better-looking textures when viewed from oblique angles. Property Descriptions --------------------- ### [Dictionary](class_dictionary#class-dictionary) data | | | | --- | --- | | *Default* | `{"depth": 0,"flags": 7,"format": 37,"height": 0,"layers": [  ],"width": 0}` | Returns a dictionary with all the data used by this texture. ### [int](class_int#class-int) flags | | | | --- | --- | | *Default* | `7` | | *Setter* | set\_flags(value) | | *Getter* | get\_flags() | Specifies which [Flags](#enum-texturelayered-flags) apply to this texture. Method Descriptions ------------------- ### [int](class_int#class-int) get\_depth ( ) const Returns the depth of the texture. Depth is the 3rd dimension (typically Z-axis). ### [Format](class_image#enum-image-format) get\_format ( ) const Returns the current format being used by this texture. See [Format](class_image#enum-image-format) for details. ### [int](class_int#class-int) get\_height ( ) const Returns the height of the texture. Height is typically represented by the Y-axis. ### [Image](class_image#class-image) get\_layer\_data ( [int](class_int#class-int) layer ) const Returns an [Image](class_image#class-image) resource with the data from specified `layer`. ### [int](class_int#class-int) get\_width ( ) const Returns the width of the texture. Width is typically represented by the X-axis. ### void set\_data\_partial ( [Image](class_image#class-image) image, [int](class_int#class-int) x\_offset, [int](class_int#class-int) y\_offset, [int](class_int#class-int) layer, [int](class_int#class-int) mipmap=0 ) Partially sets the data for a specified `layer` by overwriting using the data of the specified `image`. `x_offset` and `y_offset` determine where the [Image](class_image#class-image) is "stamped" over the texture. The `image` must fit within the texture. ### void set\_layer\_data ( [Image](class_image#class-image) image, [int](class_int#class-int) layer ) Sets the data for the specified layer. Data takes the form of a 2-dimensional [Image](class_image#class-image) resource. godot PoolIntArray PoolIntArray ============ A pooled array of integers ([int](class_int#class-int)). Description ----------- An array specifically designed to hold integer values ([int](class_int#class-int)). Optimized for memory usage, does not fragment the memory. **Note:** This type is passed by value and not by reference. This means that when *mutating* a class property of type `PoolIntArray` or mutating a `PoolIntArray` within an [Array](class_array#class-array) or [Dictionary](class_dictionary#class-dictionary), changes will be lost: ``` var array = [PoolIntArray()] array[0].push_back(1234) print(array) # [[]] (empty PoolIntArray within an Array) ``` Instead, the entire `PoolIntArray` property must be *reassigned* with `=` for it to be changed: ``` var array = [PoolIntArray()] var pool_array = array[0] pool_array.push_back(1234) array[0] = pool_array print(array) # [[1234]] (PoolIntArray with 1 element inside an Array) ``` **Note:** This type is limited to signed 32-bit integers, which means it can only take values in the interval `[-2^31, 2^31 - 1]`, i.e. `[-2147483648, 2147483647]`. Exceeding those bounds will wrap around. In comparison, [int](class_int#class-int) uses signed 64-bit integers which can hold much larger values. Methods ------- | | | | --- | --- | | [PoolIntArray](#class-poolintarray) | [PoolIntArray](#class-poolintarray-method-poolintarray) **(** [Array](class_array#class-array) from **)** | | void | [append](#class-poolintarray-method-append) **(** [int](class_int#class-int) integer **)** | | void | [append\_array](#class-poolintarray-method-append-array) **(** [PoolIntArray](#class-poolintarray) array **)** | | [int](class_int#class-int) | [count](#class-poolintarray-method-count) **(** [int](class_int#class-int) value **)** | | [bool](class_bool#class-bool) | [empty](#class-poolintarray-method-empty) **(** **)** | | void | [fill](#class-poolintarray-method-fill) **(** [int](class_int#class-int) integer **)** | | [int](class_int#class-int) | [find](#class-poolintarray-method-find) **(** [int](class_int#class-int) value, [int](class_int#class-int) from=0 **)** | | [bool](class_bool#class-bool) | [has](#class-poolintarray-method-has) **(** [int](class_int#class-int) value **)** | | [int](class_int#class-int) | [insert](#class-poolintarray-method-insert) **(** [int](class_int#class-int) idx, [int](class_int#class-int) integer **)** | | void | [invert](#class-poolintarray-method-invert) **(** **)** | | void | [push\_back](#class-poolintarray-method-push-back) **(** [int](class_int#class-int) integer **)** | | void | [remove](#class-poolintarray-method-remove) **(** [int](class_int#class-int) idx **)** | | void | [resize](#class-poolintarray-method-resize) **(** [int](class_int#class-int) idx **)** | | [int](class_int#class-int) | [rfind](#class-poolintarray-method-rfind) **(** [int](class_int#class-int) value, [int](class_int#class-int) from=-1 **)** | | void | [set](#class-poolintarray-method-set) **(** [int](class_int#class-int) idx, [int](class_int#class-int) integer **)** | | [int](class_int#class-int) | [size](#class-poolintarray-method-size) **(** **)** | | void | [sort](#class-poolintarray-method-sort) **(** **)** | Method Descriptions ------------------- ### [PoolIntArray](#class-poolintarray) PoolIntArray ( [Array](class_array#class-array) from ) Constructs a new `PoolIntArray`. Optionally, you can pass in a generic [Array](class_array#class-array) that will be converted. ### void append ( [int](class_int#class-int) integer ) Appends an element at the end of the array (alias of [push\_back](#class-poolintarray-method-push-back)). ### void append\_array ( [PoolIntArray](#class-poolintarray) array ) Appends a `PoolIntArray` at the end of this array. ### [int](class_int#class-int) count ( [int](class_int#class-int) value ) Returns the number of times an element is in the array. ### [bool](class_bool#class-bool) empty ( ) Returns `true` if the array is empty. ### void fill ( [int](class_int#class-int) integer ) Assigns the given value to all elements in the array. This can typically be used together with [resize](#class-poolintarray-method-resize) to create an array with a given size and initialized elements. ### [int](class_int#class-int) find ( [int](class_int#class-int) value, [int](class_int#class-int) from=0 ) Searches the array for a value and returns its index or `-1` if not found. Optionally, the initial search index can be passed. Returns `-1` if `from` is out of bounds. ### [bool](class_bool#class-bool) has ( [int](class_int#class-int) value ) Returns `true` if the array contains the given value. **Note:** This is equivalent to using the `in` operator. ### [int](class_int#class-int) insert ( [int](class_int#class-int) idx, [int](class_int#class-int) integer ) Inserts a new int at a given position in the array. The position must be valid, or at the end of the array (`idx == size()`). ### void invert ( ) Reverses the order of the elements in the array. ### void push\_back ( [int](class_int#class-int) integer ) Appends a value to the array. ### void remove ( [int](class_int#class-int) idx ) Removes an element from the array by index. ### void resize ( [int](class_int#class-int) idx ) Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. **Note:** Added elements are not automatically initialized to 0 and will contain garbage, i.e. indeterminate values. ### [int](class_int#class-int) rfind ( [int](class_int#class-int) value, [int](class_int#class-int) from=-1 ) Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. ### void set ( [int](class_int#class-int) idx, [int](class_int#class-int) integer ) Changes the int at the given index. ### [int](class_int#class-int) size ( ) Returns the number of elements in the array. ### void sort ( ) Sorts the elements of the array in ascending order. godot Bone2D Bone2D ====== **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Joint used with [Skeleton2D](class_skeleton2d#class-skeleton2d) to control and animate other nodes. Description ----------- Use a hierarchy of `Bone2D` bound to a [Skeleton2D](class_skeleton2d#class-skeleton2d) to control, and animate other [Node2D](class_node2d#class-node2d) nodes. You can use `Bone2D` and `Skeleton2D` nodes to animate 2D meshes created with the Polygon 2D UV editor. Each bone has a [rest](#class-bone2d-property-rest) transform that you can reset to with [apply\_rest](#class-bone2d-method-apply-rest). These rest poses are relative to the bone's parent. If in the editor, you can set the rest pose of an entire skeleton using a menu option, from the code, you need to iterate over the bones to set their individual rest poses. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [default\_length](#class-bone2d-property-default-length) | `16.0` | | [Transform2D](class_transform2d#class-transform2d) | [rest](#class-bone2d-property-rest) | `Transform2D( 0, 0, 0, 0, 0, 0 )` | Methods ------- | | | | --- | --- | | void | [apply\_rest](#class-bone2d-method-apply-rest) **(** **)** | | [int](class_int#class-int) | [get\_index\_in\_skeleton](#class-bone2d-method-get-index-in-skeleton) **(** **)** const | | [Transform2D](class_transform2d#class-transform2d) | [get\_skeleton\_rest](#class-bone2d-method-get-skeleton-rest) **(** **)** const | Property Descriptions --------------------- ### [float](class_float#class-float) default\_length | | | | --- | --- | | *Default* | `16.0` | | *Setter* | set\_default\_length(value) | | *Getter* | get\_default\_length() | Length of the bone's representation drawn in the editor's viewport in pixels. ### [Transform2D](class_transform2d#class-transform2d) rest | | | | --- | --- | | *Default* | `Transform2D( 0, 0, 0, 0, 0, 0 )` | | *Setter* | set\_rest(value) | | *Getter* | get\_rest() | Rest transform of the bone. You can reset the node's transforms to this value using [apply\_rest](#class-bone2d-method-apply-rest). Method Descriptions ------------------- ### void apply\_rest ( ) Stores the node's current transforms in [rest](#class-bone2d-property-rest). ### [int](class_int#class-int) get\_index\_in\_skeleton ( ) const Returns the node's index as part of the entire skeleton. See [Skeleton2D](class_skeleton2d#class-skeleton2d). ### [Transform2D](class_transform2d#class-transform2d) get\_skeleton\_rest ( ) const Returns the node's [rest](#class-bone2d-property-rest) `Transform2D` if it doesn't have a parent, or its rest pose relative to its parent. godot AudioStreamSample AudioStreamSample ================= **Inherits:** [AudioStream](class_audiostream#class-audiostream) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Stores audio data loaded from WAV files. Description ----------- AudioStreamSample stores sound samples loaded from WAV files. To play the stored sound, use an [AudioStreamPlayer](class_audiostreamplayer#class-audiostreamplayer) (for non-positional audio) or [AudioStreamPlayer2D](class_audiostreamplayer2d#class-audiostreamplayer2d)/[AudioStreamPlayer3D](class_audiostreamplayer3d#class-audiostreamplayer3d) (for positional audio). The sound can be looped. This class can also be used to store dynamically-generated PCM audio data. See also [AudioStreamGenerator](class_audiostreamgenerator#class-audiostreamgenerator) for procedural audio generation. Properties ---------- | | | | | --- | --- | --- | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [data](#class-audiostreamsample-property-data) | `PoolByteArray(  )` | | [Format](#enum-audiostreamsample-format) | [format](#class-audiostreamsample-property-format) | `0` | | [int](class_int#class-int) | [loop\_begin](#class-audiostreamsample-property-loop-begin) | `0` | | [int](class_int#class-int) | [loop\_end](#class-audiostreamsample-property-loop-end) | `0` | | [LoopMode](#enum-audiostreamsample-loopmode) | [loop\_mode](#class-audiostreamsample-property-loop-mode) | `0` | | [int](class_int#class-int) | [mix\_rate](#class-audiostreamsample-property-mix-rate) | `44100` | | [bool](class_bool#class-bool) | [stereo](#class-audiostreamsample-property-stereo) | `false` | Methods ------- | | | | --- | --- | | [Error](class_%40globalscope#enum-globalscope-error) | [save\_to\_wav](#class-audiostreamsample-method-save-to-wav) **(** [String](class_string#class-string) path **)** | Enumerations ------------ enum **Format**: * **FORMAT\_8\_BITS** = **0** --- 8-bit audio codec. * **FORMAT\_16\_BITS** = **1** --- 16-bit audio codec. * **FORMAT\_IMA\_ADPCM** = **2** --- Audio is compressed using IMA ADPCM. enum **LoopMode**: * **LOOP\_DISABLED** = **0** --- Audio does not loop. * **LOOP\_FORWARD** = **1** --- Audio loops the data between [loop\_begin](#class-audiostreamsample-property-loop-begin) and [loop\_end](#class-audiostreamsample-property-loop-end), playing forward only. * **LOOP\_PING\_PONG** = **2** --- Audio loops the data between [loop\_begin](#class-audiostreamsample-property-loop-begin) and [loop\_end](#class-audiostreamsample-property-loop-end), playing back and forth. * **LOOP\_BACKWARD** = **3** --- Audio loops the data between [loop\_begin](#class-audiostreamsample-property-loop-begin) and [loop\_end](#class-audiostreamsample-property-loop-end), playing backward only. Property Descriptions --------------------- ### [PoolByteArray](class_poolbytearray#class-poolbytearray) data | | | | --- | --- | | *Default* | `PoolByteArray(  )` | | *Setter* | set\_data(value) | | *Getter* | get\_data() | Contains the audio data in bytes. **Note:** This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, subtract 128 from each byte. ### [Format](#enum-audiostreamsample-format) format | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_format(value) | | *Getter* | get\_format() | Audio format. See [Format](#enum-audiostreamsample-format) constants for values. ### [int](class_int#class-int) loop\_begin | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_loop\_begin(value) | | *Getter* | get\_loop\_begin() | The loop start point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present. ### [int](class_int#class-int) loop\_end | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_loop\_end(value) | | *Getter* | get\_loop\_end() | The loop end point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present. ### [LoopMode](#enum-audiostreamsample-loopmode) loop\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_loop\_mode(value) | | *Getter* | get\_loop\_mode() | The loop mode. This information will be imported automatically from the WAV file if present. See [LoopMode](#enum-audiostreamsample-loopmode) constants for values. ### [int](class_int#class-int) mix\_rate | | | | --- | --- | | *Default* | `44100` | | *Setter* | set\_mix\_rate(value) | | *Getter* | get\_mix\_rate() | The sample rate for mixing this audio. Higher values require more storage space, but result in better quality. In games, common sample rates in use are `11025`, `16000`, `22050`, `32000`, `44100`, and `48000`. According to the [Nyquist-Shannon sampling theorem](https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem), there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are using lower-pitched sounds such as voices, lower sample rates such as `32000` or `22050` may be usable with no loss in quality. ### [bool](class_bool#class-bool) stereo | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_stereo(value) | | *Getter* | is\_stereo() | If `true`, audio is stereo. Method Descriptions ------------------- ### [Error](class_%40globalscope#enum-globalscope-error) save\_to\_wav ( [String](class_string#class-string) path ) Saves the AudioStreamSample as a WAV file to `path`. Samples with IMA ADPCM format can't be saved. **Note:** A `.wav` extension is automatically appended to `path` if it is missing.
programming_docs
godot AudioEffectAmplify AudioEffectAmplify ================== **Inherits:** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Adds an amplifying audio effect to an audio bus. Increases or decreases the volume of the selected audio bus. Description ----------- Increases or decreases the volume being routed through the audio bus. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [volume\_db](#class-audioeffectamplify-property-volume-db) | `0.0` | Property Descriptions --------------------- ### [float](class_float#class-float) volume\_db | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_volume\_db(value) | | *Getter* | get\_volume\_db() | Amount of amplification in decibels. Positive values make the sound louder, negative values make it quieter. Value can range from -80 to 24. godot AnimationNodeOneShot AnimationNodeOneShot ==================== **Inherits:** [AnimationNode](class_animationnode#class-animationnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Plays an animation once in [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). Description ----------- A resource to add to an [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). This node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters. Tutorials --------- * [AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [autorestart](#class-animationnodeoneshot-property-autorestart) | `false` | | [float](class_float#class-float) | [autorestart\_delay](#class-animationnodeoneshot-property-autorestart-delay) | `1.0` | | [float](class_float#class-float) | [autorestart\_random\_delay](#class-animationnodeoneshot-property-autorestart-random-delay) | `0.0` | | [float](class_float#class-float) | [fadein\_time](#class-animationnodeoneshot-property-fadein-time) | `0.1` | | [float](class_float#class-float) | [fadeout\_time](#class-animationnodeoneshot-property-fadeout-time) | `0.1` | | [MixMode](#enum-animationnodeoneshot-mixmode) | [mix\_mode](#class-animationnodeoneshot-property-mix-mode) | `0` | | [bool](class_bool#class-bool) | [sync](#class-animationnodeoneshot-property-sync) | `false` | Enumerations ------------ enum **MixMode**: * **MIX\_MODE\_BLEND** = **0** * **MIX\_MODE\_ADD** = **1** Property Descriptions --------------------- ### [bool](class_bool#class-bool) autorestart | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_autorestart(value) | | *Getter* | has\_autorestart() | If `true`, the sub-animation will restart automatically after finishing. ### [float](class_float#class-float) autorestart\_delay | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_autorestart\_delay(value) | | *Getter* | get\_autorestart\_delay() | The delay after which the automatic restart is triggered, in seconds. ### [float](class_float#class-float) autorestart\_random\_delay | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_autorestart\_random\_delay(value) | | *Getter* | get\_autorestart\_random\_delay() | If [autorestart](#class-animationnodeoneshot-property-autorestart) is `true`, a random additional delay (in seconds) between 0 and this value will be added to [autorestart\_delay](#class-animationnodeoneshot-property-autorestart-delay). ### [float](class_float#class-float) fadein\_time | | | | --- | --- | | *Default* | `0.1` | | *Setter* | set\_fadein\_time(value) | | *Getter* | get\_fadein\_time() | ### [float](class_float#class-float) fadeout\_time | | | | --- | --- | | *Default* | `0.1` | | *Setter* | set\_fadeout\_time(value) | | *Getter* | get\_fadeout\_time() | ### [MixMode](#enum-animationnodeoneshot-mixmode) mix\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_mix\_mode(value) | | *Getter* | get\_mix\_mode() | ### [bool](class_bool#class-bool) sync | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_sync(value) | | *Getter* | is\_using\_sync() | godot CanvasLayer CanvasLayer =========== **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [ParallaxBackground](class_parallaxbackground#class-parallaxbackground) Canvas drawing layer. Description ----------- Canvas drawing layer. [CanvasItem](class_canvasitem#class-canvasitem) nodes that are direct or indirect children of a `CanvasLayer` will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a `CanvasLayer` with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below). Tutorials --------- * [Viewport and canvas transforms](https://docs.godotengine.org/en/3.5/tutorials/2d/2d_transforms.html) * [Canvas layers](https://docs.godotengine.org/en/3.5/tutorials/2d/canvas_layers.html) * [2D Dodge The Creeps Demo](https://godotengine.org/asset-library/asset/515) Properties ---------- | | | | | --- | --- | --- | | [Node](class_node#class-node) | [custom\_viewport](#class-canvaslayer-property-custom-viewport) | | | [bool](class_bool#class-bool) | [follow\_viewport\_enable](#class-canvaslayer-property-follow-viewport-enable) | `false` | | [float](class_float#class-float) | [follow\_viewport\_scale](#class-canvaslayer-property-follow-viewport-scale) | `1.0` | | [int](class_int#class-int) | [layer](#class-canvaslayer-property-layer) | `1` | | [Vector2](class_vector2#class-vector2) | [offset](#class-canvaslayer-property-offset) | `Vector2( 0, 0 )` | | [float](class_float#class-float) | [rotation](#class-canvaslayer-property-rotation) | `0.0` | | [float](class_float#class-float) | [rotation\_degrees](#class-canvaslayer-property-rotation-degrees) | `0.0` | | [Vector2](class_vector2#class-vector2) | [scale](#class-canvaslayer-property-scale) | `Vector2( 1, 1 )` | | [Transform2D](class_transform2d#class-transform2d) | [transform](#class-canvaslayer-property-transform) | `Transform2D( 1, 0, 0, 1, 0, 0 )` | | [bool](class_bool#class-bool) | [visible](#class-canvaslayer-property-visible) | `true` | Methods ------- | | | | --- | --- | | [RID](class_rid#class-rid) | [get\_canvas](#class-canvaslayer-method-get-canvas) **(** **)** const | | void | [hide](#class-canvaslayer-method-hide) **(** **)** | | void | [show](#class-canvaslayer-method-show) **(** **)** | Signals ------- ### visibility\_changed ( ) Emitted when visibility of the layer is changed. See [visible](#class-canvaslayer-property-visible). Property Descriptions --------------------- ### [Node](class_node#class-node) custom\_viewport | | | | --- | --- | | *Setter* | set\_custom\_viewport(value) | | *Getter* | get\_custom\_viewport() | The custom [Viewport](class_viewport#class-viewport) node assigned to the `CanvasLayer`. If `null`, uses the default viewport instead. ### [bool](class_bool#class-bool) follow\_viewport\_enable | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_follow\_viewport(value) | | *Getter* | is\_following\_viewport() | If enabled, the `CanvasLayer` will use the viewport's transform, so it will move when camera moves instead of being anchored in a fixed position on the screen. Together with [follow\_viewport\_scale](#class-canvaslayer-property-follow-viewport-scale) it can be used for a pseudo 3D effect. ### [float](class_float#class-float) follow\_viewport\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_follow\_viewport\_scale(value) | | *Getter* | get\_follow\_viewport\_scale() | Scales the layer when using [follow\_viewport\_enable](#class-canvaslayer-property-follow-viewport-enable). Layers moving into the foreground should have increasing scales, while layers moving into the background should have decreasing scales. ### [int](class_int#class-int) layer | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_layer(value) | | *Getter* | get\_layer() | Layer index for draw order. Lower values are drawn first. ### [Vector2](class_vector2#class-vector2) offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_offset(value) | | *Getter* | get\_offset() | The layer's base offset. ### [float](class_float#class-float) rotation | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_rotation(value) | | *Getter* | get\_rotation() | The layer's rotation in radians. ### [float](class_float#class-float) rotation\_degrees | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_rotation\_degrees(value) | | *Getter* | get\_rotation\_degrees() | The layer's rotation in degrees. ### [Vector2](class_vector2#class-vector2) scale | | | | --- | --- | | *Default* | `Vector2( 1, 1 )` | | *Setter* | set\_scale(value) | | *Getter* | get\_scale() | The layer's scale. ### [Transform2D](class_transform2d#class-transform2d) transform | | | | --- | --- | | *Default* | `Transform2D( 1, 0, 0, 1, 0, 0 )` | | *Setter* | set\_transform(value) | | *Getter* | get\_transform() | The layer's transform. ### [bool](class_bool#class-bool) visible | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_visible(value) | | *Getter* | is\_visible() | If `false`, any [CanvasItem](class_canvasitem#class-canvasitem) under this `CanvasLayer` will be hidden. Unlike [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible), visibility of a `CanvasLayer` isn't propagated to underlying layers. Method Descriptions ------------------- ### [RID](class_rid#class-rid) get\_canvas ( ) const Returns the RID of the canvas used by this layer. ### void hide ( ) Hides any [CanvasItem](class_canvasitem#class-canvasitem) under this `CanvasLayer`. This is equivalent to setting [visible](#class-canvaslayer-property-visible) to `false`. ### void show ( ) Shows any [CanvasItem](class_canvasitem#class-canvasitem) under this `CanvasLayer`. This is equivalent to setting [visible](#class-canvaslayer-property-visible) to `true`. godot EditorImportPlugin EditorImportPlugin ================== **Inherits:** [ResourceImporter](class_resourceimporter#class-resourceimporter) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Registers a custom resource importer in the editor. Use the class to parse any file and import it as a new resource type. Description ----------- `EditorImportPlugin`s provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. EditorImportPlugins work by associating with specific file extensions and a resource type. See [get\_recognized\_extensions](#class-editorimportplugin-method-get-recognized-extensions) and [get\_resource\_type](#class-editorimportplugin-method-get-resource-type). They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the `.import` directory (see [ProjectSettings.application/config/use\_hidden\_project\_data\_directory](class_projectsettings#class-projectsettings-property-application-config-use-hidden-project-data-directory)). Below is an example EditorImportPlugin that imports a [Mesh](class_mesh#class-mesh) from a file with the extension ".special" or ".spec": ``` tool extends EditorImportPlugin func get_importer_name(): return "my.special.plugin" func get_visible_name(): return "Special Mesh" func get_recognized_extensions(): return ["special", "spec"] func get_save_extension(): return "mesh" func get_resource_type(): return "Mesh" func get_preset_count(): return 1 func get_preset_name(i): return "Default" func get_import_options(i): return [{"name": "my_option", "default_value": false}] func import(source_file, save_path, options, platform_variants, gen_files): var file = File.new() if file.open(source_file, File.READ) != OK: return FAILED var mesh = Mesh.new() # Fill the Mesh with data read in "file", left as an exercise to the reader var filename = save_path + "." + get_save_extension() return ResourceSaver.save(filename, mesh) ``` To use `EditorImportPlugin`, register it using the [EditorPlugin.add\_import\_plugin](class_editorplugin#class-editorplugin-method-add-import-plugin) method first. Tutorials --------- * [Import plugins](https://docs.godotengine.org/en/3.5/tutorials/plugins/editor/import_plugins.html) Methods ------- | | | | --- | --- | | [Array](class_array#class-array) | [get\_import\_options](#class-editorimportplugin-method-get-import-options) **(** [int](class_int#class-int) preset **)** virtual | | [int](class_int#class-int) | [get\_import\_order](#class-editorimportplugin-method-get-import-order) **(** **)** virtual | | [String](class_string#class-string) | [get\_importer\_name](#class-editorimportplugin-method-get-importer-name) **(** **)** virtual | | [bool](class_bool#class-bool) | [get\_option\_visibility](#class-editorimportplugin-method-get-option-visibility) **(** [String](class_string#class-string) option, [Dictionary](class_dictionary#class-dictionary) options **)** virtual | | [int](class_int#class-int) | [get\_preset\_count](#class-editorimportplugin-method-get-preset-count) **(** **)** virtual | | [String](class_string#class-string) | [get\_preset\_name](#class-editorimportplugin-method-get-preset-name) **(** [int](class_int#class-int) preset **)** virtual | | [float](class_float#class-float) | [get\_priority](#class-editorimportplugin-method-get-priority) **(** **)** virtual | | [Array](class_array#class-array) | [get\_recognized\_extensions](#class-editorimportplugin-method-get-recognized-extensions) **(** **)** virtual | | [String](class_string#class-string) | [get\_resource\_type](#class-editorimportplugin-method-get-resource-type) **(** **)** virtual | | [String](class_string#class-string) | [get\_save\_extension](#class-editorimportplugin-method-get-save-extension) **(** **)** virtual | | [String](class_string#class-string) | [get\_visible\_name](#class-editorimportplugin-method-get-visible-name) **(** **)** virtual | | [int](class_int#class-int) | [import](#class-editorimportplugin-method-import) **(** [String](class_string#class-string) source\_file, [String](class_string#class-string) save\_path, [Dictionary](class_dictionary#class-dictionary) options, [Array](class_array#class-array) platform\_variants, [Array](class_array#class-array) gen\_files **)** virtual | Method Descriptions ------------------- ### [Array](class_array#class-array) get\_import\_options ( [int](class_int#class-int) preset ) virtual Gets the options and default values for the preset at this index. Returns an Array of Dictionaries with the following keys: `name`, `default_value`, `property_hint` (optional), `hint_string` (optional), `usage` (optional). ### [int](class_int#class-int) get\_import\_order ( ) virtual Gets the order of this importer to be run when importing resources. Importers with *lower* import orders will be called first, and higher values will be called later. Use this to ensure the importer runs after the dependencies are already imported. The default import order is `0` unless overridden by a specific importer. See [ImportOrder](class_resourceimporter#enum-resourceimporter-importorder) for some predefined values. ### [String](class_string#class-string) get\_importer\_name ( ) virtual Gets the unique name of the importer. ### [bool](class_bool#class-bool) get\_option\_visibility ( [String](class_string#class-string) option, [Dictionary](class_dictionary#class-dictionary) options ) virtual This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled. For example: ``` func get_option_visibility(option, options): # Only show the lossy quality setting if the compression mode is set to "Lossy". if option == "compress/lossy_quality" and options.has("compress/mode"): return int(options["compress/mode"]) == COMPRESS_LOSSY return true ``` Return `true` to make all options always visible. ### [int](class_int#class-int) get\_preset\_count ( ) virtual Gets the number of initial presets defined by the plugin. Use [get\_import\_options](#class-editorimportplugin-method-get-import-options) to get the default options for the preset and [get\_preset\_name](#class-editorimportplugin-method-get-preset-name) to get the name of the preset. ### [String](class_string#class-string) get\_preset\_name ( [int](class_int#class-int) preset ) virtual Gets the name of the options preset at this index. ### [float](class_float#class-float) get\_priority ( ) virtual Gets the priority of this plugin for the recognized extension. Higher priority plugins will be preferred. The default priority is `1.0`. ### [Array](class_array#class-array) get\_recognized\_extensions ( ) virtual Gets the list of file extensions to associate with this loader (case-insensitive). e.g. `["obj"]`. ### [String](class_string#class-string) get\_resource\_type ( ) virtual Gets the Godot resource type associated with this loader. e.g. `"Mesh"` or `"Animation"`. ### [String](class_string#class-string) get\_save\_extension ( ) virtual Gets the extension used to save this resource in the `.import` directory (see [ProjectSettings.application/config/use\_hidden\_project\_data\_directory](class_projectsettings#class-projectsettings-property-application-config-use-hidden-project-data-directory)). ### [String](class_string#class-string) get\_visible\_name ( ) virtual Gets the name to display in the import window. You should choose this name as a continuation to "Import as", e.g. "Import as Special Mesh". ### [int](class_int#class-int) import ( [String](class_string#class-string) source\_file, [String](class_string#class-string) save\_path, [Dictionary](class_dictionary#class-dictionary) options, [Array](class_array#class-array) platform\_variants, [Array](class_array#class-array) gen\_files ) virtual Imports `source_file` into `save_path` with the import `options` specified. The `platform_variants` and `gen_files` arrays will be modified by this function. This method must be overridden to do the actual importing work. See this class' description for an example of overriding this method. godot VisualShaderNodeTextureUniformTriplanar VisualShaderNodeTextureUniformTriplanar ======================================= **Inherits:** [VisualShaderNodeTextureUniform](class_visualshadernodetextureuniform#class-visualshadernodetextureuniform) **<** [VisualShaderNodeUniform](class_visualshadernodeuniform#class-visualshadernodeuniform) **<** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Performs a uniform texture lookup with triplanar within the visual shader graph. Description ----------- Performs a lookup operation on the texture provided as a uniform for the shader, with support for triplanar mapping. godot ScriptCreateDialog ScriptCreateDialog ================== **Inherits:** [ConfirmationDialog](class_confirmationdialog#class-confirmationdialog) **<** [AcceptDialog](class_acceptdialog#class-acceptdialog) **<** [WindowDialog](class_windowdialog#class-windowdialog) **<** [Popup](class_popup#class-popup) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) The Editor's popup dialog for creating new [Script](class_script#class-script) files. Description ----------- The `ScriptCreateDialog` creates script files according to a given template for a given scripting language. The standard use is to configure its fields prior to calling one of the [Popup.popup](class_popup#class-popup-method-popup) methods. ``` func _ready(): dialog.config("Node", "res://new_node.gd") # For in-engine types dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # For script types dialog.popup_centered() ``` Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | dialog\_hide\_on\_ok | `false` (overrides [AcceptDialog](class_acceptdialog#class-acceptdialog-property-dialog-hide-on-ok)) | | [float](class_float#class-float) | margin\_bottom | `258.0` (overrides [Control](class_control#class-control-property-margin-bottom)) | | [float](class_float#class-float) | margin\_right | `366.0` (overrides [Control](class_control#class-control-property-margin-right)) | | [Vector2](class_vector2#class-vector2) | rect\_size | `Vector2( 366, 258 )` (overrides [Control](class_control#class-control-property-rect-size)) | | [String](class_string#class-string) | window\_title | `"Attach Node Script"` (overrides [WindowDialog](class_windowdialog#class-windowdialog-property-window-title)) | Methods ------- | | | | --- | --- | | void | [config](#class-scriptcreatedialog-method-config) **(** [String](class_string#class-string) inherits, [String](class_string#class-string) path, [bool](class_bool#class-bool) built\_in\_enabled=true, [bool](class_bool#class-bool) load\_enabled=true **)** | Signals ------- ### script\_created ( [Script](class_script#class-script) script ) Emitted when the user clicks the OK button. Method Descriptions ------------------- ### void config ( [String](class_string#class-string) inherits, [String](class_string#class-string) path, [bool](class_bool#class-bool) built\_in\_enabled=true, [bool](class_bool#class-bool) load\_enabled=true ) Prefills required fields to configure the ScriptCreateDialog for use.
programming_docs
godot DampedSpringJoint2D DampedSpringJoint2D =================== **Inherits:** [Joint2D](class_joint2d#class-joint2d) **<** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Damped spring constraint for 2D physics. Description ----------- Damped spring constraint for 2D physics. This resembles a spring joint that always wants to go back to a given length. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [damping](#class-dampedspringjoint2d-property-damping) | `1.0` | | [float](class_float#class-float) | [length](#class-dampedspringjoint2d-property-length) | `50.0` | | [float](class_float#class-float) | [rest\_length](#class-dampedspringjoint2d-property-rest-length) | `0.0` | | [float](class_float#class-float) | [stiffness](#class-dampedspringjoint2d-property-stiffness) | `20.0` | Property Descriptions --------------------- ### [float](class_float#class-float) damping | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_damping(value) | | *Getter* | get\_damping() | The spring joint's damping ratio. A value between `0` and `1`. When the two bodies move into different directions the system tries to align them to the spring axis again. A high `damping` value forces the attached bodies to align faster. ### [float](class_float#class-float) length | | | | --- | --- | | *Default* | `50.0` | | *Setter* | set\_length(value) | | *Getter* | get\_length() | The spring joint's maximum length. The two attached bodies cannot stretch it past this value. ### [float](class_float#class-float) rest\_length | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_rest\_length(value) | | *Getter* | get\_rest\_length() | When the bodies attached to the spring joint move they stretch or squash it. The joint always tries to resize towards this length. ### [float](class_float#class-float) stiffness | | | | --- | --- | | *Default* | `20.0` | | *Setter* | set\_stiffness(value) | | *Getter* | get\_stiffness() | The higher the value, the less the bodies attached to the joint will deform it. The joint applies an opposing force to the bodies, the product of the stiffness multiplied by the size difference from its resting length. godot VisualShaderNodeDotProduct VisualShaderNodeDotProduct ========================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Calculates a dot product of two vectors within the visual shader graph. Description ----------- Translates to `dot(a, b)` in the shader language. godot NavigationPolygonInstance NavigationPolygonInstance ========================= **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) A region of the 2D navigation map. Description ----------- A region of the navigation map. It tells the [Navigation2DServer](class_navigation2dserver#class-navigation2dserver) what can be navigated and what cannot, based on its [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) resource. By default this node will register to the default [World2D](class_world2d#class-world2d) navigation map. If this node is a child of a [Navigation2D](class_navigation2d#class-navigation2d) node it will register to the navigation map of the navigation node. Two regions can be connected to each other if they share a similar edge. You can set the minimum distance between two vertices required to connect two edges by using [Navigation2DServer.map\_set\_edge\_connection\_margin](class_navigation2dserver#class-navigation2dserver-method-map-set-edge-connection-margin). **Note:** Overlapping two regions' polygons is not enough for connecting two regions. They must share a similar edge. The pathfinding cost of entering this region from another region can be controlled with the [enter\_cost](#class-navigationpolygoninstance-property-enter-cost) value. **Note:** This value is not added to the path cost when the start position is already inside this region. The pathfinding cost of traveling distances inside this region can be controlled with the [travel\_cost](#class-navigationpolygoninstance-property-travel-cost) multiplier. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [enabled](#class-navigationpolygoninstance-property-enabled) | `true` | | [float](class_float#class-float) | [enter\_cost](#class-navigationpolygoninstance-property-enter-cost) | `0.0` | | [int](class_int#class-int) | [navigation\_layers](#class-navigationpolygoninstance-property-navigation-layers) | `1` | | [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) | [navpoly](#class-navigationpolygoninstance-property-navpoly) | | | [float](class_float#class-float) | [travel\_cost](#class-navigationpolygoninstance-property-travel-cost) | `1.0` | Methods ------- | | | | --- | --- | | [RID](class_rid#class-rid) | [get\_region\_rid](#class-navigationpolygoninstance-method-get-region-rid) **(** **)** const | Property Descriptions --------------------- ### [bool](class_bool#class-bool) enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_enabled(value) | | *Getter* | is\_enabled() | Determines if the `NavigationPolygonInstance` is enabled or disabled. ### [float](class_float#class-float) enter\_cost | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_enter\_cost(value) | | *Getter* | get\_enter\_cost() | When pathfinding enters this region's navmesh from another regions navmesh the `enter_cost` value is added to the path distance for determining the shortest path. ### [int](class_int#class-int) navigation\_layers | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_navigation\_layers(value) | | *Getter* | get\_navigation\_layers() | A bitfield determining all navigation map layers the [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) belongs to. On path requests with [Navigation2DServer.map\_get\_path](class_navigation2dserver#class-navigation2dserver-method-map-get-path) navmeshes without matching layers will be ignored and the navigation map will only proximity merge different navmeshes with matching layers. ### [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) navpoly | | | | --- | --- | | *Setter* | set\_navigation\_polygon(value) | | *Getter* | get\_navigation\_polygon() | The [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) resource to use. ### [float](class_float#class-float) travel\_cost | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_travel\_cost(value) | | *Getter* | get\_travel\_cost() | When pathfinding moves inside this region's navmesh the traveled distances are multiplied with `travel_cost` for determining the shortest path. Method Descriptions ------------------- ### [RID](class_rid#class-rid) get\_region\_rid ( ) const Returns the [RID](class_rid#class-rid) of this region on the [Navigation2DServer](class_navigation2dserver#class-navigation2dserver). Combined with [Navigation2DServer.map\_get\_closest\_point\_owner](class_navigation2dserver#class-navigation2dserver-method-map-get-closest-point-owner) can be used to identify the `NavigationPolygonInstance` closest to a point on the merged navigation map. godot EditorSpatialGizmo EditorSpatialGizmo ================== **Inherits:** [SpatialGizmo](class_spatialgizmo#class-spatialgizmo) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Custom gizmo for editing Spatial objects. Description ----------- Custom gizmo that is used for providing custom visualization and editing (handles) for 3D Spatial objects. See [EditorSpatialGizmoPlugin](class_editorspatialgizmoplugin#class-editorspatialgizmoplugin) for more information. Methods ------- | | | | --- | --- | | void | [add\_collision\_segments](#class-editorspatialgizmo-method-add-collision-segments) **(** [PoolVector3Array](class_poolvector3array#class-poolvector3array) segments **)** | | void | [add\_collision\_triangles](#class-editorspatialgizmo-method-add-collision-triangles) **(** [TriangleMesh](class_trianglemesh#class-trianglemesh) triangles **)** | | void | [add\_handles](#class-editorspatialgizmo-method-add-handles) **(** [PoolVector3Array](class_poolvector3array#class-poolvector3array) handles, [Material](class_material#class-material) material, [bool](class_bool#class-bool) billboard=false, [bool](class_bool#class-bool) secondary=false **)** | | void | [add\_lines](#class-editorspatialgizmo-method-add-lines) **(** [PoolVector3Array](class_poolvector3array#class-poolvector3array) lines, [Material](class_material#class-material) material, [bool](class_bool#class-bool) billboard=false, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ) **)** | | void | [add\_mesh](#class-editorspatialgizmo-method-add-mesh) **(** [Mesh](class_mesh#class-mesh) mesh, [bool](class_bool#class-bool) billboard=false, [SkinReference](class_skinreference#class-skinreference) skeleton=null, [Material](class_material#class-material) material=null **)** | | void | [add\_unscaled\_billboard](#class-editorspatialgizmo-method-add-unscaled-billboard) **(** [Material](class_material#class-material) material, [float](class_float#class-float) default\_scale=1, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ) **)** | | void | [clear](#class-editorspatialgizmo-method-clear) **(** **)** | | void | [commit\_handle](#class-editorspatialgizmo-method-commit-handle) **(** [int](class_int#class-int) index, [Variant](class_variant#class-variant) restore, [bool](class_bool#class-bool) cancel=false **)** virtual | | [String](class_string#class-string) | [get\_handle\_name](#class-editorspatialgizmo-method-get-handle-name) **(** [int](class_int#class-int) index **)** virtual | | [Variant](class_variant#class-variant) | [get\_handle\_value](#class-editorspatialgizmo-method-get-handle-value) **(** [int](class_int#class-int) index **)** virtual | | [EditorSpatialGizmoPlugin](class_editorspatialgizmoplugin#class-editorspatialgizmoplugin) | [get\_plugin](#class-editorspatialgizmo-method-get-plugin) **(** **)** const | | [Spatial](class_spatial#class-spatial) | [get\_spatial\_node](#class-editorspatialgizmo-method-get-spatial-node) **(** **)** const | | [bool](class_bool#class-bool) | [is\_handle\_highlighted](#class-editorspatialgizmo-method-is-handle-highlighted) **(** [int](class_int#class-int) index **)** virtual | | void | [redraw](#class-editorspatialgizmo-method-redraw) **(** **)** virtual | | void | [set\_handle](#class-editorspatialgizmo-method-set-handle) **(** [int](class_int#class-int) index, [Camera](class_camera#class-camera) camera, [Vector2](class_vector2#class-vector2) point **)** virtual | | void | [set\_hidden](#class-editorspatialgizmo-method-set-hidden) **(** [bool](class_bool#class-bool) hidden **)** | | void | [set\_spatial\_node](#class-editorspatialgizmo-method-set-spatial-node) **(** [Node](class_node#class-node) node **)** | Method Descriptions ------------------- ### void add\_collision\_segments ( [PoolVector3Array](class_poolvector3array#class-poolvector3array) segments ) Adds the specified `segments` to the gizmo's collision shape for picking. Call this function during [redraw](#class-editorspatialgizmo-method-redraw). ### void add\_collision\_triangles ( [TriangleMesh](class_trianglemesh#class-trianglemesh) triangles ) Adds collision triangles to the gizmo for picking. A [TriangleMesh](class_trianglemesh#class-trianglemesh) can be generated from a regular [Mesh](class_mesh#class-mesh) too. Call this function during [redraw](#class-editorspatialgizmo-method-redraw). ### void add\_handles ( [PoolVector3Array](class_poolvector3array#class-poolvector3array) handles, [Material](class_material#class-material) material, [bool](class_bool#class-bool) billboard=false, [bool](class_bool#class-bool) secondary=false ) Adds a list of handles (points) which can be used to deform the object being edited. There are virtual functions which will be called upon editing of these handles. Call this function during [redraw](#class-editorspatialgizmo-method-redraw). ### void add\_lines ( [PoolVector3Array](class_poolvector3array#class-poolvector3array) lines, [Material](class_material#class-material) material, [bool](class_bool#class-bool) billboard=false, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ) ) Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this function during [redraw](#class-editorspatialgizmo-method-redraw). ### void add\_mesh ( [Mesh](class_mesh#class-mesh) mesh, [bool](class_bool#class-bool) billboard=false, [SkinReference](class_skinreference#class-skinreference) skeleton=null, [Material](class_material#class-material) material=null ) Adds a mesh to the gizmo with the specified `billboard` state, `skeleton` and `material`. If `billboard` is `true`, the mesh will rotate to always face the camera. Call this function during [redraw](#class-editorspatialgizmo-method-redraw). ### void add\_unscaled\_billboard ( [Material](class_material#class-material) material, [float](class_float#class-float) default\_scale=1, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ) ) Adds an unscaled billboard for visualization. Call this function during [redraw](#class-editorspatialgizmo-method-redraw). ### void clear ( ) Removes everything in the gizmo including meshes, collisions and handles. ### void commit\_handle ( [int](class_int#class-int) index, [Variant](class_variant#class-variant) restore, [bool](class_bool#class-bool) cancel=false ) virtual Commit a handle being edited (handles must have been previously added by [add\_handles](#class-editorspatialgizmo-method-add-handles)). If the `cancel` parameter is `true`, an option to restore the edited value to the original is provided. ### [String](class_string#class-string) get\_handle\_name ( [int](class_int#class-int) index ) virtual Gets the name of an edited handle (handles must have been previously added by [add\_handles](#class-editorspatialgizmo-method-add-handles)). Handles can be named for reference to the user when editing. ### [Variant](class_variant#class-variant) get\_handle\_value ( [int](class_int#class-int) index ) virtual Gets actual value of a handle. This value can be anything and used for eventually undoing the motion when calling [commit\_handle](#class-editorspatialgizmo-method-commit-handle). ### [EditorSpatialGizmoPlugin](class_editorspatialgizmoplugin#class-editorspatialgizmoplugin) get\_plugin ( ) const Returns the [EditorSpatialGizmoPlugin](class_editorspatialgizmoplugin#class-editorspatialgizmoplugin) that owns this gizmo. It's useful to retrieve materials using [EditorSpatialGizmoPlugin.get\_material](class_editorspatialgizmoplugin#class-editorspatialgizmoplugin-method-get-material). ### [Spatial](class_spatial#class-spatial) get\_spatial\_node ( ) const Returns the Spatial node associated with this gizmo. ### [bool](class_bool#class-bool) is\_handle\_highlighted ( [int](class_int#class-int) index ) virtual Returns `true` if the handle at index `index` is highlighted by being hovered with the mouse. ### void redraw ( ) virtual This function is called when the [Spatial](class_spatial#class-spatial) this gizmo refers to changes (the [Spatial.update\_gizmo](class_spatial#class-spatial-method-update-gizmo) is called). ### void set\_handle ( [int](class_int#class-int) index, [Camera](class_camera#class-camera) camera, [Vector2](class_vector2#class-vector2) point ) virtual This function is used when the user drags a gizmo handle (previously added with [add\_handles](#class-editorspatialgizmo-method-add-handles)) in screen coordinates. The [Camera](class_camera#class-camera) is also provided so screen coordinates can be converted to raycasts. ### void set\_hidden ( [bool](class_bool#class-bool) hidden ) Sets the gizmo's hidden state. If `true`, the gizmo will be hidden. If `false`, it will be shown. ### void set\_spatial\_node ( [Node](class_node#class-node) node ) Sets the reference [Spatial](class_spatial#class-spatial) node for the gizmo. `node` must inherit from [Spatial](class_spatial#class-spatial). godot NavigationMeshInstance NavigationMeshInstance ====================== **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) An instance of a [NavigationMesh](class_navigationmesh#class-navigationmesh). Description ----------- An instance of a [NavigationMesh](class_navigationmesh#class-navigationmesh). It tells the [Navigation](class_navigation#class-navigation) node what can be navigated and what cannot, based on the [NavigationMesh](class_navigationmesh#class-navigationmesh) resource. By default this node will register to the default [World](class_world#class-world) navigation map. If this node is a child of a [Navigation](class_navigation#class-navigation) node it will register to the navigation map of the navigation node. Two regions can be connected to each other if they share a similar edge. You can set the minimum distance between two vertices required to connect two edges by using [NavigationServer.map\_set\_edge\_connection\_margin](class_navigationserver#class-navigationserver-method-map-set-edge-connection-margin). **Note:** Overlapping two regions' navmeshes is not enough for connecting two regions. They must share a similar edge. The cost of entering this region from another region can be controlled with the [enter\_cost](#class-navigationmeshinstance-property-enter-cost) value. **Note:** This value is not added to the path cost when the start position is already inside this region. The cost of traveling distances inside this region can be controlled with the [travel\_cost](#class-navigationmeshinstance-property-travel-cost) multiplier. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [enabled](#class-navigationmeshinstance-property-enabled) | `true` | | [float](class_float#class-float) | [enter\_cost](#class-navigationmeshinstance-property-enter-cost) | `0.0` | | [int](class_int#class-int) | [navigation\_layers](#class-navigationmeshinstance-property-navigation-layers) | `1` | | [NavigationMesh](class_navigationmesh#class-navigationmesh) | [navmesh](#class-navigationmeshinstance-property-navmesh) | | | [float](class_float#class-float) | [travel\_cost](#class-navigationmeshinstance-property-travel-cost) | `1.0` | Methods ------- | | | | --- | --- | | void | [bake\_navigation\_mesh](#class-navigationmeshinstance-method-bake-navigation-mesh) **(** [bool](class_bool#class-bool) on\_thread=true **)** | | [RID](class_rid#class-rid) | [get\_region\_rid](#class-navigationmeshinstance-method-get-region-rid) **(** **)** const | Signals ------- ### bake\_finished ( ) Notifies when the navigation mesh bake operation is completed. ### navigation\_mesh\_changed ( ) Notifies when the [NavigationMesh](class_navigationmesh#class-navigationmesh) has changed. Property Descriptions --------------------- ### [bool](class_bool#class-bool) enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_enabled(value) | | *Getter* | is\_enabled() | Determines if the `NavigationMeshInstance` is enabled or disabled. ### [float](class_float#class-float) enter\_cost | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_enter\_cost(value) | | *Getter* | get\_enter\_cost() | When pathfinding enters this region's navmesh from another regions navmesh the `enter_cost` value is added to the path distance for determining the shortest path. ### [int](class_int#class-int) navigation\_layers | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_navigation\_layers(value) | | *Getter* | get\_navigation\_layers() | A bitfield determining all navigation map layers the [NavigationMesh](class_navigationmesh#class-navigationmesh) belongs to. On path requests with [NavigationServer.map\_get\_path](class_navigationserver#class-navigationserver-method-map-get-path) navmeshes without matching layers will be ignored and the navigation map will only proximity merge different navmeshes with matching layers. ### [NavigationMesh](class_navigationmesh#class-navigationmesh) navmesh | | | | --- | --- | | *Setter* | set\_navigation\_mesh(value) | | *Getter* | get\_navigation\_mesh() | The [NavigationMesh](class_navigationmesh#class-navigationmesh) resource to use. ### [float](class_float#class-float) travel\_cost | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_travel\_cost(value) | | *Getter* | get\_travel\_cost() | When pathfinding moves inside this region's navmesh the traveled distances are multiplied with `travel_cost` for determining the shortest path. Method Descriptions ------------------- ### void bake\_navigation\_mesh ( [bool](class_bool#class-bool) on\_thread=true ) Bakes the [NavigationMesh](class_navigationmesh#class-navigationmesh). If `on_thread` is set to `true` (default), the baking is done on a separate thread. Baking on separate thread is useful because navigation baking is not a cheap operation. When it is completed, it automatically sets the new [NavigationMesh](class_navigationmesh#class-navigationmesh). Please note that baking on separate thread may be very slow if geometry is parsed from meshes as async access to each mesh involves heavy synchronization. Also, please note that baking on a separate thread is automatically disabled on operating systems that cannot use threads (such as HTML5 with threads disabled). ### [RID](class_rid#class-rid) get\_region\_rid ( ) const Returns the [RID](class_rid#class-rid) of this region on the [NavigationServer](class_navigationserver#class-navigationserver). Combined with [NavigationServer.map\_get\_closest\_point\_owner](class_navigationserver#class-navigationserver-method-map-get-closest-point-owner) can be used to identify the `NavigationMeshInstance` closest to a point on the merged navigation map.
programming_docs
godot CSGShape CSGShape ======== **Inherits:** [GeometryInstance](class_geometryinstance#class-geometryinstance) **<** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [CSGCombiner](class_csgcombiner#class-csgcombiner), [CSGPrimitive](class_csgprimitive#class-csgprimitive) The CSG base class. Description ----------- This is the CSG base class that provides CSG operation support to the various CSG nodes in Godot. **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a [MeshInstance](class_meshinstance#class-meshinstance) with a [PrimitiveMesh](class_primitivemesh#class-primitivemesh). Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. Tutorials --------- * [Prototyping levels with CSG](https://docs.godotengine.org/en/3.5/tutorials/3d/csg_tools.html) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [calculate\_tangents](#class-csgshape-property-calculate-tangents) | `true` | | [int](class_int#class-int) | [collision\_layer](#class-csgshape-property-collision-layer) | `1` | | [int](class_int#class-int) | [collision\_mask](#class-csgshape-property-collision-mask) | `1` | | [Operation](#enum-csgshape-operation) | [operation](#class-csgshape-property-operation) | `0` | | [float](class_float#class-float) | [snap](#class-csgshape-property-snap) | `0.001` | | [bool](class_bool#class-bool) | [use\_collision](#class-csgshape-property-use-collision) | `false` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [get\_collision\_layer\_bit](#class-csgshape-method-get-collision-layer-bit) **(** [int](class_int#class-int) bit **)** const | | [bool](class_bool#class-bool) | [get\_collision\_mask\_bit](#class-csgshape-method-get-collision-mask-bit) **(** [int](class_int#class-int) bit **)** const | | [Array](class_array#class-array) | [get\_meshes](#class-csgshape-method-get-meshes) **(** **)** const | | [bool](class_bool#class-bool) | [is\_root\_shape](#class-csgshape-method-is-root-shape) **(** **)** const | | void | [set\_collision\_layer\_bit](#class-csgshape-method-set-collision-layer-bit) **(** [int](class_int#class-int) bit, [bool](class_bool#class-bool) value **)** | | void | [set\_collision\_mask\_bit](#class-csgshape-method-set-collision-mask-bit) **(** [int](class_int#class-int) bit, [bool](class_bool#class-bool) value **)** | Enumerations ------------ enum **Operation**: * **OPERATION\_UNION** = **0** --- Geometry of both primitives is merged, intersecting geometry is removed. * **OPERATION\_INTERSECTION** = **1** --- Only intersecting geometry remains, the rest is removed. * **OPERATION\_SUBTRACTION** = **2** --- The second shape is subtracted from the first, leaving a dent with its shape. Property Descriptions --------------------- ### [bool](class_bool#class-bool) calculate\_tangents | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_calculate\_tangents(value) | | *Getter* | is\_calculating\_tangents() | Calculate tangents for the CSG shape which allows the use of normal maps. This is only applied on the root shape, this setting is ignored on any child. ### [int](class_int#class-int) collision\_layer | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_collision\_layer(value) | | *Getter* | get\_collision\_layer() | The physics layers this area is in. Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision\_mask property. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [Collision layers and masks](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. ### [int](class_int#class-int) collision\_mask | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_collision\_mask(value) | | *Getter* | get\_collision\_mask() | The physics layers this CSG shape scans for collisions. See [Collision layers and masks](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. ### [Operation](#enum-csgshape-operation) operation | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_operation(value) | | *Getter* | get\_operation() | The operation that is performed on this shape. This is ignored for the first CSG child node as the operation is between this node and the previous child of this nodes parent. ### [float](class_float#class-float) snap | | | | --- | --- | | *Default* | `0.001` | | *Setter* | set\_snap(value) | | *Getter* | get\_snap() | Snap makes the mesh snap to a given distance so that the faces of two meshes can be perfectly aligned. A lower value results in greater precision but may be harder to adjust. ### [bool](class_bool#class-bool) use\_collision | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_collision(value) | | *Getter* | is\_using\_collision() | Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden. Method Descriptions ------------------- ### [bool](class_bool#class-bool) get\_collision\_layer\_bit ( [int](class_int#class-int) bit ) const Returns an individual bit on the collision mask. ### [bool](class_bool#class-bool) get\_collision\_mask\_bit ( [int](class_int#class-int) bit ) const Returns an individual bit on the collision mask. ### [Array](class_array#class-array) get\_meshes ( ) const Returns an [Array](class_array#class-array) with two elements, the first is the [Transform](class_transform#class-transform) of this node and the second is the root [Mesh](class_mesh#class-mesh) of this node. Only works when this node is the root shape. ### [bool](class_bool#class-bool) is\_root\_shape ( ) const Returns `true` if this is a root shape and is thus the object that is rendered. ### void set\_collision\_layer\_bit ( [int](class_int#class-int) bit, [bool](class_bool#class-bool) value ) Sets individual bits on the layer mask. Use this if you only need to change one layer's value. ### void set\_collision\_mask\_bit ( [int](class_int#class-int) bit, [bool](class_bool#class-bool) value ) Sets individual bits on the collision mask. Use this if you only need to change one layer's value. godot PanoramaSky PanoramaSky =========== **Inherits:** [Sky](class_sky#class-sky) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A type of [Sky](class_sky#class-sky) used to draw a background texture. Description ----------- A resource referenced in an [Environment](class_environment#class-environment) that is used to draw a background. The Panorama sky functions similar to skyboxes in other engines, except it uses an equirectangular sky map instead of a cube map. Using an HDR panorama is strongly recommended for accurate, high-quality reflections. Godot supports the Radiance HDR (`.hdr`) and OpenEXR (`.exr`) image formats for this purpose. You can use [this tool](https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html) to convert a cube map to an equirectangular sky map. Properties ---------- | | | | --- | --- | | [Texture](class_texture#class-texture) | [panorama](#class-panoramasky-property-panorama) | Property Descriptions --------------------- ### [Texture](class_texture#class-texture) panorama | | | | --- | --- | | *Setter* | set\_panorama(value) | | *Getter* | get\_panorama() | [Texture](class_texture#class-texture) to be applied to the PanoramaSky. godot GLTFNode GLTFNode ======== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Description ----------- **Note:** This class is only compiled in editor builds. Run-time glTF loading and saving is *not* available in exported projects. References to `GLTFNode` within a script will cause an error in an exported project. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [camera](#class-gltfnode-property-camera) | `-1` | | [PoolIntArray](class_poolintarray#class-poolintarray) | [children](#class-gltfnode-property-children) | `PoolIntArray(  )` | | [int](class_int#class-int) | [height](#class-gltfnode-property-height) | `-1` | | [bool](class_bool#class-bool) | [joint](#class-gltfnode-property-joint) | `false` | | [int](class_int#class-int) | [light](#class-gltfnode-property-light) | `-1` | | [int](class_int#class-int) | [mesh](#class-gltfnode-property-mesh) | `-1` | | [int](class_int#class-int) | [parent](#class-gltfnode-property-parent) | `-1` | | [Quat](class_quat#class-quat) | [rotation](#class-gltfnode-property-rotation) | `Quat( 0, 0, 0, 1 )` | | [Vector3](class_vector3#class-vector3) | [scale](#class-gltfnode-property-scale) | `Vector3( 1, 1, 1 )` | | [int](class_int#class-int) | [skeleton](#class-gltfnode-property-skeleton) | `-1` | | [int](class_int#class-int) | [skin](#class-gltfnode-property-skin) | `-1` | | [Vector3](class_vector3#class-vector3) | [translation](#class-gltfnode-property-translation) | `Vector3( 0, 0, 0 )` | | [Transform](class_transform#class-transform) | [xform](#class-gltfnode-property-xform) | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | Property Descriptions --------------------- ### [int](class_int#class-int) camera | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_camera(value) | | *Getter* | get\_camera() | ### [PoolIntArray](class_poolintarray#class-poolintarray) children | | | | --- | --- | | *Default* | `PoolIntArray(  )` | | *Setter* | set\_children(value) | | *Getter* | get\_children() | ### [int](class_int#class-int) height | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_height(value) | | *Getter* | get\_height() | ### [bool](class_bool#class-bool) joint | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_joint(value) | | *Getter* | get\_joint() | ### [int](class_int#class-int) light | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_light(value) | | *Getter* | get\_light() | ### [int](class_int#class-int) mesh | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_mesh(value) | | *Getter* | get\_mesh() | ### [int](class_int#class-int) parent | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_parent(value) | | *Getter* | get\_parent() | ### [Quat](class_quat#class-quat) rotation | | | | --- | --- | | *Default* | `Quat( 0, 0, 0, 1 )` | | *Setter* | set\_rotation(value) | | *Getter* | get\_rotation() | ### [Vector3](class_vector3#class-vector3) scale | | | | --- | --- | | *Default* | `Vector3( 1, 1, 1 )` | | *Setter* | set\_scale(value) | | *Getter* | get\_scale() | ### [int](class_int#class-int) skeleton | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_skeleton(value) | | *Getter* | get\_skeleton() | ### [int](class_int#class-int) skin | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_skin(value) | | *Getter* | get\_skin() | ### [Vector3](class_vector3#class-vector3) translation | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_translation(value) | | *Getter* | get\_translation() | ### [Transform](class_transform#class-transform) xform | | | | --- | --- | | *Default* | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | | *Setter* | set\_xform(value) | | *Getter* | get\_xform() | godot Navigation2DServer Navigation2DServer ================== **Inherits:** [Object](class_object#class-object) Server interface for low-level 2D navigation access. Description ----------- Navigation2DServer is the server responsible for all 2D navigation. It handles several objects, namely maps, regions and agents. Maps are made up of regions, which are made of navigation polygons. Together, they define the navigable areas in the 2D world. **Note:** Most NavigationServer changes take effect after the next physics frame and not immediately. This includes all changes made to maps, regions or agents by navigation related Nodes in the SceneTree or made through scripts. For two regions to be connected to each other, they must share a similar edge. An edge is considered connected to another if both of its two vertices are at a distance less than navigation map `edge_connection_margin` to the respective other edge's vertex. You may assign navigation layers to regions with [region\_set\_navigation\_layers](#class-navigation2dserver-method-region-set-navigation-layers), which then can be checked upon when requesting a path with [map\_get\_path](#class-navigation2dserver-method-map-get-path). This allows allowing or forbidding some areas to 2D objects. To use the collision avoidance system, you may use agents. You can set an agent's target velocity, then the servers will emit a callback with a modified velocity. **Note:** The collision avoidance system ignores regions. Using the modified velocity as-is might lead to pushing and agent outside of a navigable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine. This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. Tutorials --------- * [2D Navigation Demo](https://godotengine.org/asset-library/asset/117) Methods ------- | | | | --- | --- | | [RID](class_rid#class-rid) | [agent\_create](#class-navigation2dserver-method-agent-create) **(** **)** const | | [RID](class_rid#class-rid) | [agent\_get\_map](#class-navigation2dserver-method-agent-get-map) **(** [RID](class_rid#class-rid) agent **)** const | | [bool](class_bool#class-bool) | [agent\_is\_map\_changed](#class-navigation2dserver-method-agent-is-map-changed) **(** [RID](class_rid#class-rid) agent **)** const | | void | [agent\_set\_callback](#class-navigation2dserver-method-agent-set-callback) **(** [RID](class_rid#class-rid) agent, [Object](class_object#class-object) receiver, [String](class_string#class-string) method, [Variant](class_variant#class-variant) userdata=null **)** const | | void | [agent\_set\_map](#class-navigation2dserver-method-agent-set-map) **(** [RID](class_rid#class-rid) agent, [RID](class_rid#class-rid) map **)** const | | void | [agent\_set\_max\_neighbors](#class-navigation2dserver-method-agent-set-max-neighbors) **(** [RID](class_rid#class-rid) agent, [int](class_int#class-int) count **)** const | | void | [agent\_set\_max\_speed](#class-navigation2dserver-method-agent-set-max-speed) **(** [RID](class_rid#class-rid) agent, [float](class_float#class-float) max\_speed **)** const | | void | [agent\_set\_neighbor\_dist](#class-navigation2dserver-method-agent-set-neighbor-dist) **(** [RID](class_rid#class-rid) agent, [float](class_float#class-float) dist **)** const | | void | [agent\_set\_position](#class-navigation2dserver-method-agent-set-position) **(** [RID](class_rid#class-rid) agent, [Vector2](class_vector2#class-vector2) position **)** const | | void | [agent\_set\_radius](#class-navigation2dserver-method-agent-set-radius) **(** [RID](class_rid#class-rid) agent, [float](class_float#class-float) radius **)** const | | void | [agent\_set\_target\_velocity](#class-navigation2dserver-method-agent-set-target-velocity) **(** [RID](class_rid#class-rid) agent, [Vector2](class_vector2#class-vector2) target\_velocity **)** const | | void | [agent\_set\_time\_horizon](#class-navigation2dserver-method-agent-set-time-horizon) **(** [RID](class_rid#class-rid) agent, [float](class_float#class-float) time **)** const | | void | [agent\_set\_velocity](#class-navigation2dserver-method-agent-set-velocity) **(** [RID](class_rid#class-rid) agent, [Vector2](class_vector2#class-vector2) velocity **)** const | | void | [free\_rid](#class-navigation2dserver-method-free-rid) **(** [RID](class_rid#class-rid) rid **)** const | | [Array](class_array#class-array) | [get\_maps](#class-navigation2dserver-method-get-maps) **(** **)** const | | [RID](class_rid#class-rid) | [map\_create](#class-navigation2dserver-method-map-create) **(** **)** const | | void | [map\_force\_update](#class-navigation2dserver-method-map-force-update) **(** [RID](class_rid#class-rid) map **)** | | [Array](class_array#class-array) | [map\_get\_agents](#class-navigation2dserver-method-map-get-agents) **(** [RID](class_rid#class-rid) map **)** const | | [float](class_float#class-float) | [map\_get\_cell\_height](#class-navigation2dserver-method-map-get-cell-height) **(** [RID](class_rid#class-rid) map **)** const | | [float](class_float#class-float) | [map\_get\_cell\_size](#class-navigation2dserver-method-map-get-cell-size) **(** [RID](class_rid#class-rid) map **)** const | | [Vector2](class_vector2#class-vector2) | [map\_get\_closest\_point](#class-navigation2dserver-method-map-get-closest-point) **(** [RID](class_rid#class-rid) map, [Vector2](class_vector2#class-vector2) to\_point **)** const | | [RID](class_rid#class-rid) | [map\_get\_closest\_point\_owner](#class-navigation2dserver-method-map-get-closest-point-owner) **(** [RID](class_rid#class-rid) map, [Vector2](class_vector2#class-vector2) to\_point **)** const | | [float](class_float#class-float) | [map\_get\_edge\_connection\_margin](#class-navigation2dserver-method-map-get-edge-connection-margin) **(** [RID](class_rid#class-rid) map **)** const | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [map\_get\_path](#class-navigation2dserver-method-map-get-path) **(** [RID](class_rid#class-rid) map, [Vector2](class_vector2#class-vector2) origin, [Vector2](class_vector2#class-vector2) destination, [bool](class_bool#class-bool) optimize, [int](class_int#class-int) navigation\_layers=1 **)** const | | [Array](class_array#class-array) | [map\_get\_regions](#class-navigation2dserver-method-map-get-regions) **(** [RID](class_rid#class-rid) map **)** const | | [bool](class_bool#class-bool) | [map\_is\_active](#class-navigation2dserver-method-map-is-active) **(** [RID](class_rid#class-rid) map **)** const | | void | [map\_set\_active](#class-navigation2dserver-method-map-set-active) **(** [RID](class_rid#class-rid) map, [bool](class_bool#class-bool) active **)** const | | void | [map\_set\_cell\_height](#class-navigation2dserver-method-map-set-cell-height) **(** [RID](class_rid#class-rid) map, [float](class_float#class-float) cell\_height **)** const | | void | [map\_set\_cell\_size](#class-navigation2dserver-method-map-set-cell-size) **(** [RID](class_rid#class-rid) map, [float](class_float#class-float) cell\_size **)** const | | void | [map\_set\_edge\_connection\_margin](#class-navigation2dserver-method-map-set-edge-connection-margin) **(** [RID](class_rid#class-rid) map, [float](class_float#class-float) margin **)** const | | [RID](class_rid#class-rid) | [region\_create](#class-navigation2dserver-method-region-create) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [region\_get\_connection\_pathway\_end](#class-navigation2dserver-method-region-get-connection-pathway-end) **(** [RID](class_rid#class-rid) region, [int](class_int#class-int) connection **)** const | | [Vector2](class_vector2#class-vector2) | [region\_get\_connection\_pathway\_start](#class-navigation2dserver-method-region-get-connection-pathway-start) **(** [RID](class_rid#class-rid) region, [int](class_int#class-int) connection **)** const | | [int](class_int#class-int) | [region\_get\_connections\_count](#class-navigation2dserver-method-region-get-connections-count) **(** [RID](class_rid#class-rid) region **)** const | | [float](class_float#class-float) | [region\_get\_enter\_cost](#class-navigation2dserver-method-region-get-enter-cost) **(** [RID](class_rid#class-rid) region **)** const | | [RID](class_rid#class-rid) | [region\_get\_map](#class-navigation2dserver-method-region-get-map) **(** [RID](class_rid#class-rid) region **)** const | | [int](class_int#class-int) | [region\_get\_navigation\_layers](#class-navigation2dserver-method-region-get-navigation-layers) **(** [RID](class_rid#class-rid) region **)** const | | [float](class_float#class-float) | [region\_get\_travel\_cost](#class-navigation2dserver-method-region-get-travel-cost) **(** [RID](class_rid#class-rid) region **)** const | | [bool](class_bool#class-bool) | [region\_owns\_point](#class-navigation2dserver-method-region-owns-point) **(** [RID](class_rid#class-rid) region, [Vector2](class_vector2#class-vector2) point **)** const | | void | [region\_set\_enter\_cost](#class-navigation2dserver-method-region-set-enter-cost) **(** [RID](class_rid#class-rid) region, [float](class_float#class-float) enter\_cost **)** const | | void | [region\_set\_map](#class-navigation2dserver-method-region-set-map) **(** [RID](class_rid#class-rid) region, [RID](class_rid#class-rid) map **)** const | | void | [region\_set\_navigation\_layers](#class-navigation2dserver-method-region-set-navigation-layers) **(** [RID](class_rid#class-rid) region, [int](class_int#class-int) navigation\_layers **)** const | | void | [region\_set\_navpoly](#class-navigation2dserver-method-region-set-navpoly) **(** [RID](class_rid#class-rid) region, [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) nav\_poly **)** const | | void | [region\_set\_transform](#class-navigation2dserver-method-region-set-transform) **(** [RID](class_rid#class-rid) region, [Transform2D](class_transform2d#class-transform2d) transform **)** const | | void | [region\_set\_travel\_cost](#class-navigation2dserver-method-region-set-travel-cost) **(** [RID](class_rid#class-rid) region, [float](class_float#class-float) travel\_cost **)** const | Signals ------- ### map\_changed ( [RID](class_rid#class-rid) map ) Emitted when a navigation map is updated, when a region moves or is modified. Method Descriptions ------------------- ### [RID](class_rid#class-rid) agent\_create ( ) const Creates the agent. ### [RID](class_rid#class-rid) agent\_get\_map ( [RID](class_rid#class-rid) agent ) const Returns the navigation map [RID](class_rid#class-rid) the requested `agent` is currently assigned to. ### [bool](class_bool#class-bool) agent\_is\_map\_changed ( [RID](class_rid#class-rid) agent ) const Returns `true` if the map got changed the previous frame. ### void agent\_set\_callback ( [RID](class_rid#class-rid) agent, [Object](class_object#class-object) receiver, [String](class_string#class-string) method, [Variant](class_variant#class-variant) userdata=null ) const Callback called at the end of the RVO process. If a callback is created manually and the agent is placed on a navigation map it will calculate avoidance for the agent and dispatch the calculated `safe_velocity` to the `receiver` object with a signal to the chosen `method` name. **Note:** Created callbacks are always processed independently of the SceneTree state as long as the agent is on a navigation map and not freed. To disable the dispatch of a callback from an agent use [agent\_set\_callback](#class-navigation2dserver-method-agent-set-callback) again with a `null` object as the `receiver`. ### void agent\_set\_map ( [RID](class_rid#class-rid) agent, [RID](class_rid#class-rid) map ) const Puts the agent in the map. ### void agent\_set\_max\_neighbors ( [RID](class_rid#class-rid) agent, [int](class_int#class-int) count ) const Sets the maximum number of other agents the agent takes into account in the navigation. The larger this number, the longer the running time of the simulation. If the number is too low, the simulation will not be safe. ### void agent\_set\_max\_speed ( [RID](class_rid#class-rid) agent, [float](class_float#class-float) max\_speed ) const Sets the maximum speed of the agent. Must be positive. ### void agent\_set\_neighbor\_dist ( [RID](class_rid#class-rid) agent, [float](class_float#class-float) dist ) const Sets the maximum distance to other agents this agent takes into account in the navigation. The larger this number, the longer the running time of the simulation. If the number is too low, the simulation will not be safe. ### void agent\_set\_position ( [RID](class_rid#class-rid) agent, [Vector2](class_vector2#class-vector2) position ) const Sets the position of the agent in world space. ### void agent\_set\_radius ( [RID](class_rid#class-rid) agent, [float](class_float#class-float) radius ) const Sets the radius of the agent. ### void agent\_set\_target\_velocity ( [RID](class_rid#class-rid) agent, [Vector2](class_vector2#class-vector2) target\_velocity ) const Sets the new target velocity. ### void agent\_set\_time\_horizon ( [RID](class_rid#class-rid) agent, [float](class_float#class-float) time ) const The minimal amount of time for which the agent's velocities that are computed by the simulation are safe with respect to other agents. The larger this number, the sooner this agent will respond to the presence of other agents, but the less freedom this agent has in choosing its velocities. Must be positive. ### void agent\_set\_velocity ( [RID](class_rid#class-rid) agent, [Vector2](class_vector2#class-vector2) velocity ) const Sets the current velocity of the agent. ### void free\_rid ( [RID](class_rid#class-rid) rid ) const Destroys the given RID. ### [Array](class_array#class-array) get\_maps ( ) const Returns all created navigation map [RID](class_rid#class-rid)s on the NavigationServer. This returns both 2D and 3D created navigation maps as there is technically no distinction between them. ### [RID](class_rid#class-rid) map\_create ( ) const Create a new map. ### void map\_force\_update ( [RID](class_rid#class-rid) map ) This function immediately forces synchronization of the specified navigation `map` [RID](class_rid#class-rid). By default navigation maps are only synchronized at the end of each physics frame. This function can be used to immediately (re)calculate all the navigation meshes and region connections of the navigation map. This makes it possible to query a navigation path for a changed map immediately and in the same frame (multiple times if needed). Due to technical restrictions the current NavigationServer command queue will be flushed. This means all already queued update commands for this physics frame will be executed, even those intended for other maps, regions and agents not part of the specified map. The expensive computation of the navigation meshes and region connections of a map will only be done for the specified map. Other maps will receive the normal synchronization at the end of the physics frame. Should the specified map receive changes after the forced update it will update again as well when the other maps receive their update. Avoidance processing and dispatch of the `safe_velocity` signals is untouched by this function and continues to happen for all maps and agents at the end of the physics frame. **Note:** With great power comes great responsibility. This function should only be used by users that really know what they are doing and have a good reason for it. Forcing an immediate update of a navigation map requires locking the NavigationServer and flushing the entire NavigationServer command queue. Not only can this severely impact the performance of a game but it can also introduce bugs if used inappropriately without much foresight. ### [Array](class_array#class-array) map\_get\_agents ( [RID](class_rid#class-rid) map ) const Returns all navigation agents [RID](class_rid#class-rid)s that are currently assigned to the requested navigation `map`. ### [float](class_float#class-float) map\_get\_cell\_height ( [RID](class_rid#class-rid) map ) const Returns the map cell height. **Note:** Currently not implemented. ### [float](class_float#class-float) map\_get\_cell\_size ( [RID](class_rid#class-rid) map ) const Returns the map cell size. ### [Vector2](class_vector2#class-vector2) map\_get\_closest\_point ( [RID](class_rid#class-rid) map, [Vector2](class_vector2#class-vector2) to\_point ) const Returns the point closest to the provided `to_point` on the navigation mesh surface. ### [RID](class_rid#class-rid) map\_get\_closest\_point\_owner ( [RID](class_rid#class-rid) map, [Vector2](class_vector2#class-vector2) to\_point ) const Returns the owner region RID for the point returned by [map\_get\_closest\_point](#class-navigation2dserver-method-map-get-closest-point). ### [float](class_float#class-float) map\_get\_edge\_connection\_margin ( [RID](class_rid#class-rid) map ) const Returns the edge connection margin of the map. The edge connection margin is a distance used to connect two regions. ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) map\_get\_path ( [RID](class_rid#class-rid) map, [Vector2](class_vector2#class-vector2) origin, [Vector2](class_vector2#class-vector2) destination, [bool](class_bool#class-bool) optimize, [int](class_int#class-int) navigation\_layers=1 ) const Returns the navigation path to reach the destination from the origin. `navigation_layers` is a bitmask of all region layers that are allowed to be in the path. ### [Array](class_array#class-array) map\_get\_regions ( [RID](class_rid#class-rid) map ) const Returns all navigation regions [RID](class_rid#class-rid)s that are currently assigned to the requested navigation `map`. ### [bool](class_bool#class-bool) map\_is\_active ( [RID](class_rid#class-rid) map ) const Returns `true` if the map is active. ### void map\_set\_active ( [RID](class_rid#class-rid) map, [bool](class_bool#class-bool) active ) const Sets the map active. ### void map\_set\_cell\_height ( [RID](class_rid#class-rid) map, [float](class_float#class-float) cell\_height ) const Set the map cell height used to weld the navigation mesh polygons. **Note:** Currently not implemented. ### void map\_set\_cell\_size ( [RID](class_rid#class-rid) map, [float](class_float#class-float) cell\_size ) const Set the map cell size used to weld the navigation mesh polygons. ### void map\_set\_edge\_connection\_margin ( [RID](class_rid#class-rid) map, [float](class_float#class-float) margin ) const Set the map edge connection margin used to weld the compatible region edges. ### [RID](class_rid#class-rid) region\_create ( ) const Creates a new region. ### [Vector2](class_vector2#class-vector2) region\_get\_connection\_pathway\_end ( [RID](class_rid#class-rid) region, [int](class_int#class-int) connection ) const Returns the ending point of a connection door. `connection` is an index between 0 and the return value of [region\_get\_connections\_count](#class-navigation2dserver-method-region-get-connections-count). ### [Vector2](class_vector2#class-vector2) region\_get\_connection\_pathway\_start ( [RID](class_rid#class-rid) region, [int](class_int#class-int) connection ) const Returns the starting point of a connection door. `connection` is an index between 0 and the return value of [region\_get\_connections\_count](#class-navigation2dserver-method-region-get-connections-count). ### [int](class_int#class-int) region\_get\_connections\_count ( [RID](class_rid#class-rid) region ) const Returns how many connections this `region` has with other regions in the map. ### [float](class_float#class-float) region\_get\_enter\_cost ( [RID](class_rid#class-rid) region ) const Returns the `enter_cost` of this `region`. ### [RID](class_rid#class-rid) region\_get\_map ( [RID](class_rid#class-rid) region ) const Returns the navigation map [RID](class_rid#class-rid) the requested `region` is currently assigned to. ### [int](class_int#class-int) region\_get\_navigation\_layers ( [RID](class_rid#class-rid) region ) const Returns the region's navigation layers. ### [float](class_float#class-float) region\_get\_travel\_cost ( [RID](class_rid#class-rid) region ) const Returns the `travel_cost` of this `region`. ### [bool](class_bool#class-bool) region\_owns\_point ( [RID](class_rid#class-rid) region, [Vector2](class_vector2#class-vector2) point ) const Returns `true` if the provided `point` in world space is currently owned by the provided navigation `region`. Owned in this context means that one of the region's navigation mesh polygon faces has a possible position at the closest distance to this point compared to all other navigation meshes from other navigation regions that are also registered on the navigation map of the provided region. If multiple navigation meshes have positions at equal distance the navigation region whose polygons are processed first wins the ownership. Polygons are processed in the same order that navigation regions were registered on the NavigationServer. **Note:** If navigation meshes from different navigation regions overlap (which should be avoided in general) the result might not be what is expected. ### void region\_set\_enter\_cost ( [RID](class_rid#class-rid) region, [float](class_float#class-float) enter\_cost ) const Sets the `enter_cost` for this `region`. ### void region\_set\_map ( [RID](class_rid#class-rid) region, [RID](class_rid#class-rid) map ) const Sets the map for the region. ### void region\_set\_navigation\_layers ( [RID](class_rid#class-rid) region, [int](class_int#class-int) navigation\_layers ) const Set the region's navigation layers. This allows selecting regions from a path request (when using [map\_get\_path](#class-navigation2dserver-method-map-get-path)). ### void region\_set\_navpoly ( [RID](class_rid#class-rid) region, [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) nav\_poly ) const Sets the navigation mesh for the region. ### void region\_set\_transform ( [RID](class_rid#class-rid) region, [Transform2D](class_transform2d#class-transform2d) transform ) const Sets the global transformation for the region. ### void region\_set\_travel\_cost ( [RID](class_rid#class-rid) region, [float](class_float#class-float) travel\_cost ) const Sets the `travel_cost` for this `region`.
programming_docs
godot VSeparator VSeparator ========== **Inherits:** [Separator](class_separator#class-separator) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Vertical version of [Separator](class_separator#class-separator). Description ----------- Vertical version of [Separator](class_separator#class-separator). Even though it looks vertical, it is used to separate objects horizontally. Theme Properties ---------------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [separation](#class-vseparator-theme-constant-separation) | `4` | | [StyleBox](class_stylebox#class-stylebox) | [separator](#class-vseparator-theme-style-separator) | | Theme Property Descriptions --------------------------- ### [int](class_int#class-int) separation | | | | --- | --- | | *Default* | `4` | The width of the area covered by the separator. Effectively works like a minimum width. ### [StyleBox](class_stylebox#class-stylebox) separator The style for the separator line. Works best with [StyleBoxLine](class_styleboxline#class-styleboxline) (remember to enable [StyleBoxLine.vertical](class_styleboxline#class-styleboxline-property-vertical)). godot Quat Quat ==== Quaternion. Description ----------- A unit quaternion used for representing 3D rotations. Quaternions need to be normalized to be used for rotation. It is similar to Basis, which implements matrix representation of rotations, and can be parametrized using both an axis-angle pair or Euler angles. Basis stores rotation, scale, and shearing, while Quat only stores rotation. Due to its compactness and the way it is stored in memory, certain operations (obtaining axis-angle and performing SLERP, in particular) are more efficient and robust against floating-point errors. Tutorials --------- * [Using 3D transforms](https://docs.godotengine.org/en/3.5/tutorials/3d/using_transforms.html#interpolating-with-quaternions) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [w](#class-quat-property-w) | `1.0` | | [float](class_float#class-float) | [x](#class-quat-property-x) | `0.0` | | [float](class_float#class-float) | [y](#class-quat-property-y) | `0.0` | | [float](class_float#class-float) | [z](#class-quat-property-z) | `0.0` | Methods ------- | | | | --- | --- | | [Quat](#class-quat) | [Quat](#class-quat-method-quat) **(** [Basis](class_basis#class-basis) from **)** | | [Quat](#class-quat) | [Quat](#class-quat-method-quat) **(** [Vector3](class_vector3#class-vector3) euler **)** | | [Quat](#class-quat) | [Quat](#class-quat-method-quat) **(** [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle **)** | | [Quat](#class-quat) | [Quat](#class-quat-method-quat) **(** [float](class_float#class-float) x, [float](class_float#class-float) y, [float](class_float#class-float) z, [float](class_float#class-float) w **)** | | [float](class_float#class-float) | [angle\_to](#class-quat-method-angle-to) **(** [Quat](#class-quat) to **)** | | [Quat](#class-quat) | [cubic\_slerp](#class-quat-method-cubic-slerp) **(** [Quat](#class-quat) b, [Quat](#class-quat) pre\_a, [Quat](#class-quat) post\_b, [float](class_float#class-float) weight **)** | | [float](class_float#class-float) | [dot](#class-quat-method-dot) **(** [Quat](#class-quat) b **)** | | [Vector3](class_vector3#class-vector3) | [get\_euler](#class-quat-method-get-euler) **(** **)** | | [Quat](#class-quat) | [inverse](#class-quat-method-inverse) **(** **)** | | [bool](class_bool#class-bool) | [is\_equal\_approx](#class-quat-method-is-equal-approx) **(** [Quat](#class-quat) quat **)** | | [bool](class_bool#class-bool) | [is\_normalized](#class-quat-method-is-normalized) **(** **)** | | [float](class_float#class-float) | [length](#class-quat-method-length) **(** **)** | | [float](class_float#class-float) | [length\_squared](#class-quat-method-length-squared) **(** **)** | | [Quat](#class-quat) | [normalized](#class-quat-method-normalized) **(** **)** | | void | [set\_axis\_angle](#class-quat-method-set-axis-angle) **(** [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle **)** | | void | [set\_euler](#class-quat-method-set-euler) **(** [Vector3](class_vector3#class-vector3) euler **)** | | [Quat](#class-quat) | [slerp](#class-quat-method-slerp) **(** [Quat](#class-quat) to, [float](class_float#class-float) weight **)** | | [Quat](#class-quat) | [slerpni](#class-quat-method-slerpni) **(** [Quat](#class-quat) to, [float](class_float#class-float) weight **)** | | [Vector3](class_vector3#class-vector3) | [xform](#class-quat-method-xform) **(** [Vector3](class_vector3#class-vector3) v **)** | Constants --------- ### IDENTITY = Quat( 0, 0, 0, 1 ) --- The identity quaternion, representing no rotation. Equivalent to an identity [Basis](class_basis#class-basis) matrix. If a vector is transformed by an identity quaternion, it will not change. Property Descriptions --------------------- ### [float](class_float#class-float) w | | | | --- | --- | | *Default* | `1.0` | W component of the quaternion (real part). Quaternion components should usually not be manipulated directly. ### [float](class_float#class-float) x | | | | --- | --- | | *Default* | `0.0` | X component of the quaternion (imaginary `i` axis part). Quaternion components should usually not be manipulated directly. ### [float](class_float#class-float) y | | | | --- | --- | | *Default* | `0.0` | Y component of the quaternion (imaginary `j` axis part). Quaternion components should usually not be manipulated directly. ### [float](class_float#class-float) z | | | | --- | --- | | *Default* | `0.0` | Z component of the quaternion (imaginary `k` axis part). Quaternion components should usually not be manipulated directly. Method Descriptions ------------------- ### [Quat](#class-quat) Quat ( [Basis](class_basis#class-basis) from ) Constructs a quaternion from the given [Basis](class_basis#class-basis). * [Quat](#class-quat) **Quat** **(** [Vector3](class_vector3#class-vector3) euler **)** Constructs a quaternion that will perform a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle). * [Quat](#class-quat) **Quat** **(** [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle **)** Constructs a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector. * [Quat](#class-quat) **Quat** **(** [float](class_float#class-float) x, [float](class_float#class-float) y, [float](class_float#class-float) z, [float](class_float#class-float) w **)** Constructs a quaternion defined by the given values. ### [float](class_float#class-float) angle\_to ( [Quat](#class-quat) to ) Returns the angle between this quaternion and `to`. This is the magnitude of the angle you would need to rotate by to get from one to the other. **Note:** This method has an abnormally high amount of floating-point error, so methods such as [@GDScript.is\_zero\_approx](class_%40gdscript#class-gdscript-method-is-zero-approx) will not work reliably. ### [Quat](#class-quat) cubic\_slerp ( [Quat](#class-quat) b, [Quat](#class-quat) pre\_a, [Quat](#class-quat) post\_b, [float](class_float#class-float) weight ) Performs a cubic spherical interpolation between quaternions `pre_a`, this vector, `b`, and `post_b`, by the given amount `weight`. ### [float](class_float#class-float) dot ( [Quat](#class-quat) b ) Returns the dot product of two quaternions. ### [Vector3](class_vector3#class-vector3) get\_euler ( ) Returns Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last) corresponding to the rotation represented by the unit quaternion. Returned vector contains the rotation angles in the format (X angle, Y angle, Z angle). ### [Quat](#class-quat) inverse ( ) Returns the inverse of the quaternion. ### [bool](class_bool#class-bool) is\_equal\_approx ( [Quat](#class-quat) quat ) Returns `true` if this quaternion and `quat` are approximately equal, by running [@GDScript.is\_equal\_approx](class_%40gdscript#class-gdscript-method-is-equal-approx) on each component. ### [bool](class_bool#class-bool) is\_normalized ( ) Returns whether the quaternion is normalized or not. ### [float](class_float#class-float) length ( ) Returns the length of the quaternion. ### [float](class_float#class-float) length\_squared ( ) Returns the length of the quaternion, squared. ### [Quat](#class-quat) normalized ( ) Returns a copy of the quaternion, normalized to unit length. ### void set\_axis\_angle ( [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle ) Sets the quaternion to a rotation which rotates around axis by the specified angle, in radians. The axis must be a normalized vector. ### void set\_euler ( [Vector3](class_vector3#class-vector3) euler ) Sets the quaternion to a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle). ### [Quat](#class-quat) slerp ( [Quat](#class-quat) to, [float](class_float#class-float) weight ) Returns the result of the spherical linear interpolation between this quaternion and `to` by amount `weight`. **Note:** Both quaternions must be normalized. ### [Quat](#class-quat) slerpni ( [Quat](#class-quat) to, [float](class_float#class-float) weight ) Returns the result of the spherical linear interpolation between this quaternion and `to` by amount `weight`, but without checking if the rotation path is not bigger than 90 degrees. ### [Vector3](class_vector3#class-vector3) xform ( [Vector3](class_vector3#class-vector3) v ) Returns a vector transformed (multiplied) by this quaternion. godot InputEventAction InputEventAction ================ **Inherits:** [InputEvent](class_inputevent#class-inputevent) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Input event type for actions. Description ----------- Contains a generic action which can be targeted from several types of inputs. Actions can be created from the **Input Map** tab in the **Project > Project Settings** menu. See [Node.\_input](class_node#class-node-method-input). Tutorials --------- * [InputEvent: Actions](https://docs.godotengine.org/en/3.5/tutorials/inputs/inputevent.html#actions) * [2D Dodge The Creeps Demo](https://godotengine.org/asset-library/asset/515) * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [action](#class-inputeventaction-property-action) | `""` | | [bool](class_bool#class-bool) | [pressed](#class-inputeventaction-property-pressed) | `false` | | [float](class_float#class-float) | [strength](#class-inputeventaction-property-strength) | `1.0` | Property Descriptions --------------------- ### [String](class_string#class-string) action | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_action(value) | | *Getter* | get\_action() | The action's name. Actions are accessed via this [String](class_string#class-string). ### [bool](class_bool#class-bool) pressed | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_pressed(value) | | *Getter* | is\_pressed() | If `true`, the action's state is pressed. If `false`, the action's state is released. ### [float](class_float#class-float) strength | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_strength(value) | | *Getter* | get\_strength() | The action's strength between 0 and 1. This value is considered as equal to 0 if pressed is `false`. The event strength allows faking analog joypad motion events, by specifying how strongly the joypad axis is bent or pressed. godot HSlider HSlider ======= **Inherits:** [Slider](class_slider#class-slider) **<** [Range](class_range#class-range) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Horizontal slider. Description ----------- Horizontal slider. See [Slider](class_slider#class-slider). This one goes from left (min) to right (max). **Note:** The [Range.changed](class_range#class-range-signal-changed) and [Range.value\_changed](class_range#class-range-signal-value-changed) signals are part of the [Range](class_range#class-range) class which this class inherits from. Theme Properties ---------------- | | | | --- | --- | | [Texture](class_texture#class-texture) | [grabber](#class-hslider-theme-icon-grabber) | | [Texture](class_texture#class-texture) | [grabber\_disabled](#class-hslider-theme-icon-grabber-disabled) | | [Texture](class_texture#class-texture) | [grabber\_highlight](#class-hslider-theme-icon-grabber-highlight) | | [Texture](class_texture#class-texture) | [tick](#class-hslider-theme-icon-tick) | | [StyleBox](class_stylebox#class-stylebox) | [grabber\_area](#class-hslider-theme-style-grabber-area) | | [StyleBox](class_stylebox#class-stylebox) | [grabber\_area\_highlight](#class-hslider-theme-style-grabber-area-highlight) | | [StyleBox](class_stylebox#class-stylebox) | [slider](#class-hslider-theme-style-slider) | Theme Property Descriptions --------------------------- ### [Texture](class_texture#class-texture) grabber The texture for the grabber (the draggable element). ### [Texture](class_texture#class-texture) grabber\_disabled The texture for the grabber when it's disabled. ### [Texture](class_texture#class-texture) grabber\_highlight The texture for the grabber when it's focused. ### [Texture](class_texture#class-texture) tick The texture for the ticks, visible when [Slider.tick\_count](class_slider#class-slider-property-tick-count) is greater than 0. ### [StyleBox](class_stylebox#class-stylebox) grabber\_area The background of the area to the left of the grabber. ### [StyleBox](class_stylebox#class-stylebox) grabber\_area\_highlight ### [StyleBox](class_stylebox#class-stylebox) slider The background for the whole slider. Determines the height of the `grabber_area`. godot CollisionShape2D CollisionShape2D ================ **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Node that represents collision shape data in 2D space. Description ----------- Editor facility for creating and editing collision shapes in 2D space. Set the [shape](#class-collisionshape2d-property-shape) property to configure the shape. **IMPORTANT**: this is an Editor-only helper to create shapes, use [CollisionObject2D.shape\_owner\_get\_shape](class_collisionobject2d#class-collisionobject2d-method-shape-owner-get-shape) to get the actual shape. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area2D](class_area2d#class-area2d) to give it a detection shape, or add it to a [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) to create a solid object. Tutorials --------- * [Physics introduction](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html) * [2D Dodge The Creeps Demo](https://godotengine.org/asset-library/asset/515) * [2D Pong Demo](https://godotengine.org/asset-library/asset/121) * [2D Kinematic Character Demo](https://godotengine.org/asset-library/asset/113) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [disabled](#class-collisionshape2d-property-disabled) | `false` | | [bool](class_bool#class-bool) | [one\_way\_collision](#class-collisionshape2d-property-one-way-collision) | `false` | | [float](class_float#class-float) | [one\_way\_collision\_margin](#class-collisionshape2d-property-one-way-collision-margin) | `1.0` | | [Shape2D](class_shape2d#class-shape2d) | [shape](#class-collisionshape2d-property-shape) | | Property Descriptions --------------------- ### [bool](class_bool#class-bool) disabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_disabled(value) | | *Getter* | is\_disabled() | A disabled collision shape has no effect in the world. This property should be changed with [Object.set\_deferred](class_object#class-object-method-set-deferred). ### [bool](class_bool#class-bool) one\_way\_collision | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_one\_way\_collision(value) | | *Getter* | is\_one\_way\_collision\_enabled() | Sets whether this collision shape should only detect collision on one side (top or bottom). **Note:** This property has no effect if this `CollisionShape2D` is a child of an [Area2D](class_area2d#class-area2d) node. ### [float](class_float#class-float) one\_way\_collision\_margin | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_one\_way\_collision\_margin(value) | | *Getter* | get\_one\_way\_collision\_margin() | The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the shape at a high velocity. ### [Shape2D](class_shape2d#class-shape2d) shape | | | | --- | --- | | *Setter* | set\_shape(value) | | *Getter* | get\_shape() | The actual shape owned by this collision shape. godot NoiseTexture NoiseTexture ============ **Inherits:** [Texture](class_texture#class-texture) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) [OpenSimplexNoise](class_opensimplexnoise#class-opensimplexnoise) filled texture. Description ----------- Uses an [OpenSimplexNoise](class_opensimplexnoise#class-opensimplexnoise) to fill the texture data. You can specify the texture size but keep in mind that larger textures will take longer to generate and seamless noise only works with square sized textures. NoiseTexture can also generate normalmap textures. The class uses [Thread](class_thread#class-thread)s to generate the texture data internally, so [Texture.get\_data](class_texture#class-texture-method-get-data) may return `null` if the generation process has not completed yet. In that case, you need to wait for the texture to be generated before accessing the data: ``` var texture = preload("res://noise.tres") yield(texture, "changed") var image = texture.get_data() ``` Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [as\_normalmap](#class-noisetexture-property-as-normalmap) | `false` | | [float](class_float#class-float) | [bump\_strength](#class-noisetexture-property-bump-strength) | `8.0` | | [int](class_int#class-int) | flags | `7` (overrides [Texture](class_texture#class-texture-property-flags)) | | [int](class_int#class-int) | [height](#class-noisetexture-property-height) | `512` | | [OpenSimplexNoise](class_opensimplexnoise#class-opensimplexnoise) | [noise](#class-noisetexture-property-noise) | | | [Vector2](class_vector2#class-vector2) | [noise\_offset](#class-noisetexture-property-noise-offset) | `Vector2( 0, 0 )` | | [bool](class_bool#class-bool) | [seamless](#class-noisetexture-property-seamless) | `false` | | [int](class_int#class-int) | [width](#class-noisetexture-property-width) | `512` | Property Descriptions --------------------- ### [bool](class_bool#class-bool) as\_normalmap | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_as\_normalmap(value) | | *Getter* | is\_normalmap() | If `true`, the resulting texture contains a normal map created from the original noise interpreted as a bump map. ### [float](class_float#class-float) bump\_strength | | | | --- | --- | | *Default* | `8.0` | | *Setter* | set\_bump\_strength(value) | | *Getter* | get\_bump\_strength() | Strength of the bump maps used in this texture. A higher value will make the bump maps appear larger while a lower value will make them appear softer. ### [int](class_int#class-int) height | | | | --- | --- | | *Default* | `512` | | *Setter* | set\_height(value) | | *Getter* | get\_height() | Height of the generated texture. ### [OpenSimplexNoise](class_opensimplexnoise#class-opensimplexnoise) noise | | | | --- | --- | | *Setter* | set\_noise(value) | | *Getter* | get\_noise() | The [OpenSimplexNoise](class_opensimplexnoise#class-opensimplexnoise) instance used to generate the noise. ### [Vector2](class_vector2#class-vector2) noise\_offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_noise\_offset(value) | | *Getter* | get\_noise\_offset() | An offset used to specify the noise space coordinate of the top left corner of the generated noise. This value is ignored if [seamless](#class-noisetexture-property-seamless) is enabled. ### [bool](class_bool#class-bool) seamless | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_seamless(value) | | *Getter* | get\_seamless() | Whether the texture can be tiled without visible seams or not. Seamless textures take longer to generate. **Note:** Seamless noise has a lower contrast compared to non-seamless noise. This is due to the way noise uses higher dimensions for generating seamless noise. ### [int](class_int#class-int) width | | | | --- | --- | | *Default* | `512` | | *Setter* | set\_width(value) | | *Getter* | get\_width() | Width of the generated texture.
programming_docs
godot AnimationNodeTimeScale AnimationNodeTimeScale ====================== **Inherits:** [AnimationNode](class_animationnode#class-animationnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A time-scaling animation node to be used with [AnimationTree](class_animationtree#class-animationtree). Description ----------- Allows scaling the speed of the animation (or reversing it) in any children nodes. Setting it to 0 will pause the animation. Tutorials --------- * [AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html) * [3D Platformer Demo](https://godotengine.org/asset-library/asset/125) godot XMLParser XMLParser ========= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Low-level class for creating parsers for [XML](https://en.wikipedia.org/wiki/XML) files. Description ----------- This class can serve as base to make custom XML parsers. Since XML is a very flexible standard, this interface is low-level so it can be applied to any possible schema. Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [get\_attribute\_count](#class-xmlparser-method-get-attribute-count) **(** **)** const | | [String](class_string#class-string) | [get\_attribute\_name](#class-xmlparser-method-get-attribute-name) **(** [int](class_int#class-int) idx **)** const | | [String](class_string#class-string) | [get\_attribute\_value](#class-xmlparser-method-get-attribute-value) **(** [int](class_int#class-int) idx **)** const | | [int](class_int#class-int) | [get\_current\_line](#class-xmlparser-method-get-current-line) **(** **)** const | | [String](class_string#class-string) | [get\_named\_attribute\_value](#class-xmlparser-method-get-named-attribute-value) **(** [String](class_string#class-string) name **)** const | | [String](class_string#class-string) | [get\_named\_attribute\_value\_safe](#class-xmlparser-method-get-named-attribute-value-safe) **(** [String](class_string#class-string) name **)** const | | [String](class_string#class-string) | [get\_node\_data](#class-xmlparser-method-get-node-data) **(** **)** const | | [String](class_string#class-string) | [get\_node\_name](#class-xmlparser-method-get-node-name) **(** **)** const | | [int](class_int#class-int) | [get\_node\_offset](#class-xmlparser-method-get-node-offset) **(** **)** const | | [NodeType](#enum-xmlparser-nodetype) | [get\_node\_type](#class-xmlparser-method-get-node-type) **(** **)** | | [bool](class_bool#class-bool) | [has\_attribute](#class-xmlparser-method-has-attribute) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [is\_empty](#class-xmlparser-method-is-empty) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [open](#class-xmlparser-method-open) **(** [String](class_string#class-string) file **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [open\_buffer](#class-xmlparser-method-open-buffer) **(** [PoolByteArray](class_poolbytearray#class-poolbytearray) buffer **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [read](#class-xmlparser-method-read) **(** **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [seek](#class-xmlparser-method-seek) **(** [int](class_int#class-int) position **)** | | void | [skip\_section](#class-xmlparser-method-skip-section) **(** **)** | Enumerations ------------ enum **NodeType**: * **NODE\_NONE** = **0** --- There's no node (no file or buffer opened). * **NODE\_ELEMENT** = **1** --- Element (tag). * **NODE\_ELEMENT\_END** = **2** --- End of element. * **NODE\_TEXT** = **3** --- Text node. * **NODE\_COMMENT** = **4** --- Comment node. * **NODE\_CDATA** = **5** --- CDATA content. * **NODE\_UNKNOWN** = **6** --- Unknown node. Method Descriptions ------------------- ### [int](class_int#class-int) get\_attribute\_count ( ) const Gets the amount of attributes in the current element. ### [String](class_string#class-string) get\_attribute\_name ( [int](class_int#class-int) idx ) const Gets the name of the attribute specified by the index in `idx` argument. ### [String](class_string#class-string) get\_attribute\_value ( [int](class_int#class-int) idx ) const Gets the value of the attribute specified by the index in `idx` argument. ### [int](class_int#class-int) get\_current\_line ( ) const Gets the current line in the parsed file (currently not implemented). ### [String](class_string#class-string) get\_named\_attribute\_value ( [String](class_string#class-string) name ) const Gets the value of a certain attribute of the current element by name. This will raise an error if the element has no such attribute. ### [String](class_string#class-string) get\_named\_attribute\_value\_safe ( [String](class_string#class-string) name ) const Gets the value of a certain attribute of the current element by name. This will return an empty [String](class_string#class-string) if the attribute is not found. ### [String](class_string#class-string) get\_node\_data ( ) const Gets the contents of a text node. This will raise an error in any other type of node. ### [String](class_string#class-string) get\_node\_name ( ) const Gets the name of the current element node. This will raise an error if the current node type is neither [NODE\_ELEMENT](#class-xmlparser-constant-node-element) nor [NODE\_ELEMENT\_END](#class-xmlparser-constant-node-element-end). ### [int](class_int#class-int) get\_node\_offset ( ) const Gets the byte offset of the current node since the beginning of the file or buffer. ### [NodeType](#enum-xmlparser-nodetype) get\_node\_type ( ) Gets the type of the current node. Compare with [NodeType](#enum-xmlparser-nodetype) constants. ### [bool](class_bool#class-bool) has\_attribute ( [String](class_string#class-string) name ) const Check whether the current element has a certain attribute. ### [bool](class_bool#class-bool) is\_empty ( ) const Check whether the current element is empty (this only works for completely empty tags, e.g. `<element \>`). ### [Error](class_%40globalscope#enum-globalscope-error) open ( [String](class_string#class-string) file ) Opens an XML file for parsing. This returns an error code. ### [Error](class_%40globalscope#enum-globalscope-error) open\_buffer ( [PoolByteArray](class_poolbytearray#class-poolbytearray) buffer ) Opens an XML raw buffer for parsing. This returns an error code. ### [Error](class_%40globalscope#enum-globalscope-error) read ( ) Reads the next node of the file. This returns an error code. ### [Error](class_%40globalscope#enum-globalscope-error) seek ( [int](class_int#class-int) position ) Moves the buffer cursor to a certain offset (since the beginning) and read the next node there. This returns an error code. ### void skip\_section ( ) Skips the current section. If the node contains other elements, they will be ignored and the cursor will go to the closing of the current element. godot CheckButton CheckButton =========== **Inherits:** [Button](class_button#class-button) **<** [BaseButton](class_basebutton#class-basebutton) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Checkable button. See also [CheckBox](class_checkbox#class-checkbox). Description ----------- CheckButton is a toggle button displayed as a check field. It's similar to [CheckBox](class_checkbox#class-checkbox) in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an **immediate** effect on something. For instance, it should be used if toggling it enables/disables a setting without requiring the user to press a confirmation button. See also [BaseButton](class_basebutton#class-basebutton) which contains common properties and methods associated with this node. Properties ---------- | | | | | --- | --- | --- | | [TextAlign](class_button#enum-button-textalign) | align | `0` (overrides [Button](class_button#class-button-property-align)) | | [bool](class_bool#class-bool) | toggle\_mode | `true` (overrides [BaseButton](class_basebutton#class-basebutton-property-toggle-mode)) | Theme Properties ---------------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [font\_color](#class-checkbutton-theme-color-font-color) | `Color( 0.88, 0.88, 0.88, 1 )` | | [Color](class_color#class-color) | [font\_color\_disabled](#class-checkbutton-theme-color-font-color-disabled) | `Color( 0.9, 0.9, 0.9, 0.2 )` | | [Color](class_color#class-color) | [font\_color\_focus](#class-checkbutton-theme-color-font-color-focus) | `Color( 0.94, 0.94, 0.94, 1 )` | | [Color](class_color#class-color) | [font\_color\_hover](#class-checkbutton-theme-color-font-color-hover) | `Color( 0.94, 0.94, 0.94, 1 )` | | [Color](class_color#class-color) | [font\_color\_hover\_pressed](#class-checkbutton-theme-color-font-color-hover-pressed) | `Color( 1, 1, 1, 1 )` | | [Color](class_color#class-color) | [font\_color\_pressed](#class-checkbutton-theme-color-font-color-pressed) | `Color( 1, 1, 1, 1 )` | | [int](class_int#class-int) | [check\_vadjust](#class-checkbutton-theme-constant-check-vadjust) | `0` | | [int](class_int#class-int) | [hseparation](#class-checkbutton-theme-constant-hseparation) | `4` | | [Font](class_font#class-font) | [font](#class-checkbutton-theme-font-font) | | | [Texture](class_texture#class-texture) | [off](#class-checkbutton-theme-icon-off) | | | [Texture](class_texture#class-texture) | [off\_disabled](#class-checkbutton-theme-icon-off-disabled) | | | [Texture](class_texture#class-texture) | [on](#class-checkbutton-theme-icon-on) | | | [Texture](class_texture#class-texture) | [on\_disabled](#class-checkbutton-theme-icon-on-disabled) | | | [StyleBox](class_stylebox#class-stylebox) | [disabled](#class-checkbutton-theme-style-disabled) | | | [StyleBox](class_stylebox#class-stylebox) | [focus](#class-checkbutton-theme-style-focus) | | | [StyleBox](class_stylebox#class-stylebox) | [hover](#class-checkbutton-theme-style-hover) | | | [StyleBox](class_stylebox#class-stylebox) | [hover\_pressed](#class-checkbutton-theme-style-hover-pressed) | | | [StyleBox](class_stylebox#class-stylebox) | [normal](#class-checkbutton-theme-style-normal) | | | [StyleBox](class_stylebox#class-stylebox) | [pressed](#class-checkbutton-theme-style-pressed) | | Theme Property Descriptions --------------------------- ### [Color](class_color#class-color) font\_color | | | | --- | --- | | *Default* | `Color( 0.88, 0.88, 0.88, 1 )` | The `CheckButton` text's font color. ### [Color](class_color#class-color) font\_color\_disabled | | | | --- | --- | | *Default* | `Color( 0.9, 0.9, 0.9, 0.2 )` | The `CheckButton` text's font color when it's disabled. ### [Color](class_color#class-color) font\_color\_focus | | | | --- | --- | | *Default* | `Color( 0.94, 0.94, 0.94, 1 )` | The `CheckButton` text's font color when it's focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color. ### [Color](class_color#class-color) font\_color\_hover | | | | --- | --- | | *Default* | `Color( 0.94, 0.94, 0.94, 1 )` | The `CheckButton` text's font color when it's hovered. ### [Color](class_color#class-color) font\_color\_hover\_pressed | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | The `CheckButton` text's font color when it's hovered and pressed. ### [Color](class_color#class-color) font\_color\_pressed | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | The `CheckButton` text's font color when it's pressed. ### [int](class_int#class-int) check\_vadjust | | | | --- | --- | | *Default* | `0` | The vertical offset used when rendering the toggle icons (in pixels). ### [int](class_int#class-int) hseparation | | | | --- | --- | | *Default* | `4` | The separation between the toggle icon and the text (in pixels). ### [Font](class_font#class-font) font The [Font](class_font#class-font) to use for the `CheckButton` text. ### [Texture](class_texture#class-texture) off The icon to display when the `CheckButton` is unchecked. ### [Texture](class_texture#class-texture) off\_disabled The icon to display when the `CheckButton` is unchecked and disabled. ### [Texture](class_texture#class-texture) on The icon to display when the `CheckButton` is checked. ### [Texture](class_texture#class-texture) on\_disabled The icon to display when the `CheckButton` is checked and disabled. ### [StyleBox](class_stylebox#class-stylebox) disabled The [StyleBox](class_stylebox#class-stylebox) to display as a background when the `CheckButton` is disabled. ### [StyleBox](class_stylebox#class-stylebox) focus The [StyleBox](class_stylebox#class-stylebox) to display as a background when the `CheckButton` is focused. ### [StyleBox](class_stylebox#class-stylebox) hover The [StyleBox](class_stylebox#class-stylebox) to display as a background when the `CheckButton` is hovered. ### [StyleBox](class_stylebox#class-stylebox) hover\_pressed The [StyleBox](class_stylebox#class-stylebox) to display as a background when the `CheckButton` is hovered and pressed. ### [StyleBox](class_stylebox#class-stylebox) normal The [StyleBox](class_stylebox#class-stylebox) to display as a background. ### [StyleBox](class_stylebox#class-stylebox) pressed The [StyleBox](class_stylebox#class-stylebox) to display as a background when the `CheckButton` is pressed. godot RigidBody RigidBody ========= **Inherits:** [PhysicsBody](class_physicsbody#class-physicsbody) **<** [CollisionObject](class_collisionobject#class-collisionobject) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [VehicleBody](class_vehiclebody#class-vehiclebody) Physics Body whose position is determined through physics simulation in 3D space. Description ----------- This is the node that implements full 3D physics. This means that you do not control a RigidBody directly. Instead, you can apply forces to it (gravity, impulses, etc.), and the physics simulation will calculate the resulting movement, collision, bouncing, rotating, etc. A RigidBody has 4 behavior [mode](#class-rigidbody-property-mode)s: Rigid, Static, Character, and Kinematic. **Note:** Don't change a RigidBody's position every frame or very often. Sporadic changes work fine, but physics runs at a different granularity (fixed Hz) than usual rendering (process callback) and maybe even in a separate thread, so changing this from a process loop may result in strange behavior. If you need to directly affect the body's state, use [\_integrate\_forces](#class-rigidbody-method-integrate-forces), which allows you to directly access the physics state. If you need to override the default physics behavior, you can write a custom force integration function. See [custom\_integrator](#class-rigidbody-property-custom-integrator). With Bullet physics (the default), the center of mass is the RigidBody3D center. With GodotPhysics, the center of mass is the average of the [CollisionShape](class_collisionshape#class-collisionshape) centers. Tutorials --------- * [Physics introduction](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html) * [3D Truck Town Demo](https://godotengine.org/asset-library/asset/524) * [3D Physics Tests Demo](https://godotengine.org/asset-library/asset/675) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [angular\_damp](#class-rigidbody-property-angular-damp) | `-1.0` | | [Vector3](class_vector3#class-vector3) | [angular\_velocity](#class-rigidbody-property-angular-velocity) | `Vector3( 0, 0, 0 )` | | [bool](class_bool#class-bool) | [axis\_lock\_angular\_x](#class-rigidbody-property-axis-lock-angular-x) | `false` | | [bool](class_bool#class-bool) | [axis\_lock\_angular\_y](#class-rigidbody-property-axis-lock-angular-y) | `false` | | [bool](class_bool#class-bool) | [axis\_lock\_angular\_z](#class-rigidbody-property-axis-lock-angular-z) | `false` | | [bool](class_bool#class-bool) | [axis\_lock\_linear\_x](#class-rigidbody-property-axis-lock-linear-x) | `false` | | [bool](class_bool#class-bool) | [axis\_lock\_linear\_y](#class-rigidbody-property-axis-lock-linear-y) | `false` | | [bool](class_bool#class-bool) | [axis\_lock\_linear\_z](#class-rigidbody-property-axis-lock-linear-z) | `false` | | [float](class_float#class-float) | [bounce](#class-rigidbody-property-bounce) | | | [bool](class_bool#class-bool) | [can\_sleep](#class-rigidbody-property-can-sleep) | `true` | | [bool](class_bool#class-bool) | [contact\_monitor](#class-rigidbody-property-contact-monitor) | `false` | | [int](class_int#class-int) | [contacts\_reported](#class-rigidbody-property-contacts-reported) | `0` | | [bool](class_bool#class-bool) | [continuous\_cd](#class-rigidbody-property-continuous-cd) | `false` | | [bool](class_bool#class-bool) | [custom\_integrator](#class-rigidbody-property-custom-integrator) | `false` | | [float](class_float#class-float) | [friction](#class-rigidbody-property-friction) | | | [float](class_float#class-float) | [gravity\_scale](#class-rigidbody-property-gravity-scale) | `1.0` | | [float](class_float#class-float) | [linear\_damp](#class-rigidbody-property-linear-damp) | `-1.0` | | [Vector3](class_vector3#class-vector3) | [linear\_velocity](#class-rigidbody-property-linear-velocity) | `Vector3( 0, 0, 0 )` | | [float](class_float#class-float) | [mass](#class-rigidbody-property-mass) | `1.0` | | [Mode](#enum-rigidbody-mode) | [mode](#class-rigidbody-property-mode) | `0` | | [PhysicsMaterial](class_physicsmaterial#class-physicsmaterial) | [physics\_material\_override](#class-rigidbody-property-physics-material-override) | | | [bool](class_bool#class-bool) | [sleeping](#class-rigidbody-property-sleeping) | `false` | | [float](class_float#class-float) | [weight](#class-rigidbody-property-weight) | `9.8` | Methods ------- | | | | --- | --- | | void | [\_integrate\_forces](#class-rigidbody-method-integrate-forces) **(** [PhysicsDirectBodyState](class_physicsdirectbodystate#class-physicsdirectbodystate) state **)** virtual | | void | [add\_central\_force](#class-rigidbody-method-add-central-force) **(** [Vector3](class_vector3#class-vector3) force **)** | | void | [add\_force](#class-rigidbody-method-add-force) **(** [Vector3](class_vector3#class-vector3) force, [Vector3](class_vector3#class-vector3) position **)** | | void | [add\_torque](#class-rigidbody-method-add-torque) **(** [Vector3](class_vector3#class-vector3) torque **)** | | void | [apply\_central\_impulse](#class-rigidbody-method-apply-central-impulse) **(** [Vector3](class_vector3#class-vector3) impulse **)** | | void | [apply\_impulse](#class-rigidbody-method-apply-impulse) **(** [Vector3](class_vector3#class-vector3) position, [Vector3](class_vector3#class-vector3) impulse **)** | | void | [apply\_torque\_impulse](#class-rigidbody-method-apply-torque-impulse) **(** [Vector3](class_vector3#class-vector3) impulse **)** | | [bool](class_bool#class-bool) | [get\_axis\_lock](#class-rigidbody-method-get-axis-lock) **(** [BodyAxis](class_physicsserver#enum-physicsserver-bodyaxis) axis **)** const | | [Array](class_array#class-array) | [get\_colliding\_bodies](#class-rigidbody-method-get-colliding-bodies) **(** **)** const | | [Basis](class_basis#class-basis) | [get\_inverse\_inertia\_tensor](#class-rigidbody-method-get-inverse-inertia-tensor) **(** **)** | | void | [set\_axis\_lock](#class-rigidbody-method-set-axis-lock) **(** [BodyAxis](class_physicsserver#enum-physicsserver-bodyaxis) axis, [bool](class_bool#class-bool) lock **)** | | void | [set\_axis\_velocity](#class-rigidbody-method-set-axis-velocity) **(** [Vector3](class_vector3#class-vector3) axis\_velocity **)** | Signals ------- ### body\_entered ( [Node](class_node#class-node) body ) Emitted when a collision with another [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap) occurs. Requires [contact\_monitor](#class-rigidbody-property-contact-monitor) to be set to `true` and [contacts\_reported](#class-rigidbody-property-contacts-reported) to be set high enough to detect all the collisions. [GridMap](class_gridmap#class-gridmap)s are detected if the [MeshLibrary](class_meshlibrary#class-meshlibrary) has Collision [Shape](class_shape#class-shape)s. `body` the [Node](class_node#class-node), if it exists in the tree, of the other [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap). ### body\_exited ( [Node](class_node#class-node) body ) Emitted when the collision with another [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap) ends. Requires [contact\_monitor](#class-rigidbody-property-contact-monitor) to be set to `true` and [contacts\_reported](#class-rigidbody-property-contacts-reported) to be set high enough to detect all the collisions. [GridMap](class_gridmap#class-gridmap)s are detected if the [MeshLibrary](class_meshlibrary#class-meshlibrary) has Collision [Shape](class_shape#class-shape)s. `body` the [Node](class_node#class-node), if it exists in the tree, of the other [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap). ### body\_shape\_entered ( [RID](class_rid#class-rid) body\_rid, [Node](class_node#class-node) body, [int](class_int#class-int) body\_shape\_index, [int](class_int#class-int) local\_shape\_index ) Emitted when one of this RigidBody's [Shape](class_shape#class-shape)s collides with another [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap)'s [Shape](class_shape#class-shape)s. Requires [contact\_monitor](#class-rigidbody-property-contact-monitor) to be set to `true` and [contacts\_reported](#class-rigidbody-property-contacts-reported) to be set high enough to detect all the collisions. [GridMap](class_gridmap#class-gridmap)s are detected if the [MeshLibrary](class_meshlibrary#class-meshlibrary) has Collision [Shape](class_shape#class-shape)s. `body_rid` the [RID](class_rid#class-rid) of the other [PhysicsBody](class_physicsbody#class-physicsbody) or [MeshLibrary](class_meshlibrary#class-meshlibrary)'s [CollisionObject](class_collisionobject#class-collisionobject) used by the [PhysicsServer](class_physicsserver#class-physicsserver). `body` the [Node](class_node#class-node), if it exists in the tree, of the other [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap). `body_shape_index` the index of the [Shape](class_shape#class-shape) of the other [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap) used by the [PhysicsServer](class_physicsserver#class-physicsserver). Get the [CollisionShape](class_collisionshape#class-collisionshape) node with `body.shape_owner_get_owner(body_shape_index)`. `local_shape_index` the index of the [Shape](class_shape#class-shape) of this RigidBody used by the [PhysicsServer](class_physicsserver#class-physicsserver). Get the [CollisionShape](class_collisionshape#class-collisionshape) node with `self.shape_owner_get_owner(local_shape_index)`. **Note:** Bullet physics cannot identify the shape index when using a [ConcavePolygonShape](class_concavepolygonshape#class-concavepolygonshape). Don't use multiple [CollisionShape](class_collisionshape#class-collisionshape)s when using a [ConcavePolygonShape](class_concavepolygonshape#class-concavepolygonshape) with Bullet physics if you need shape indices. ### body\_shape\_exited ( [RID](class_rid#class-rid) body\_rid, [Node](class_node#class-node) body, [int](class_int#class-int) body\_shape\_index, [int](class_int#class-int) local\_shape\_index ) Emitted when the collision between one of this RigidBody's [Shape](class_shape#class-shape)s and another [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap)'s [Shape](class_shape#class-shape)s ends. Requires [contact\_monitor](#class-rigidbody-property-contact-monitor) to be set to `true` and [contacts\_reported](#class-rigidbody-property-contacts-reported) to be set high enough to detect all the collisions. [GridMap](class_gridmap#class-gridmap)s are detected if the [MeshLibrary](class_meshlibrary#class-meshlibrary) has Collision [Shape](class_shape#class-shape)s. `body_rid` the [RID](class_rid#class-rid) of the other [PhysicsBody](class_physicsbody#class-physicsbody) or [MeshLibrary](class_meshlibrary#class-meshlibrary)'s [CollisionObject](class_collisionobject#class-collisionobject) used by the [PhysicsServer](class_physicsserver#class-physicsserver). [GridMap](class_gridmap#class-gridmap)s are detected if the Meshes have [Shape](class_shape#class-shape)s. `body` the [Node](class_node#class-node), if it exists in the tree, of the other [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap). `body_shape_index` the index of the [Shape](class_shape#class-shape) of the other [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap) used by the [PhysicsServer](class_physicsserver#class-physicsserver). Get the [CollisionShape](class_collisionshape#class-collisionshape) node with `body.shape_owner_get_owner(body_shape_index)`. `local_shape_index` the index of the [Shape](class_shape#class-shape) of this RigidBody used by the [PhysicsServer](class_physicsserver#class-physicsserver). Get the [CollisionShape](class_collisionshape#class-collisionshape) node with `self.shape_owner_get_owner(local_shape_index)`. **Note:** Bullet physics cannot identify the shape index when using a [ConcavePolygonShape](class_concavepolygonshape#class-concavepolygonshape). Don't use multiple [CollisionShape](class_collisionshape#class-collisionshape)s when using a [ConcavePolygonShape](class_concavepolygonshape#class-concavepolygonshape) with Bullet physics if you need shape indices. ### sleeping\_state\_changed ( ) Emitted when the physics engine changes the body's sleeping state. **Note:** Changing the value [sleeping](#class-rigidbody-property-sleeping) will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or `emit_signal("sleeping_state_changed")` is used. Enumerations ------------ enum **Mode**: * **MODE\_RIGID** = **0** --- Rigid body mode. This is the "natural" state of a rigid body. It is affected by forces, and can move, rotate, and be affected by user code. * **MODE\_STATIC** = **1** --- Static mode. The body behaves like a [StaticBody](class_staticbody#class-staticbody), and can only move by user code. * **MODE\_CHARACTER** = **2** --- Character body mode. This behaves like a rigid body, but can not rotate. * **MODE\_KINEMATIC** = **3** --- Kinematic body mode. The body behaves like a [KinematicBody](class_kinematicbody#class-kinematicbody), and can only move by user code. Property Descriptions --------------------- ### [float](class_float#class-float) angular\_damp | | | | --- | --- | | *Default* | `-1.0` | | *Setter* | set\_angular\_damp(value) | | *Getter* | get\_angular\_damp() | Damps the body's rotational forces. If this value is different from -1.0 it will be added to any angular damp derived from the world or areas. See [ProjectSettings.physics/3d/default\_angular\_damp](class_projectsettings#class-projectsettings-property-physics-3d-default-angular-damp) for more details about damping. ### [Vector3](class_vector3#class-vector3) angular\_velocity | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_angular\_velocity(value) | | *Getter* | get\_angular\_velocity() | The body's rotational velocity in axis-angle format. The magnitude of the vector is the rotation rate in *radians* per second. ### [bool](class_bool#class-bool) axis\_lock\_angular\_x | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_axis\_lock(value) | | *Getter* | get\_axis\_lock() | Lock the body's rotation in the X axis. ### [bool](class_bool#class-bool) axis\_lock\_angular\_y | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_axis\_lock(value) | | *Getter* | get\_axis\_lock() | Lock the body's rotation in the Y axis. ### [bool](class_bool#class-bool) axis\_lock\_angular\_z | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_axis\_lock(value) | | *Getter* | get\_axis\_lock() | Lock the body's rotation in the Z axis. ### [bool](class_bool#class-bool) axis\_lock\_linear\_x | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_axis\_lock(value) | | *Getter* | get\_axis\_lock() | Lock the body's movement in the X axis. ### [bool](class_bool#class-bool) axis\_lock\_linear\_y | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_axis\_lock(value) | | *Getter* | get\_axis\_lock() | Lock the body's movement in the Y axis. ### [bool](class_bool#class-bool) axis\_lock\_linear\_z | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_axis\_lock(value) | | *Getter* | get\_axis\_lock() | Lock the body's movement in the Z axis. ### [float](class_float#class-float) bounce | | | | --- | --- | | *Setter* | set\_bounce(value) | | *Getter* | get\_bounce() | The body's bounciness. Values range from `0` (no bounce) to `1` (full bounciness). Deprecated, use [PhysicsMaterial.bounce](class_physicsmaterial#class-physicsmaterial-property-bounce) instead via [physics\_material\_override](#class-rigidbody-property-physics-material-override). ### [bool](class_bool#class-bool) can\_sleep | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_can\_sleep(value) | | *Getter* | is\_able\_to\_sleep() | If `true`, the body can enter sleep mode when there is no movement. See [sleeping](#class-rigidbody-property-sleeping). **Note:** A RigidBody3D will never enter sleep mode automatically if its [mode](#class-rigidbody-property-mode) is [MODE\_CHARACTER](#class-rigidbody-constant-mode-character). It can still be put to sleep manually by setting its [sleeping](#class-rigidbody-property-sleeping) property to `true`. ### [bool](class_bool#class-bool) contact\_monitor | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_contact\_monitor(value) | | *Getter* | is\_contact\_monitor\_enabled() | If `true`, the RigidBody will emit signals when it collides with another RigidBody. See also [contacts\_reported](#class-rigidbody-property-contacts-reported). ### [int](class_int#class-int) contacts\_reported | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_max\_contacts\_reported(value) | | *Getter* | get\_max\_contacts\_reported() | The maximum number of contacts that will be recorded. Requires [contact\_monitor](#class-rigidbody-property-contact-monitor) to be set to `true`. **Note:** The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner). ### [bool](class_bool#class-bool) continuous\_cd | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_continuous\_collision\_detection(value) | | *Getter* | is\_using\_continuous\_collision\_detection() | If `true`, continuous collision detection is used. Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. Continuous collision detection is more precise, and misses fewer impacts by small, fast-moving objects. Not using continuous collision detection is faster to compute, but can miss small, fast-moving objects. ### [bool](class_bool#class-bool) custom\_integrator | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_custom\_integrator(value) | | *Getter* | is\_using\_custom\_integrator() | If `true`, internal force integration will be disabled (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the [\_integrate\_forces](#class-rigidbody-method-integrate-forces) function, if defined. ### [float](class_float#class-float) friction | | | | --- | --- | | *Setter* | set\_friction(value) | | *Getter* | get\_friction() | The body's friction, from 0 (frictionless) to 1 (max friction). Deprecated, use [PhysicsMaterial.friction](class_physicsmaterial#class-physicsmaterial-property-friction) instead via [physics\_material\_override](#class-rigidbody-property-physics-material-override). ### [float](class_float#class-float) gravity\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_gravity\_scale(value) | | *Getter* | get\_gravity\_scale() | This is multiplied by the global 3D gravity setting found in **Project > Project Settings > Physics > 3d** to produce RigidBody's gravity. For example, a value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object. ### [float](class_float#class-float) linear\_damp | | | | --- | --- | | *Default* | `-1.0` | | *Setter* | set\_linear\_damp(value) | | *Getter* | get\_linear\_damp() | The body's linear damp. Cannot be less than -1.0. If this value is different from -1.0 it will be added to any linear damp derived from the world or areas. See [ProjectSettings.physics/3d/default\_linear\_damp](class_projectsettings#class-projectsettings-property-physics-3d-default-linear-damp) for more details about damping. ### [Vector3](class_vector3#class-vector3) linear\_velocity | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_linear\_velocity(value) | | *Getter* | get\_linear\_velocity() | The body's linear velocity in units per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [\_integrate\_forces](#class-rigidbody-method-integrate-forces) as your process loop for precise control of the body state. ### [float](class_float#class-float) mass | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_mass(value) | | *Getter* | get\_mass() | The body's mass. ### [Mode](#enum-rigidbody-mode) mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_mode(value) | | *Getter* | get\_mode() | The body mode. See [Mode](#enum-rigidbody-mode) for possible values. ### [PhysicsMaterial](class_physicsmaterial#class-physicsmaterial) physics\_material\_override | | | | --- | --- | | *Setter* | set\_physics\_material\_override(value) | | *Getter* | get\_physics\_material\_override() | The physics material override for the body. If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. ### [bool](class_bool#class-bool) sleeping | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_sleeping(value) | | *Getter* | is\_sleeping() | If `true`, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [apply\_impulse](#class-rigidbody-method-apply-impulse) or [add\_force](#class-rigidbody-method-add-force) methods. ### [float](class_float#class-float) weight | | | | --- | --- | | *Default* | `9.8` | | *Setter* | set\_weight(value) | | *Getter* | get\_weight() | The body's weight based on its mass and the global 3D gravity. Global values are set in **Project > Project Settings > Physics > 3d**. Method Descriptions ------------------- ### void \_integrate\_forces ( [PhysicsDirectBodyState](class_physicsdirectbodystate#class-physicsdirectbodystate) state ) virtual Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it works in addition to the usual physics behavior, but the [custom\_integrator](#class-rigidbody-property-custom-integrator) property allows you to disable the default behavior and do fully custom force integration for a body. ### void add\_central\_force ( [Vector3](class_vector3#class-vector3) force ) Adds a constant directional force (i.e. acceleration) without affecting rotation. This is equivalent to `add_force(force, Vector3(0,0,0))`. ### void add\_force ( [Vector3](class_vector3#class-vector3) force, [Vector3](class_vector3#class-vector3) position ) Adds a constant directional force (i.e. acceleration). The position uses the rotation of the global coordinate system, but is centered at the object's origin. ### void add\_torque ( [Vector3](class_vector3#class-vector3) torque ) Adds a constant rotational force (i.e. a motor) without affecting position. ### void apply\_central\_impulse ( [Vector3](class_vector3#class-vector3) impulse ) Applies a directional impulse without affecting rotation. This is equivalent to `apply_impulse(Vector3(0,0,0), impulse)`. ### void apply\_impulse ( [Vector3](class_vector3#class-vector3) position, [Vector3](class_vector3#class-vector3) impulse ) Applies a positioned impulse to the body. An impulse is time independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin. ### void apply\_torque\_impulse ( [Vector3](class_vector3#class-vector3) impulse ) Applies a torque impulse which will be affected by the body mass and shape. This will rotate the body around the `impulse` vector passed. ### [bool](class_bool#class-bool) get\_axis\_lock ( [BodyAxis](class_physicsserver#enum-physicsserver-bodyaxis) axis ) const Returns `true` if the specified linear or rotational axis is locked. ### [Array](class_array#class-array) get\_colliding\_bodies ( ) const Returns a list of the bodies colliding with this one. Requires [contact\_monitor](#class-rigidbody-property-contact-monitor) to be set to `true` and [contacts\_reported](#class-rigidbody-property-contacts-reported) to be set high enough to detect all the collisions. **Note:** The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead. ### [Basis](class_basis#class-basis) get\_inverse\_inertia\_tensor ( ) Returns the inverse inertia tensor basis. This is used to calculate the angular acceleration resulting from a torque applied to the RigidBody. ### void set\_axis\_lock ( [BodyAxis](class_physicsserver#enum-physicsserver-bodyaxis) axis, [bool](class_bool#class-bool) lock ) Locks the specified linear or rotational axis. ### void set\_axis\_velocity ( [Vector3](class_vector3#class-vector3) axis\_velocity ) Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior.
programming_docs
godot LineShape2D LineShape2D =========== **Inherits:** [Shape2D](class_shape2d#class-shape2d) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Line shape for 2D collisions. Description ----------- Line shape for 2D collisions. It works like a 2D plane and will not allow any physics body to go to the negative side. Not recommended for rigid bodies, and usually not recommended for static bodies either because it forces checks against it on every frame. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [d](#class-lineshape2d-property-d) | `0.0` | | [Vector2](class_vector2#class-vector2) | [normal](#class-lineshape2d-property-normal) | `Vector2( 0, -1 )` | Property Descriptions --------------------- ### [float](class_float#class-float) d | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_d(value) | | *Getter* | get\_d() | The line's distance from the origin. ### [Vector2](class_vector2#class-vector2) normal | | | | --- | --- | | *Default* | `Vector2( 0, -1 )` | | *Setter* | set\_normal(value) | | *Getter* | get\_normal() | The line's normal. godot PhysicsTestMotionResult PhysicsTestMotionResult ======================= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [Object](class_object#class-object) | [collider](#class-physicstestmotionresult-property-collider) | | | [int](class_int#class-int) | [collider\_id](#class-physicstestmotionresult-property-collider-id) | `0` | | [RID](class_rid#class-rid) | [collider\_rid](#class-physicstestmotionresult-property-collider-rid) | | | [int](class_int#class-int) | [collider\_shape](#class-physicstestmotionresult-property-collider-shape) | `0` | | [Vector3](class_vector3#class-vector3) | [collider\_velocity](#class-physicstestmotionresult-property-collider-velocity) | `Vector3( 0, 0, 0 )` | | [float](class_float#class-float) | [collision\_depth](#class-physicstestmotionresult-property-collision-depth) | `0.0` | | [Vector3](class_vector3#class-vector3) | [collision\_normal](#class-physicstestmotionresult-property-collision-normal) | `Vector3( 0, 0, 0 )` | | [Vector3](class_vector3#class-vector3) | [collision\_point](#class-physicstestmotionresult-property-collision-point) | `Vector3( 0, 0, 0 )` | | [float](class_float#class-float) | [collision\_safe\_fraction](#class-physicstestmotionresult-property-collision-safe-fraction) | `0.0` | | [float](class_float#class-float) | [collision\_unsafe\_fraction](#class-physicstestmotionresult-property-collision-unsafe-fraction) | `0.0` | | [Vector3](class_vector3#class-vector3) | [motion](#class-physicstestmotionresult-property-motion) | `Vector3( 0, 0, 0 )` | | [Vector3](class_vector3#class-vector3) | [motion\_remainder](#class-physicstestmotionresult-property-motion-remainder) | `Vector3( 0, 0, 0 )` | Property Descriptions --------------------- ### [Object](class_object#class-object) collider | | | | --- | --- | | *Getter* | get\_collider() | ### [int](class_int#class-int) collider\_id | | | | --- | --- | | *Default* | `0` | | *Getter* | get\_collider\_id() | ### [RID](class_rid#class-rid) collider\_rid | | | | --- | --- | | *Getter* | get\_collider\_rid() | ### [int](class_int#class-int) collider\_shape | | | | --- | --- | | *Default* | `0` | | *Getter* | get\_collider\_shape() | ### [Vector3](class_vector3#class-vector3) collider\_velocity | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Getter* | get\_collider\_velocity() | ### [float](class_float#class-float) collision\_depth | | | | --- | --- | | *Default* | `0.0` | | *Getter* | get\_collision\_depth() | ### [Vector3](class_vector3#class-vector3) collision\_normal | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Getter* | get\_collision\_normal() | ### [Vector3](class_vector3#class-vector3) collision\_point | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Getter* | get\_collision\_point() | ### [float](class_float#class-float) collision\_safe\_fraction | | | | --- | --- | | *Default* | `0.0` | | *Getter* | get\_collision\_safe\_fraction() | ### [float](class_float#class-float) collision\_unsafe\_fraction | | | | --- | --- | | *Default* | `0.0` | | *Getter* | get\_collision\_unsafe\_fraction() | ### [Vector3](class_vector3#class-vector3) motion | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Getter* | get\_motion() | ### [Vector3](class_vector3#class-vector3) motion\_remainder | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Getter* | get\_motion\_remainder() | godot HTTPRequest HTTPRequest =========== **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) A node with the ability to send HTTP(S) requests. Description ----------- A node with the ability to send HTTP requests. Uses [HTTPClient](class_httpclient#class-httpclient) internally. Can be used to make HTTP requests, i.e. download or upload files or web content via HTTP. **Warning:** See the notes and warnings on [HTTPClient](class_httpclient#class-httpclient) for limitations, especially regarding SSL security. **Example of contacting a REST API and printing one of its returned fields:** ``` func _ready(): # Create an HTTP request node and connect its completion signal. var http_request = HTTPRequest.new() add_child(http_request) http_request.connect("request_completed", self, "_http_request_completed") # Perform a GET request. The URL below returns JSON as of writing. var error = http_request.request("https://httpbin.org/get") if error != OK: push_error("An error occurred in the HTTP request.") # Perform a POST request. The URL below returns JSON as of writing. # Note: Don't make simultaneous requests using a single HTTPRequest node. # The snippet below is provided for reference only. var body = to_json({"name": "Godette"}) error = http_request.request("https://httpbin.org/post", [], true, HTTPClient.METHOD_POST, body) if error != OK: push_error("An error occurred in the HTTP request.") # Called when the HTTP request is completed. func _http_request_completed(result, response_code, headers, body): var response = parse_json(body.get_string_from_utf8()) # Will print the user agent string used by the HTTPRequest node (as recognized by httpbin.org). print(response.headers["User-Agent"]) ``` **Example of loading and displaying an image using HTTPRequest:** ``` func _ready(): # Create an HTTP request node and connect its completion signal. var http_request = HTTPRequest.new() add_child(http_request) http_request.connect("request_completed", self, "_http_request_completed") # Perform the HTTP request. The URL below returns a PNG image as of writing. var error = http_request.request("https://via.placeholder.com/512") if error != OK: push_error("An error occurred in the HTTP request.") # Called when the HTTP request is completed. func _http_request_completed(result, response_code, headers, body): var image = Image.new() var error = image.load_png_from_buffer(body) if error != OK: push_error("Couldn't load the image.") var texture = ImageTexture.new() texture.create_from_image(image) # Display the image in a TextureRect node. var texture_rect = TextureRect.new() add_child(texture_rect) texture_rect.texture = texture ``` Tutorials --------- * [Making HTTP requests](https://docs.godotengine.org/en/3.5/tutorials/networking/http_request_class.html) * [SSL certificates](https://docs.godotengine.org/en/3.5/tutorials/networking/ssl_certificates.html) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [body\_size\_limit](#class-httprequest-property-body-size-limit) | `-1` | | [int](class_int#class-int) | [download\_chunk\_size](#class-httprequest-property-download-chunk-size) | `65536` | | [String](class_string#class-string) | [download\_file](#class-httprequest-property-download-file) | `""` | | [int](class_int#class-int) | [max\_redirects](#class-httprequest-property-max-redirects) | `8` | | [float](class_float#class-float) | [timeout](#class-httprequest-property-timeout) | `0.0` | | [bool](class_bool#class-bool) | [use\_threads](#class-httprequest-property-use-threads) | `false` | Methods ------- | | | | --- | --- | | void | [cancel\_request](#class-httprequest-method-cancel-request) **(** **)** | | [int](class_int#class-int) | [get\_body\_size](#class-httprequest-method-get-body-size) **(** **)** const | | [int](class_int#class-int) | [get\_downloaded\_bytes](#class-httprequest-method-get-downloaded-bytes) **(** **)** const | | [Status](class_httpclient#enum-httpclient-status) | [get\_http\_client\_status](#class-httprequest-method-get-http-client-status) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [request](#class-httprequest-method-request) **(** [String](class_string#class-string) url, [PoolStringArray](class_poolstringarray#class-poolstringarray) custom\_headers=PoolStringArray( ), [bool](class_bool#class-bool) ssl\_validate\_domain=true, [Method](class_httpclient#enum-httpclient-method) method=0, [String](class_string#class-string) request\_data="" **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [request\_raw](#class-httprequest-method-request-raw) **(** [String](class_string#class-string) url, [PoolStringArray](class_poolstringarray#class-poolstringarray) custom\_headers=PoolStringArray( ), [bool](class_bool#class-bool) ssl\_validate\_domain=true, [Method](class_httpclient#enum-httpclient-method) method=0, [PoolByteArray](class_poolbytearray#class-poolbytearray) request\_data\_raw=PoolByteArray( ) **)** | | void | [set\_http\_proxy](#class-httprequest-method-set-http-proxy) **(** [String](class_string#class-string) host, [int](class_int#class-int) port **)** | | void | [set\_https\_proxy](#class-httprequest-method-set-https-proxy) **(** [String](class_string#class-string) host, [int](class_int#class-int) port **)** | Signals ------- ### request\_completed ( [int](class_int#class-int) result, [int](class_int#class-int) response\_code, [PoolStringArray](class_poolstringarray#class-poolstringarray) headers, [PoolByteArray](class_poolbytearray#class-poolbytearray) body ) Emitted when a request is completed. Enumerations ------------ enum **Result**: * **RESULT\_SUCCESS** = **0** --- Request successful. * **RESULT\_CHUNKED\_BODY\_SIZE\_MISMATCH** = **1** * **RESULT\_CANT\_CONNECT** = **2** --- Request failed while connecting. * **RESULT\_CANT\_RESOLVE** = **3** --- Request failed while resolving. * **RESULT\_CONNECTION\_ERROR** = **4** --- Request failed due to connection (read/write) error. * **RESULT\_SSL\_HANDSHAKE\_ERROR** = **5** --- Request failed on SSL handshake. * **RESULT\_NO\_RESPONSE** = **6** --- Request does not have a response (yet). * **RESULT\_BODY\_SIZE\_LIMIT\_EXCEEDED** = **7** --- Request exceeded its maximum size limit, see [body\_size\_limit](#class-httprequest-property-body-size-limit). * **RESULT\_REQUEST\_FAILED** = **8** --- Request failed (currently unused). * **RESULT\_DOWNLOAD\_FILE\_CANT\_OPEN** = **9** --- HTTPRequest couldn't open the download file. * **RESULT\_DOWNLOAD\_FILE\_WRITE\_ERROR** = **10** --- HTTPRequest couldn't write to the download file. * **RESULT\_REDIRECT\_LIMIT\_REACHED** = **11** --- Request reached its maximum redirect limit, see [max\_redirects](#class-httprequest-property-max-redirects). * **RESULT\_TIMEOUT** = **12** Property Descriptions --------------------- ### [int](class_int#class-int) body\_size\_limit | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_body\_size\_limit(value) | | *Getter* | get\_body\_size\_limit() | Maximum allowed size for response bodies (`-1` means no limit). When only small files are expected, this can be used to prevent disallow receiving files that are too large, preventing potential denial of service attacks. ### [int](class_int#class-int) download\_chunk\_size | | | | --- | --- | | *Default* | `65536` | | *Setter* | set\_download\_chunk\_size(value) | | *Getter* | get\_download\_chunk\_size() | The size of the buffer used and maximum bytes to read per iteration. See [HTTPClient.read\_chunk\_size](class_httpclient#class-httpclient-property-read-chunk-size). Set this to a lower value (e.g. 4096 for 4 KiB) when downloading small files to decrease memory usage at the cost of download speeds. ### [String](class_string#class-string) download\_file | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_download\_file(value) | | *Getter* | get\_download\_file() | The file to download into. If set to a non-empty string, the request output will be written to the file located at the path. If a file already exists at the specified location, it will be overwritten as soon as body data begins to be received. **Note:** Folders are not automatically created when the file is created. If [download\_file](#class-httprequest-property-download-file) points to a subfolder, it's recommended to create the necessary folders beforehand using [Directory.make\_dir\_recursive](class_directory#class-directory-method-make-dir-recursive) to ensure the file can be written. ### [int](class_int#class-int) max\_redirects | | | | --- | --- | | *Default* | `8` | | *Setter* | set\_max\_redirects(value) | | *Getter* | get\_max\_redirects() | Maximum number of allowed redirects. This is used to prevent endless redirect loops. ### [float](class_float#class-float) timeout | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_timeout(value) | | *Getter* | get\_timeout() | If set to a value greater than `0.0` before the request starts, the HTTP request will time out after `timeout` seconds have passed and the request is not *completed* yet. For small HTTP requests such as REST API usage, set [timeout](#class-httprequest-property-timeout) to a value between `10.0` and `30.0` to prevent the application from getting stuck if the request fails to get a response in a timely manner. For file downloads, leave this to `0.0` to prevent the download from failing if it takes too much time. ### [bool](class_bool#class-bool) use\_threads | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_threads(value) | | *Getter* | is\_using\_threads() | If `true`, multithreading is used to improve performance. Method Descriptions ------------------- ### void cancel\_request ( ) Cancels the current request. ### [int](class_int#class-int) get\_body\_size ( ) const Returns the response body length. **Note:** Some Web servers may not send a body length. In this case, the value returned will be `-1`. If using chunked transfer encoding, the body length will also be `-1`. ### [int](class_int#class-int) get\_downloaded\_bytes ( ) const Returns the amount of bytes this HTTPRequest downloaded. ### [Status](class_httpclient#enum-httpclient-status) get\_http\_client\_status ( ) const Returns the current status of the underlying [HTTPClient](class_httpclient#class-httpclient). See [Status](class_httpclient#enum-httpclient-status). ### [Error](class_%40globalscope#enum-globalscope-error) request ( [String](class_string#class-string) url, [PoolStringArray](class_poolstringarray#class-poolstringarray) custom\_headers=PoolStringArray( ), [bool](class_bool#class-bool) ssl\_validate\_domain=true, [Method](class_httpclient#enum-httpclient-method) method=0, [String](class_string#class-string) request\_data="" ) Creates request on the underlying [HTTPClient](class_httpclient#class-httpclient). If there is no configuration errors, it tries to connect using [HTTPClient.connect\_to\_host](class_httpclient#class-httpclient-method-connect-to-host) and passes parameters onto [HTTPClient.request](class_httpclient#class-httpclient-method-request). Returns [@GlobalScope.OK](class_%40globalscope#class-globalscope-constant-ok) if request is successfully created. (Does not imply that the server has responded), [@GlobalScope.ERR\_UNCONFIGURED](class_%40globalscope#class-globalscope-constant-err-unconfigured) if not in the tree, [@GlobalScope.ERR\_BUSY](class_%40globalscope#class-globalscope-constant-err-busy) if still processing previous request, [@GlobalScope.ERR\_INVALID\_PARAMETER](class_%40globalscope#class-globalscope-constant-err-invalid-parameter) if given string is not a valid URL format, or [@GlobalScope.ERR\_CANT\_CONNECT](class_%40globalscope#class-globalscope-constant-err-cant-connect) if not using thread and the [HTTPClient](class_httpclient#class-httpclient) cannot connect to host. **Note:** When `method` is [HTTPClient.METHOD\_GET](class_httpclient#class-httpclient-constant-method-get), the payload sent via `request_data` might be ignored by the server or even cause the server to reject the request (check [RFC 7231 section 4.3.1](https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.1) for more details). As a workaround, you can send data as a query string in the URL. See [String.http\_escape](class_string#class-string-method-http-escape) for an example. ### [Error](class_%40globalscope#enum-globalscope-error) request\_raw ( [String](class_string#class-string) url, [PoolStringArray](class_poolstringarray#class-poolstringarray) custom\_headers=PoolStringArray( ), [bool](class_bool#class-bool) ssl\_validate\_domain=true, [Method](class_httpclient#enum-httpclient-method) method=0, [PoolByteArray](class_poolbytearray#class-poolbytearray) request\_data\_raw=PoolByteArray( ) ) Creates request on the underlying [HTTPClient](class_httpclient#class-httpclient) using a raw array of bytes for the request body. If there is no configuration errors, it tries to connect using [HTTPClient.connect\_to\_host](class_httpclient#class-httpclient-method-connect-to-host) and passes parameters onto [HTTPClient.request](class_httpclient#class-httpclient-method-request). Returns [@GlobalScope.OK](class_%40globalscope#class-globalscope-constant-ok) if request is successfully created. (Does not imply that the server has responded), [@GlobalScope.ERR\_UNCONFIGURED](class_%40globalscope#class-globalscope-constant-err-unconfigured) if not in the tree, [@GlobalScope.ERR\_BUSY](class_%40globalscope#class-globalscope-constant-err-busy) if still processing previous request, [@GlobalScope.ERR\_INVALID\_PARAMETER](class_%40globalscope#class-globalscope-constant-err-invalid-parameter) if given string is not a valid URL format, or [@GlobalScope.ERR\_CANT\_CONNECT](class_%40globalscope#class-globalscope-constant-err-cant-connect) if not using thread and the [HTTPClient](class_httpclient#class-httpclient) cannot connect to host. ### void set\_http\_proxy ( [String](class_string#class-string) host, [int](class_int#class-int) port ) Sets the proxy server for HTTP requests. The proxy server is unset if `host` is empty or `port` is -1. ### void set\_https\_proxy ( [String](class_string#class-string) host, [int](class_int#class-int) port ) Sets the proxy server for HTTPS requests. The proxy server is unset if `host` is empty or `port` is -1. godot AnimationNodeBlendSpace1D AnimationNodeBlendSpace1D ========================= **Inherits:** [AnimationRootNode](class_animationrootnode#class-animationrootnode) **<** [AnimationNode](class_animationnode#class-animationnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Blends linearly between two of any number of [AnimationNode](class_animationnode#class-animationnode) of any type placed on a virtual axis. Description ----------- A resource to add to an [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). This is a virtual axis on which you can add any type of [AnimationNode](class_animationnode#class-animationnode) using [add\_blend\_point](#class-animationnodeblendspace1d-method-add-blend-point). Outputs the linear blend of the two [AnimationNode](class_animationnode#class-animationnode)s closest to the node's current value. You can set the extents of the axis using the [min\_space](#class-animationnodeblendspace1d-property-min-space) and [max\_space](#class-animationnodeblendspace1d-property-max-space). Tutorials --------- * [Using AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [max\_space](#class-animationnodeblendspace1d-property-max-space) | `1.0` | | [float](class_float#class-float) | [min\_space](#class-animationnodeblendspace1d-property-min-space) | `-1.0` | | [float](class_float#class-float) | [snap](#class-animationnodeblendspace1d-property-snap) | `0.1` | | [String](class_string#class-string) | [value\_label](#class-animationnodeblendspace1d-property-value-label) | `"value"` | Methods ------- | | | | --- | --- | | void | [add\_blend\_point](#class-animationnodeblendspace1d-method-add-blend-point) **(** [AnimationRootNode](class_animationrootnode#class-animationrootnode) node, [float](class_float#class-float) pos, [int](class_int#class-int) at\_index=-1 **)** | | [int](class_int#class-int) | [get\_blend\_point\_count](#class-animationnodeblendspace1d-method-get-blend-point-count) **(** **)** const | | [AnimationRootNode](class_animationrootnode#class-animationrootnode) | [get\_blend\_point\_node](#class-animationnodeblendspace1d-method-get-blend-point-node) **(** [int](class_int#class-int) point **)** const | | [float](class_float#class-float) | [get\_blend\_point\_position](#class-animationnodeblendspace1d-method-get-blend-point-position) **(** [int](class_int#class-int) point **)** const | | void | [remove\_blend\_point](#class-animationnodeblendspace1d-method-remove-blend-point) **(** [int](class_int#class-int) point **)** | | void | [set\_blend\_point\_node](#class-animationnodeblendspace1d-method-set-blend-point-node) **(** [int](class_int#class-int) point, [AnimationRootNode](class_animationrootnode#class-animationrootnode) node **)** | | void | [set\_blend\_point\_position](#class-animationnodeblendspace1d-method-set-blend-point-position) **(** [int](class_int#class-int) point, [float](class_float#class-float) pos **)** | Property Descriptions --------------------- ### [float](class_float#class-float) max\_space | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_max\_space(value) | | *Getter* | get\_max\_space() | The blend space's axis's upper limit for the points' position. See [add\_blend\_point](#class-animationnodeblendspace1d-method-add-blend-point). ### [float](class_float#class-float) min\_space | | | | --- | --- | | *Default* | `-1.0` | | *Setter* | set\_min\_space(value) | | *Getter* | get\_min\_space() | The blend space's axis's lower limit for the points' position. See [add\_blend\_point](#class-animationnodeblendspace1d-method-add-blend-point). ### [float](class_float#class-float) snap | | | | --- | --- | | *Default* | `0.1` | | *Setter* | set\_snap(value) | | *Getter* | get\_snap() | Position increment to snap to when moving a point on the axis. ### [String](class_string#class-string) value\_label | | | | --- | --- | | *Default* | `"value"` | | *Setter* | set\_value\_label(value) | | *Getter* | get\_value\_label() | Label of the virtual axis of the blend space. Method Descriptions ------------------- ### void add\_blend\_point ( [AnimationRootNode](class_animationrootnode#class-animationrootnode) node, [float](class_float#class-float) pos, [int](class_int#class-int) at\_index=-1 ) Adds a new point that represents a `node` on the virtual axis at a given position set by `pos`. You can insert it at a specific index using the `at_index` argument. If you use the default value for `at_index`, the point is inserted at the end of the blend points array. ### [int](class_int#class-int) get\_blend\_point\_count ( ) const Returns the number of points on the blend axis. ### [AnimationRootNode](class_animationrootnode#class-animationrootnode) get\_blend\_point\_node ( [int](class_int#class-int) point ) const Returns the [AnimationNode](class_animationnode#class-animationnode) referenced by the point at index `point`. ### [float](class_float#class-float) get\_blend\_point\_position ( [int](class_int#class-int) point ) const Returns the position of the point at index `point`. ### void remove\_blend\_point ( [int](class_int#class-int) point ) Removes the point at index `point` from the blend axis. ### void set\_blend\_point\_node ( [int](class_int#class-int) point, [AnimationRootNode](class_animationrootnode#class-animationrootnode) node ) Changes the [AnimationNode](class_animationnode#class-animationnode) referenced by the point at index `point`. ### void set\_blend\_point\_position ( [int](class_int#class-int) point, [float](class_float#class-float) pos ) Updates the position of the point at index `point` on the blend axis.
programming_docs
godot ScrollContainer ScrollContainer =============== **Inherits:** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [EditorInspector](class_editorinspector#class-editorinspector) A helper node for displaying scrollable elements such as lists. Description ----------- A ScrollContainer node meant to contain a [Control](class_control#class-control) child. ScrollContainers will automatically create a scrollbar child ([HScrollBar](class_hscrollbar#class-hscrollbar), [VScrollBar](class_vscrollbar#class-vscrollbar), or both) when needed and will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the [Control.rect\_min\_size](class_control#class-control-property-rect-min-size) of the Control relative to the ScrollContainer. Works great with a [Panel](class_panel#class-panel) control. You can set `EXPAND` on the children's size flags, so they will upscale to the ScrollContainer's size if it's larger (scroll is invisible for the chosen dimension). Tutorials --------- * [GUI containers](https://docs.godotengine.org/en/3.5/tutorials/ui/gui_containers.html) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [follow\_focus](#class-scrollcontainer-property-follow-focus) | `false` | | [bool](class_bool#class-bool) | rect\_clip\_content | `true` (overrides [Control](class_control#class-control-property-rect-clip-content)) | | [int](class_int#class-int) | [scroll\_deadzone](#class-scrollcontainer-property-scroll-deadzone) | `0` | | [int](class_int#class-int) | [scroll\_horizontal](#class-scrollcontainer-property-scroll-horizontal) | `0` | | [bool](class_bool#class-bool) | [scroll\_horizontal\_enabled](#class-scrollcontainer-property-scroll-horizontal-enabled) | `true` | | [int](class_int#class-int) | [scroll\_vertical](#class-scrollcontainer-property-scroll-vertical) | `0` | | [bool](class_bool#class-bool) | [scroll\_vertical\_enabled](#class-scrollcontainer-property-scroll-vertical-enabled) | `true` | Methods ------- | | | | --- | --- | | void | [ensure\_control\_visible](#class-scrollcontainer-method-ensure-control-visible) **(** [Control](class_control#class-control) control **)** | | [HScrollBar](class_hscrollbar#class-hscrollbar) | [get\_h\_scrollbar](#class-scrollcontainer-method-get-h-scrollbar) **(** **)** | | [VScrollBar](class_vscrollbar#class-vscrollbar) | [get\_v\_scrollbar](#class-scrollcontainer-method-get-v-scrollbar) **(** **)** | Theme Properties ---------------- | | | | --- | --- | | [StyleBox](class_stylebox#class-stylebox) | [bg](#class-scrollcontainer-theme-style-bg) | Signals ------- ### scroll\_ended ( ) Emitted when scrolling stops. ### scroll\_started ( ) Emitted when scrolling is started. Property Descriptions --------------------- ### [bool](class_bool#class-bool) follow\_focus | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_follow\_focus(value) | | *Getter* | is\_following\_focus() | If `true`, the ScrollContainer will automatically scroll to focused children (including indirect children) to make sure they are fully visible. ### [int](class_int#class-int) scroll\_deadzone | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_deadzone(value) | | *Getter* | get\_deadzone() | ### [int](class_int#class-int) scroll\_horizontal | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_h\_scroll(value) | | *Getter* | get\_h\_scroll() | The current horizontal scroll value. ### [bool](class_bool#class-bool) scroll\_horizontal\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_enable\_h\_scroll(value) | | *Getter* | is\_h\_scroll\_enabled() | If `true`, enables horizontal scrolling. ### [int](class_int#class-int) scroll\_vertical | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_v\_scroll(value) | | *Getter* | get\_v\_scroll() | The current vertical scroll value. ### [bool](class_bool#class-bool) scroll\_vertical\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_enable\_v\_scroll(value) | | *Getter* | is\_v\_scroll\_enabled() | If `true`, enables vertical scrolling. Method Descriptions ------------------- ### void ensure\_control\_visible ( [Control](class_control#class-control) control ) Ensures the given `control` is visible (must be a direct or indirect child of the ScrollContainer). Used by [follow\_focus](#class-scrollcontainer-property-follow-focus). **Note:** This will not work on a node that was just added during the same frame. If you want to scroll to a newly added child, you must wait until the next frame using [SceneTree.idle\_frame](class_scenetree#class-scenetree-signal-idle-frame): ``` add_child(child_node) yield(get_tree(), "idle_frame") ensure_control_visible(child_node) ``` ### [HScrollBar](class_hscrollbar#class-hscrollbar) get\_h\_scrollbar ( ) Returns the horizontal scrollbar [HScrollBar](class_hscrollbar#class-hscrollbar) of this `ScrollContainer`. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to disable the horizontal scrollbar, use [scroll\_horizontal\_enabled](#class-scrollcontainer-property-scroll-horizontal-enabled). If you want to only hide it instead, use its [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. ### [VScrollBar](class_vscrollbar#class-vscrollbar) get\_v\_scrollbar ( ) Returns the vertical scrollbar [VScrollBar](class_vscrollbar#class-vscrollbar) of this `ScrollContainer`. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to disable the vertical scrollbar, use [scroll\_vertical\_enabled](#class-scrollcontainer-property-scroll-vertical-enabled). If you want to only hide it instead, use its [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. Theme Property Descriptions --------------------------- ### [StyleBox](class_stylebox#class-stylebox) bg The background [StyleBox](class_stylebox#class-stylebox) of the `ScrollContainer`. godot PinJoint2D PinJoint2D ========== **Inherits:** [Joint2D](class_joint2d#class-joint2d) **<** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Pin Joint for 2D shapes. Description ----------- Pin Joint for 2D rigid bodies. It pins two bodies (rigid or static) together. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [softness](#class-pinjoint2d-property-softness) | `0.0` | Property Descriptions --------------------- ### [float](class_float#class-float) softness | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_softness(value) | | *Getter* | get\_softness() | The higher this value, the more the bond to the pinned partner can flex. godot Dictionary Dictionary ========== Dictionary type. Description ----------- Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are composed of pairs of keys (which must be unique) and values. Dictionaries will preserve the insertion order when adding elements, even though this may not be reflected when printing the dictionary. In other programming languages, this data structure is sometimes referred to as a hash map or associative array. You can define a dictionary by placing a comma-separated list of `key: value` pairs in curly braces `{}`. Erasing elements while iterating over them **is not supported** and will result in undefined behavior. **Note:** Dictionaries are always passed by reference. To get a copy of a dictionary which can be modified independently of the original dictionary, use [duplicate](#class-dictionary-method-duplicate). Creating a dictionary: ``` var my_dict = {} # Creates an empty dictionary. var dict_variable_key = "Another key name" var dict_variable_value = "value2" var another_dict = { "Some key name": "value1", dict_variable_key: dict_variable_value, } var points_dict = {"White": 50, "Yellow": 75, "Orange": 100} # Alternative Lua-style syntax. # Doesn't require quotes around keys, but only string constants can be used as key names. # Additionally, key names must start with a letter or an underscore. # Here, `some_key` is a string literal, not a variable! another_dict = { some_key = 42, } ``` You can access a dictionary's values by referencing the appropriate key. In the above example, `points_dict["White"]` will return `50`. You can also write `points_dict.White`, which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable). ``` export(String, "White", "Yellow", "Orange") var my_color var points_dict = {"White": 50, "Yellow": 75, "Orange": 100} func _ready(): # We can't use dot syntax here as `my_color` is a variable. var points = points_dict[my_color] ``` In the above code, `points` will be assigned the value that is paired with the appropriate color selected in `my_color`. Dictionaries can contain more complex data: ``` my_dict = {"First Array": [1, 2, 3, 4]} # Assigns an Array to a String key. ``` To add a key to an existing dictionary, access it like an existing key and assign to it: ``` var points_dict = {"White": 50, "Yellow": 75, "Orange": 100} points_dict["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value. ``` Finally, dictionaries can contain different types of keys and values in the same dictionary: ``` # This is a valid dictionary. # To access the string "Nested value" below, use `my_dict.sub_dict.sub_key` or `my_dict["sub_dict"]["sub_key"]`. # Indexing styles can be mixed and matched depending on your needs. var my_dict = { "String Key": 5, 4: [1, 2, 3], 7: "Hello", "sub_dict": {"sub_key": "Nested value"}, } ``` **Note:** Unlike [Array](class_array#class-array)s, you can't compare dictionaries directly: ``` array1 = [1, 2, 3] array2 = [1, 2, 3] func compare_arrays(): print(array1 == array2) # Will print true. var dict1 = {"a": 1, "b": 2, "c": 3} var dict2 = {"a": 1, "b": 2, "c": 3} func compare_dictionaries(): print(dict1 == dict2) # Will NOT print true. ``` You need to first calculate the dictionary's hash with [hash](#class-dictionary-method-hash) before you can compare them: ``` var dict1 = {"a": 1, "b": 2, "c": 3} var dict2 = {"a": 1, "b": 2, "c": 3} func compare_dictionaries(): print(dict1.hash() == dict2.hash()) # Will print true. ``` **Note:** When declaring a dictionary with `const`, the dictionary itself can still be mutated by defining the values of individual keys. Using `const` will only prevent assigning the constant with another value after it was initialized. Tutorials --------- * [GDScript basics: Dictionary](https://docs.godotengine.org/en/3.5/tutorials/scripting/gdscript/gdscript_basics.html#dictionary) * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) * [OS Test Demo](https://godotengine.org/asset-library/asset/677) Methods ------- | | | | --- | --- | | void | [clear](#class-dictionary-method-clear) **(** **)** | | [Dictionary](#class-dictionary) | [duplicate](#class-dictionary-method-duplicate) **(** [bool](class_bool#class-bool) deep=false **)** | | [bool](class_bool#class-bool) | [empty](#class-dictionary-method-empty) **(** **)** | | [bool](class_bool#class-bool) | [erase](#class-dictionary-method-erase) **(** [Variant](class_variant#class-variant) key **)** | | [Variant](class_variant#class-variant) | [get](#class-dictionary-method-get) **(** [Variant](class_variant#class-variant) key, [Variant](class_variant#class-variant) default=null **)** | | [bool](class_bool#class-bool) | [has](#class-dictionary-method-has) **(** [Variant](class_variant#class-variant) key **)** | | [bool](class_bool#class-bool) | [has\_all](#class-dictionary-method-has-all) **(** [Array](class_array#class-array) keys **)** | | [int](class_int#class-int) | [hash](#class-dictionary-method-hash) **(** **)** | | [Array](class_array#class-array) | [keys](#class-dictionary-method-keys) **(** **)** | | void | [merge](#class-dictionary-method-merge) **(** [Dictionary](#class-dictionary) dictionary, [bool](class_bool#class-bool) overwrite=false **)** | | [int](class_int#class-int) | [size](#class-dictionary-method-size) **(** **)** | | [Array](class_array#class-array) | [values](#class-dictionary-method-values) **(** **)** | Method Descriptions ------------------- ### void clear ( ) Clear the dictionary, removing all key/value pairs. ### [Dictionary](#class-dictionary) duplicate ( [bool](class_bool#class-bool) deep=false ) Creates a copy of the dictionary, and returns it. The `deep` parameter causes inner dictionaries and arrays to be copied recursively, but does not apply to objects. ### [bool](class_bool#class-bool) empty ( ) Returns `true` if the dictionary is empty. ### [bool](class_bool#class-bool) erase ( [Variant](class_variant#class-variant) key ) Erase a dictionary key/value pair by key. Returns `true` if the given key was present in the dictionary, `false` otherwise. **Note:** Don't erase elements while iterating over the dictionary. You can iterate over the [keys](#class-dictionary-method-keys) array instead. ### [Variant](class_variant#class-variant) get ( [Variant](class_variant#class-variant) key, [Variant](class_variant#class-variant) default=null ) Returns the current value for the specified key in the `Dictionary`. If the key does not exist, the method returns the value of the optional default argument, or `null` if it is omitted. ### [bool](class_bool#class-bool) has ( [Variant](class_variant#class-variant) key ) Returns `true` if the dictionary has a given key. **Note:** This is equivalent to using the `in` operator as follows: ``` # Will evaluate to `true`. if "godot" in {"godot": "engine"}: pass ``` This method (like the `in` operator) will evaluate to `true` as long as the key exists, even if the associated value is `null`. ### [bool](class_bool#class-bool) has\_all ( [Array](class_array#class-array) keys ) Returns `true` if the dictionary has all the keys in the given array. ### [int](class_int#class-int) hash ( ) Returns a hashed 32-bit integer value representing the dictionary contents. This can be used to compare dictionaries by value: ``` var dict1 = {0: 10} var dict2 = {0: 10} # The line below prints `true`, whereas it would have printed `false` if both variables were compared directly. print(dict1.hash() == dict2.hash()) ``` **Note:** Dictionaries with the same keys/values but in a different order will have a different hash. **Note:** Dictionaries with equal content will always produce identical hash values. However, the reverse is not true. Returning identical hash values does *not* imply the dictionaries are equal, because different dictionaries can have identical hash values due to hash collisions. ### [Array](class_array#class-array) keys ( ) Returns the list of keys in the `Dictionary`. ### void merge ( [Dictionary](#class-dictionary) dictionary, [bool](class_bool#class-bool) overwrite=false ) Adds elements from `dictionary` to this `Dictionary`. By default, duplicate keys will not be copied over, unless `overwrite` is `true`. ### [int](class_int#class-int) size ( ) Returns the number of keys in the dictionary. ### [Array](class_array#class-array) values ( ) Returns the list of values in the `Dictionary`. godot GLTFBufferView GLTFBufferView ============== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Description ----------- **Note:** This class is only compiled in editor builds. Run-time glTF loading and saving is *not* available in exported projects. References to `GLTFBufferView` within a script will cause an error in an exported project. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [buffer](#class-gltfbufferview-property-buffer) | `-1` | | [int](class_int#class-int) | [byte\_length](#class-gltfbufferview-property-byte-length) | `0` | | [int](class_int#class-int) | [byte\_offset](#class-gltfbufferview-property-byte-offset) | `0` | | [int](class_int#class-int) | [byte\_stride](#class-gltfbufferview-property-byte-stride) | `-1` | | [bool](class_bool#class-bool) | [indices](#class-gltfbufferview-property-indices) | `false` | Property Descriptions --------------------- ### [int](class_int#class-int) buffer | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_buffer(value) | | *Getter* | get\_buffer() | ### [int](class_int#class-int) byte\_length | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_byte\_length(value) | | *Getter* | get\_byte\_length() | ### [int](class_int#class-int) byte\_offset | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_byte\_offset(value) | | *Getter* | get\_byte\_offset() | ### [int](class_int#class-int) byte\_stride | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_byte\_stride(value) | | *Getter* | get\_byte\_stride() | ### [bool](class_bool#class-bool) indices | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_indices(value) | | *Getter* | get\_indices() | godot AudioEffectEQ21 AudioEffectEQ21 =============== **Inherits:** [AudioEffectEQ](class_audioeffecteq#class-audioeffecteq) **<** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Adds a 21-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 22 Hz to 22000 Hz. Each frequency can be modulated between -60/+24 dB. Description ----------- Frequency bands: Band 1: 22 Hz Band 2: 32 Hz Band 3: 44 Hz Band 4: 63 Hz Band 5: 90 Hz Band 6: 125 Hz Band 7: 175 Hz Band 8: 250 Hz Band 9: 350 Hz Band 10: 500 Hz Band 11: 700 Hz Band 12: 1000 Hz Band 13: 1400 Hz Band 14: 2000 Hz Band 15: 2800 Hz Band 16: 4000 Hz Band 17: 5600 Hz Band 18: 8000 Hz Band 19: 11000 Hz Band 20: 16000 Hz Band 21: 22000 Hz See also [AudioEffectEQ](class_audioeffecteq#class-audioeffecteq), [AudioEffectEQ6](class_audioeffecteq6#class-audioeffecteq6), [AudioEffectEQ10](class_audioeffecteq10#class-audioeffecteq10). godot ARVRAnchor ARVRAnchor ========== **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) An anchor point in AR space. Description ----------- The `ARVRAnchor` point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them. This node is mapped to one of the anchors through its unique ID. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the ID; the nodes will simply remain on 0,0,0 until a plane is recognized. Keep in mind that, as long as plane detection is enabled, the size, placing and orientation of an anchor will be updated as the detection logic learns more about the real world out there especially if only part of the surface is in view. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [anchor\_id](#class-arvranchor-property-anchor-id) | `1` | Methods ------- | | | | --- | --- | | [String](class_string#class-string) | [get\_anchor\_name](#class-arvranchor-method-get-anchor-name) **(** **)** const | | [bool](class_bool#class-bool) | [get\_is\_active](#class-arvranchor-method-get-is-active) **(** **)** const | | [Mesh](class_mesh#class-mesh) | [get\_mesh](#class-arvranchor-method-get-mesh) **(** **)** const | | [Plane](class_plane#class-plane) | [get\_plane](#class-arvranchor-method-get-plane) **(** **)** const | | [Vector3](class_vector3#class-vector3) | [get\_size](#class-arvranchor-method-get-size) **(** **)** const | Signals ------- ### mesh\_updated ( [Mesh](class_mesh#class-mesh) mesh ) Emitted when the mesh associated with the anchor changes or when one becomes available. This is especially important for topology that is constantly being `mesh_updated`. Property Descriptions --------------------- ### [int](class_int#class-int) anchor\_id | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_anchor\_id(value) | | *Getter* | get\_anchor\_id() | The anchor's ID. You can set this before the anchor itself exists. The first anchor gets an ID of `1`, the second an ID of `2`, etc. When anchors get removed, the engine can then assign the corresponding ID to new anchors. The most common situation where anchors "disappear" is when the AR server identifies that two anchors represent different parts of the same plane and merges them. Method Descriptions ------------------- ### [String](class_string#class-string) get\_anchor\_name ( ) const Returns the name given to this anchor. ### [bool](class_bool#class-bool) get\_is\_active ( ) const Returns `true` if the anchor is being tracked and `false` if no anchor with this ID is currently known. ### [Mesh](class_mesh#class-mesh) get\_mesh ( ) const If provided by the [ARVRInterface](class_arvrinterface#class-arvrinterface), this returns a mesh object for the anchor. For an anchor, this can be a shape related to the object being tracked or it can be a mesh that provides topology related to the anchor and can be used to create shadows/reflections on surfaces or for generating collision shapes. ### [Plane](class_plane#class-plane) get\_plane ( ) const Returns a plane aligned with our anchor; handy for intersection testing. ### [Vector3](class_vector3#class-vector3) get\_size ( ) const Returns the estimated size of the plane that was detected. Say when the anchor relates to a table in the real world, this is the estimated size of the surface of that table.
programming_docs
godot VisualShaderNodeScalarUniform VisualShaderNodeScalarUniform ============================= **Inherits:** [VisualShaderNodeUniform](class_visualshadernodeuniform#class-visualshadernodeuniform) **<** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [default\_value](#class-visualshadernodescalaruniform-property-default-value) | `0.0` | | [bool](class_bool#class-bool) | [default\_value\_enabled](#class-visualshadernodescalaruniform-property-default-value-enabled) | `false` | | [Hint](#enum-visualshadernodescalaruniform-hint) | [hint](#class-visualshadernodescalaruniform-property-hint) | `0` | | [float](class_float#class-float) | [max](#class-visualshadernodescalaruniform-property-max) | `1.0` | | [float](class_float#class-float) | [min](#class-visualshadernodescalaruniform-property-min) | `0.0` | | [float](class_float#class-float) | [step](#class-visualshadernodescalaruniform-property-step) | `0.1` | Enumerations ------------ enum **Hint**: * **HINT\_NONE** = **0** --- No hint used. * **HINT\_RANGE** = **1** --- A range hint for scalar value, which limits possible input values between [min](#class-visualshadernodescalaruniform-property-min) and [max](#class-visualshadernodescalaruniform-property-max). Translated to `hint_range(min, max)` in shader code. * **HINT\_RANGE\_STEP** = **2** --- A range hint for scalar value with step, which limits possible input values between [min](#class-visualshadernodescalaruniform-property-min) and [max](#class-visualshadernodescalaruniform-property-max), with a step (increment) of [step](#class-visualshadernodescalaruniform-property-step)). Translated to `hint_range(min, max, step)` in shader code. * **HINT\_MAX** = **3** --- Represents the size of the [Hint](#enum-visualshadernodescalaruniform-hint) enum. Property Descriptions --------------------- ### [float](class_float#class-float) default\_value | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_default\_value(value) | | *Getter* | get\_default\_value() | A default value to be assigned within the shader. ### [bool](class_bool#class-bool) default\_value\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_default\_value\_enabled(value) | | *Getter* | is\_default\_value\_enabled() | Enables usage of the [default\_value](#class-visualshadernodescalaruniform-property-default-value). ### [Hint](#enum-visualshadernodescalaruniform-hint) hint | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_hint(value) | | *Getter* | get\_hint() | A hint applied to the uniform, which controls the values it can take when set through the inspector. ### [float](class_float#class-float) max | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_max(value) | | *Getter* | get\_max() | Minimum value for range hints. Used if [hint](#class-visualshadernodescalaruniform-property-hint) is set to [HINT\_RANGE](#class-visualshadernodescalaruniform-constant-hint-range) or [HINT\_RANGE\_STEP](#class-visualshadernodescalaruniform-constant-hint-range-step). ### [float](class_float#class-float) min | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_min(value) | | *Getter* | get\_min() | Maximum value for range hints. Used if [hint](#class-visualshadernodescalaruniform-property-hint) is set to [HINT\_RANGE](#class-visualshadernodescalaruniform-constant-hint-range) or [HINT\_RANGE\_STEP](#class-visualshadernodescalaruniform-constant-hint-range-step). ### [float](class_float#class-float) step | | | | --- | --- | | *Default* | `0.1` | | *Setter* | set\_step(value) | | *Getter* | get\_step() | Step (increment) value for the range hint with step. Used if [hint](#class-visualshadernodescalaruniform-property-hint) is set to [HINT\_RANGE\_STEP](#class-visualshadernodescalaruniform-constant-hint-range-step). godot ScrollBar ScrollBar ========= **Inherits:** [Range](class_range#class-range) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [HScrollBar](class_hscrollbar#class-hscrollbar), [VScrollBar](class_vscrollbar#class-vscrollbar) Base class for scroll bars. Description ----------- Scrollbars are a [Range](class_range#class-range)-based [Control](class_control#class-control), that display a draggable area (the size of the page). Horizontal ([HScrollBar](class_hscrollbar#class-hscrollbar)) and Vertical ([VScrollBar](class_vscrollbar#class-vscrollbar)) versions are available. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [custom\_step](#class-scrollbar-property-custom-step) | `-1.0` | | [int](class_int#class-int) | size\_flags\_vertical | `0` (overrides [Control](class_control#class-control-property-size-flags-vertical)) | | [float](class_float#class-float) | step | `0.0` (overrides [Range](class_range#class-range-property-step)) | Signals ------- ### scrolling ( ) Emitted when the scrollbar is being scrolled. Property Descriptions --------------------- ### [float](class_float#class-float) custom\_step | | | | --- | --- | | *Default* | `-1.0` | | *Setter* | set\_custom\_step(value) | | *Getter* | get\_custom\_step() | Overrides the step used when clicking increment and decrement buttons or when using arrow keys when the `ScrollBar` is focused. godot ResourceInteractiveLoader ResourceInteractiveLoader ========================= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Interactive [Resource](class_resource#class-resource) loader. Description ----------- Interactive [Resource](class_resource#class-resource) loader. This object is returned by [ResourceLoader](class_resourceloader#class-resourceloader) when performing an interactive load. It allows loading resources with high granularity, which makes it mainly useful for displaying loading bars or percentages. Methods ------- | | | | --- | --- | | [Resource](class_resource#class-resource) | [get\_resource](#class-resourceinteractiveloader-method-get-resource) **(** **)** | | [int](class_int#class-int) | [get\_stage](#class-resourceinteractiveloader-method-get-stage) **(** **)** const | | [int](class_int#class-int) | [get\_stage\_count](#class-resourceinteractiveloader-method-get-stage-count) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [poll](#class-resourceinteractiveloader-method-poll) **(** **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [wait](#class-resourceinteractiveloader-method-wait) **(** **)** | Method Descriptions ------------------- ### [Resource](class_resource#class-resource) get\_resource ( ) Returns the loaded resource if the load operation completed successfully, `null` otherwise. ### [int](class_int#class-int) get\_stage ( ) const Returns the load stage. The total amount of stages can be queried with [get\_stage\_count](#class-resourceinteractiveloader-method-get-stage-count). ### [int](class_int#class-int) get\_stage\_count ( ) const Returns the total amount of stages (calls to [poll](#class-resourceinteractiveloader-method-poll)) needed to completely load this resource. ### [Error](class_%40globalscope#enum-globalscope-error) poll ( ) Polls the loading operation, i.e. loads a data chunk up to the next stage. Returns [@GlobalScope.OK](class_%40globalscope#class-globalscope-constant-ok) if the poll is successful but the load operation has not finished yet (intermediate stage). This means [poll](#class-resourceinteractiveloader-method-poll) will have to be called again until the last stage is completed. Returns [@GlobalScope.ERR\_FILE\_EOF](class_%40globalscope#class-globalscope-constant-err-file-eof) if the load operation has completed successfully. The loaded resource can be obtained by calling [get\_resource](#class-resourceinteractiveloader-method-get-resource). Returns another [Error](class_%40globalscope#enum-globalscope-error) code if the poll has failed. ### [Error](class_%40globalscope#enum-globalscope-error) wait ( ) Polls the loading operation successively until the resource is completely loaded or a [poll](#class-resourceinteractiveloader-method-poll) fails. Returns [@GlobalScope.ERR\_FILE\_EOF](class_%40globalscope#class-globalscope-constant-err-file-eof) if the load operation has completed successfully. The loaded resource can be obtained by calling [get\_resource](#class-resourceinteractiveloader-method-get-resource). Returns another [Error](class_%40globalscope#enum-globalscope-error) code if a poll has failed, aborting the operation. godot HTTPClient HTTPClient ========== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Low-level hyper-text transfer protocol client. Description ----------- Hyper-text transfer protocol client (sometimes called "User Agent"). Used to make HTTP requests to download web content, upload files and other data or to communicate with various services, among other use cases. See the [HTTPRequest](class_httprequest#class-httprequest) node for a higher-level alternative. **Note:** This client only needs to connect to a host once (see [connect\_to\_host](#class-httpclient-method-connect-to-host)) to send multiple requests. Because of this, methods that take URLs usually take just the part after the host instead of the full URL, as the client is already connected to a host. See [request](#class-httpclient-method-request) for a full example and to get started. A `HTTPClient` should be reused between multiple requests or to connect to different hosts instead of creating one client per request. Supports SSL and SSL server certificate verification. HTTP status codes in the 2xx range indicate success, 3xx redirection (i.e. "try again, but over here"), 4xx something was wrong with the request, and 5xx something went wrong on the server's side. For more information on HTTP, see <https://developer.mozilla.org/en-US/docs/Web/HTTP> (or read RFC 2616 to get it straight from the source: <https://tools.ietf.org/html/rfc2616>). **Note:** When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS). If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the `Access-Control-Allow-Origin: *` HTTP header. **Note:** SSL/TLS support is currently limited to TLS 1.0, TLS 1.1, and TLS 1.2. Attempting to connect to a TLS 1.3-only server will return an error. **Warning:** SSL/TLS certificate revocation and certificate pinning are currently not supported. Revoked certificates are accepted as long as they are otherwise valid. If this is a concern, you may want to use automatically managed certificates with a short validity period. Tutorials --------- * [HTTP client class](https://docs.godotengine.org/en/3.5/tutorials/networking/http_client_class.html) * [SSL certificates](https://docs.godotengine.org/en/3.5/tutorials/networking/ssl_certificates.html) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [blocking\_mode\_enabled](#class-httpclient-property-blocking-mode-enabled) | `false` | | [StreamPeer](class_streampeer#class-streampeer) | [connection](#class-httpclient-property-connection) | | | [int](class_int#class-int) | [read\_chunk\_size](#class-httpclient-property-read-chunk-size) | `65536` | Methods ------- | | | | --- | --- | | void | [close](#class-httpclient-method-close) **(** **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [connect\_to\_host](#class-httpclient-method-connect-to-host) **(** [String](class_string#class-string) host, [int](class_int#class-int) port=-1, [bool](class_bool#class-bool) use\_ssl=false, [bool](class_bool#class-bool) verify\_host=true **)** | | [int](class_int#class-int) | [get\_response\_body\_length](#class-httpclient-method-get-response-body-length) **(** **)** const | | [int](class_int#class-int) | [get\_response\_code](#class-httpclient-method-get-response-code) **(** **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_response\_headers](#class-httpclient-method-get-response-headers) **(** **)** | | [Dictionary](class_dictionary#class-dictionary) | [get\_response\_headers\_as\_dictionary](#class-httpclient-method-get-response-headers-as-dictionary) **(** **)** | | [Status](#enum-httpclient-status) | [get\_status](#class-httpclient-method-get-status) **(** **)** const | | [bool](class_bool#class-bool) | [has\_response](#class-httpclient-method-has-response) **(** **)** const | | [bool](class_bool#class-bool) | [is\_response\_chunked](#class-httpclient-method-is-response-chunked) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [poll](#class-httpclient-method-poll) **(** **)** | | [String](class_string#class-string) | [query\_string\_from\_dict](#class-httpclient-method-query-string-from-dict) **(** [Dictionary](class_dictionary#class-dictionary) fields **)** | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [read\_response\_body\_chunk](#class-httpclient-method-read-response-body-chunk) **(** **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [request](#class-httpclient-method-request) **(** [Method](#enum-httpclient-method) method, [String](class_string#class-string) url, [PoolStringArray](class_poolstringarray#class-poolstringarray) headers, [String](class_string#class-string) body="" **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [request\_raw](#class-httpclient-method-request-raw) **(** [Method](#enum-httpclient-method) method, [String](class_string#class-string) url, [PoolStringArray](class_poolstringarray#class-poolstringarray) headers, [PoolByteArray](class_poolbytearray#class-poolbytearray) body **)** | | void | [set\_http\_proxy](#class-httpclient-method-set-http-proxy) **(** [String](class_string#class-string) host, [int](class_int#class-int) port **)** | | void | [set\_https\_proxy](#class-httpclient-method-set-https-proxy) **(** [String](class_string#class-string) host, [int](class_int#class-int) port **)** | Enumerations ------------ enum **Method**: * **METHOD\_GET** = **0** --- HTTP GET method. The GET method requests a representation of the specified resource. Requests using GET should only retrieve data. * **METHOD\_HEAD** = **1** --- HTTP HEAD method. The HEAD method asks for a response identical to that of a GET request, but without the response body. This is useful to request metadata like HTTP headers or to check if a resource exists. * **METHOD\_POST** = **2** --- HTTP POST method. The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server. This is often used for forms and submitting data or uploading files. * **METHOD\_PUT** = **3** --- HTTP PUT method. The PUT method asks to replace all current representations of the target resource with the request payload. (You can think of POST as "create or update" and PUT as "update", although many services tend to not make a clear distinction or change their meaning). * **METHOD\_DELETE** = **4** --- HTTP DELETE method. The DELETE method requests to delete the specified resource. * **METHOD\_OPTIONS** = **5** --- HTTP OPTIONS method. The OPTIONS method asks for a description of the communication options for the target resource. Rarely used. * **METHOD\_TRACE** = **6** --- HTTP TRACE method. The TRACE method performs a message loop-back test along the path to the target resource. Returns the entire HTTP request received in the response body. Rarely used. * **METHOD\_CONNECT** = **7** --- HTTP CONNECT method. The CONNECT method establishes a tunnel to the server identified by the target resource. Rarely used. * **METHOD\_PATCH** = **8** --- HTTP PATCH method. The PATCH method is used to apply partial modifications to a resource. * **METHOD\_MAX** = **9** --- Represents the size of the [Method](#enum-httpclient-method) enum. enum **Status**: * **STATUS\_DISCONNECTED** = **0** --- Status: Disconnected from the server. * **STATUS\_RESOLVING** = **1** --- Status: Currently resolving the hostname for the given URL into an IP. * **STATUS\_CANT\_RESOLVE** = **2** --- Status: DNS failure: Can't resolve the hostname for the given URL. * **STATUS\_CONNECTING** = **3** --- Status: Currently connecting to server. * **STATUS\_CANT\_CONNECT** = **4** --- Status: Can't connect to the server. * **STATUS\_CONNECTED** = **5** --- Status: Connection established. * **STATUS\_REQUESTING** = **6** --- Status: Currently sending request. * **STATUS\_BODY** = **7** --- Status: HTTP body received. * **STATUS\_CONNECTION\_ERROR** = **8** --- Status: Error in HTTP connection. * **STATUS\_SSL\_HANDSHAKE\_ERROR** = **9** --- Status: Error in SSL handshake. enum **ResponseCode**: * **RESPONSE\_CONTINUE** = **100** --- HTTP status code `100 Continue`. Interim response that indicates everything so far is OK and that the client should continue with the request (or ignore this status if already finished). * **RESPONSE\_SWITCHING\_PROTOCOLS** = **101** --- HTTP status code `101 Switching Protocol`. Sent in response to an `Upgrade` request header by the client. Indicates the protocol the server is switching to. * **RESPONSE\_PROCESSING** = **102** --- HTTP status code `102 Processing` (WebDAV). Indicates that the server has received and is processing the request, but no response is available yet. * **RESPONSE\_OK** = **200** --- HTTP status code `200 OK`. The request has succeeded. Default response for successful requests. Meaning varies depending on the request. GET: The resource has been fetched and is transmitted in the message body. HEAD: The entity headers are in the message body. POST: The resource describing the result of the action is transmitted in the message body. TRACE: The message body contains the request message as received by the server. * **RESPONSE\_CREATED** = **201** --- HTTP status code `201 Created`. The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request. * **RESPONSE\_ACCEPTED** = **202** --- HTTP status code `202 Accepted`. The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing. * **RESPONSE\_NON\_AUTHORITATIVE\_INFORMATION** = **203** --- HTTP status code `203 Non-Authoritative Information`. This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response. * **RESPONSE\_NO\_CONTENT** = **204** --- HTTP status code `204 No Content`. There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones. * **RESPONSE\_RESET\_CONTENT** = **205** --- HTTP status code `205 Reset Content`. The server has fulfilled the request and desires that the client resets the "document view" that caused the request to be sent to its original state as received from the origin server. * **RESPONSE\_PARTIAL\_CONTENT** = **206** --- HTTP status code `206 Partial Content`. This response code is used because of a range header sent by the client to separate download into multiple streams. * **RESPONSE\_MULTI\_STATUS** = **207** --- HTTP status code `207 Multi-Status` (WebDAV). A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate. * **RESPONSE\_ALREADY\_REPORTED** = **208** --- HTTP status code `208 Already Reported` (WebDAV). Used inside a DAV: propstat response element to avoid enumerating the internal members of multiple bindings to the same collection repeatedly. * **RESPONSE\_IM\_USED** = **226** --- HTTP status code `226 IM Used` (WebDAV). The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance. * **RESPONSE\_MULTIPLE\_CHOICES** = **300** --- HTTP status code `300 Multiple Choice`. The request has more than one possible responses and there is no standardized way to choose one of the responses. User-agent or user should choose one of them. * **RESPONSE\_MOVED\_PERMANENTLY** = **301** --- HTTP status code `301 Moved Permanently`. Redirection. This response code means the URI of requested resource has been changed. The new URI is usually included in the response. * **RESPONSE\_FOUND** = **302** --- HTTP status code `302 Found`. Temporary redirection. This response code means the URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests. * **RESPONSE\_SEE\_OTHER** = **303** --- HTTP status code `303 See Other`. The server is redirecting the user agent to a different resource, as indicated by a URI in the Location header field, which is intended to provide an indirect response to the original request. * **RESPONSE\_NOT\_MODIFIED** = **304** --- HTTP status code `304 Not Modified`. A conditional GET or HEAD request has been received and would have resulted in a 200 OK response if it were not for the fact that the condition evaluated to `false`. * **RESPONSE\_USE\_PROXY** = **305** --- HTTP status code `305 Use Proxy`. *Deprecated. Do not use.* * **RESPONSE\_SWITCH\_PROXY** = **306** --- HTTP status code `306 Switch Proxy`. *Deprecated. Do not use.* * **RESPONSE\_TEMPORARY\_REDIRECT** = **307** --- HTTP status code `307 Temporary Redirect`. The target resource resides temporarily under a different URI and the user agent MUST NOT change the request method if it performs an automatic redirection to that URI. * **RESPONSE\_PERMANENT\_REDIRECT** = **308** --- HTTP status code `308 Permanent Redirect`. The target resource has been assigned a new permanent URI and any future references to this resource ought to use one of the enclosed URIs. * **RESPONSE\_BAD\_REQUEST** = **400** --- HTTP status code `400 Bad Request`. The request was invalid. The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, invalid request contents, or deceptive request routing). * **RESPONSE\_UNAUTHORIZED** = **401** --- HTTP status code `401 Unauthorized`. Credentials required. The request has not been applied because it lacks valid authentication credentials for the target resource. * **RESPONSE\_PAYMENT\_REQUIRED** = **402** --- HTTP status code `402 Payment Required`. This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems, however this is not currently used. * **RESPONSE\_FORBIDDEN** = **403** --- HTTP status code `403 Forbidden`. The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give proper response. Unlike `401`, the client's identity is known to the server. * **RESPONSE\_NOT\_FOUND** = **404** --- HTTP status code `404 Not Found`. The server can not find requested resource. Either the URL is not recognized or the endpoint is valid but the resource itself does not exist. May also be sent instead of 403 to hide existence of a resource if the client is not authorized. * **RESPONSE\_METHOD\_NOT\_ALLOWED** = **405** --- HTTP status code `405 Method Not Allowed`. The request's HTTP method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code. * **RESPONSE\_NOT\_ACCEPTABLE** = **406** --- HTTP status code `406 Not Acceptable`. The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request. Used when negotiation content. * **RESPONSE\_PROXY\_AUTHENTICATION\_REQUIRED** = **407** --- HTTP status code `407 Proxy Authentication Required`. Similar to 401 Unauthorized, but it indicates that the client needs to authenticate itself in order to use a proxy. * **RESPONSE\_REQUEST\_TIMEOUT** = **408** --- HTTP status code `408 Request Timeout`. The server did not receive a complete request message within the time that it was prepared to wait. * **RESPONSE\_CONFLICT** = **409** --- HTTP status code `409 Conflict`. The request could not be completed due to a conflict with the current state of the target resource. This code is used in situations where the user might be able to resolve the conflict and resubmit the request. * **RESPONSE\_GONE** = **410** --- HTTP status code `410 Gone`. The target resource is no longer available at the origin server and this condition is likely permanent. * **RESPONSE\_LENGTH\_REQUIRED** = **411** --- HTTP status code `411 Length Required`. The server refuses to accept the request without a defined Content-Length header. * **RESPONSE\_PRECONDITION\_FAILED** = **412** --- HTTP status code `412 Precondition Failed`. One or more conditions given in the request header fields evaluated to `false` when tested on the server. * **RESPONSE\_REQUEST\_ENTITY\_TOO\_LARGE** = **413** --- HTTP status code `413 Entity Too Large`. The server is refusing to process a request because the request payload is larger than the server is willing or able to process. * **RESPONSE\_REQUEST\_URI\_TOO\_LONG** = **414** --- HTTP status code `414 Request-URI Too Long`. The server is refusing to service the request because the request-target is longer than the server is willing to interpret. * **RESPONSE\_UNSUPPORTED\_MEDIA\_TYPE** = **415** --- HTTP status code `415 Unsupported Media Type`. The origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource. * **RESPONSE\_REQUESTED\_RANGE\_NOT\_SATISFIABLE** = **416** --- HTTP status code `416 Requested Range Not Satisfiable`. None of the ranges in the request's Range header field overlap the current extent of the selected resource or the set of ranges requested has been rejected due to invalid ranges or an excessive request of small or overlapping ranges. * **RESPONSE\_EXPECTATION\_FAILED** = **417** --- HTTP status code `417 Expectation Failed`. The expectation given in the request's Expect header field could not be met by at least one of the inbound servers. * **RESPONSE\_IM\_A\_TEAPOT** = **418** --- HTTP status code `418 I'm A Teapot`. Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout. * **RESPONSE\_MISDIRECTED\_REQUEST** = **421** --- HTTP status code `421 Misdirected Request`. The request was directed at a server that is not able to produce a response. This can be sent by a server that is not configured to produce responses for the combination of scheme and authority that are included in the request URI. * **RESPONSE\_UNPROCESSABLE\_ENTITY** = **422** --- HTTP status code `422 Unprocessable Entity` (WebDAV). The server understands the content type of the request entity (hence a 415 Unsupported Media Type status code is inappropriate), and the syntax of the request entity is correct (thus a 400 Bad Request status code is inappropriate) but was unable to process the contained instructions. * **RESPONSE\_LOCKED** = **423** --- HTTP status code `423 Locked` (WebDAV). The source or destination resource of a method is locked. * **RESPONSE\_FAILED\_DEPENDENCY** = **424** --- HTTP status code `424 Failed Dependency` (WebDAV). The method could not be performed on the resource because the requested action depended on another action and that action failed. * **RESPONSE\_UPGRADE\_REQUIRED** = **426** --- HTTP status code `426 Upgrade Required`. The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol. * **RESPONSE\_PRECONDITION\_REQUIRED** = **428** --- HTTP status code `428 Precondition Required`. The origin server requires the request to be conditional. * **RESPONSE\_TOO\_MANY\_REQUESTS** = **429** --- HTTP status code `429 Too Many Requests`. The user has sent too many requests in a given amount of time (see "rate limiting"). Back off and increase time between requests or try again later. * **RESPONSE\_REQUEST\_HEADER\_FIELDS\_TOO\_LARGE** = **431** --- HTTP status code `431 Request Header Fields Too Large`. The server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields. * **RESPONSE\_UNAVAILABLE\_FOR\_LEGAL\_REASONS** = **451** --- HTTP status code `451 Response Unavailable For Legal Reasons`. The server is denying access to the resource as a consequence of a legal demand. * **RESPONSE\_INTERNAL\_SERVER\_ERROR** = **500** --- HTTP status code `500 Internal Server Error`. The server encountered an unexpected condition that prevented it from fulfilling the request. * **RESPONSE\_NOT\_IMPLEMENTED** = **501** --- HTTP status code `501 Not Implemented`. The server does not support the functionality required to fulfill the request. * **RESPONSE\_BAD\_GATEWAY** = **502** --- HTTP status code `502 Bad Gateway`. The server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request. Usually returned by load balancers or proxies. * **RESPONSE\_SERVICE\_UNAVAILABLE** = **503** --- HTTP status code `503 Service Unavailable`. The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. Try again later. * **RESPONSE\_GATEWAY\_TIMEOUT** = **504** --- HTTP status code `504 Gateway Timeout`. The server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request. Usually returned by load balancers or proxies. * **RESPONSE\_HTTP\_VERSION\_NOT\_SUPPORTED** = **505** --- HTTP status code `505 HTTP Version Not Supported`. The server does not support, or refuses to support, the major version of HTTP that was used in the request message. * **RESPONSE\_VARIANT\_ALSO\_NEGOTIATES** = **506** --- HTTP status code `506 Variant Also Negotiates`. The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process. * **RESPONSE\_INSUFFICIENT\_STORAGE** = **507** --- HTTP status code `507 Insufficient Storage`. The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. * **RESPONSE\_LOOP\_DETECTED** = **508** --- HTTP status code `508 Loop Detected`. The server terminated an operation because it encountered an infinite loop while processing a request with "Depth: infinity". This status indicates that the entire operation failed. * **RESPONSE\_NOT\_EXTENDED** = **510** --- HTTP status code `510 Not Extended`. The policy for accessing the resource has not been met in the request. The server should send back all the information necessary for the client to issue an extended request. * **RESPONSE\_NETWORK\_AUTH\_REQUIRED** = **511** --- HTTP status code `511 Network Authentication Required`. The client needs to authenticate to gain network access. Property Descriptions --------------------- ### [bool](class_bool#class-bool) blocking\_mode\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_blocking\_mode(value) | | *Getter* | is\_blocking\_mode\_enabled() | If `true`, execution will block until all data is read from the response. ### [StreamPeer](class_streampeer#class-streampeer) connection | | | | --- | --- | | *Setter* | set\_connection(value) | | *Getter* | get\_connection() | The connection to use for this client. ### [int](class_int#class-int) read\_chunk\_size | | | | --- | --- | | *Default* | `65536` | | *Setter* | set\_read\_chunk\_size(value) | | *Getter* | get\_read\_chunk\_size() | The size of the buffer used and maximum bytes to read per iteration. See [read\_response\_body\_chunk](#class-httpclient-method-read-response-body-chunk). Method Descriptions ------------------- ### void close ( ) Closes the current connection, allowing reuse of this `HTTPClient`. ### [Error](class_%40globalscope#enum-globalscope-error) connect\_to\_host ( [String](class_string#class-string) host, [int](class_int#class-int) port=-1, [bool](class_bool#class-bool) use\_ssl=false, [bool](class_bool#class-bool) verify\_host=true ) Connects to a host. This needs to be done before any requests are sent. The host should not have [http://](#) prepended but will strip the protocol identifier if provided. If no `port` is specified (or `-1` is used), it is automatically set to 80 for HTTP and 443 for HTTPS (if `use_ssl` is enabled). `verify_host` will check the SSL identity of the host if set to `true`. ### [int](class_int#class-int) get\_response\_body\_length ( ) const Returns the response's body length. **Note:** Some Web servers may not send a body length. In this case, the value returned will be `-1`. If using chunked transfer encoding, the body length will also be `-1`. ### [int](class_int#class-int) get\_response\_code ( ) const Returns the response's HTTP status code. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_response\_headers ( ) Returns the response headers. ### [Dictionary](class_dictionary#class-dictionary) get\_response\_headers\_as\_dictionary ( ) Returns all response headers as a Dictionary of structure `{ "key": "value1; value2" }` where the case-sensitivity of the keys and values is kept like the server delivers it. A value is a simple String, this string can have more than one value where "; " is used as separator. **Example:** ``` { "content-length": 12, "Content-Type": "application/json; charset=UTF-8", } ``` ### [Status](#enum-httpclient-status) get\_status ( ) const Returns a [Status](#enum-httpclient-status) constant. Need to call [poll](#class-httpclient-method-poll) in order to get status updates. ### [bool](class_bool#class-bool) has\_response ( ) const If `true`, this `HTTPClient` has a response available. ### [bool](class_bool#class-bool) is\_response\_chunked ( ) const If `true`, this `HTTPClient` has a response that is chunked. ### [Error](class_%40globalscope#enum-globalscope-error) poll ( ) This needs to be called in order to have any request processed. Check results with [get\_status](#class-httpclient-method-get-status). ### [String](class_string#class-string) query\_string\_from\_dict ( [Dictionary](class_dictionary#class-dictionary) fields ) Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary, e.g.: ``` var fields = {"username": "user", "password": "pass"} var query_string = http_client.query_string_from_dict(fields) # Returns "username=user&password=pass" ``` Furthermore, if a key has a `null` value, only the key itself is added, without equal sign and value. If the value is an array, for each value in it a pair with the same key is added. ``` var fields = {"single": 123, "not_valued": null, "multiple": [22, 33, 44]} var query_string = http_client.query_string_from_dict(fields) # Returns "single=123&not_valued&multiple=22&multiple=33&multiple=44" ``` ### [PoolByteArray](class_poolbytearray#class-poolbytearray) read\_response\_body\_chunk ( ) Reads one chunk from the response. ### [Error](class_%40globalscope#enum-globalscope-error) request ( [Method](#enum-httpclient-method) method, [String](class_string#class-string) url, [PoolStringArray](class_poolstringarray#class-poolstringarray) headers, [String](class_string#class-string) body="" ) Sends a request to the connected host. The URL parameter is usually just the part after the host, so for `http://somehost.com/index.php`, it is `/index.php`. When sending requests to an HTTP proxy server, it should be an absolute URL. For [METHOD\_OPTIONS](#class-httpclient-constant-method-options) requests, `*` is also allowed. For [METHOD\_CONNECT](#class-httpclient-constant-method-connect) requests, it should be the authority component (`host:port`). Headers are HTTP request headers. For available HTTP methods, see [Method](#enum-httpclient-method). To create a POST request with query strings to push to the server, do: ``` var fields = {"username" : "user", "password" : "pass"} var query_string = http_client.query_string_from_dict(fields) var headers = ["Content-Type: application/x-www-form-urlencoded", "Content-Length: " + str(query_string.length())] var result = http_client.request(http_client.METHOD_POST, "/index.php", headers, query_string) ``` **Note:** The `request_data` parameter is ignored if `method` is [METHOD\_GET](#class-httpclient-constant-method-get). This is because GET methods can't contain request data. As a workaround, you can pass request data as a query string in the URL. See [String.http\_escape](class_string#class-string-method-http-escape) for an example. ### [Error](class_%40globalscope#enum-globalscope-error) request\_raw ( [Method](#enum-httpclient-method) method, [String](class_string#class-string) url, [PoolStringArray](class_poolstringarray#class-poolstringarray) headers, [PoolByteArray](class_poolbytearray#class-poolbytearray) body ) Sends a raw request to the connected host. The URL parameter is usually just the part after the host, so for `http://somehost.com/index.php`, it is `/index.php`. When sending requests to an HTTP proxy server, it should be an absolute URL. For [METHOD\_OPTIONS](#class-httpclient-constant-method-options) requests, `*` is also allowed. For [METHOD\_CONNECT](#class-httpclient-constant-method-connect) requests, it should be the authority component (`host:port`). Headers are HTTP request headers. For available HTTP methods, see [Method](#enum-httpclient-method). Sends the body data raw, as a byte array and does not encode it in any way. ### void set\_http\_proxy ( [String](class_string#class-string) host, [int](class_int#class-int) port ) Sets the proxy server for HTTP requests. The proxy server is unset if `host` is empty or `port` is -1. ### void set\_https\_proxy ( [String](class_string#class-string) host, [int](class_int#class-int) port ) Sets the proxy server for HTTPS requests. The proxy server is unset if `host` is empty or `port` is -1.
programming_docs
godot VisualShaderNodeFaceForward VisualShaderNodeFaceForward =========================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Returns the vector that points in the same direction as a reference vector within the visual shader graph. Description ----------- Translates to `faceforward(N, I, Nref)` in the shader language. The function has three vector parameters: `N`, the vector to orient, `I`, the incident vector, and `Nref`, the reference vector. If the dot product of `I` and `Nref` is smaller than zero the return value is `N`. Otherwise, `-N` is returned. godot VisualScriptEngineSingleton VisualScriptEngineSingleton =========================== **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A Visual Script node returning a singleton from [@GlobalScope](class_%40globalscope#class-globalscope). Description ----------- A Visual Script node returning a singleton from [@GlobalScope](class_%40globalscope#class-globalscope). Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [constant](#class-visualscriptenginesingleton-property-constant) | `""` | Property Descriptions --------------------- ### [String](class_string#class-string) constant | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_singleton(value) | | *Getter* | get\_singleton() | The singleton's name. godot TextFile TextFile ======== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) godot CPUParticles CPUParticles ============ **Inherits:** [GeometryInstance](class_geometryinstance#class-geometryinstance) **<** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) CPU-based 3D particle emitter. Description ----------- CPU-based 3D particle node used to create a variety of particle systems and effects. See also [Particles](class_particles#class-particles), which provides the same functionality with hardware acceleration, but may not run on older devices. **Note:** Unlike [Particles](class_particles#class-particles), the visibility rect is generated on-the-fly and doesn't need to be configured by the user. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [amount](#class-cpuparticles-property-amount) | `8` | | [float](class_float#class-float) | [angle](#class-cpuparticles-property-angle) | `0.0` | | [Curve](class_curve#class-curve) | [angle\_curve](#class-cpuparticles-property-angle-curve) | | | [float](class_float#class-float) | [angle\_random](#class-cpuparticles-property-angle-random) | `0.0` | | [float](class_float#class-float) | [angular\_velocity](#class-cpuparticles-property-angular-velocity) | `0.0` | | [Curve](class_curve#class-curve) | [angular\_velocity\_curve](#class-cpuparticles-property-angular-velocity-curve) | | | [float](class_float#class-float) | [angular\_velocity\_random](#class-cpuparticles-property-angular-velocity-random) | `0.0` | | [float](class_float#class-float) | [anim\_offset](#class-cpuparticles-property-anim-offset) | `0.0` | | [Curve](class_curve#class-curve) | [anim\_offset\_curve](#class-cpuparticles-property-anim-offset-curve) | | | [float](class_float#class-float) | [anim\_offset\_random](#class-cpuparticles-property-anim-offset-random) | `0.0` | | [float](class_float#class-float) | [anim\_speed](#class-cpuparticles-property-anim-speed) | `0.0` | | [Curve](class_curve#class-curve) | [anim\_speed\_curve](#class-cpuparticles-property-anim-speed-curve) | | | [float](class_float#class-float) | [anim\_speed\_random](#class-cpuparticles-property-anim-speed-random) | `0.0` | | [Color](class_color#class-color) | [color](#class-cpuparticles-property-color) | `Color( 1, 1, 1, 1 )` | | [Gradient](class_gradient#class-gradient) | [color\_initial\_ramp](#class-cpuparticles-property-color-initial-ramp) | | | [Gradient](class_gradient#class-gradient) | [color\_ramp](#class-cpuparticles-property-color-ramp) | | | [float](class_float#class-float) | [damping](#class-cpuparticles-property-damping) | `0.0` | | [Curve](class_curve#class-curve) | [damping\_curve](#class-cpuparticles-property-damping-curve) | | | [float](class_float#class-float) | [damping\_random](#class-cpuparticles-property-damping-random) | `0.0` | | [Vector3](class_vector3#class-vector3) | [direction](#class-cpuparticles-property-direction) | `Vector3( 1, 0, 0 )` | | [DrawOrder](#enum-cpuparticles-draworder) | [draw\_order](#class-cpuparticles-property-draw-order) | `0` | | [Vector3](class_vector3#class-vector3) | [emission\_box\_extents](#class-cpuparticles-property-emission-box-extents) | | | [PoolColorArray](class_poolcolorarray#class-poolcolorarray) | [emission\_colors](#class-cpuparticles-property-emission-colors) | | | [PoolVector3Array](class_poolvector3array#class-poolvector3array) | [emission\_normals](#class-cpuparticles-property-emission-normals) | | | [PoolVector3Array](class_poolvector3array#class-poolvector3array) | [emission\_points](#class-cpuparticles-property-emission-points) | | | [Vector3](class_vector3#class-vector3) | [emission\_ring\_axis](#class-cpuparticles-property-emission-ring-axis) | | | [float](class_float#class-float) | [emission\_ring\_height](#class-cpuparticles-property-emission-ring-height) | | | [float](class_float#class-float) | [emission\_ring\_inner\_radius](#class-cpuparticles-property-emission-ring-inner-radius) | | | [float](class_float#class-float) | [emission\_ring\_radius](#class-cpuparticles-property-emission-ring-radius) | | | [EmissionShape](#enum-cpuparticles-emissionshape) | [emission\_shape](#class-cpuparticles-property-emission-shape) | `0` | | [float](class_float#class-float) | [emission\_sphere\_radius](#class-cpuparticles-property-emission-sphere-radius) | | | [bool](class_bool#class-bool) | [emitting](#class-cpuparticles-property-emitting) | `true` | | [float](class_float#class-float) | [explosiveness](#class-cpuparticles-property-explosiveness) | `0.0` | | [int](class_int#class-int) | [fixed\_fps](#class-cpuparticles-property-fixed-fps) | `0` | | [bool](class_bool#class-bool) | [flag\_align\_y](#class-cpuparticles-property-flag-align-y) | `false` | | [bool](class_bool#class-bool) | [flag\_disable\_z](#class-cpuparticles-property-flag-disable-z) | `false` | | [bool](class_bool#class-bool) | [flag\_rotate\_y](#class-cpuparticles-property-flag-rotate-y) | `false` | | [float](class_float#class-float) | [flatness](#class-cpuparticles-property-flatness) | `0.0` | | [bool](class_bool#class-bool) | [fract\_delta](#class-cpuparticles-property-fract-delta) | `true` | | [Vector3](class_vector3#class-vector3) | [gravity](#class-cpuparticles-property-gravity) | `Vector3( 0, -9.8, 0 )` | | [float](class_float#class-float) | [hue\_variation](#class-cpuparticles-property-hue-variation) | `0.0` | | [Curve](class_curve#class-curve) | [hue\_variation\_curve](#class-cpuparticles-property-hue-variation-curve) | | | [float](class_float#class-float) | [hue\_variation\_random](#class-cpuparticles-property-hue-variation-random) | `0.0` | | [float](class_float#class-float) | [initial\_velocity](#class-cpuparticles-property-initial-velocity) | `0.0` | | [float](class_float#class-float) | [initial\_velocity\_random](#class-cpuparticles-property-initial-velocity-random) | `0.0` | | [float](class_float#class-float) | [lifetime](#class-cpuparticles-property-lifetime) | `1.0` | | [float](class_float#class-float) | [lifetime\_randomness](#class-cpuparticles-property-lifetime-randomness) | `0.0` | | [float](class_float#class-float) | [linear\_accel](#class-cpuparticles-property-linear-accel) | `0.0` | | [Curve](class_curve#class-curve) | [linear\_accel\_curve](#class-cpuparticles-property-linear-accel-curve) | | | [float](class_float#class-float) | [linear\_accel\_random](#class-cpuparticles-property-linear-accel-random) | `0.0` | | [bool](class_bool#class-bool) | [local\_coords](#class-cpuparticles-property-local-coords) | `true` | | [Mesh](class_mesh#class-mesh) | [mesh](#class-cpuparticles-property-mesh) | | | [bool](class_bool#class-bool) | [one\_shot](#class-cpuparticles-property-one-shot) | `false` | | [float](class_float#class-float) | [orbit\_velocity](#class-cpuparticles-property-orbit-velocity) | | | [Curve](class_curve#class-curve) | [orbit\_velocity\_curve](#class-cpuparticles-property-orbit-velocity-curve) | | | [float](class_float#class-float) | [orbit\_velocity\_random](#class-cpuparticles-property-orbit-velocity-random) | | | [float](class_float#class-float) | [preprocess](#class-cpuparticles-property-preprocess) | `0.0` | | [float](class_float#class-float) | [radial\_accel](#class-cpuparticles-property-radial-accel) | `0.0` | | [Curve](class_curve#class-curve) | [radial\_accel\_curve](#class-cpuparticles-property-radial-accel-curve) | | | [float](class_float#class-float) | [radial\_accel\_random](#class-cpuparticles-property-radial-accel-random) | `0.0` | | [float](class_float#class-float) | [randomness](#class-cpuparticles-property-randomness) | `0.0` | | [float](class_float#class-float) | [scale\_amount](#class-cpuparticles-property-scale-amount) | `1.0` | | [Curve](class_curve#class-curve) | [scale\_amount\_curve](#class-cpuparticles-property-scale-amount-curve) | | | [float](class_float#class-float) | [scale\_amount\_random](#class-cpuparticles-property-scale-amount-random) | `0.0` | | [float](class_float#class-float) | [speed\_scale](#class-cpuparticles-property-speed-scale) | `1.0` | | [float](class_float#class-float) | [spread](#class-cpuparticles-property-spread) | `45.0` | | [float](class_float#class-float) | [tangential\_accel](#class-cpuparticles-property-tangential-accel) | `0.0` | | [Curve](class_curve#class-curve) | [tangential\_accel\_curve](#class-cpuparticles-property-tangential-accel-curve) | | | [float](class_float#class-float) | [tangential\_accel\_random](#class-cpuparticles-property-tangential-accel-random) | `0.0` | Methods ------- | | | | --- | --- | | void | [convert\_from\_particles](#class-cpuparticles-method-convert-from-particles) **(** [Node](class_node#class-node) particles **)** | | [float](class_float#class-float) | [get\_param](#class-cpuparticles-method-get-param) **(** [Parameter](#enum-cpuparticles-parameter) param **)** const | | [Curve](class_curve#class-curve) | [get\_param\_curve](#class-cpuparticles-method-get-param-curve) **(** [Parameter](#enum-cpuparticles-parameter) param **)** const | | [float](class_float#class-float) | [get\_param\_randomness](#class-cpuparticles-method-get-param-randomness) **(** [Parameter](#enum-cpuparticles-parameter) param **)** const | | [bool](class_bool#class-bool) | [get\_particle\_flag](#class-cpuparticles-method-get-particle-flag) **(** [Flags](#enum-cpuparticles-flags) flag **)** const | | void | [restart](#class-cpuparticles-method-restart) **(** **)** | | void | [set\_param](#class-cpuparticles-method-set-param) **(** [Parameter](#enum-cpuparticles-parameter) param, [float](class_float#class-float) value **)** | | void | [set\_param\_curve](#class-cpuparticles-method-set-param-curve) **(** [Parameter](#enum-cpuparticles-parameter) param, [Curve](class_curve#class-curve) curve **)** | | void | [set\_param\_randomness](#class-cpuparticles-method-set-param-randomness) **(** [Parameter](#enum-cpuparticles-parameter) param, [float](class_float#class-float) randomness **)** | | void | [set\_particle\_flag](#class-cpuparticles-method-set-particle-flag) **(** [Flags](#enum-cpuparticles-flags) flag, [bool](class_bool#class-bool) enable **)** | Enumerations ------------ enum **DrawOrder**: * **DRAW\_ORDER\_INDEX** = **0** --- Particles are drawn in the order emitted. * **DRAW\_ORDER\_LIFETIME** = **1** --- Particles are drawn in order of remaining lifetime. * **DRAW\_ORDER\_VIEW\_DEPTH** = **2** --- Particles are drawn in order of depth. enum **Parameter**: * **PARAM\_INITIAL\_LINEAR\_VELOCITY** = **0** --- Use with [set\_param](#class-cpuparticles-method-set-param), [set\_param\_randomness](#class-cpuparticles-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles-method-set-param-curve) to set initial velocity properties. * **PARAM\_ANGULAR\_VELOCITY** = **1** --- Use with [set\_param](#class-cpuparticles-method-set-param), [set\_param\_randomness](#class-cpuparticles-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles-method-set-param-curve) to set angular velocity properties. * **PARAM\_ORBIT\_VELOCITY** = **2** --- Use with [set\_param](#class-cpuparticles-method-set-param), [set\_param\_randomness](#class-cpuparticles-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles-method-set-param-curve) to set orbital velocity properties. * **PARAM\_LINEAR\_ACCEL** = **3** --- Use with [set\_param](#class-cpuparticles-method-set-param), [set\_param\_randomness](#class-cpuparticles-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles-method-set-param-curve) to set linear acceleration properties. * **PARAM\_RADIAL\_ACCEL** = **4** --- Use with [set\_param](#class-cpuparticles-method-set-param), [set\_param\_randomness](#class-cpuparticles-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles-method-set-param-curve) to set radial acceleration properties. * **PARAM\_TANGENTIAL\_ACCEL** = **5** --- Use with [set\_param](#class-cpuparticles-method-set-param), [set\_param\_randomness](#class-cpuparticles-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles-method-set-param-curve) to set tangential acceleration properties. * **PARAM\_DAMPING** = **6** --- Use with [set\_param](#class-cpuparticles-method-set-param), [set\_param\_randomness](#class-cpuparticles-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles-method-set-param-curve) to set damping properties. * **PARAM\_ANGLE** = **7** --- Use with [set\_param](#class-cpuparticles-method-set-param), [set\_param\_randomness](#class-cpuparticles-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles-method-set-param-curve) to set angle properties. * **PARAM\_SCALE** = **8** --- Use with [set\_param](#class-cpuparticles-method-set-param), [set\_param\_randomness](#class-cpuparticles-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles-method-set-param-curve) to set scale properties. * **PARAM\_HUE\_VARIATION** = **9** --- Use with [set\_param](#class-cpuparticles-method-set-param), [set\_param\_randomness](#class-cpuparticles-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles-method-set-param-curve) to set hue variation properties. * **PARAM\_ANIM\_SPEED** = **10** --- Use with [set\_param](#class-cpuparticles-method-set-param), [set\_param\_randomness](#class-cpuparticles-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles-method-set-param-curve) to set animation speed properties. * **PARAM\_ANIM\_OFFSET** = **11** --- Use with [set\_param](#class-cpuparticles-method-set-param), [set\_param\_randomness](#class-cpuparticles-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles-method-set-param-curve) to set animation offset properties. * **PARAM\_MAX** = **12** --- Represents the size of the [Parameter](#enum-cpuparticles-parameter) enum. enum **Flags**: * **FLAG\_ALIGN\_Y\_TO\_VELOCITY** = **0** --- Use with [set\_particle\_flag](#class-cpuparticles-method-set-particle-flag) to set [flag\_align\_y](#class-cpuparticles-property-flag-align-y). * **FLAG\_ROTATE\_Y** = **1** --- Use with [set\_particle\_flag](#class-cpuparticles-method-set-particle-flag) to set [flag\_rotate\_y](#class-cpuparticles-property-flag-rotate-y). * **FLAG\_DISABLE\_Z** = **2** --- Use with [set\_particle\_flag](#class-cpuparticles-method-set-particle-flag) to set [flag\_disable\_z](#class-cpuparticles-property-flag-disable-z). * **FLAG\_MAX** = **3** --- Represents the size of the [Flags](#enum-cpuparticles-flags) enum. enum **EmissionShape**: * **EMISSION\_SHAPE\_POINT** = **0** --- All particles will be emitted from a single point. * **EMISSION\_SHAPE\_SPHERE** = **1** --- Particles will be emitted in the volume of a sphere. * **EMISSION\_SHAPE\_BOX** = **2** --- Particles will be emitted in the volume of a box. * **EMISSION\_SHAPE\_POINTS** = **3** --- Particles will be emitted at a position chosen randomly among [emission\_points](#class-cpuparticles-property-emission-points). Particle color will be modulated by [emission\_colors](#class-cpuparticles-property-emission-colors). * **EMISSION\_SHAPE\_DIRECTED\_POINTS** = **4** --- Particles will be emitted at a position chosen randomly among [emission\_points](#class-cpuparticles-property-emission-points). Particle velocity and rotation will be set based on [emission\_normals](#class-cpuparticles-property-emission-normals). Particle color will be modulated by [emission\_colors](#class-cpuparticles-property-emission-colors). * **EMISSION\_SHAPE\_RING** = **5** --- Particles will be emitted in a ring or cylinder. * **EMISSION\_SHAPE\_MAX** = **6** --- Represents the size of the [EmissionShape](#enum-cpuparticles-emissionshape) enum. Property Descriptions --------------------- ### [int](class_int#class-int) amount | | | | --- | --- | | *Default* | `8` | | *Setter* | set\_amount(value) | | *Getter* | get\_amount() | The number of particles emitted in one emission cycle (corresponding to the [lifetime](#class-cpuparticles-property-lifetime)). **Note:** Changing [amount](#class-cpuparticles-property-amount) will reset the particle emission, therefore removing all particles that were already emitted before changing [amount](#class-cpuparticles-property-amount). ### [float](class_float#class-float) angle | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial rotation applied to each particle, in degrees. ### [Curve](class_curve#class-curve) angle\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's rotation will be animated along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) angle\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Rotation randomness ratio. ### [float](class_float#class-float) angular\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial angular velocity applied to each particle in *degrees* per second. Sets the speed of rotation of the particle. ### [Curve](class_curve#class-curve) angular\_velocity\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's angular velocity will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) angular\_velocity\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Angular velocity randomness ratio. ### [float](class_float#class-float) anim\_offset | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Particle animation offset. ### [Curve](class_curve#class-curve) anim\_offset\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's animation offset will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) anim\_offset\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Animation offset randomness ratio. ### [float](class_float#class-float) anim\_speed | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Particle animation speed. ### [Curve](class_curve#class-curve) anim\_speed\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's animation speed will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) anim\_speed\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Animation speed randomness ratio. ### [Color](class_color#class-color) color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_color(value) | | *Getter* | get\_color() | Each particle's initial color. To have particle display color in a [SpatialMaterial](class_spatialmaterial#class-spatialmaterial) make sure to set [SpatialMaterial.vertex\_color\_use\_as\_albedo](class_spatialmaterial#class-spatialmaterial-property-vertex-color-use-as-albedo) to `true`. ### [Gradient](class_gradient#class-gradient) color\_initial\_ramp | | | | --- | --- | | *Setter* | set\_color\_initial\_ramp(value) | | *Getter* | get\_color\_initial\_ramp() | Each particle's initial color will vary along this [GradientTexture](class_gradienttexture#class-gradienttexture) (multiplied with [color](#class-cpuparticles-property-color)). ### [Gradient](class_gradient#class-gradient) color\_ramp | | | | --- | --- | | *Setter* | set\_color\_ramp(value) | | *Getter* | get\_color\_ramp() | Each particle's color will vary along this [GradientTexture](class_gradienttexture#class-gradienttexture) over its lifetime (multiplied with [color](#class-cpuparticles-property-color)). ### [float](class_float#class-float) damping | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The rate at which particles lose velocity. ### [Curve](class_curve#class-curve) damping\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Damping will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) damping\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Damping randomness ratio. ### [Vector3](class_vector3#class-vector3) direction | | | | --- | --- | | *Default* | `Vector3( 1, 0, 0 )` | | *Setter* | set\_direction(value) | | *Getter* | get\_direction() | Unit vector specifying the particles' emission direction. ### [DrawOrder](#enum-cpuparticles-draworder) draw\_order | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_draw\_order(value) | | *Getter* | get\_draw\_order() | Particle draw order. Uses [DrawOrder](#enum-cpuparticles-draworder) values. ### [Vector3](class_vector3#class-vector3) emission\_box\_extents | | | | --- | --- | | *Setter* | set\_emission\_box\_extents(value) | | *Getter* | get\_emission\_box\_extents() | The rectangle's extents if [emission\_shape](#class-cpuparticles-property-emission-shape) is set to [EMISSION\_SHAPE\_BOX](#class-cpuparticles-constant-emission-shape-box). ### [PoolColorArray](class_poolcolorarray#class-poolcolorarray) emission\_colors | | | | --- | --- | | *Setter* | set\_emission\_colors(value) | | *Getter* | get\_emission\_colors() | Sets the [Color](class_color#class-color)s to modulate particles by when using [EMISSION\_SHAPE\_POINTS](#class-cpuparticles-constant-emission-shape-points) or [EMISSION\_SHAPE\_DIRECTED\_POINTS](#class-cpuparticles-constant-emission-shape-directed-points). ### [PoolVector3Array](class_poolvector3array#class-poolvector3array) emission\_normals | | | | --- | --- | | *Setter* | set\_emission\_normals(value) | | *Getter* | get\_emission\_normals() | Sets the direction the particles will be emitted in when using [EMISSION\_SHAPE\_DIRECTED\_POINTS](#class-cpuparticles-constant-emission-shape-directed-points). ### [PoolVector3Array](class_poolvector3array#class-poolvector3array) emission\_points | | | | --- | --- | | *Setter* | set\_emission\_points(value) | | *Getter* | get\_emission\_points() | Sets the initial positions to spawn particles when using [EMISSION\_SHAPE\_POINTS](#class-cpuparticles-constant-emission-shape-points) or [EMISSION\_SHAPE\_DIRECTED\_POINTS](#class-cpuparticles-constant-emission-shape-directed-points). ### [Vector3](class_vector3#class-vector3) emission\_ring\_axis | | | | --- | --- | | *Setter* | set\_emission\_ring\_axis(value) | | *Getter* | get\_emission\_ring\_axis() | The axis for the ring shaped emitter when using [EMISSION\_SHAPE\_RING](#class-cpuparticles-constant-emission-shape-ring). ### [float](class_float#class-float) emission\_ring\_height | | | | --- | --- | | *Setter* | set\_emission\_ring\_height(value) | | *Getter* | get\_emission\_ring\_height() | The height for the ring shaped emitter when using [EMISSION\_SHAPE\_RING](#class-cpuparticles-constant-emission-shape-ring). ### [float](class_float#class-float) emission\_ring\_inner\_radius | | | | --- | --- | | *Setter* | set\_emission\_ring\_inner\_radius(value) | | *Getter* | get\_emission\_ring\_inner\_radius() | The inner radius for the ring shaped emitter when using [EMISSION\_SHAPE\_RING](#class-cpuparticles-constant-emission-shape-ring). ### [float](class_float#class-float) emission\_ring\_radius | | | | --- | --- | | *Setter* | set\_emission\_ring\_radius(value) | | *Getter* | get\_emission\_ring\_radius() | The radius for the ring shaped emitter when using [EMISSION\_SHAPE\_RING](#class-cpuparticles-constant-emission-shape-ring). ### [EmissionShape](#enum-cpuparticles-emissionshape) emission\_shape | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_emission\_shape(value) | | *Getter* | get\_emission\_shape() | Particles will be emitted inside this region. See [EmissionShape](#enum-cpuparticles-emissionshape) for possible values. ### [float](class_float#class-float) emission\_sphere\_radius | | | | --- | --- | | *Setter* | set\_emission\_sphere\_radius(value) | | *Getter* | get\_emission\_sphere\_radius() | The sphere's radius if [EmissionShape](#enum-cpuparticles-emissionshape) is set to [EMISSION\_SHAPE\_SPHERE](#class-cpuparticles-constant-emission-shape-sphere). ### [bool](class_bool#class-bool) emitting | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_emitting(value) | | *Getter* | is\_emitting() | If `true`, particles are being emitted. ### [float](class_float#class-float) explosiveness | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_explosiveness\_ratio(value) | | *Getter* | get\_explosiveness\_ratio() | How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins. ### [int](class_int#class-int) fixed\_fps | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_fixed\_fps(value) | | *Getter* | get\_fixed\_fps() | The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself. ### [bool](class_bool#class-bool) flag\_align\_y | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_particle\_flag(value) | | *Getter* | get\_particle\_flag() | Align Y axis of particle with the direction of its velocity. ### [bool](class_bool#class-bool) flag\_disable\_z | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_particle\_flag(value) | | *Getter* | get\_particle\_flag() | If `true`, particles will not move on the z axis. ### [bool](class_bool#class-bool) flag\_rotate\_y | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_particle\_flag(value) | | *Getter* | get\_particle\_flag() | If `true`, particles rotate around Y axis by [angle](#class-cpuparticles-property-angle). ### [float](class_float#class-float) flatness | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_flatness(value) | | *Getter* | get\_flatness() | Amount of [spread](#class-cpuparticles-property-spread) in Y/Z plane. A value of `1` restricts particles to X/Z plane. ### [bool](class_bool#class-bool) fract\_delta | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_fractional\_delta(value) | | *Getter* | get\_fractional\_delta() | If `true`, results in fractional delta calculation which has a smoother particles display effect. ### [Vector3](class_vector3#class-vector3) gravity | | | | --- | --- | | *Default* | `Vector3( 0, -9.8, 0 )` | | *Setter* | set\_gravity(value) | | *Getter* | get\_gravity() | Gravity applied to every particle. ### [float](class_float#class-float) hue\_variation | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial hue variation applied to each particle. ### [Curve](class_curve#class-curve) hue\_variation\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's hue will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) hue\_variation\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Hue variation randomness ratio. ### [float](class_float#class-float) initial\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial velocity magnitude for each particle. Direction comes from [spread](#class-cpuparticles-property-spread) and the node's orientation. ### [float](class_float#class-float) initial\_velocity\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Initial velocity randomness ratio. ### [float](class_float#class-float) lifetime | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_lifetime(value) | | *Getter* | get\_lifetime() | The amount of time each particle will exist (in seconds). ### [float](class_float#class-float) lifetime\_randomness | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_lifetime\_randomness(value) | | *Getter* | get\_lifetime\_randomness() | Particle lifetime randomness ratio. ### [float](class_float#class-float) linear\_accel | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Linear acceleration applied to each particle in the direction of motion. ### [Curve](class_curve#class-curve) linear\_accel\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's linear acceleration will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) linear\_accel\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Linear acceleration randomness ratio. ### [bool](class_bool#class-bool) local\_coords | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_use\_local\_coordinates(value) | | *Getter* | get\_use\_local\_coordinates() | If `true`, particles use the parent node's coordinate space. If `false`, they use global coordinates. ### [Mesh](class_mesh#class-mesh) mesh | | | | --- | --- | | *Setter* | set\_mesh(value) | | *Getter* | get\_mesh() | The [Mesh](class_mesh#class-mesh) used for each particle. If `null`, particles will be spheres. ### [bool](class_bool#class-bool) one\_shot | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_one\_shot(value) | | *Getter* | get\_one\_shot() | If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end. ### [float](class_float#class-float) orbit\_velocity | | | | --- | --- | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Orbital velocity applied to each particle. Makes the particles circle around origin in the local XY plane. Specified in number of full rotations around origin per second. This property is only available when [flag\_disable\_z](#class-cpuparticles-property-flag-disable-z) is `true`. ### [Curve](class_curve#class-curve) orbit\_velocity\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's orbital velocity will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) orbit\_velocity\_random | | | | --- | --- | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Orbital velocity randomness ratio. ### [float](class_float#class-float) preprocess | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_pre\_process\_time(value) | | *Getter* | get\_pre\_process\_time() | Particle system starts as if it had already run for this many seconds. ### [float](class_float#class-float) radial\_accel | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Radial acceleration applied to each particle. Makes particle accelerate away from origin. ### [Curve](class_curve#class-curve) radial\_accel\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's radial acceleration will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) radial\_accel\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Radial acceleration randomness ratio. ### [float](class_float#class-float) randomness | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_randomness\_ratio(value) | | *Getter* | get\_randomness\_ratio() | Emission lifetime randomness ratio. ### [float](class_float#class-float) scale\_amount | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial scale applied to each particle. ### [Curve](class_curve#class-curve) scale\_amount\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's scale will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) scale\_amount\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Scale randomness ratio. ### [float](class_float#class-float) speed\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_speed\_scale(value) | | *Getter* | get\_speed\_scale() | Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles. ### [float](class_float#class-float) spread | | | | --- | --- | | *Default* | `45.0` | | *Setter* | set\_spread(value) | | *Getter* | get\_spread() | Each particle's initial direction range from `+spread` to `-spread` degrees. Applied to X/Z plane and Y/Z planes. ### [float](class_float#class-float) tangential\_accel | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. ### [Curve](class_curve#class-curve) tangential\_accel\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's tangential acceleration will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) tangential\_accel\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Tangential acceleration randomness ratio. Method Descriptions ------------------- ### void convert\_from\_particles ( [Node](class_node#class-node) particles ) Sets this node's properties to match a given [Particles](class_particles#class-particles) node with an assigned [ParticlesMaterial](class_particlesmaterial#class-particlesmaterial). ### [float](class_float#class-float) get\_param ( [Parameter](#enum-cpuparticles-parameter) param ) const Returns the base value of the parameter specified by [Parameter](#enum-cpuparticles-parameter). ### [Curve](class_curve#class-curve) get\_param\_curve ( [Parameter](#enum-cpuparticles-parameter) param ) const Returns the [Curve](class_curve#class-curve) of the parameter specified by [Parameter](#enum-cpuparticles-parameter). ### [float](class_float#class-float) get\_param\_randomness ( [Parameter](#enum-cpuparticles-parameter) param ) const Returns the randomness factor of the parameter specified by [Parameter](#enum-cpuparticles-parameter). ### [bool](class_bool#class-bool) get\_particle\_flag ( [Flags](#enum-cpuparticles-flags) flag ) const Returns the enabled state of the given flag (see [Flags](#enum-cpuparticles-flags) for options). ### void restart ( ) Restarts the particle emitter. ### void set\_param ( [Parameter](#enum-cpuparticles-parameter) param, [float](class_float#class-float) value ) Sets the base value of the parameter specified by [Parameter](#enum-cpuparticles-parameter). ### void set\_param\_curve ( [Parameter](#enum-cpuparticles-parameter) param, [Curve](class_curve#class-curve) curve ) Sets the [Curve](class_curve#class-curve) of the parameter specified by [Parameter](#enum-cpuparticles-parameter). ### void set\_param\_randomness ( [Parameter](#enum-cpuparticles-parameter) param, [float](class_float#class-float) randomness ) Sets the randomness factor of the parameter specified by [Parameter](#enum-cpuparticles-parameter). ### void set\_particle\_flag ( [Flags](#enum-cpuparticles-flags) flag, [bool](class_bool#class-bool) enable ) Enables or disables the given flag (see [Flags](#enum-cpuparticles-flags) for options).
programming_docs
godot EditorSpatialGizmoPlugin EditorSpatialGizmoPlugin ======================== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Used by the editor to define Spatial gizmo types. Description ----------- `EditorSpatialGizmoPlugin` allows you to define a new type of Gizmo. There are two main ways to do so: extending `EditorSpatialGizmoPlugin` for the simpler gizmos, or creating a new [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) type. See the tutorial in the documentation for more info. To use `EditorSpatialGizmoPlugin`, register it using the [EditorPlugin.add\_spatial\_gizmo\_plugin](class_editorplugin#class-editorplugin-method-add-spatial-gizmo-plugin) method first. Tutorials --------- * [Spatial gizmo plugins](https://docs.godotengine.org/en/3.5/tutorials/plugins/editor/spatial_gizmos.html) Methods ------- | | | | --- | --- | | void | [add\_material](#class-editorspatialgizmoplugin-method-add-material) **(** [String](class_string#class-string) name, [SpatialMaterial](class_spatialmaterial#class-spatialmaterial) material **)** | | [bool](class_bool#class-bool) | [can\_be\_hidden](#class-editorspatialgizmoplugin-method-can-be-hidden) **(** **)** virtual | | void | [commit\_handle](#class-editorspatialgizmoplugin-method-commit-handle) **(** [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo, [int](class_int#class-int) index, [Variant](class_variant#class-variant) restore, [bool](class_bool#class-bool) cancel=false **)** virtual | | [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) | [create\_gizmo](#class-editorspatialgizmoplugin-method-create-gizmo) **(** [Spatial](class_spatial#class-spatial) spatial **)** virtual | | void | [create\_handle\_material](#class-editorspatialgizmoplugin-method-create-handle-material) **(** [String](class_string#class-string) name, [bool](class_bool#class-bool) billboard=false, [Texture](class_texture#class-texture) texture=null **)** | | void | [create\_icon\_material](#class-editorspatialgizmoplugin-method-create-icon-material) **(** [String](class_string#class-string) name, [Texture](class_texture#class-texture) texture, [bool](class_bool#class-bool) on\_top=false, [Color](class_color#class-color) color=Color( 1, 1, 1, 1 ) **)** | | void | [create\_material](#class-editorspatialgizmoplugin-method-create-material) **(** [String](class_string#class-string) name, [Color](class_color#class-color) color, [bool](class_bool#class-bool) billboard=false, [bool](class_bool#class-bool) on\_top=false, [bool](class_bool#class-bool) use\_vertex\_color=false **)** | | [String](class_string#class-string) | [get\_handle\_name](#class-editorspatialgizmoplugin-method-get-handle-name) **(** [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo, [int](class_int#class-int) index **)** virtual | | [Variant](class_variant#class-variant) | [get\_handle\_value](#class-editorspatialgizmoplugin-method-get-handle-value) **(** [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo, [int](class_int#class-int) index **)** virtual | | [SpatialMaterial](class_spatialmaterial#class-spatialmaterial) | [get\_material](#class-editorspatialgizmoplugin-method-get-material) **(** [String](class_string#class-string) name, [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo=null **)** | | [String](class_string#class-string) | [get\_name](#class-editorspatialgizmoplugin-method-get-name) **(** **)** virtual | | [int](class_int#class-int) | [get\_priority](#class-editorspatialgizmoplugin-method-get-priority) **(** **)** virtual | | [bool](class_bool#class-bool) | [has\_gizmo](#class-editorspatialgizmoplugin-method-has-gizmo) **(** [Spatial](class_spatial#class-spatial) spatial **)** virtual | | [bool](class_bool#class-bool) | [is\_handle\_highlighted](#class-editorspatialgizmoplugin-method-is-handle-highlighted) **(** [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo, [int](class_int#class-int) index **)** virtual | | [bool](class_bool#class-bool) | [is\_selectable\_when\_hidden](#class-editorspatialgizmoplugin-method-is-selectable-when-hidden) **(** **)** virtual | | void | [redraw](#class-editorspatialgizmoplugin-method-redraw) **(** [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo **)** virtual | | void | [set\_handle](#class-editorspatialgizmoplugin-method-set-handle) **(** [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo, [int](class_int#class-int) index, [Camera](class_camera#class-camera) camera, [Vector2](class_vector2#class-vector2) point **)** virtual | Method Descriptions ------------------- ### void add\_material ( [String](class_string#class-string) name, [SpatialMaterial](class_spatialmaterial#class-spatialmaterial) material ) Adds a new material to the internal material list for the plugin. It can then be accessed with [get\_material](#class-editorspatialgizmoplugin-method-get-material). Should not be overridden. ### [bool](class_bool#class-bool) can\_be\_hidden ( ) virtual Override this method to define whether the gizmo can be hidden or not. Returns `true` if not overridden. ### void commit\_handle ( [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo, [int](class_int#class-int) index, [Variant](class_variant#class-variant) restore, [bool](class_bool#class-bool) cancel=false ) virtual Override this method to commit gizmo handles. Called for this plugin's active gizmos. ### [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) create\_gizmo ( [Spatial](class_spatial#class-spatial) spatial ) virtual Override this method to return a custom [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) for the spatial nodes of your choice, return `null` for the rest of nodes. See also [has\_gizmo](#class-editorspatialgizmoplugin-method-has-gizmo). ### void create\_handle\_material ( [String](class_string#class-string) name, [bool](class_bool#class-bool) billboard=false, [Texture](class_texture#class-texture) texture=null ) Creates a handle material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [get\_material](#class-editorspatialgizmoplugin-method-get-material) and used in [EditorSpatialGizmo.add\_handles](class_editorspatialgizmo#class-editorspatialgizmo-method-add-handles). Should not be overridden. You can optionally provide a texture to use instead of the default icon. ### void create\_icon\_material ( [String](class_string#class-string) name, [Texture](class_texture#class-texture) texture, [bool](class_bool#class-bool) on\_top=false, [Color](class_color#class-color) color=Color( 1, 1, 1, 1 ) ) Creates an icon material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [get\_material](#class-editorspatialgizmoplugin-method-get-material) and used in [EditorSpatialGizmo.add\_unscaled\_billboard](class_editorspatialgizmo#class-editorspatialgizmo-method-add-unscaled-billboard). Should not be overridden. ### void create\_material ( [String](class_string#class-string) name, [Color](class_color#class-color) color, [bool](class_bool#class-bool) billboard=false, [bool](class_bool#class-bool) on\_top=false, [bool](class_bool#class-bool) use\_vertex\_color=false ) Creates an unshaded material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [get\_material](#class-editorspatialgizmoplugin-method-get-material) and used in [EditorSpatialGizmo.add\_mesh](class_editorspatialgizmo#class-editorspatialgizmo-method-add-mesh) and [EditorSpatialGizmo.add\_lines](class_editorspatialgizmo#class-editorspatialgizmo-method-add-lines). Should not be overridden. ### [String](class_string#class-string) get\_handle\_name ( [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo, [int](class_int#class-int) index ) virtual Override this method to provide gizmo's handle names. Called for this plugin's active gizmos. ### [Variant](class_variant#class-variant) get\_handle\_value ( [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo, [int](class_int#class-int) index ) virtual Gets actual value of a handle from gizmo. Called for this plugin's active gizmos. ### [SpatialMaterial](class_spatialmaterial#class-spatialmaterial) get\_material ( [String](class_string#class-string) name, [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo=null ) Gets material from the internal list of materials. If an [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) is provided, it will try to get the corresponding variant (selected and/or editable). ### [String](class_string#class-string) get\_name ( ) virtual Override this method to provide the name that will appear in the gizmo visibility menu. ### [int](class_int#class-int) get\_priority ( ) virtual Override this method to set the gizmo's priority. Higher values correspond to higher priority. If a gizmo with higher priority conflicts with another gizmo, only the gizmo with higher priority will be used. All built-in editor gizmos return a priority of `-1`. If not overridden, this method will return `0`, which means custom gizmos will automatically override built-in gizmos. ### [bool](class_bool#class-bool) has\_gizmo ( [Spatial](class_spatial#class-spatial) spatial ) virtual Override this method to define which Spatial nodes have a gizmo from this plugin. Whenever a [Spatial](class_spatial#class-spatial) node is added to a scene this method is called, if it returns `true` the node gets a generic [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) assigned and is added to this plugin's list of active gizmos. ### [bool](class_bool#class-bool) is\_handle\_highlighted ( [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo, [int](class_int#class-int) index ) virtual Gets whether a handle is highlighted or not. Called for this plugin's active gizmos. ### [bool](class_bool#class-bool) is\_selectable\_when\_hidden ( ) virtual Override this method to define whether a Spatial with this gizmo should be selectable even when the gizmo is hidden. ### void redraw ( [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo ) virtual Callback to redraw the provided gizmo. Called for this plugin's active gizmos. ### void set\_handle ( [EditorSpatialGizmo](class_editorspatialgizmo#class-editorspatialgizmo) gizmo, [int](class_int#class-int) index, [Camera](class_camera#class-camera) camera, [Vector2](class_vector2#class-vector2) point ) virtual Update the value of a handle after it has been updated. Called for this plugin's active gizmos. godot InstancePlaceholder InstancePlaceholder =================== **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) Placeholder for the root [Node](class_node#class-node) of a [PackedScene](class_packedscene#class-packedscene). Description ----------- Turning on the option **Load As Placeholder** for an instanced scene in the editor causes it to be replaced by an InstancePlaceholder when running the game. This makes it possible to delay actually loading the scene until calling [replace\_by\_instance](#class-instanceplaceholder-method-replace-by-instance). This is useful to avoid loading large scenes all at once by loading parts of it selectively. The InstancePlaceholder does not have a transform. This causes any child nodes to be positioned relatively to the Viewport from point (0,0), rather than their parent as displayed in the editor. Replacing the placeholder with a scene with a transform will transform children relatively to their parent again. Methods ------- | | | | --- | --- | | [Node](class_node#class-node) | [create\_instance](#class-instanceplaceholder-method-create-instance) **(** [bool](class_bool#class-bool) replace=false, [PackedScene](class_packedscene#class-packedscene) custom\_scene=null **)** | | [String](class_string#class-string) | [get\_instance\_path](#class-instanceplaceholder-method-get-instance-path) **(** **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_stored\_values](#class-instanceplaceholder-method-get-stored-values) **(** [bool](class_bool#class-bool) with\_order=false **)** | | void | [replace\_by\_instance](#class-instanceplaceholder-method-replace-by-instance) **(** [PackedScene](class_packedscene#class-packedscene) custom\_scene=null **)** | Method Descriptions ------------------- ### [Node](class_node#class-node) create\_instance ( [bool](class_bool#class-bool) replace=false, [PackedScene](class_packedscene#class-packedscene) custom\_scene=null ) Call this method to actually load in the node. The created node will be placed as a sibling *above* the `InstancePlaceholder` in the scene tree. The [Node](class_node#class-node)'s reference is also returned for convenience. **Note:** [create\_instance](#class-instanceplaceholder-method-create-instance) is not thread-safe. Use [Object.call\_deferred](class_object#class-object-method-call-deferred) if calling from a thread. ### [String](class_string#class-string) get\_instance\_path ( ) const Gets the path to the [PackedScene](class_packedscene#class-packedscene) resource file that is loaded by default when calling [replace\_by\_instance](#class-instanceplaceholder-method-replace-by-instance). Not thread-safe. Use [Object.call\_deferred](class_object#class-object-method-call-deferred) if calling from a thread. ### [Dictionary](class_dictionary#class-dictionary) get\_stored\_values ( [bool](class_bool#class-bool) with\_order=false ) Returns the list of properties that will be applied to the node when [create\_instance](#class-instanceplaceholder-method-create-instance) is called. If `with_order` is `true`, a key named `.order` (note the leading period) is added to the dictionary. This `.order` key is an [Array](class_array#class-array) of [String](class_string#class-string) property names specifying the order in which properties will be applied (with index 0 being the first). ### void replace\_by\_instance ( [PackedScene](class_packedscene#class-packedscene) custom\_scene=null ) Replaces this placeholder by the scene handed as an argument, or the original scene if no argument is given. As for all resources, the scene is loaded only if it's not loaded already. By manually loading the scene beforehand, delays caused by this function can be avoided. godot Area Area ==== **Inherits:** [CollisionObject](class_collisionobject#class-collisionobject) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) 3D area for detection and physics and audio influence. Description ----------- 3D area that detects [CollisionObject](class_collisionobject#class-collisionobject) nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to a custom audio bus. To give the area its shape, add a [CollisionShape](class_collisionshape#class-collisionshape) or a [CollisionPolygon](class_collisionpolygon#class-collisionpolygon) node as a *direct* child (or add multiple such nodes as direct children) of the area. **Warning:** See [ConcavePolygonShape](class_concavepolygonshape#class-concavepolygonshape) (also called "trimesh") for a warning about possibly unexpected behavior when using that shape for an area. Tutorials --------- * [3D Platformer Demo](https://godotengine.org/asset-library/asset/125) * [GUI in 3D Demo](https://godotengine.org/asset-library/asset/127) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [angular\_damp](#class-area-property-angular-damp) | `0.1` | | [String](class_string#class-string) | [audio\_bus\_name](#class-area-property-audio-bus-name) | `"Master"` | | [bool](class_bool#class-bool) | [audio\_bus\_override](#class-area-property-audio-bus-override) | `false` | | [float](class_float#class-float) | [gravity](#class-area-property-gravity) | `9.8` | | [float](class_float#class-float) | [gravity\_distance\_scale](#class-area-property-gravity-distance-scale) | `0.0` | | [bool](class_bool#class-bool) | [gravity\_point](#class-area-property-gravity-point) | `false` | | [Vector3](class_vector3#class-vector3) | [gravity\_vec](#class-area-property-gravity-vec) | `Vector3( 0, -1, 0 )` | | [float](class_float#class-float) | [linear\_damp](#class-area-property-linear-damp) | `0.1` | | [bool](class_bool#class-bool) | [monitorable](#class-area-property-monitorable) | `true` | | [bool](class_bool#class-bool) | [monitoring](#class-area-property-monitoring) | `true` | | [float](class_float#class-float) | [priority](#class-area-property-priority) | `0.0` | | [float](class_float#class-float) | [reverb\_bus\_amount](#class-area-property-reverb-bus-amount) | `0.0` | | [bool](class_bool#class-bool) | [reverb\_bus\_enable](#class-area-property-reverb-bus-enable) | `false` | | [String](class_string#class-string) | [reverb\_bus\_name](#class-area-property-reverb-bus-name) | `"Master"` | | [float](class_float#class-float) | [reverb\_bus\_uniformity](#class-area-property-reverb-bus-uniformity) | `0.0` | | [SpaceOverride](#enum-area-spaceoverride) | [space\_override](#class-area-property-space-override) | `0` | Methods ------- | | | | --- | --- | | [Array](class_array#class-array) | [get\_overlapping\_areas](#class-area-method-get-overlapping-areas) **(** **)** const | | [Array](class_array#class-array) | [get\_overlapping\_bodies](#class-area-method-get-overlapping-bodies) **(** **)** const | | [bool](class_bool#class-bool) | [overlaps\_area](#class-area-method-overlaps-area) **(** [Node](class_node#class-node) area **)** const | | [bool](class_bool#class-bool) | [overlaps\_body](#class-area-method-overlaps-body) **(** [Node](class_node#class-node) body **)** const | Signals ------- ### area\_entered ( [Area](#class-area) area ) Emitted when another Area enters this Area. Requires [monitoring](#class-area-property-monitoring) to be set to `true`. `area` the other Area. ### area\_exited ( [Area](#class-area) area ) Emitted when another Area exits this Area. Requires [monitoring](#class-area-property-monitoring) to be set to `true`. `area` the other Area. ### area\_shape\_entered ( [RID](class_rid#class-rid) area\_rid, [Area](#class-area) area, [int](class_int#class-int) area\_shape\_index, [int](class_int#class-int) local\_shape\_index ) Emitted when one of another Area's [Shape](class_shape#class-shape)s enters one of this Area's [Shape](class_shape#class-shape)s. Requires [monitoring](#class-area-property-monitoring) to be set to `true`. `area_rid` the [RID](class_rid#class-rid) of the other Area's [CollisionObject](class_collisionobject#class-collisionobject) used by the [PhysicsServer](class_physicsserver#class-physicsserver). `area` the other Area. `area_shape_index` the index of the [Shape](class_shape#class-shape) of the other Area used by the [PhysicsServer](class_physicsserver#class-physicsserver). Get the [CollisionShape](class_collisionshape#class-collisionshape) node with `area.shape_owner_get_owner(area_shape_index)`. `local_shape_index` the index of the [Shape](class_shape#class-shape) of this Area used by the [PhysicsServer](class_physicsserver#class-physicsserver). Get the [CollisionShape](class_collisionshape#class-collisionshape) node with `self.shape_owner_get_owner(local_shape_index)`. ### area\_shape\_exited ( [RID](class_rid#class-rid) area\_rid, [Area](#class-area) area, [int](class_int#class-int) area\_shape\_index, [int](class_int#class-int) local\_shape\_index ) Emitted when one of another Area's [Shape](class_shape#class-shape)s enters one of this Area's [Shape](class_shape#class-shape)s. Requires [monitoring](#class-area-property-monitoring) to be set to `true`. `area_rid` the [RID](class_rid#class-rid) of the other Area's [CollisionObject](class_collisionobject#class-collisionobject) used by the [PhysicsServer](class_physicsserver#class-physicsserver). `area` the other Area. `area_shape_index` the index of the [Shape](class_shape#class-shape) of the other Area used by the [PhysicsServer](class_physicsserver#class-physicsserver). Get the [CollisionShape](class_collisionshape#class-collisionshape) node with `area.shape_owner_get_owner(area_shape_index)`. `local_shape_index` the index of the [Shape](class_shape#class-shape) of this Area used by the [PhysicsServer](class_physicsserver#class-physicsserver). Get the [CollisionShape](class_collisionshape#class-collisionshape) node with `self.shape_owner_get_owner(local_shape_index)`. ### body\_entered ( [Node](class_node#class-node) body ) Emitted when a [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap) enters this Area. Requires [monitoring](#class-area-property-monitoring) to be set to `true`. [GridMap](class_gridmap#class-gridmap)s are detected if the [MeshLibrary](class_meshlibrary#class-meshlibrary) has Collision [Shape](class_shape#class-shape)s. `body` the [Node](class_node#class-node), if it exists in the tree, of the other [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap). ### body\_exited ( [Node](class_node#class-node) body ) Emitted when a [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap) exits this Area. Requires [monitoring](#class-area-property-monitoring) to be set to `true`. [GridMap](class_gridmap#class-gridmap)s are detected if the [MeshLibrary](class_meshlibrary#class-meshlibrary) has Collision [Shape](class_shape#class-shape)s. `body` the [Node](class_node#class-node), if it exists in the tree, of the other [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap). ### body\_shape\_entered ( [RID](class_rid#class-rid) body\_rid, [Node](class_node#class-node) body, [int](class_int#class-int) body\_shape\_index, [int](class_int#class-int) local\_shape\_index ) Emitted when one of a [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap)'s [Shape](class_shape#class-shape)s enters one of this Area's [Shape](class_shape#class-shape)s. Requires [monitoring](#class-area-property-monitoring) to be set to `true`. [GridMap](class_gridmap#class-gridmap)s are detected if the [MeshLibrary](class_meshlibrary#class-meshlibrary) has Collision [Shape](class_shape#class-shape)s. `body_rid` the [RID](class_rid#class-rid) of the [PhysicsBody](class_physicsbody#class-physicsbody) or [MeshLibrary](class_meshlibrary#class-meshlibrary)'s [CollisionObject](class_collisionobject#class-collisionobject) used by the [PhysicsServer](class_physicsserver#class-physicsserver). `body` the [Node](class_node#class-node), if it exists in the tree, of the [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap). `body_shape_index` the index of the [Shape](class_shape#class-shape) of the [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap) used by the [PhysicsServer](class_physicsserver#class-physicsserver). Get the [CollisionShape](class_collisionshape#class-collisionshape) node with `body.shape_owner_get_owner(body_shape_index)`. `local_shape_index` the index of the [Shape](class_shape#class-shape) of this Area used by the [PhysicsServer](class_physicsserver#class-physicsserver). Get the [CollisionShape](class_collisionshape#class-collisionshape) node with `self.shape_owner_get_owner(local_shape_index)`. ### body\_shape\_exited ( [RID](class_rid#class-rid) body\_rid, [Node](class_node#class-node) body, [int](class_int#class-int) body\_shape\_index, [int](class_int#class-int) local\_shape\_index ) Emitted when one of a [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap)'s [Shape](class_shape#class-shape)s enters one of this Area's [Shape](class_shape#class-shape)s. Requires [monitoring](#class-area-property-monitoring) to be set to `true`. [GridMap](class_gridmap#class-gridmap)s are detected if the [MeshLibrary](class_meshlibrary#class-meshlibrary) has Collision [Shape](class_shape#class-shape)s. `body_rid` the [RID](class_rid#class-rid) of the [PhysicsBody](class_physicsbody#class-physicsbody) or [MeshLibrary](class_meshlibrary#class-meshlibrary)'s [CollisionObject](class_collisionobject#class-collisionobject) used by the [PhysicsServer](class_physicsserver#class-physicsserver). `body` the [Node](class_node#class-node), if it exists in the tree, of the [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap). `body_shape_index` the index of the [Shape](class_shape#class-shape) of the [PhysicsBody](class_physicsbody#class-physicsbody) or [GridMap](class_gridmap#class-gridmap) used by the [PhysicsServer](class_physicsserver#class-physicsserver). Get the [CollisionShape](class_collisionshape#class-collisionshape) node with `body.shape_owner_get_owner(body_shape_index)`. `local_shape_index` the index of the [Shape](class_shape#class-shape) of this Area used by the [PhysicsServer](class_physicsserver#class-physicsserver). Get the [CollisionShape](class_collisionshape#class-collisionshape) node with `self.shape_owner_get_owner(local_shape_index)`. Enumerations ------------ enum **SpaceOverride**: * **SPACE\_OVERRIDE\_DISABLED** = **0** --- This area does not affect gravity/damping. * **SPACE\_OVERRIDE\_COMBINE** = **1** --- This area adds its gravity/damping values to whatever has been calculated so far (in [priority](#class-area-property-priority) order). * **SPACE\_OVERRIDE\_COMBINE\_REPLACE** = **2** --- This area adds its gravity/damping values to whatever has been calculated so far (in [priority](#class-area-property-priority) order), ignoring any lower priority areas. * **SPACE\_OVERRIDE\_REPLACE** = **3** --- This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas. * **SPACE\_OVERRIDE\_REPLACE\_COMBINE** = **4** --- This area replaces any gravity/damping calculated so far (in [priority](#class-area-property-priority) order), but keeps calculating the rest of the areas. Property Descriptions --------------------- ### [float](class_float#class-float) angular\_damp | | | | --- | --- | | *Default* | `0.1` | | *Setter* | set\_angular\_damp(value) | | *Getter* | get\_angular\_damp() | The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. See [ProjectSettings.physics/3d/default\_angular\_damp](class_projectsettings#class-projectsettings-property-physics-3d-default-angular-damp) for more details about damping. ### [String](class_string#class-string) audio\_bus\_name | | | | --- | --- | | *Default* | `"Master"` | | *Setter* | set\_audio\_bus(value) | | *Getter* | get\_audio\_bus() | The name of the area's audio bus. ### [bool](class_bool#class-bool) audio\_bus\_override | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_audio\_bus\_override(value) | | *Getter* | is\_overriding\_audio\_bus() | If `true`, the area's audio bus overrides the default audio bus. ### [float](class_float#class-float) gravity | | | | --- | --- | | *Default* | `9.8` | | *Setter* | set\_gravity(value) | | *Getter* | get\_gravity() | The area's gravity intensity (in meters per second squared). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction. ### [float](class_float#class-float) gravity\_distance\_scale | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_gravity\_distance\_scale(value) | | *Getter* | get\_gravity\_distance\_scale() | The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance. ### [bool](class_bool#class-bool) gravity\_point | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_gravity\_is\_point(value) | | *Getter* | is\_gravity\_a\_point() | If `true`, gravity is calculated from a point (set via [gravity\_vec](#class-area-property-gravity-vec)). See also [space\_override](#class-area-property-space-override). ### [Vector3](class_vector3#class-vector3) gravity\_vec | | | | --- | --- | | *Default* | `Vector3( 0, -1, 0 )` | | *Setter* | set\_gravity\_vector(value) | | *Getter* | get\_gravity\_vector() | The area's gravity vector (not normalized). If gravity is a point (see [gravity\_point](#class-area-property-gravity-point)), this will be the point of attraction. ### [float](class_float#class-float) linear\_damp | | | | --- | --- | | *Default* | `0.1` | | *Setter* | set\_linear\_damp(value) | | *Getter* | get\_linear\_damp() | The rate at which objects stop moving in this area. Represents the linear velocity lost per second. See [ProjectSettings.physics/3d/default\_linear\_damp](class_projectsettings#class-projectsettings-property-physics-3d-default-linear-damp) for more details about damping. ### [bool](class_bool#class-bool) monitorable | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_monitorable(value) | | *Getter* | is\_monitorable() | If `true`, other monitoring areas can detect this area. ### [bool](class_bool#class-bool) monitoring | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_monitoring(value) | | *Getter* | is\_monitoring() | If `true`, the area detects bodies or areas entering and exiting it. ### [float](class_float#class-float) priority | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_priority(value) | | *Getter* | get\_priority() | The area's priority. Higher priority areas are processed first. ### [float](class_float#class-float) reverb\_bus\_amount | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_reverb\_amount(value) | | *Getter* | get\_reverb\_amount() | The degree to which this area applies reverb to its associated audio. Ranges from `0` to `1` with `0.1` precision. ### [bool](class_bool#class-bool) reverb\_bus\_enable | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_reverb\_bus(value) | | *Getter* | is\_using\_reverb\_bus() | If `true`, the area applies reverb to its associated audio. ### [String](class_string#class-string) reverb\_bus\_name | | | | --- | --- | | *Default* | `"Master"` | | *Setter* | set\_reverb\_bus(value) | | *Getter* | get\_reverb\_bus() | The reverb bus name to use for this area's associated audio. ### [float](class_float#class-float) reverb\_bus\_uniformity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_reverb\_uniformity(value) | | *Getter* | get\_reverb\_uniformity() | The degree to which this area's reverb is a uniform effect. Ranges from `0` to `1` with `0.1` precision. ### [SpaceOverride](#enum-area-spaceoverride) space\_override | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_space\_override\_mode(value) | | *Getter* | get\_space\_override\_mode() | Override mode for gravity and damping calculations within this area. See [SpaceOverride](#enum-area-spaceoverride) for possible values. Method Descriptions ------------------- ### [Array](class_array#class-array) get\_overlapping\_areas ( ) const Returns a list of intersecting `Area`s. The overlapping area's [CollisionObject.collision\_layer](class_collisionobject#class-collisionobject-property-collision-layer) must be part of this area's [CollisionObject.collision\_mask](class_collisionobject#class-collisionobject-property-collision-mask) in order to be detected. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. ### [Array](class_array#class-array) get\_overlapping\_bodies ( ) const Returns a list of intersecting [PhysicsBody](class_physicsbody#class-physicsbody)s. The overlapping body's [CollisionObject.collision\_layer](class_collisionobject#class-collisionobject-property-collision-layer) must be part of this area's [CollisionObject.collision\_mask](class_collisionobject#class-collisionobject-property-collision-mask) in order to be detected. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. ### [bool](class_bool#class-bool) overlaps\_area ( [Node](class_node#class-node) area ) const If `true`, the given area overlaps the Area. **Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. ### [bool](class_bool#class-bool) overlaps\_body ( [Node](class_node#class-node) body ) const If `true`, the given physics body overlaps the Area. **Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. The `body` argument can either be a [PhysicsBody](class_physicsbody#class-physicsbody) or a [GridMap](class_gridmap#class-gridmap) instance (while GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body).
programming_docs
godot Timer Timer ===== **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) A countdown timer. Description ----------- Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or "one-shot" mode. **Note:** To create a one-shot timer without instantiating a node, use [SceneTree.create\_timer](class_scenetree#class-scenetree-method-create-timer). Tutorials --------- * [2D Dodge The Creeps Demo](https://godotengine.org/asset-library/asset/515) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [autostart](#class-timer-property-autostart) | `false` | | [bool](class_bool#class-bool) | [one\_shot](#class-timer-property-one-shot) | `false` | | [bool](class_bool#class-bool) | [paused](#class-timer-property-paused) | | | [TimerProcessMode](#enum-timer-timerprocessmode) | [process\_mode](#class-timer-property-process-mode) | `1` | | [float](class_float#class-float) | [time\_left](#class-timer-property-time-left) | | | [float](class_float#class-float) | [wait\_time](#class-timer-property-wait-time) | `1.0` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [is\_stopped](#class-timer-method-is-stopped) **(** **)** const | | void | [start](#class-timer-method-start) **(** [float](class_float#class-float) time\_sec=-1 **)** | | void | [stop](#class-timer-method-stop) **(** **)** | Signals ------- ### timeout ( ) Emitted when the timer reaches 0. Enumerations ------------ enum **TimerProcessMode**: * **TIMER\_PROCESS\_PHYSICS** = **0** --- Update the timer during the physics step at each frame (fixed framerate processing). * **TIMER\_PROCESS\_IDLE** = **1** --- Update the timer during the idle time at each frame. Property Descriptions --------------------- ### [bool](class_bool#class-bool) autostart | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_autostart(value) | | *Getter* | has\_autostart() | If `true`, the timer will automatically start when entering the scene tree. **Note:** This property is automatically set to `false` after the timer enters the scene tree and starts. ### [bool](class_bool#class-bool) one\_shot | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_one\_shot(value) | | *Getter* | is\_one\_shot() | If `true`, the timer will stop when reaching 0. If `false`, it will restart. ### [bool](class_bool#class-bool) paused | | | | --- | --- | | *Setter* | set\_paused(value) | | *Getter* | is\_paused() | If `true`, the timer is paused and will not process until it is unpaused again, even if [start](#class-timer-method-start) is called. ### [TimerProcessMode](#enum-timer-timerprocessmode) process\_mode | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_timer\_process\_mode(value) | | *Getter* | get\_timer\_process\_mode() | Processing mode. See [TimerProcessMode](#enum-timer-timerprocessmode). ### [float](class_float#class-float) time\_left | | | | --- | --- | | *Getter* | get\_time\_left() | The timer's remaining time in seconds. Returns 0 if the timer is inactive. **Note:** You cannot set this value. To change the timer's remaining time, use [start](#class-timer-method-start). ### [float](class_float#class-float) wait\_time | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_wait\_time(value) | | *Getter* | get\_wait\_time() | The wait time in seconds. **Note:** Timers can only emit once per rendered frame at most (or once per physics frame if [process\_mode](#class-timer-property-process-mode) is [TIMER\_PROCESS\_PHYSICS](#class-timer-constant-timer-process-physics)). This means very low wait times (lower than 0.05 seconds) will behave in significantly different ways depending on the rendered framerate. For very low wait times, it is recommended to use a process loop in a script instead of using a Timer node. Method Descriptions ------------------- ### [bool](class_bool#class-bool) is\_stopped ( ) const Returns `true` if the timer is stopped. ### void start ( [float](class_float#class-float) time\_sec=-1 ) Starts the timer. Sets `wait_time` to `time_sec` if `time_sec > 0`. This also resets the remaining time to `wait_time`. **Note:** This method will not resume a paused timer. See [paused](#class-timer-property-paused). ### void stop ( ) Stops the timer. godot PluginScript PluginScript ============ **Inherits:** [Script](class_script#class-script) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Methods ------- | | | | --- | --- | | [Variant](class_variant#class-variant) | [new](#class-pluginscript-method-new) **(** ... **)** vararg | Method Descriptions ------------------- ### [Variant](class_variant#class-variant) new ( ... ) vararg Returns a new instance of the script. godot QuadMesh QuadMesh ======== **Inherits:** [PrimitiveMesh](class_primitivemesh#class-primitivemesh) **<** [Mesh](class_mesh#class-mesh) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Class representing a square mesh. Description ----------- Class representing a square [PrimitiveMesh](class_primitivemesh#class-primitivemesh). This flat mesh does not have a thickness. By default, this mesh is aligned on the X and Y axes; this default rotation is more suited for use with billboarded materials. Unlike [PlaneMesh](class_planemesh#class-planemesh), this mesh doesn't provide subdivision options. Tutorials --------- * [GUI in 3D Demo](https://godotengine.org/asset-library/asset/127) * [2D in 3D Demo](https://godotengine.org/asset-library/asset/129) Properties ---------- | | | | | --- | --- | --- | | [Vector3](class_vector3#class-vector3) | [center\_offset](#class-quadmesh-property-center-offset) | `Vector3( 0, 0, 0 )` | | [Vector2](class_vector2#class-vector2) | [size](#class-quadmesh-property-size) | `Vector2( 1, 1 )` | Property Descriptions --------------------- ### [Vector3](class_vector3#class-vector3) center\_offset | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_center\_offset(value) | | *Getter* | get\_center\_offset() | Offset of the generated Quad. Useful for particles. ### [Vector2](class_vector2#class-vector2) size | | | | --- | --- | | *Default* | `Vector2( 1, 1 )` | | *Setter* | set\_size(value) | | *Getter* | get\_size() | Size on the X and Y axes. godot ResourceFormatLoader ResourceFormatLoader ==================== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Loads a specific resource type from a file. Description ----------- Godot loads resources in the editor or in exported games using ResourceFormatLoaders. They are queried automatically via the [ResourceLoader](class_resourceloader#class-resourceloader) singleton, or when a resource with internal dependencies is loaded. Each file type may load as a different resource type, so multiple ResourceFormatLoaders are registered in the engine. Extending this class allows you to define your own loader. Be sure to respect the documented return types and values. You should give it a global class name with `class_name` for it to be registered. Like built-in ResourceFormatLoaders, it will be called automatically when loading resources of its handled type(s). You may also implement a [ResourceFormatSaver](class_resourceformatsaver#class-resourceformatsaver). **Note:** You can also extend [EditorImportPlugin](class_editorimportplugin#class-editorimportplugin) if the resource type you need exists but Godot is unable to load its format. Choosing one way over another depends on if the format is suitable or not for the final exported game. For example, it's better to import `.png` textures as `.stex` ([StreamTexture](class_streamtexture#class-streamtexture)) first, so they can be loaded with better efficiency on the graphics card. Methods ------- | | | | --- | --- | | void | [get\_dependencies](#class-resourceformatloader-method-get-dependencies) **(** [String](class_string#class-string) path, [String](class_string#class-string) add\_types **)** virtual | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_recognized\_extensions](#class-resourceformatloader-method-get-recognized-extensions) **(** **)** virtual | | [String](class_string#class-string) | [get\_resource\_type](#class-resourceformatloader-method-get-resource-type) **(** [String](class_string#class-string) path **)** virtual | | [bool](class_bool#class-bool) | [handles\_type](#class-resourceformatloader-method-handles-type) **(** [String](class_string#class-string) typename **)** virtual | | [Variant](class_variant#class-variant) | [load](#class-resourceformatloader-method-load) **(** [String](class_string#class-string) path, [String](class_string#class-string) original\_path **)** virtual | | [int](class_int#class-int) | [rename\_dependencies](#class-resourceformatloader-method-rename-dependencies) **(** [String](class_string#class-string) path, [String](class_string#class-string) renames **)** virtual | Method Descriptions ------------------- ### void get\_dependencies ( [String](class_string#class-string) path, [String](class_string#class-string) add\_types ) virtual If implemented, gets the dependencies of a given resource. If `add_types` is `true`, paths should be appended `::TypeName`, where `TypeName` is the class name of the dependency. **Note:** Custom resource types defined by scripts aren't known by the [ClassDB](class_classdb#class-classdb), so you might just return `"Resource"` for them. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_recognized\_extensions ( ) virtual Gets the list of extensions for files this loader is able to read. ### [String](class_string#class-string) get\_resource\_type ( [String](class_string#class-string) path ) virtual Gets the class name of the resource associated with the given path. If the loader cannot handle it, it should return `""`. **Note:** Custom resource types defined by scripts aren't known by the [ClassDB](class_classdb#class-classdb), so you might just return `"Resource"` for them. ### [bool](class_bool#class-bool) handles\_type ( [String](class_string#class-string) typename ) virtual Tells which resource class this loader can load. **Note:** Custom resource types defined by scripts aren't known by the [ClassDB](class_classdb#class-classdb), so you might just handle `"Resource"` for them. ### [Variant](class_variant#class-variant) load ( [String](class_string#class-string) path, [String](class_string#class-string) original\_path ) virtual Loads a resource when the engine finds this loader to be compatible. If the loaded resource is the result of an import, `original_path` will target the source file. Returns a [Resource](class_resource#class-resource) object on success, or an [Error](class_%40globalscope#enum-globalscope-error) constant in case of failure. ### [int](class_int#class-int) rename\_dependencies ( [String](class_string#class-string) path, [String](class_string#class-string) renames ) virtual If implemented, renames dependencies within the given resource and saves it. `renames` is a dictionary `{ String => String }` mapping old dependency paths to new paths. Returns [@GlobalScope.OK](class_%40globalscope#class-globalscope-constant-ok) on success, or an [Error](class_%40globalscope#enum-globalscope-error) constant in case of failure. godot PoolByteArray PoolByteArray ============= A pooled array of bytes. Description ----------- An array specifically designed to hold bytes. Optimized for memory usage, does not fragment the memory. **Note:** This type is passed by value and not by reference. This means that when *mutating* a class property of type `PoolByteArray` or mutating a `PoolByteArray` within an [Array](class_array#class-array) or [Dictionary](class_dictionary#class-dictionary), changes will be lost: ``` var array = [PoolByteArray()] array[0].push_back(123) print(array) # [[]] (empty PoolByteArray within an Array) ``` Instead, the entire `PoolByteArray` property must be *reassigned* with `=` for it to be changed: ``` var array = [PoolByteArray()] var pool_array = array[0] pool_array.push_back(123) array[0] = pool_array print(array) # [[123]] (PoolByteArray with 1 element inside an Array) ``` Methods ------- | | | | --- | --- | | [PoolByteArray](#class-poolbytearray) | [PoolByteArray](#class-poolbytearray-method-poolbytearray) **(** [Array](class_array#class-array) from **)** | | void | [append](#class-poolbytearray-method-append) **(** [int](class_int#class-int) byte **)** | | void | [append\_array](#class-poolbytearray-method-append-array) **(** [PoolByteArray](#class-poolbytearray) array **)** | | [PoolByteArray](#class-poolbytearray) | [compress](#class-poolbytearray-method-compress) **(** [int](class_int#class-int) compression\_mode=0 **)** | | [int](class_int#class-int) | [count](#class-poolbytearray-method-count) **(** [int](class_int#class-int) value **)** | | [PoolByteArray](#class-poolbytearray) | [decompress](#class-poolbytearray-method-decompress) **(** [int](class_int#class-int) buffer\_size, [int](class_int#class-int) compression\_mode=0 **)** | | [PoolByteArray](#class-poolbytearray) | [decompress\_dynamic](#class-poolbytearray-method-decompress-dynamic) **(** [int](class_int#class-int) max\_output\_size, [int](class_int#class-int) compression\_mode=0 **)** | | [bool](class_bool#class-bool) | [empty](#class-poolbytearray-method-empty) **(** **)** | | void | [fill](#class-poolbytearray-method-fill) **(** [int](class_int#class-int) byte **)** | | [int](class_int#class-int) | [find](#class-poolbytearray-method-find) **(** [int](class_int#class-int) value, [int](class_int#class-int) from=0 **)** | | [String](class_string#class-string) | [get\_string\_from\_ascii](#class-poolbytearray-method-get-string-from-ascii) **(** **)** | | [String](class_string#class-string) | [get\_string\_from\_utf8](#class-poolbytearray-method-get-string-from-utf8) **(** **)** | | [bool](class_bool#class-bool) | [has](#class-poolbytearray-method-has) **(** [int](class_int#class-int) value **)** | | [String](class_string#class-string) | [hex\_encode](#class-poolbytearray-method-hex-encode) **(** **)** | | [int](class_int#class-int) | [insert](#class-poolbytearray-method-insert) **(** [int](class_int#class-int) idx, [int](class_int#class-int) byte **)** | | void | [invert](#class-poolbytearray-method-invert) **(** **)** | | void | [push\_back](#class-poolbytearray-method-push-back) **(** [int](class_int#class-int) byte **)** | | void | [remove](#class-poolbytearray-method-remove) **(** [int](class_int#class-int) idx **)** | | void | [resize](#class-poolbytearray-method-resize) **(** [int](class_int#class-int) idx **)** | | [int](class_int#class-int) | [rfind](#class-poolbytearray-method-rfind) **(** [int](class_int#class-int) value, [int](class_int#class-int) from=-1 **)** | | void | [set](#class-poolbytearray-method-set) **(** [int](class_int#class-int) idx, [int](class_int#class-int) byte **)** | | [int](class_int#class-int) | [size](#class-poolbytearray-method-size) **(** **)** | | void | [sort](#class-poolbytearray-method-sort) **(** **)** | | [PoolByteArray](#class-poolbytearray) | [subarray](#class-poolbytearray-method-subarray) **(** [int](class_int#class-int) from, [int](class_int#class-int) to **)** | Method Descriptions ------------------- ### [PoolByteArray](#class-poolbytearray) PoolByteArray ( [Array](class_array#class-array) from ) Constructs a new `PoolByteArray`. Optionally, you can pass in a generic [Array](class_array#class-array) that will be converted. ### void append ( [int](class_int#class-int) byte ) Appends an element at the end of the array (alias of [push\_back](#class-poolbytearray-method-push-back)). ### void append\_array ( [PoolByteArray](#class-poolbytearray) array ) Appends a `PoolByteArray` at the end of this array. ### [PoolByteArray](#class-poolbytearray) compress ( [int](class_int#class-int) compression\_mode=0 ) Returns a new `PoolByteArray` with the data compressed. Set the compression mode using one of [CompressionMode](class_file#enum-file-compressionmode)'s constants. ### [int](class_int#class-int) count ( [int](class_int#class-int) value ) Returns the number of times an element is in the array. ### [PoolByteArray](#class-poolbytearray) decompress ( [int](class_int#class-int) buffer\_size, [int](class_int#class-int) compression\_mode=0 ) Returns a new `PoolByteArray` with the data decompressed. Set `buffer_size` to the size of the uncompressed data. Set the compression mode using one of [CompressionMode](class_file#enum-file-compressionmode)'s constants. ### [PoolByteArray](#class-poolbytearray) decompress\_dynamic ( [int](class_int#class-int) max\_output\_size, [int](class_int#class-int) compression\_mode=0 ) Returns a new `PoolByteArray` with the data decompressed. Set the compression mode using one of [CompressionMode](class_file#enum-file-compressionmode)'s constants. **This method only accepts gzip and deflate compression modes.** This method is potentially slower than `decompress`, as it may have to re-allocate its output buffer multiple times while decompressing, where as `decompress` knows its output buffer size from the beginning. GZIP has a maximal compression ratio of 1032:1, meaning it's very possible for a small compressed payload to decompress to a potentially very large output. To guard against this, you may provide a maximum size this function is allowed to allocate in bytes via `max_output_size`. Passing -1 will allow for unbounded output. If any positive value is passed, and the decompression exceeds that amount in bytes, then an error will be returned. ### [bool](class_bool#class-bool) empty ( ) Returns `true` if the array is empty. ### void fill ( [int](class_int#class-int) byte ) Assigns the given value to all elements in the array. This can typically be used together with [resize](#class-poolbytearray-method-resize) to create an array with a given size and initialized elements. ### [int](class_int#class-int) find ( [int](class_int#class-int) value, [int](class_int#class-int) from=0 ) Searches the array for a value and returns its index or `-1` if not found. Optionally, the initial search index can be passed. Returns `-1` if `from` is out of bounds. ### [String](class_string#class-string) get\_string\_from\_ascii ( ) Returns a copy of the array's contents as [String](class_string#class-string). Fast alternative to [get\_string\_from\_utf8](#class-poolbytearray-method-get-string-from-utf8) if the content is ASCII-only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use [get\_string\_from\_utf8](#class-poolbytearray-method-get-string-from-utf8). ### [String](class_string#class-string) get\_string\_from\_utf8 ( ) Returns a copy of the array's contents as [String](class_string#class-string). Slower than [get\_string\_from\_ascii](#class-poolbytearray-method-get-string-from-ascii) but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. ### [bool](class_bool#class-bool) has ( [int](class_int#class-int) value ) Returns `true` if the array contains the given value. **Note:** This is equivalent to using the `in` operator. ### [String](class_string#class-string) hex\_encode ( ) Returns a hexadecimal representation of this array as a [String](class_string#class-string). ``` var array = PoolByteArray([11, 46, 255]) print(array.hex_encode()) # Prints: 0b2eff ``` ### [int](class_int#class-int) insert ( [int](class_int#class-int) idx, [int](class_int#class-int) byte ) Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (`idx == size()`). ### void invert ( ) Reverses the order of the elements in the array. ### void push\_back ( [int](class_int#class-int) byte ) Appends an element at the end of the array. ### void remove ( [int](class_int#class-int) idx ) Removes an element from the array by index. ### void resize ( [int](class_int#class-int) idx ) Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. **Note:** Added elements are not automatically initialized to 0 and will contain garbage, i.e. indeterminate values. ### [int](class_int#class-int) rfind ( [int](class_int#class-int) value, [int](class_int#class-int) from=-1 ) Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. ### void set ( [int](class_int#class-int) idx, [int](class_int#class-int) byte ) Changes the byte at the given index. ### [int](class_int#class-int) size ( ) Returns the number of elements in the array. ### void sort ( ) Sorts the elements of the array in ascending order. ### [PoolByteArray](#class-poolbytearray) subarray ( [int](class_int#class-int) from, [int](class_int#class-int) to ) Returns the slice of the `PoolByteArray` between indices (inclusive) as a new `PoolByteArray`. Any negative index is considered to be from the end of the array.
programming_docs
godot InputEventGesture InputEventGesture ================= **Inherits:** [InputEventWithModifiers](class_inputeventwithmodifiers#class-inputeventwithmodifiers) **<** [InputEvent](class_inputevent#class-inputevent) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [InputEventMagnifyGesture](class_inputeventmagnifygesture#class-inputeventmagnifygesture), [InputEventPanGesture](class_inputeventpangesture#class-inputeventpangesture) Base class for touch control gestures. Properties ---------- | | | | | --- | --- | --- | | [Vector2](class_vector2#class-vector2) | [position](#class-inputeventgesture-property-position) | `Vector2( 0, 0 )` | Property Descriptions --------------------- ### [Vector2](class_vector2#class-vector2) position | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_position(value) | | *Getter* | get\_position() | The local gesture position relative to the [Viewport](class_viewport#class-viewport). If used in [Control.\_gui\_input](class_control#class-control-method-gui-input), the position is relative to the current [Control](class_control#class-control) that received this gesture. godot VisualShaderNodeVectorSmoothStep VisualShaderNodeVectorSmoothStep ================================ **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Calculates a vector SmoothStep function within the visual shader graph. Description ----------- Translates to `smoothstep(edge0, edge1, x)` in the shader language, where `x` is a vector. Returns `0.0` if `x` is smaller than `edge0` and `1.0` if `x` is larger than `edge1`. Otherwise the return value is interpolated between `0.0` and `1.0` using Hermite polynomials. godot VisualShaderNodeVectorFunc VisualShaderNodeVectorFunc ========================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A vector function to be used within the visual shader graph. Description ----------- A visual shader node able to perform different functions using vectors. Properties ---------- | | | | | --- | --- | --- | | [Function](#enum-visualshadernodevectorfunc-function) | [function](#class-visualshadernodevectorfunc-property-function) | `0` | Enumerations ------------ enum **Function**: * **FUNC\_NORMALIZE** = **0** --- Normalizes the vector so that it has a length of `1` but points in the same direction. * **FUNC\_SATURATE** = **1** --- Clamps the value between `0.0` and `1.0`. * **FUNC\_NEGATE** = **2** --- Returns the opposite value of the parameter. * **FUNC\_RECIPROCAL** = **3** --- Returns `1/vector`. * **FUNC\_RGB2HSV** = **4** --- Converts RGB vector to HSV equivalent. * **FUNC\_HSV2RGB** = **5** --- Converts HSV vector to RGB equivalent. * **FUNC\_ABS** = **6** --- Returns the absolute value of the parameter. * **FUNC\_ACOS** = **7** --- Returns the arc-cosine of the parameter. * **FUNC\_ACOSH** = **8** --- Returns the inverse hyperbolic cosine of the parameter. * **FUNC\_ASIN** = **9** --- Returns the arc-sine of the parameter. * **FUNC\_ASINH** = **10** --- Returns the inverse hyperbolic sine of the parameter. * **FUNC\_ATAN** = **11** --- Returns the arc-tangent of the parameter. * **FUNC\_ATANH** = **12** --- Returns the inverse hyperbolic tangent of the parameter. * **FUNC\_CEIL** = **13** --- Finds the nearest integer that is greater than or equal to the parameter. * **FUNC\_COS** = **14** --- Returns the cosine of the parameter. * **FUNC\_COSH** = **15** --- Returns the hyperbolic cosine of the parameter. * **FUNC\_DEGREES** = **16** --- Converts a quantity in radians to degrees. * **FUNC\_EXP** = **17** --- Base-e Exponential. * **FUNC\_EXP2** = **18** --- Base-2 Exponential. * **FUNC\_FLOOR** = **19** --- Finds the nearest integer less than or equal to the parameter. * **FUNC\_FRAC** = **20** --- Computes the fractional part of the argument. * **FUNC\_INVERSE\_SQRT** = **21** --- Returns the inverse of the square root of the parameter. * **FUNC\_LOG** = **22** --- Natural logarithm. * **FUNC\_LOG2** = **23** --- Base-2 logarithm. * **FUNC\_RADIANS** = **24** --- Converts a quantity in degrees to radians. * **FUNC\_ROUND** = **25** --- Finds the nearest integer to the parameter. * **FUNC\_ROUNDEVEN** = **26** --- Finds the nearest even integer to the parameter. * **FUNC\_SIGN** = **27** --- Extracts the sign of the parameter, i.e. returns `-1` if the parameter is negative, `1` if it's positive and `0` otherwise. * **FUNC\_SIN** = **28** --- Returns the sine of the parameter. * **FUNC\_SINH** = **29** --- Returns the hyperbolic sine of the parameter. * **FUNC\_SQRT** = **30** --- Returns the square root of the parameter. * **FUNC\_TAN** = **31** --- Returns the tangent of the parameter. * **FUNC\_TANH** = **32** --- Returns the hyperbolic tangent of the parameter. * **FUNC\_TRUNC** = **33** --- Returns a value equal to the nearest integer to the parameter whose absolute value is not larger than the absolute value of the parameter. * **FUNC\_ONEMINUS** = **34** --- Returns `1.0 - vector`. Property Descriptions --------------------- ### [Function](#enum-visualshadernodevectorfunc-function) function | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_function(value) | | *Getter* | get\_function() | The function to be performed. See [Function](#enum-visualshadernodevectorfunc-function) for options. godot ReferenceRect ReferenceRect ============= **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Reference frame for GUI. Description ----------- A rectangle box that displays only a [border\_color](#class-referencerect-property-border-color) border color around its rectangle. `ReferenceRect` has no fill [Color](class_color#class-color). If you need to display a rectangle filled with a solid color, consider using [ColorRect](class_colorrect#class-colorrect) instead. Properties ---------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [border\_color](#class-referencerect-property-border-color) | `Color( 1, 0, 0, 1 )` | | [float](class_float#class-float) | [border\_width](#class-referencerect-property-border-width) | `1.0` | | [bool](class_bool#class-bool) | [editor\_only](#class-referencerect-property-editor-only) | `true` | Property Descriptions --------------------- ### [Color](class_color#class-color) border\_color | | | | --- | --- | | *Default* | `Color( 1, 0, 0, 1 )` | | *Setter* | set\_border\_color(value) | | *Getter* | get\_border\_color() | Sets the border [Color](class_color#class-color) of the `ReferenceRect`. ### [float](class_float#class-float) border\_width | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_border\_width(value) | | *Getter* | get\_border\_width() | Sets the border width of the `ReferenceRect`. The border grows both inwards and outwards with respect to the rectangle box. ### [bool](class_bool#class-bool) editor\_only | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_editor\_only(value) | | *Getter* | get\_editor\_only() | If set to `true`, the `ReferenceRect` will only be visible while in editor. Otherwise, `ReferenceRect` will be visible in game. godot CheckBox CheckBox ======== **Inherits:** [Button](class_button#class-button) **<** [BaseButton](class_basebutton#class-basebutton) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Binary choice user interface widget. See also [CheckButton](class_checkbutton#class-checkbutton). Description ----------- A checkbox allows the user to make a binary choice (choosing only one of two possible options). It's similar to [CheckButton](class_checkbutton#class-checkbutton) in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckBox when toggling it has **no** immediate effect on something. For instance, it should be used when toggling it will only do something once a confirmation button is pressed. See also [BaseButton](class_basebutton#class-basebutton) which contains common properties and methods associated with this node. Properties ---------- | | | | | --- | --- | --- | | [TextAlign](class_button#enum-button-textalign) | align | `0` (overrides [Button](class_button#class-button-property-align)) | | [bool](class_bool#class-bool) | toggle\_mode | `true` (overrides [BaseButton](class_basebutton#class-basebutton-property-toggle-mode)) | Theme Properties ---------------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [font\_color](#class-checkbox-theme-color-font-color) | `Color( 0.88, 0.88, 0.88, 1 )` | | [Color](class_color#class-color) | [font\_color\_disabled](#class-checkbox-theme-color-font-color-disabled) | `Color( 0.9, 0.9, 0.9, 0.2 )` | | [Color](class_color#class-color) | [font\_color\_focus](#class-checkbox-theme-color-font-color-focus) | `Color( 0.94, 0.94, 0.94, 1 )` | | [Color](class_color#class-color) | [font\_color\_hover](#class-checkbox-theme-color-font-color-hover) | `Color( 0.94, 0.94, 0.94, 1 )` | | [Color](class_color#class-color) | [font\_color\_hover\_pressed](#class-checkbox-theme-color-font-color-hover-pressed) | `Color( 1, 1, 1, 1 )` | | [Color](class_color#class-color) | [font\_color\_pressed](#class-checkbox-theme-color-font-color-pressed) | `Color( 1, 1, 1, 1 )` | | [int](class_int#class-int) | [check\_vadjust](#class-checkbox-theme-constant-check-vadjust) | `0` | | [int](class_int#class-int) | [hseparation](#class-checkbox-theme-constant-hseparation) | `4` | | [Font](class_font#class-font) | [font](#class-checkbox-theme-font-font) | | | [Texture](class_texture#class-texture) | [checked](#class-checkbox-theme-icon-checked) | | | [Texture](class_texture#class-texture) | [checked\_disabled](#class-checkbox-theme-icon-checked-disabled) | | | [Texture](class_texture#class-texture) | [radio\_checked](#class-checkbox-theme-icon-radio-checked) | | | [Texture](class_texture#class-texture) | [radio\_checked\_disabled](#class-checkbox-theme-icon-radio-checked-disabled) | | | [Texture](class_texture#class-texture) | [radio\_unchecked](#class-checkbox-theme-icon-radio-unchecked) | | | [Texture](class_texture#class-texture) | [radio\_unchecked\_disabled](#class-checkbox-theme-icon-radio-unchecked-disabled) | | | [Texture](class_texture#class-texture) | [unchecked](#class-checkbox-theme-icon-unchecked) | | | [Texture](class_texture#class-texture) | [unchecked\_disabled](#class-checkbox-theme-icon-unchecked-disabled) | | | [StyleBox](class_stylebox#class-stylebox) | [disabled](#class-checkbox-theme-style-disabled) | | | [StyleBox](class_stylebox#class-stylebox) | [focus](#class-checkbox-theme-style-focus) | | | [StyleBox](class_stylebox#class-stylebox) | [hover](#class-checkbox-theme-style-hover) | | | [StyleBox](class_stylebox#class-stylebox) | [hover\_pressed](#class-checkbox-theme-style-hover-pressed) | | | [StyleBox](class_stylebox#class-stylebox) | [normal](#class-checkbox-theme-style-normal) | | | [StyleBox](class_stylebox#class-stylebox) | [pressed](#class-checkbox-theme-style-pressed) | | Theme Property Descriptions --------------------------- ### [Color](class_color#class-color) font\_color | | | | --- | --- | | *Default* | `Color( 0.88, 0.88, 0.88, 1 )` | The `CheckBox` text's font color. ### [Color](class_color#class-color) font\_color\_disabled | | | | --- | --- | | *Default* | `Color( 0.9, 0.9, 0.9, 0.2 )` | The `CheckBox` text's font color when it's disabled. ### [Color](class_color#class-color) font\_color\_focus | | | | --- | --- | | *Default* | `Color( 0.94, 0.94, 0.94, 1 )` | The `CheckBox` text's font color when it's focused. Only replaces the normal text color of the checkbox. Disabled, hovered, and pressed states take precedence over this color. ### [Color](class_color#class-color) font\_color\_hover | | | | --- | --- | | *Default* | `Color( 0.94, 0.94, 0.94, 1 )` | The `CheckBox` text's font color when it's hovered. ### [Color](class_color#class-color) font\_color\_hover\_pressed | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | The `CheckBox` text's font color when it's hovered and pressed. ### [Color](class_color#class-color) font\_color\_pressed | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | The `CheckBox` text's font color when it's pressed. ### [int](class_int#class-int) check\_vadjust | | | | --- | --- | | *Default* | `0` | The vertical offset used when rendering the check icons (in pixels). ### [int](class_int#class-int) hseparation | | | | --- | --- | | *Default* | `4` | The separation between the check icon and the text (in pixels). ### [Font](class_font#class-font) font The [Font](class_font#class-font) to use for the `CheckBox` text. ### [Texture](class_texture#class-texture) checked The check icon to display when the `CheckBox` is checked. ### [Texture](class_texture#class-texture) checked\_disabled The check icon to display when the `CheckBox` is checked and disabled. ### [Texture](class_texture#class-texture) radio\_checked If the `CheckBox` is configured as a radio button, the icon to display when the `CheckBox` is checked. ### [Texture](class_texture#class-texture) radio\_checked\_disabled ### [Texture](class_texture#class-texture) radio\_unchecked If the `CheckBox` is configured as a radio button, the icon to display when the `CheckBox` is unchecked. ### [Texture](class_texture#class-texture) radio\_unchecked\_disabled ### [Texture](class_texture#class-texture) unchecked The check icon to display when the `CheckBox` is unchecked. ### [Texture](class_texture#class-texture) unchecked\_disabled The check icon to display when the `CheckBox` is unchecked and disabled. ### [StyleBox](class_stylebox#class-stylebox) disabled The [StyleBox](class_stylebox#class-stylebox) to display as a background when the `CheckBox` is disabled. ### [StyleBox](class_stylebox#class-stylebox) focus The [StyleBox](class_stylebox#class-stylebox) to display as a background when the `CheckBox` is focused. ### [StyleBox](class_stylebox#class-stylebox) hover The [StyleBox](class_stylebox#class-stylebox) to display as a background when the `CheckBox` is hovered. ### [StyleBox](class_stylebox#class-stylebox) hover\_pressed The [StyleBox](class_stylebox#class-stylebox) to display as a background when the `CheckBox` is hovered and pressed. ### [StyleBox](class_stylebox#class-stylebox) normal The [StyleBox](class_stylebox#class-stylebox) to display as a background. ### [StyleBox](class_stylebox#class-stylebox) pressed The [StyleBox](class_stylebox#class-stylebox) to display as a background when the `CheckBox` is pressed. godot KinematicCollision KinematicCollision ================== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Collision data for [KinematicBody](class_kinematicbody#class-kinematicbody) collisions. Description ----------- Contains collision data for [KinematicBody](class_kinematicbody#class-kinematicbody) collisions. When a [KinematicBody](class_kinematicbody#class-kinematicbody) is moved using [KinematicBody.move\_and\_collide](class_kinematicbody#class-kinematicbody-method-move-and-collide), it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision object is returned. This object contains information about the collision, including the colliding object, the remaining motion, and the collision position. This information can be used to calculate a collision response. Properties ---------- | | | | | --- | --- | --- | | [Object](class_object#class-object) | [collider](#class-kinematiccollision-property-collider) | | | [int](class_int#class-int) | [collider\_id](#class-kinematiccollision-property-collider-id) | `0` | | [Variant](class_variant#class-variant) | [collider\_metadata](#class-kinematiccollision-property-collider-metadata) | | | [RID](class_rid#class-rid) | [collider\_rid](#class-kinematiccollision-property-collider-rid) | | | [Object](class_object#class-object) | [collider\_shape](#class-kinematiccollision-property-collider-shape) | | | [int](class_int#class-int) | [collider\_shape\_index](#class-kinematiccollision-property-collider-shape-index) | `0` | | [Vector3](class_vector3#class-vector3) | [collider\_velocity](#class-kinematiccollision-property-collider-velocity) | `Vector3( 0, 0, 0 )` | | [Object](class_object#class-object) | [local\_shape](#class-kinematiccollision-property-local-shape) | | | [Vector3](class_vector3#class-vector3) | [normal](#class-kinematiccollision-property-normal) | `Vector3( 0, 0, 0 )` | | [Vector3](class_vector3#class-vector3) | [position](#class-kinematiccollision-property-position) | `Vector3( 0, 0, 0 )` | | [Vector3](class_vector3#class-vector3) | [remainder](#class-kinematiccollision-property-remainder) | `Vector3( 0, 0, 0 )` | | [Vector3](class_vector3#class-vector3) | [travel](#class-kinematiccollision-property-travel) | `Vector3( 0, 0, 0 )` | Methods ------- | | | | --- | --- | | [float](class_float#class-float) | [get\_angle](#class-kinematiccollision-method-get-angle) **(** [Vector3](class_vector3#class-vector3) up\_direction=Vector3( 0, 1, 0 ) **)** const | Property Descriptions --------------------- ### [Object](class_object#class-object) collider | | | | --- | --- | | *Getter* | get\_collider() | The colliding body. ### [int](class_int#class-int) collider\_id | | | | --- | --- | | *Default* | `0` | | *Getter* | get\_collider\_id() | The colliding body's unique instance ID. See [Object.get\_instance\_id](class_object#class-object-method-get-instance-id). ### [Variant](class_variant#class-variant) collider\_metadata | | | | --- | --- | | *Getter* | get\_collider\_metadata() | The colliding body's metadata. See [Object](class_object#class-object). ### [RID](class_rid#class-rid) collider\_rid | | | | --- | --- | | *Getter* | get\_collider\_rid() | The colliding body's [RID](class_rid#class-rid) used by the [PhysicsServer](class_physicsserver#class-physicsserver). ### [Object](class_object#class-object) collider\_shape | | | | --- | --- | | *Getter* | get\_collider\_shape() | The colliding body's shape. ### [int](class_int#class-int) collider\_shape\_index | | | | --- | --- | | *Default* | `0` | | *Getter* | get\_collider\_shape\_index() | The colliding shape's index. See [CollisionObject](class_collisionobject#class-collisionobject). ### [Vector3](class_vector3#class-vector3) collider\_velocity | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Getter* | get\_collider\_velocity() | The colliding object's velocity. ### [Object](class_object#class-object) local\_shape | | | | --- | --- | | *Getter* | get\_local\_shape() | The moving object's colliding shape. ### [Vector3](class_vector3#class-vector3) normal | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Getter* | get\_normal() | The colliding body's shape's normal at the point of collision. ### [Vector3](class_vector3#class-vector3) position | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Getter* | get\_position() | The point of collision, in global coordinates. ### [Vector3](class_vector3#class-vector3) remainder | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Getter* | get\_remainder() | The moving object's remaining movement vector. ### [Vector3](class_vector3#class-vector3) travel | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Getter* | get\_travel() | The distance the moving object traveled before collision. Method Descriptions ------------------- ### [float](class_float#class-float) get\_angle ( [Vector3](class_vector3#class-vector3) up\_direction=Vector3( 0, 1, 0 ) ) const The collision angle according to `up_direction`, which is `Vector3.UP` by default. This value is always positive.
programming_docs
godot VSlider VSlider ======= **Inherits:** [Slider](class_slider#class-slider) **<** [Range](class_range#class-range) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Vertical slider. Description ----------- Vertical slider. See [Slider](class_slider#class-slider). This one goes from bottom (min) to top (max). **Note:** The [Range.changed](class_range#class-range-signal-changed) and [Range.value\_changed](class_range#class-range-signal-value-changed) signals are part of the [Range](class_range#class-range) class which this class inherits from. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | size\_flags\_horizontal | `0` (overrides [Control](class_control#class-control-property-size-flags-horizontal)) | | [int](class_int#class-int) | size\_flags\_vertical | `1` (overrides [Control](class_control#class-control-property-size-flags-vertical)) | Theme Properties ---------------- | | | | --- | --- | | [Texture](class_texture#class-texture) | [grabber](#class-vslider-theme-icon-grabber) | | [Texture](class_texture#class-texture) | [grabber\_disabled](#class-vslider-theme-icon-grabber-disabled) | | [Texture](class_texture#class-texture) | [grabber\_highlight](#class-vslider-theme-icon-grabber-highlight) | | [Texture](class_texture#class-texture) | [tick](#class-vslider-theme-icon-tick) | | [StyleBox](class_stylebox#class-stylebox) | [grabber\_area](#class-vslider-theme-style-grabber-area) | | [StyleBox](class_stylebox#class-stylebox) | [grabber\_area\_highlight](#class-vslider-theme-style-grabber-area-highlight) | | [StyleBox](class_stylebox#class-stylebox) | [slider](#class-vslider-theme-style-slider) | Theme Property Descriptions --------------------------- ### [Texture](class_texture#class-texture) grabber The texture for the grabber (the draggable element). ### [Texture](class_texture#class-texture) grabber\_disabled The texture for the grabber when it's disabled. ### [Texture](class_texture#class-texture) grabber\_highlight The texture for the grabber when it's focused. ### [Texture](class_texture#class-texture) tick The texture for the ticks, visible when [Slider.tick\_count](class_slider#class-slider-property-tick-count) is greater than 0. ### [StyleBox](class_stylebox#class-stylebox) grabber\_area The background of the area below the grabber. ### [StyleBox](class_stylebox#class-stylebox) grabber\_area\_highlight ### [StyleBox](class_stylebox#class-stylebox) slider The background for the whole slider. Determines the width of the `grabber_area`. godot ConfigFile ConfigFile ========== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Helper class to handle INI-style files. Description ----------- This helper class can be used to store [Variant](class_variant#class-variant) values on the filesystem using INI-style formatting. The stored values are identified by a section and a key: ``` [section] some_key=42 string_example="Hello World!" a_vector=Vector3( 1, 0, 2 ) ``` The stored data can be saved to or parsed from a file, though ConfigFile objects can also be used directly without accessing the filesystem. The following example shows how to create a simple `ConfigFile` and save it on disk: ``` # Create new ConfigFile object. var config = ConfigFile.new() # Store some values. config.set_value("Player1", "player_name", "Steve") config.set_value("Player1", "best_score", 10) config.set_value("Player2", "player_name", "V3geta") config.set_value("Player2", "best_score", 9001) # Save it to a file (overwrite if already exists). config.save("user://scores.cfg") ``` This example shows how the above file could be loaded: ``` var score_data = {} var config = ConfigFile.new() # Load data from a file. var err = config.load("user://scores.cfg") # If the file didn't load, ignore it. if err != OK: return # Iterate over all sections. for player in config.get_sections(): # Fetch the data for each section. var player_name = config.get_value(player, "player_name") var player_score = config.get_value(player, "best_score") score_data[player_name] = player_score ``` Any operation that mutates the ConfigFile such as [set\_value](#class-configfile-method-set-value), [clear](#class-configfile-method-clear), or [erase\_section](#class-configfile-method-erase-section), only changes what is loaded in memory. If you want to write the change to a file, you have to save the changes with [save](#class-configfile-method-save), [save\_encrypted](#class-configfile-method-save-encrypted), or [save\_encrypted\_pass](#class-configfile-method-save-encrypted-pass). Keep in mind that section and property names can't contain spaces. Anything after a space will be ignored on save and on load. ConfigFiles can also contain manually written comment lines starting with a semicolon (`;`). Those lines will be ignored when parsing the file. Note that comments will be lost when saving the ConfigFile. This can still be useful for dedicated server configuration files, which are typically never overwritten without explicit user action. **Note:** The file extension given to a ConfigFile does not have any impact on its formatting or behavior. By convention, the `.cfg` extension is used here, but any other extension such as `.ini` is also valid. Since neither `.cfg` nor `.ini` are standardized, Godot's ConfigFile formatting may differ from files written by other programs. Methods ------- | | | | --- | --- | | void | [clear](#class-configfile-method-clear) **(** **)** | | void | [erase\_section](#class-configfile-method-erase-section) **(** [String](class_string#class-string) section **)** | | void | [erase\_section\_key](#class-configfile-method-erase-section-key) **(** [String](class_string#class-string) section, [String](class_string#class-string) key **)** | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_section\_keys](#class-configfile-method-get-section-keys) **(** [String](class_string#class-string) section **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_sections](#class-configfile-method-get-sections) **(** **)** const | | [Variant](class_variant#class-variant) | [get\_value](#class-configfile-method-get-value) **(** [String](class_string#class-string) section, [String](class_string#class-string) key, [Variant](class_variant#class-variant) default=null **)** const | | [bool](class_bool#class-bool) | [has\_section](#class-configfile-method-has-section) **(** [String](class_string#class-string) section **)** const | | [bool](class_bool#class-bool) | [has\_section\_key](#class-configfile-method-has-section-key) **(** [String](class_string#class-string) section, [String](class_string#class-string) key **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [load](#class-configfile-method-load) **(** [String](class_string#class-string) path **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [load\_encrypted](#class-configfile-method-load-encrypted) **(** [String](class_string#class-string) path, [PoolByteArray](class_poolbytearray#class-poolbytearray) key **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [load\_encrypted\_pass](#class-configfile-method-load-encrypted-pass) **(** [String](class_string#class-string) path, [String](class_string#class-string) password **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [parse](#class-configfile-method-parse) **(** [String](class_string#class-string) data **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [save](#class-configfile-method-save) **(** [String](class_string#class-string) path **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [save\_encrypted](#class-configfile-method-save-encrypted) **(** [String](class_string#class-string) path, [PoolByteArray](class_poolbytearray#class-poolbytearray) key **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [save\_encrypted\_pass](#class-configfile-method-save-encrypted-pass) **(** [String](class_string#class-string) path, [String](class_string#class-string) password **)** | | void | [set\_value](#class-configfile-method-set-value) **(** [String](class_string#class-string) section, [String](class_string#class-string) key, [Variant](class_variant#class-variant) value **)** | Method Descriptions ------------------- ### void clear ( ) Removes the entire contents of the config. ### void erase\_section ( [String](class_string#class-string) section ) Deletes the specified section along with all the key-value pairs inside. Raises an error if the section does not exist. ### void erase\_section\_key ( [String](class_string#class-string) section, [String](class_string#class-string) key ) Deletes the specified key in a section. Raises an error if either the section or the key do not exist. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_section\_keys ( [String](class_string#class-string) section ) const Returns an array of all defined key identifiers in the specified section. Raises an error and returns an empty array if the section does not exist. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_sections ( ) const Returns an array of all defined section identifiers. ### [Variant](class_variant#class-variant) get\_value ( [String](class_string#class-string) section, [String](class_string#class-string) key, [Variant](class_variant#class-variant) default=null ) const Returns the current value for the specified section and key. If either the section or the key do not exist, the method returns the fallback `default` value. If `default` is not specified or set to `null`, an error is also raised. ### [bool](class_bool#class-bool) has\_section ( [String](class_string#class-string) section ) const Returns `true` if the specified section exists. ### [bool](class_bool#class-bool) has\_section\_key ( [String](class_string#class-string) section, [String](class_string#class-string) key ) const Returns `true` if the specified section-key pair exists. ### [Error](class_%40globalscope#enum-globalscope-error) load ( [String](class_string#class-string) path ) Loads the config file specified as a parameter. The file's contents are parsed and loaded in the `ConfigFile` object which the method was called on. Returns one of the [Error](class_%40globalscope#enum-globalscope-error) code constants (`OK` on success). ### [Error](class_%40globalscope#enum-globalscope-error) load\_encrypted ( [String](class_string#class-string) path, [PoolByteArray](class_poolbytearray#class-poolbytearray) key ) Loads the encrypted config file specified as a parameter, using the provided `key` to decrypt it. The file's contents are parsed and loaded in the `ConfigFile` object which the method was called on. Returns one of the [Error](class_%40globalscope#enum-globalscope-error) code constants (`OK` on success). ### [Error](class_%40globalscope#enum-globalscope-error) load\_encrypted\_pass ( [String](class_string#class-string) path, [String](class_string#class-string) password ) Loads the encrypted config file specified as a parameter, using the provided `password` to decrypt it. The file's contents are parsed and loaded in the `ConfigFile` object which the method was called on. Returns one of the [Error](class_%40globalscope#enum-globalscope-error) code constants (`OK` on success). ### [Error](class_%40globalscope#enum-globalscope-error) parse ( [String](class_string#class-string) data ) Parses the passed string as the contents of a config file. The string is parsed and loaded in the ConfigFile object which the method was called on. Returns one of the [Error](class_%40globalscope#enum-globalscope-error) code constants (`OK` on success). ### [Error](class_%40globalscope#enum-globalscope-error) save ( [String](class_string#class-string) path ) Saves the contents of the `ConfigFile` object to the file specified as a parameter. The output file uses an INI-style structure. Returns one of the [Error](class_%40globalscope#enum-globalscope-error) code constants (`OK` on success). ### [Error](class_%40globalscope#enum-globalscope-error) save\_encrypted ( [String](class_string#class-string) path, [PoolByteArray](class_poolbytearray#class-poolbytearray) key ) Saves the contents of the `ConfigFile` object to the AES-256 encrypted file specified as a parameter, using the provided `key` to encrypt it. The output file uses an INI-style structure. Returns one of the [Error](class_%40globalscope#enum-globalscope-error) code constants (`OK` on success). ### [Error](class_%40globalscope#enum-globalscope-error) save\_encrypted\_pass ( [String](class_string#class-string) path, [String](class_string#class-string) password ) Saves the contents of the `ConfigFile` object to the AES-256 encrypted file specified as a parameter, using the provided `password` to encrypt it. The output file uses an INI-style structure. Returns one of the [Error](class_%40globalscope#enum-globalscope-error) code constants (`OK` on success). ### void set\_value ( [String](class_string#class-string) section, [String](class_string#class-string) key, [Variant](class_variant#class-variant) value ) Assigns a value to the specified key of the specified section. If either the section or the key do not exist, they are created. Passing a `null` value deletes the specified key if it exists, and deletes the section if it ends up empty once the key has been removed. godot MobileVRInterface MobileVRInterface ================= **Inherits:** [ARVRInterface](class_arvrinterface#class-arvrinterface) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Generic mobile VR implementation. Description ----------- This is a generic mobile VR implementation where you need to provide details about the phone and HMD used. It does not rely on any existing framework. This is the most basic interface we have. For the best effect, you need a mobile phone with a gyroscope and accelerometer. Note that even though there is no positional tracking, the camera will assume the headset is at a height of 1.85 meters. You can change this by setting [eye\_height](#class-mobilevrinterface-property-eye-height). You can initialise this interface as follows: ``` var interface = ARVRServer.find_interface("Native mobile") if interface and interface.initialize(): get_viewport().arvr = true ``` Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [display\_to\_lens](#class-mobilevrinterface-property-display-to-lens) | `4.0` | | [float](class_float#class-float) | [display\_width](#class-mobilevrinterface-property-display-width) | `14.5` | | [float](class_float#class-float) | [eye\_height](#class-mobilevrinterface-property-eye-height) | `1.85` | | [float](class_float#class-float) | [iod](#class-mobilevrinterface-property-iod) | `6.0` | | [float](class_float#class-float) | [k1](#class-mobilevrinterface-property-k1) | `0.215` | | [float](class_float#class-float) | [k2](#class-mobilevrinterface-property-k2) | `0.215` | | [float](class_float#class-float) | [oversample](#class-mobilevrinterface-property-oversample) | `1.5` | Property Descriptions --------------------- ### [float](class_float#class-float) display\_to\_lens | | | | --- | --- | | *Default* | `4.0` | | *Setter* | set\_display\_to\_lens(value) | | *Getter* | get\_display\_to\_lens() | The distance between the display and the lenses inside of the device in centimeters. ### [float](class_float#class-float) display\_width | | | | --- | --- | | *Default* | `14.5` | | *Setter* | set\_display\_width(value) | | *Getter* | get\_display\_width() | The width of the display in centimeters. ### [float](class_float#class-float) eye\_height | | | | --- | --- | | *Default* | `1.85` | | *Setter* | set\_eye\_height(value) | | *Getter* | get\_eye\_height() | The height at which the camera is placed in relation to the ground (i.e. [ARVROrigin](class_arvrorigin#class-arvrorigin) node). ### [float](class_float#class-float) iod | | | | --- | --- | | *Default* | `6.0` | | *Setter* | set\_iod(value) | | *Getter* | get\_iod() | The interocular distance, also known as the interpupillary distance. The distance between the pupils of the left and right eye. ### [float](class_float#class-float) k1 | | | | --- | --- | | *Default* | `0.215` | | *Setter* | set\_k1(value) | | *Getter* | get\_k1() | The k1 lens factor is one of the two constants that define the strength of the lens used and directly influences the lens distortion effect. ### [float](class_float#class-float) k2 | | | | --- | --- | | *Default* | `0.215` | | *Setter* | set\_k2(value) | | *Getter* | get\_k2() | The k2 lens factor, see k1. ### [float](class_float#class-float) oversample | | | | --- | --- | | *Default* | `1.5` | | *Setter* | set\_oversample(value) | | *Getter* | get\_oversample() | The oversample setting. Because of the lens distortion we have to render our buffers at a higher resolution then the screen can natively handle. A value between 1.5 and 2.0 often provides good results but at the cost of performance. godot VisualShaderNodeScalarFunc VisualShaderNodeScalarFunc ========================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [Function](#enum-visualshadernodescalarfunc-function) | [function](#class-visualshadernodescalarfunc-property-function) | `13` | Enumerations ------------ enum **Function**: * **FUNC\_SIN** = **0** * **FUNC\_COS** = **1** * **FUNC\_TAN** = **2** * **FUNC\_ASIN** = **3** * **FUNC\_ACOS** = **4** * **FUNC\_ATAN** = **5** * **FUNC\_SINH** = **6** * **FUNC\_COSH** = **7** * **FUNC\_TANH** = **8** * **FUNC\_LOG** = **9** * **FUNC\_EXP** = **10** * **FUNC\_SQRT** = **11** * **FUNC\_ABS** = **12** * **FUNC\_SIGN** = **13** * **FUNC\_FLOOR** = **14** * **FUNC\_ROUND** = **15** * **FUNC\_CEIL** = **16** * **FUNC\_FRAC** = **17** * **FUNC\_SATURATE** = **18** * **FUNC\_NEGATE** = **19** * **FUNC\_ACOSH** = **20** * **FUNC\_ASINH** = **21** * **FUNC\_ATANH** = **22** * **FUNC\_DEGREES** = **23** * **FUNC\_EXP2** = **24** * **FUNC\_INVERSE\_SQRT** = **25** * **FUNC\_LOG2** = **26** * **FUNC\_RADIANS** = **27** * **FUNC\_RECIPROCAL** = **28** * **FUNC\_ROUNDEVEN** = **29** * **FUNC\_TRUNC** = **30** * **FUNC\_ONEMINUS** = **31** Property Descriptions --------------------- ### [Function](#enum-visualshadernodescalarfunc-function) function | | | | --- | --- | | *Default* | `13` | | *Setter* | set\_function(value) | | *Getter* | get\_function() | godot Node2D Node2D ====== **Inherits:** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [AnimatedSprite](class_animatedsprite#class-animatedsprite), [AudioStreamPlayer2D](class_audiostreamplayer2d#class-audiostreamplayer2d), [BackBufferCopy](class_backbuffercopy#class-backbuffercopy), [Bone2D](class_bone2d#class-bone2d), [CPUParticles2D](class_cpuparticles2d#class-cpuparticles2d), [Camera2D](class_camera2d#class-camera2d), [CanvasModulate](class_canvasmodulate#class-canvasmodulate), [CollisionObject2D](class_collisionobject2d#class-collisionobject2d), [CollisionPolygon2D](class_collisionpolygon2d#class-collisionpolygon2d), [CollisionShape2D](class_collisionshape2d#class-collisionshape2d), [Joint2D](class_joint2d#class-joint2d), [Light2D](class_light2d#class-light2d), [LightOccluder2D](class_lightoccluder2d#class-lightoccluder2d), [Line2D](class_line2d#class-line2d), [Listener2D](class_listener2d#class-listener2d), [MeshInstance2D](class_meshinstance2d#class-meshinstance2d), [MultiMeshInstance2D](class_multimeshinstance2d#class-multimeshinstance2d), [Navigation2D](class_navigation2d#class-navigation2d), [NavigationPolygonInstance](class_navigationpolygoninstance#class-navigationpolygoninstance), [ParallaxLayer](class_parallaxlayer#class-parallaxlayer), [Particles2D](class_particles2d#class-particles2d), [Path2D](class_path2d#class-path2d), [PathFollow2D](class_pathfollow2d#class-pathfollow2d), [Polygon2D](class_polygon2d#class-polygon2d), [Position2D](class_position2d#class-position2d), [RayCast2D](class_raycast2d#class-raycast2d), [RemoteTransform2D](class_remotetransform2d#class-remotetransform2d), [Skeleton2D](class_skeleton2d#class-skeleton2d), [Sprite](class_sprite#class-sprite), [TileMap](class_tilemap#class-tilemap), [TouchScreenButton](class_touchscreenbutton#class-touchscreenbutton), [VisibilityNotifier2D](class_visibilitynotifier2d#class-visibilitynotifier2d), [YSort](class_ysort#class-ysort) A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index. Description ----------- A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control of the node's render order. Tutorials --------- * [Custom drawing in 2D](https://docs.godotengine.org/en/3.5/tutorials/2d/custom_drawing_in_2d.html) * [All 2D Demos](https://github.com/godotengine/godot-demo-projects/tree/master/2d) Properties ---------- | | | | | --- | --- | --- | | [Vector2](class_vector2#class-vector2) | [global\_position](#class-node2d-property-global-position) | | | [float](class_float#class-float) | [global\_rotation](#class-node2d-property-global-rotation) | | | [float](class_float#class-float) | [global\_rotation\_degrees](#class-node2d-property-global-rotation-degrees) | | | [Vector2](class_vector2#class-vector2) | [global\_scale](#class-node2d-property-global-scale) | | | [Transform2D](class_transform2d#class-transform2d) | [global\_transform](#class-node2d-property-global-transform) | | | [Vector2](class_vector2#class-vector2) | [position](#class-node2d-property-position) | `Vector2( 0, 0 )` | | [float](class_float#class-float) | [rotation](#class-node2d-property-rotation) | `0.0` | | [float](class_float#class-float) | [rotation\_degrees](#class-node2d-property-rotation-degrees) | `0.0` | | [Vector2](class_vector2#class-vector2) | [scale](#class-node2d-property-scale) | `Vector2( 1, 1 )` | | [Transform2D](class_transform2d#class-transform2d) | [transform](#class-node2d-property-transform) | | | [bool](class_bool#class-bool) | [z\_as\_relative](#class-node2d-property-z-as-relative) | `true` | | [int](class_int#class-int) | [z\_index](#class-node2d-property-z-index) | `0` | Methods ------- | | | | --- | --- | | void | [apply\_scale](#class-node2d-method-apply-scale) **(** [Vector2](class_vector2#class-vector2) ratio **)** | | [float](class_float#class-float) | [get\_angle\_to](#class-node2d-method-get-angle-to) **(** [Vector2](class_vector2#class-vector2) point **)** const | | [Transform2D](class_transform2d#class-transform2d) | [get\_relative\_transform\_to\_parent](#class-node2d-method-get-relative-transform-to-parent) **(** [Node](class_node#class-node) parent **)** const | | void | [global\_translate](#class-node2d-method-global-translate) **(** [Vector2](class_vector2#class-vector2) offset **)** | | void | [look\_at](#class-node2d-method-look-at) **(** [Vector2](class_vector2#class-vector2) point **)** | | void | [move\_local\_x](#class-node2d-method-move-local-x) **(** [float](class_float#class-float) delta, [bool](class_bool#class-bool) scaled=false **)** | | void | [move\_local\_y](#class-node2d-method-move-local-y) **(** [float](class_float#class-float) delta, [bool](class_bool#class-bool) scaled=false **)** | | void | [rotate](#class-node2d-method-rotate) **(** [float](class_float#class-float) radians **)** | | [Vector2](class_vector2#class-vector2) | [to\_global](#class-node2d-method-to-global) **(** [Vector2](class_vector2#class-vector2) local\_point **)** const | | [Vector2](class_vector2#class-vector2) | [to\_local](#class-node2d-method-to-local) **(** [Vector2](class_vector2#class-vector2) global\_point **)** const | | void | [translate](#class-node2d-method-translate) **(** [Vector2](class_vector2#class-vector2) offset **)** | Property Descriptions --------------------- ### [Vector2](class_vector2#class-vector2) global\_position | | | | --- | --- | | *Setter* | set\_global\_position(value) | | *Getter* | get\_global\_position() | Global position. ### [float](class_float#class-float) global\_rotation | | | | --- | --- | | *Setter* | set\_global\_rotation(value) | | *Getter* | get\_global\_rotation() | Global rotation in radians. ### [float](class_float#class-float) global\_rotation\_degrees | | | | --- | --- | | *Setter* | set\_global\_rotation\_degrees(value) | | *Getter* | get\_global\_rotation\_degrees() | Global rotation in degrees. ### [Vector2](class_vector2#class-vector2) global\_scale | | | | --- | --- | | *Setter* | set\_global\_scale(value) | | *Getter* | get\_global\_scale() | Global scale. ### [Transform2D](class_transform2d#class-transform2d) global\_transform | | | | --- | --- | | *Setter* | set\_global\_transform(value) | | *Getter* | get\_global\_transform() | Global [Transform2D](class_transform2d#class-transform2d). ### [Vector2](class_vector2#class-vector2) position | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_position(value) | | *Getter* | get\_position() | Position, relative to the node's parent. ### [float](class_float#class-float) rotation | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_rotation(value) | | *Getter* | get\_rotation() | Rotation in radians, relative to the node's parent. ### [float](class_float#class-float) rotation\_degrees | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_rotation\_degrees(value) | | *Getter* | get\_rotation\_degrees() | Rotation in degrees, relative to the node's parent. ### [Vector2](class_vector2#class-vector2) scale | | | | --- | --- | | *Default* | `Vector2( 1, 1 )` | | *Setter* | set\_scale(value) | | *Getter* | get\_scale() | The node's scale. Unscaled value: `(1, 1)`. **Note:** Negative X scales in 2D are not decomposable from the transformation matrix. Due to the way scale is represented with transformation matrices in Godot, negative scales on the X axis will be changed to negative scales on the Y axis and a rotation of 180 degrees when decomposed. ### [Transform2D](class_transform2d#class-transform2d) transform | | | | --- | --- | | *Setter* | set\_transform(value) | | *Getter* | get\_transform() | Local [Transform2D](class_transform2d#class-transform2d). ### [bool](class_bool#class-bool) z\_as\_relative | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_z\_as\_relative(value) | | *Getter* | is\_z\_relative() | If `true`, the node's Z index is relative to its parent's Z index. If this node's Z index is 2 and its parent's effective Z index is 3, then this node's effective Z index will be 2 + 3 = 5. ### [int](class_int#class-int) z\_index | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_z\_index(value) | | *Getter* | get\_z\_index() | Z index. Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between [VisualServer.CANVAS\_ITEM\_Z\_MIN](class_visualserver#class-visualserver-constant-canvas-item-z-min) and [VisualServer.CANVAS\_ITEM\_Z\_MAX](class_visualserver#class-visualserver-constant-canvas-item-z-max) (inclusive). Method Descriptions ------------------- ### void apply\_scale ( [Vector2](class_vector2#class-vector2) ratio ) Multiplies the current scale by the `ratio` vector. ### [float](class_float#class-float) get\_angle\_to ( [Vector2](class_vector2#class-vector2) point ) const Returns the angle between the node and the `point` in radians. [Illustration of the returned angle.](https://raw.githubusercontent.com/godotengine/godot-docs/master/img/node2d_get_angle_to.png) ### [Transform2D](class_transform2d#class-transform2d) get\_relative\_transform\_to\_parent ( [Node](class_node#class-node) parent ) const Returns the [Transform2D](class_transform2d#class-transform2d) relative to this node's parent. ### void global\_translate ( [Vector2](class_vector2#class-vector2) offset ) Adds the `offset` vector to the node's global position. ### void look\_at ( [Vector2](class_vector2#class-vector2) point ) Rotates the node so it points towards the `point`, which is expected to use global coordinates. ### void move\_local\_x ( [float](class_float#class-float) delta, [bool](class_bool#class-bool) scaled=false ) Applies a local translation on the node's X axis based on the [Node.\_process](class_node#class-node-method-process)'s `delta`. If `scaled` is `false`, normalizes the movement. ### void move\_local\_y ( [float](class_float#class-float) delta, [bool](class_bool#class-bool) scaled=false ) Applies a local translation on the node's Y axis based on the [Node.\_process](class_node#class-node-method-process)'s `delta`. If `scaled` is `false`, normalizes the movement. ### void rotate ( [float](class_float#class-float) radians ) Applies a rotation to the node, in radians, starting from its current rotation. ### [Vector2](class_vector2#class-vector2) to\_global ( [Vector2](class_vector2#class-vector2) local\_point ) const Transforms the provided local position into a position in global coordinate space. The input is expected to be local relative to the `Node2D` it is called on. e.g. Applying this method to the positions of child nodes will correctly transform their positions into the global coordinate space, but applying it to a node's own position will give an incorrect result, as it will incorporate the node's own transformation into its global position. ### [Vector2](class_vector2#class-vector2) to\_local ( [Vector2](class_vector2#class-vector2) global\_point ) const Transforms the provided global position into a position in local coordinate space. The output will be local relative to the `Node2D` it is called on. e.g. It is appropriate for determining the positions of child nodes, but it is not appropriate for determining its own position relative to its parent. ### void translate ( [Vector2](class_vector2#class-vector2) offset ) Translates the node by the given `offset` in local coordinates.
programming_docs
godot GDNativeLibrary GDNativeLibrary =============== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) An external library containing functions or script classes to use in Godot. Description ----------- A GDNative library can implement [NativeScript](class_nativescript#class-nativescript)s, global functions to call with the [GDNative](class_gdnative#class-gdnative) class, or low-level engine extensions through interfaces such as [ARVRInterfaceGDNative](class_arvrinterfacegdnative#class-arvrinterfacegdnative). The library must be compiled for each platform and architecture that the project will run on. Tutorials --------- * [GDNative C example](https://docs.godotengine.org/en/3.5/tutorials/scripting/gdnative/gdnative_c_example.html) * [GDNative C++ example](https://docs.godotengine.org/en/3.5/tutorials/scripting/gdnative/gdnative_cpp_example.html) Properties ---------- | | | | | --- | --- | --- | | [ConfigFile](class_configfile#class-configfile) | [config\_file](#class-gdnativelibrary-property-config-file) | | | [bool](class_bool#class-bool) | [load\_once](#class-gdnativelibrary-property-load-once) | `true` | | [bool](class_bool#class-bool) | [reloadable](#class-gdnativelibrary-property-reloadable) | `true` | | [bool](class_bool#class-bool) | [singleton](#class-gdnativelibrary-property-singleton) | `false` | | [String](class_string#class-string) | [symbol\_prefix](#class-gdnativelibrary-property-symbol-prefix) | `"godot_"` | Methods ------- | | | | --- | --- | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_current\_dependencies](#class-gdnativelibrary-method-get-current-dependencies) **(** **)** const | | [String](class_string#class-string) | [get\_current\_library\_path](#class-gdnativelibrary-method-get-current-library-path) **(** **)** const | Property Descriptions --------------------- ### [ConfigFile](class_configfile#class-configfile) config\_file | | | | --- | --- | | *Setter* | set\_config\_file(value) | | *Getter* | get\_config\_file() | This resource in INI-style [ConfigFile](class_configfile#class-configfile) format, as in `.gdnlib` files. ### [bool](class_bool#class-bool) load\_once | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_load\_once(value) | | *Getter* | should\_load\_once() | If `true`, Godot loads only one copy of the library and each script that references the library will share static data like static or global variables. If `false`, Godot loads a separate copy of the library into memory for each script that references it. ### [bool](class_bool#class-bool) reloadable | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_reloadable(value) | | *Getter* | is\_reloadable() | If `true`, the editor will temporarily unload the library whenever the user switches away from the editor window, allowing the user to recompile the library without restarting Godot. **Note:** If the library defines tool scripts that run inside the editor, `reloadable` must be `false`. Otherwise, the editor will attempt to unload the tool scripts while they're in use and crash. ### [bool](class_bool#class-bool) singleton | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_singleton(value) | | *Getter* | is\_singleton() | If `true`, Godot loads the library at startup rather than the first time a script uses the library, calling `{prefix}gdnative_singleton` after initializing the library (where `{prefix}` is the value of [symbol\_prefix](#class-gdnativelibrary-property-symbol-prefix)). The library remains loaded as long as Godot is running. **Note:** A singleton library cannot be [reloadable](#class-gdnativelibrary-property-reloadable). ### [String](class_string#class-string) symbol\_prefix | | | | --- | --- | | *Default* | `"godot_"` | | *Setter* | set\_symbol\_prefix(value) | | *Getter* | get\_symbol\_prefix() | The prefix this library's entry point functions begin with. For example, a GDNativeLibrary would declare its `gdnative_init` function as `godot_gdnative_init` by default. On platforms that require statically linking libraries (currently only iOS), each library must have a different `symbol_prefix`. Method Descriptions ------------------- ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_current\_dependencies ( ) const Returns paths to all dependency libraries for the current platform and architecture. ### [String](class_string#class-string) get\_current\_library\_path ( ) const Returns the path to the dynamic library file for the current platform and architecture. godot ReflectionProbe ReflectionProbe =============== **Inherits:** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Captures its surroundings to create fast, accurate reflections from a given point. Description ----------- Capture its surroundings as a dual paraboloid image, and stores versions of it with increasing levels of blur to simulate different material roughnesses. The `ReflectionProbe` is used to create high-quality reflections at a low performance cost (when [update\_mode](#class-reflectionprobe-property-update-mode) is [UPDATE\_ONCE](#class-reflectionprobe-constant-update-once)). `ReflectionProbe`s can be blended together and with the rest of the scene smoothly. `ReflectionProbe`s can also be combined with [GIProbe](class_giprobe#class-giprobe) and screen-space reflections ([Environment.ss\_reflections\_enabled](class_environment#class-environment-property-ss-reflections-enabled)) to get more accurate reflections in specific areas. `ReflectionProbe`s render all objects within their [cull\_mask](#class-reflectionprobe-property-cull-mask), so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them as-is. **Note:** Unlike [GIProbe](class_giprobe#class-giprobe), `ReflectionProbe`s only source their environment from a [WorldEnvironment](class_worldenvironment#class-worldenvironment) node. If you specify an [Environment](class_environment#class-environment) resource within a [Camera](class_camera#class-camera) node, it will be ignored by the `ReflectionProbe`. This can lead to incorrect lighting within the `ReflectionProbe`. **Note:** By default, Godot will only render 16 reflection probes. If you need more, increase the number of atlas subdivisions. This setting can be found in [ProjectSettings.rendering/quality/reflections/atlas\_subdiv](class_projectsettings#class-projectsettings-property-rendering-quality-reflections-atlas-subdiv). **Note:** The GLES2 backend will only display two reflection probes at the same time for a single mesh. If possible, split up large meshes that span over multiple reflection probes into smaller ones. Tutorials --------- * [Reflection probes](https://docs.godotengine.org/en/3.5/tutorials/3d/reflection_probes.html) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [box\_projection](#class-reflectionprobe-property-box-projection) | `false` | | [int](class_int#class-int) | [cull\_mask](#class-reflectionprobe-property-cull-mask) | `1048575` | | [bool](class_bool#class-bool) | [enable\_shadows](#class-reflectionprobe-property-enable-shadows) | `false` | | [Vector3](class_vector3#class-vector3) | [extents](#class-reflectionprobe-property-extents) | `Vector3( 1, 1, 1 )` | | [float](class_float#class-float) | [intensity](#class-reflectionprobe-property-intensity) | `1.0` | | [Color](class_color#class-color) | [interior\_ambient\_color](#class-reflectionprobe-property-interior-ambient-color) | `Color( 0, 0, 0, 1 )` | | [float](class_float#class-float) | [interior\_ambient\_contrib](#class-reflectionprobe-property-interior-ambient-contrib) | `0.0` | | [float](class_float#class-float) | [interior\_ambient\_energy](#class-reflectionprobe-property-interior-ambient-energy) | `1.0` | | [bool](class_bool#class-bool) | [interior\_enable](#class-reflectionprobe-property-interior-enable) | `false` | | [float](class_float#class-float) | [max\_distance](#class-reflectionprobe-property-max-distance) | `0.0` | | [Vector3](class_vector3#class-vector3) | [origin\_offset](#class-reflectionprobe-property-origin-offset) | `Vector3( 0, 0, 0 )` | | [UpdateMode](#enum-reflectionprobe-updatemode) | [update\_mode](#class-reflectionprobe-property-update-mode) | `0` | Enumerations ------------ enum **UpdateMode**: * **UPDATE\_ONCE** = **0** --- Update the probe once on the next frame (recommended for most objects). The corresponding radiance map will be generated over the following six frames. This takes more time to update than [UPDATE\_ALWAYS](#class-reflectionprobe-constant-update-always), but it has a lower performance cost and can result in higher-quality reflections. The ReflectionProbe is updated when its transform changes, but not when nearby geometry changes. You can force a `ReflectionProbe` update by moving the `ReflectionProbe` slightly in any direction. * **UPDATE\_ALWAYS** = **1** --- Update the probe every frame. This provides better results for fast-moving dynamic objects (such as cars). However, it has a significant performance cost. Due to the cost, it's recommended to only use one ReflectionProbe with [UPDATE\_ALWAYS](#class-reflectionprobe-constant-update-always) at most per scene. For all other use cases, use [UPDATE\_ONCE](#class-reflectionprobe-constant-update-once). Property Descriptions --------------------- ### [bool](class_bool#class-bool) box\_projection | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_enable\_box\_projection(value) | | *Getter* | is\_box\_projection\_enabled() | If `true`, enables box projection. This makes reflections look more correct in rectangle-shaped rooms by offsetting the reflection center depending on the camera's location. **Note:** To better fit rectangle-shaped rooms that are not aligned to the grid, you can rotate the `ReflectionProbe` node. ### [int](class_int#class-int) cull\_mask | | | | --- | --- | | *Default* | `1048575` | | *Setter* | set\_cull\_mask(value) | | *Getter* | get\_cull\_mask() | Sets the cull mask which determines what objects are drawn by this probe. Every [VisualInstance](class_visualinstance#class-visualinstance) with a layer included in this cull mask will be rendered by the probe. To improve performance, it is best to only include large objects which are likely to take up a lot of space in the reflection. ### [bool](class_bool#class-bool) enable\_shadows | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_enable\_shadows(value) | | *Getter* | are\_shadows\_enabled() | If `true`, computes shadows in the reflection probe. This makes the reflection probe slower to render; you may want to disable this if using the [UPDATE\_ALWAYS](#class-reflectionprobe-constant-update-always) [update\_mode](#class-reflectionprobe-property-update-mode). ### [Vector3](class_vector3#class-vector3) extents | | | | --- | --- | | *Default* | `Vector3( 1, 1, 1 )` | | *Setter* | set\_extents(value) | | *Getter* | get\_extents() | The size of the reflection probe. The larger the extents the more space covered by the probe which will lower the perceived resolution. It is best to keep the extents only as large as you need them. **Note:** To better fit areas that are not aligned to the grid, you can rotate the `ReflectionProbe` node. ### [float](class_float#class-float) intensity | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_intensity(value) | | *Getter* | get\_intensity() | Defines the reflection intensity. Intensity modulates the strength of the reflection. ### [Color](class_color#class-color) interior\_ambient\_color | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 1 )` | | *Setter* | set\_interior\_ambient(value) | | *Getter* | get\_interior\_ambient() | Sets the ambient light color to be used when this probe is set to [interior\_enable](#class-reflectionprobe-property-interior-enable). ### [float](class_float#class-float) interior\_ambient\_contrib | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_interior\_ambient\_probe\_contribution(value) | | *Getter* | get\_interior\_ambient\_probe\_contribution() | Sets the contribution value for how much the reflection affects the ambient light for this reflection probe when set to [interior\_enable](#class-reflectionprobe-property-interior-enable). Useful so that ambient light matches the color of the room. ### [float](class_float#class-float) interior\_ambient\_energy | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_interior\_ambient\_energy(value) | | *Getter* | get\_interior\_ambient\_energy() | Sets the energy multiplier for this reflection probe's ambient light contribution when set to [interior\_enable](#class-reflectionprobe-property-interior-enable). ### [bool](class_bool#class-bool) interior\_enable | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_as\_interior(value) | | *Getter* | is\_set\_as\_interior() | If `true`, reflections will ignore sky contribution. Ambient lighting is then controlled by the `interior_ambient_*` properties. ### [float](class_float#class-float) max\_distance | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_max\_distance(value) | | *Getter* | get\_max\_distance() | The maximum distance away from the `ReflectionProbe` an object can be before it is culled. Decrease this to improve performance, especially when using the [UPDATE\_ALWAYS](#class-reflectionprobe-constant-update-always) [update\_mode](#class-reflectionprobe-property-update-mode). **Note:** The maximum reflection distance is always at least equal to the [extents](#class-reflectionprobe-property-extents). This means that decreasing [max\_distance](#class-reflectionprobe-property-max-distance) will not always cull objects from reflections, especially if the reflection probe's [extents](#class-reflectionprobe-property-extents) are already large. ### [Vector3](class_vector3#class-vector3) origin\_offset | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_origin\_offset(value) | | *Getter* | get\_origin\_offset() | Sets the origin offset to be used when this `ReflectionProbe` is in [box\_projection](#class-reflectionprobe-property-box-projection) mode. This can be set to a non-zero value to ensure a reflection fits a rectangle-shaped room, while reducing the amount of objects that "get in the way" of the reflection. ### [UpdateMode](#enum-reflectionprobe-updatemode) update\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_update\_mode(value) | | *Getter* | get\_update\_mode() | Sets how frequently the `ReflectionProbe` is updated. Can be [UPDATE\_ONCE](#class-reflectionprobe-constant-update-once) or [UPDATE\_ALWAYS](#class-reflectionprobe-constant-update-always). godot InputEventJoypadMotion InputEventJoypadMotion ====================== **Inherits:** [InputEvent](class_inputevent#class-inputevent) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Input event type for gamepad joysticks and other motions. For buttons, see `InputEventJoypadButton`. Description ----------- Stores information about joystick motions. One `InputEventJoypadMotion` represents one axis at a time. Tutorials --------- * [Using InputEvent](https://docs.godotengine.org/en/3.5/tutorials/inputs/inputevent.html) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [axis](#class-inputeventjoypadmotion-property-axis) | `0` | | [float](class_float#class-float) | [axis\_value](#class-inputeventjoypadmotion-property-axis-value) | `0.0` | Property Descriptions --------------------- ### [int](class_int#class-int) axis | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_axis(value) | | *Getter* | get\_axis() | Axis identifier. Use one of the [JoystickList](class_%40globalscope#enum-globalscope-joysticklist) axis constants. ### [float](class_float#class-float) axis\_value | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_axis\_value(value) | | *Getter* | get\_axis\_value() | Current position of the joystick on the given axis. The value ranges from `-1.0` to `1.0`. A value of `0` means the axis is in its resting position. godot RemoteTransform RemoteTransform =============== **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) RemoteTransform pushes its own [Transform](class_transform#class-transform) to another [Spatial](class_spatial#class-spatial) derived Node in the scene. Description ----------- RemoteTransform pushes its own [Transform](class_transform#class-transform) to another [Spatial](class_spatial#class-spatial) derived Node (called the remote node) in the scene. It can be set to update another Node's position, rotation and/or scale. It can use either global or local coordinates. Properties ---------- | | | | | --- | --- | --- | | [NodePath](class_nodepath#class-nodepath) | [remote\_path](#class-remotetransform-property-remote-path) | `NodePath("")` | | [bool](class_bool#class-bool) | [update\_position](#class-remotetransform-property-update-position) | `true` | | [bool](class_bool#class-bool) | [update\_rotation](#class-remotetransform-property-update-rotation) | `true` | | [bool](class_bool#class-bool) | [update\_scale](#class-remotetransform-property-update-scale) | `true` | | [bool](class_bool#class-bool) | [use\_global\_coordinates](#class-remotetransform-property-use-global-coordinates) | `true` | Methods ------- | | | | --- | --- | | void | [force\_update\_cache](#class-remotetransform-method-force-update-cache) **(** **)** | Property Descriptions --------------------- ### [NodePath](class_nodepath#class-nodepath) remote\_path | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_remote\_node(value) | | *Getter* | get\_remote\_node() | The [NodePath](class_nodepath#class-nodepath) to the remote node, relative to the RemoteTransform's position in the scene. ### [bool](class_bool#class-bool) update\_position | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_update\_position(value) | | *Getter* | get\_update\_position() | If `true`, the remote node's position is updated. ### [bool](class_bool#class-bool) update\_rotation | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_update\_rotation(value) | | *Getter* | get\_update\_rotation() | If `true`, the remote node's rotation is updated. ### [bool](class_bool#class-bool) update\_scale | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_update\_scale(value) | | *Getter* | get\_update\_scale() | If `true`, the remote node's scale is updated. ### [bool](class_bool#class-bool) use\_global\_coordinates | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_use\_global\_coordinates(value) | | *Getter* | get\_use\_global\_coordinates() | If `true`, global coordinates are used. If `false`, local coordinates are used. Method Descriptions ------------------- ### void force\_update\_cache ( ) `RemoteTransform` caches the remote node. It may not notice if the remote node disappears; [force\_update\_cache](#class-remotetransform-method-force-update-cache) forces it to update the cache again. godot VisualShaderNodeVectorScalarSmoothStep VisualShaderNodeVectorScalarSmoothStep ====================================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Calculates a vector SmoothStep function using scalar within the visual shader graph. Description ----------- Translates to `smoothstep(edge0, edge1, x)` in the shader language, where `x` is a scalar. Returns `0.0` if `x` is smaller than `edge0` and `1.0` if `x` is larger than `edge1`. Otherwise the return value is interpolated between `0.0` and `1.0` using Hermite polynomials.
programming_docs
godot WebRTCMultiplayer WebRTCMultiplayer ================= **Inherits:** [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer) **<** [PacketPeer](class_packetpeer#class-packetpeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A simple interface to create a peer-to-peer mesh network composed of [WebRTCPeerConnection](class_webrtcpeerconnection#class-webrtcpeerconnection) that is compatible with the [MultiplayerAPI](class_multiplayerapi#class-multiplayerapi). Description ----------- This class constructs a full mesh of [WebRTCPeerConnection](class_webrtcpeerconnection#class-webrtcpeerconnection) (one connection for each peer) that can be used as a [MultiplayerAPI.network\_peer](class_multiplayerapi#class-multiplayerapi-property-network-peer). You can add each [WebRTCPeerConnection](class_webrtcpeerconnection#class-webrtcpeerconnection) via [add\_peer](#class-webrtcmultiplayer-method-add-peer) or remove them via [remove\_peer](#class-webrtcmultiplayer-method-remove-peer). Peers must be added in [WebRTCPeerConnection.STATE\_NEW](class_webrtcpeerconnection#class-webrtcpeerconnection-constant-state-new) state to allow it to create the appropriate channels. This class will not create offers nor set descriptions, it will only poll them, and notify connections and disconnections. [NetworkedMultiplayerPeer.connection\_succeeded](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-signal-connection-succeeded) and [NetworkedMultiplayerPeer.server\_disconnected](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-signal-server-disconnected) will not be emitted unless `server_compatibility` is `true` in [initialize](#class-webrtcmultiplayer-method-initialize). Beside that data transfer works like in a [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer). Methods ------- | | | | --- | --- | | [Error](class_%40globalscope#enum-globalscope-error) | [add\_peer](#class-webrtcmultiplayer-method-add-peer) **(** [WebRTCPeerConnection](class_webrtcpeerconnection#class-webrtcpeerconnection) peer, [int](class_int#class-int) peer\_id, [int](class_int#class-int) unreliable\_lifetime=1 **)** | | void | [close](#class-webrtcmultiplayer-method-close) **(** **)** | | [Dictionary](class_dictionary#class-dictionary) | [get\_peer](#class-webrtcmultiplayer-method-get-peer) **(** [int](class_int#class-int) peer\_id **)** | | [Dictionary](class_dictionary#class-dictionary) | [get\_peers](#class-webrtcmultiplayer-method-get-peers) **(** **)** | | [bool](class_bool#class-bool) | [has\_peer](#class-webrtcmultiplayer-method-has-peer) **(** [int](class_int#class-int) peer\_id **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [initialize](#class-webrtcmultiplayer-method-initialize) **(** [int](class_int#class-int) peer\_id, [bool](class_bool#class-bool) server\_compatibility=false **)** | | void | [remove\_peer](#class-webrtcmultiplayer-method-remove-peer) **(** [int](class_int#class-int) peer\_id **)** | Method Descriptions ------------------- ### [Error](class_%40globalscope#enum-globalscope-error) add\_peer ( [WebRTCPeerConnection](class_webrtcpeerconnection#class-webrtcpeerconnection) peer, [int](class_int#class-int) peer\_id, [int](class_int#class-int) unreliable\_lifetime=1 ) Add a new peer to the mesh with the given `peer_id`. The [WebRTCPeerConnection](class_webrtcpeerconnection#class-webrtcpeerconnection) must be in state [WebRTCPeerConnection.STATE\_NEW](class_webrtcpeerconnection#class-webrtcpeerconnection-constant-state-new). Three channels will be created for reliable, unreliable, and ordered transport. The value of `unreliable_lifetime` will be passed to the `maxPacketLifetime` option when creating unreliable and ordered channels (see [WebRTCPeerConnection.create\_data\_channel](class_webrtcpeerconnection#class-webrtcpeerconnection-method-create-data-channel)). ### void close ( ) Close all the add peer connections and channels, freeing all resources. ### [Dictionary](class_dictionary#class-dictionary) get\_peer ( [int](class_int#class-int) peer\_id ) Return a dictionary representation of the peer with given `peer_id` with three keys. `connection` containing the [WebRTCPeerConnection](class_webrtcpeerconnection#class-webrtcpeerconnection) to this peer, `channels` an array of three [WebRTCDataChannel](class_webrtcdatachannel#class-webrtcdatachannel), and `connected` a boolean representing if the peer connection is currently connected (all three channels are open). ### [Dictionary](class_dictionary#class-dictionary) get\_peers ( ) Returns a dictionary which keys are the peer ids and values the peer representation as in [get\_peer](#class-webrtcmultiplayer-method-get-peer). ### [bool](class_bool#class-bool) has\_peer ( [int](class_int#class-int) peer\_id ) Returns `true` if the given `peer_id` is in the peers map (it might not be connected though). ### [Error](class_%40globalscope#enum-globalscope-error) initialize ( [int](class_int#class-int) peer\_id, [bool](class_bool#class-bool) server\_compatibility=false ) Initialize the multiplayer peer with the given `peer_id` (must be between 1 and 2147483647). If `server_compatibilty` is `false` (default), the multiplayer peer will be immediately in state [NetworkedMultiplayerPeer.CONNECTION\_CONNECTED](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-constant-connection-connected) and [NetworkedMultiplayerPeer.connection\_succeeded](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-signal-connection-succeeded) will not be emitted. If `server_compatibilty` is `true` the peer will suppress all [NetworkedMultiplayerPeer.peer\_connected](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-signal-peer-connected) signals until a peer with id [NetworkedMultiplayerPeer.TARGET\_PEER\_SERVER](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-constant-target-peer-server) connects and then emit [NetworkedMultiplayerPeer.connection\_succeeded](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-signal-connection-succeeded). After that the signal [NetworkedMultiplayerPeer.peer\_connected](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-signal-peer-connected) will be emitted for every already connected peer, and any new peer that might connect. If the server peer disconnects after that, signal [NetworkedMultiplayerPeer.server\_disconnected](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-signal-server-disconnected) will be emitted and state will become [NetworkedMultiplayerPeer.CONNECTION\_CONNECTED](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-constant-connection-connected). ### void remove\_peer ( [int](class_int#class-int) peer\_id ) Remove the peer with given `peer_id` from the mesh. If the peer was connected, and [NetworkedMultiplayerPeer.peer\_connected](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-signal-peer-connected) was emitted for it, then [NetworkedMultiplayerPeer.peer\_disconnected](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-signal-peer-disconnected) will be emitted. godot OccluderShape OccluderShape ============= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [OccluderShapePolygon](class_occludershapepolygon#class-occludershapepolygon), [OccluderShapeSphere](class_occludershapesphere#class-occludershapesphere) Base class for shapes used for occlusion culling by the [Occluder](class_occluder#class-occluder) node. Description ----------- [Occluder](class_occluder#class-occluder)s can use any primitive shape derived from `OccluderShape`. godot VisualScriptComposeArray VisualScriptComposeArray ======================== **Inherits:** [VisualScriptLists](class_visualscriptlists#class-visualscriptlists) **<** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A Visual Script Node used to create array from a list of items. Description ----------- A Visual Script Node used to compose array from the list of elements provided with custom in-graph UI hard coded in the VisualScript Editor. godot AcceptDialog AcceptDialog ============ **Inherits:** [WindowDialog](class_windowdialog#class-windowdialog) **<** [Popup](class_popup#class-popup) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [ConfirmationDialog](class_confirmationdialog#class-confirmationdialog) Base dialog for user notification. Description ----------- This dialog is useful for small notifications to the user about an event. It can only be accepted or closed, with the same result. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [dialog\_autowrap](#class-acceptdialog-property-dialog-autowrap) | `false` | | [bool](class_bool#class-bool) | [dialog\_hide\_on\_ok](#class-acceptdialog-property-dialog-hide-on-ok) | `true` | | [String](class_string#class-string) | [dialog\_text](#class-acceptdialog-property-dialog-text) | `""` | | [String](class_string#class-string) | window\_title | `"Alert!"` (overrides [WindowDialog](class_windowdialog#class-windowdialog-property-window-title)) | Methods ------- | | | | --- | --- | | [Button](class_button#class-button) | [add\_button](#class-acceptdialog-method-add-button) **(** [String](class_string#class-string) text, [bool](class_bool#class-bool) right=false, [String](class_string#class-string) action="" **)** | | [Button](class_button#class-button) | [add\_cancel](#class-acceptdialog-method-add-cancel) **(** [String](class_string#class-string) name **)** | | [Label](class_label#class-label) | [get\_label](#class-acceptdialog-method-get-label) **(** **)** | | [Button](class_button#class-button) | [get\_ok](#class-acceptdialog-method-get-ok) **(** **)** | | void | [register\_text\_enter](#class-acceptdialog-method-register-text-enter) **(** [Node](class_node#class-node) line\_edit **)** | | void | [remove\_button](#class-acceptdialog-method-remove-button) **(** [Control](class_control#class-control) button **)** | Signals ------- ### confirmed ( ) Emitted when the dialog is accepted, i.e. the OK button is pressed. ### custom\_action ( [String](class_string#class-string) action ) Emitted when a custom button is pressed. See [add\_button](#class-acceptdialog-method-add-button). Property Descriptions --------------------- ### [bool](class_bool#class-bool) dialog\_autowrap | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_autowrap(value) | | *Getter* | has\_autowrap() | Sets autowrapping for the text in the dialog. ### [bool](class_bool#class-bool) dialog\_hide\_on\_ok | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_hide\_on\_ok(value) | | *Getter* | get\_hide\_on\_ok() | If `true`, the dialog is hidden when the OK button is pressed. You can set it to `false` if you want to do e.g. input validation when receiving the [confirmed](#class-acceptdialog-signal-confirmed) signal, and handle hiding the dialog in your own logic. **Note:** Some nodes derived from this class can have a different default value, and potentially their own built-in logic overriding this setting. For example [FileDialog](class_filedialog#class-filedialog) defaults to `false`, and has its own input validation code that is called when you press OK, which eventually hides the dialog if the input is valid. As such, this property can't be used in [FileDialog](class_filedialog#class-filedialog) to disable hiding the dialog when pressing OK. ### [String](class_string#class-string) dialog\_text | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_text(value) | | *Getter* | get\_text() | The text displayed by the dialog. Method Descriptions ------------------- ### [Button](class_button#class-button) add\_button ( [String](class_string#class-string) text, [bool](class_bool#class-bool) right=false, [String](class_string#class-string) action="" ) Adds a button with label `text` and a custom `action` to the dialog and returns the created button. `action` will be passed to the [custom\_action](#class-acceptdialog-signal-custom-action) signal when pressed. If `true`, `right` will place the button to the right of any sibling buttons. You can use [remove\_button](#class-acceptdialog-method-remove-button) method to remove a button created with this method from the dialog. ### [Button](class_button#class-button) add\_cancel ( [String](class_string#class-string) name ) Adds a button with label `name` and a cancel action to the dialog and returns the created button. You can use [remove\_button](#class-acceptdialog-method-remove-button) method to remove a button created with this method from the dialog. ### [Label](class_label#class-label) get\_label ( ) Returns the label used for built-in text. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. ### [Button](class_button#class-button) get\_ok ( ) Returns the OK [Button](class_button#class-button) instance. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. ### void register\_text\_enter ( [Node](class_node#class-node) line\_edit ) Registers a [LineEdit](class_lineedit#class-lineedit) in the dialog. When the enter key is pressed, the dialog will be accepted. ### void remove\_button ( [Control](class_control#class-control) button ) Removes the `button` from the dialog. Does NOT free the `button`. The `button` must be a [Button](class_button#class-button) added with [add\_button](#class-acceptdialog-method-add-button) or [add\_cancel](#class-acceptdialog-method-add-cancel) method. After removal, pressing the `button` will no longer emit this dialog's [custom\_action](#class-acceptdialog-signal-custom-action) signal or cancel this dialog. godot KinematicCollision2D KinematicCollision2D ==================== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Collision data for [KinematicBody2D](class_kinematicbody2d#class-kinematicbody2d) collisions. Description ----------- Contains collision data for [KinematicBody2D](class_kinematicbody2d#class-kinematicbody2d) collisions. When a [KinematicBody2D](class_kinematicbody2d#class-kinematicbody2d) is moved using [KinematicBody2D.move\_and\_collide](class_kinematicbody2d#class-kinematicbody2d-method-move-and-collide), it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision2D object is returned. This object contains information about the collision, including the colliding object, the remaining motion, and the collision position. This information can be used to calculate a collision response. Properties ---------- | | | | | --- | --- | --- | | [Object](class_object#class-object) | [collider](#class-kinematiccollision2d-property-collider) | | | [int](class_int#class-int) | [collider\_id](#class-kinematiccollision2d-property-collider-id) | `0` | | [Variant](class_variant#class-variant) | [collider\_metadata](#class-kinematiccollision2d-property-collider-metadata) | | | [RID](class_rid#class-rid) | [collider\_rid](#class-kinematiccollision2d-property-collider-rid) | | | [Object](class_object#class-object) | [collider\_shape](#class-kinematiccollision2d-property-collider-shape) | | | [int](class_int#class-int) | [collider\_shape\_index](#class-kinematiccollision2d-property-collider-shape-index) | `0` | | [Vector2](class_vector2#class-vector2) | [collider\_velocity](#class-kinematiccollision2d-property-collider-velocity) | `Vector2( 0, 0 )` | | [Object](class_object#class-object) | [local\_shape](#class-kinematiccollision2d-property-local-shape) | | | [Vector2](class_vector2#class-vector2) | [normal](#class-kinematiccollision2d-property-normal) | `Vector2( 0, 0 )` | | [Vector2](class_vector2#class-vector2) | [position](#class-kinematiccollision2d-property-position) | `Vector2( 0, 0 )` | | [Vector2](class_vector2#class-vector2) | [remainder](#class-kinematiccollision2d-property-remainder) | `Vector2( 0, 0 )` | | [Vector2](class_vector2#class-vector2) | [travel](#class-kinematiccollision2d-property-travel) | `Vector2( 0, 0 )` | Methods ------- | | | | --- | --- | | [float](class_float#class-float) | [get\_angle](#class-kinematiccollision2d-method-get-angle) **(** [Vector2](class_vector2#class-vector2) up\_direction=Vector2( 0, -1 ) **)** const | Property Descriptions --------------------- ### [Object](class_object#class-object) collider | | | | --- | --- | | *Getter* | get\_collider() | The colliding body. ### [int](class_int#class-int) collider\_id | | | | --- | --- | | *Default* | `0` | | *Getter* | get\_collider\_id() | The colliding body's unique instance ID. See [Object.get\_instance\_id](class_object#class-object-method-get-instance-id). ### [Variant](class_variant#class-variant) collider\_metadata | | | | --- | --- | | *Getter* | get\_collider\_metadata() | The colliding body's metadata. See [Object](class_object#class-object). ### [RID](class_rid#class-rid) collider\_rid | | | | --- | --- | | *Getter* | get\_collider\_rid() | The colliding body's [RID](class_rid#class-rid) used by the [Physics2DServer](class_physics2dserver#class-physics2dserver). ### [Object](class_object#class-object) collider\_shape | | | | --- | --- | | *Getter* | get\_collider\_shape() | The colliding body's shape. ### [int](class_int#class-int) collider\_shape\_index | | | | --- | --- | | *Default* | `0` | | *Getter* | get\_collider\_shape\_index() | The colliding shape's index. See [CollisionObject2D](class_collisionobject2d#class-collisionobject2d). ### [Vector2](class_vector2#class-vector2) collider\_velocity | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Getter* | get\_collider\_velocity() | The colliding object's velocity. ### [Object](class_object#class-object) local\_shape | | | | --- | --- | | *Getter* | get\_local\_shape() | The moving object's colliding shape. ### [Vector2](class_vector2#class-vector2) normal | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Getter* | get\_normal() | The colliding body's shape's normal at the point of collision. ### [Vector2](class_vector2#class-vector2) position | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Getter* | get\_position() | The point of collision, in global coordinates. ### [Vector2](class_vector2#class-vector2) remainder | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Getter* | get\_remainder() | The moving object's remaining movement vector. ### [Vector2](class_vector2#class-vector2) travel | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Getter* | get\_travel() | The distance the moving object traveled before collision. Method Descriptions ------------------- ### [float](class_float#class-float) get\_angle ( [Vector2](class_vector2#class-vector2) up\_direction=Vector2( 0, -1 ) ) const The collision angle according to `up_direction`, which is `Vector2.UP` by default. This value is always positive. godot PanelContainer PanelContainer ============== **Inherits:** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [ScriptEditor](class_scripteditor#class-scripteditor) Panel container type. Description ----------- Panel container type. This container fits controls inside of the delimited area of a stylebox. It's useful for giving controls an outline. Tutorials --------- * [GUI containers](https://docs.godotengine.org/en/3.5/tutorials/ui/gui_containers.html) * [2D Role Playing Game Demo](https://godotengine.org/asset-library/asset/520) Theme Properties ---------------- | | | | --- | --- | | [StyleBox](class_stylebox#class-stylebox) | [panel](#class-panelcontainer-theme-style-panel) | Theme Property Descriptions --------------------------- ### [StyleBox](class_stylebox#class-stylebox) panel The style of `PanelContainer`'s background.
programming_docs
godot ARVRServer ARVRServer ========== **Inherits:** [Object](class_object#class-object) Server for AR and VR features. Description ----------- The AR/VR server is the heart of our Advanced and Virtual Reality solution and handles all the processing. Tutorials --------- * [XR (AR/VR)](https://docs.godotengine.org/en/3.5/tutorials/vr/index.html) Properties ---------- | | | | | --- | --- | --- | | [ARVRInterface](class_arvrinterface#class-arvrinterface) | [primary\_interface](#class-arvrserver-property-primary-interface) | | | [float](class_float#class-float) | [world\_scale](#class-arvrserver-property-world-scale) | `1.0` | Methods ------- | | | | --- | --- | | void | [add\_interface](#class-arvrserver-method-add-interface) **(** [ARVRInterface](class_arvrinterface#class-arvrinterface) interface **)** | | void | [add\_tracker](#class-arvrserver-method-add-tracker) **(** [ARVRPositionalTracker](class_arvrpositionaltracker#class-arvrpositionaltracker) tracker **)** | | void | [center\_on\_hmd](#class-arvrserver-method-center-on-hmd) **(** [RotationMode](#enum-arvrserver-rotationmode) rotation\_mode, [bool](class_bool#class-bool) keep\_height **)** | | void | [clear\_primary\_interface\_if](#class-arvrserver-method-clear-primary-interface-if) **(** [ARVRInterface](class_arvrinterface#class-arvrinterface) interface **)** | | [ARVRInterface](class_arvrinterface#class-arvrinterface) | [find\_interface](#class-arvrserver-method-find-interface) **(** [String](class_string#class-string) name **)** const | | [Transform](class_transform#class-transform) | [get\_hmd\_transform](#class-arvrserver-method-get-hmd-transform) **(** **)** | | [ARVRInterface](class_arvrinterface#class-arvrinterface) | [get\_interface](#class-arvrserver-method-get-interface) **(** [int](class_int#class-int) idx **)** const | | [int](class_int#class-int) | [get\_interface\_count](#class-arvrserver-method-get-interface-count) **(** **)** const | | [Array](class_array#class-array) | [get\_interfaces](#class-arvrserver-method-get-interfaces) **(** **)** const | | [int](class_int#class-int) | [get\_last\_commit\_usec](#class-arvrserver-method-get-last-commit-usec) **(** **)** | | [int](class_int#class-int) | [get\_last\_frame\_usec](#class-arvrserver-method-get-last-frame-usec) **(** **)** | | [int](class_int#class-int) | [get\_last\_process\_usec](#class-arvrserver-method-get-last-process-usec) **(** **)** | | [Transform](class_transform#class-transform) | [get\_reference\_frame](#class-arvrserver-method-get-reference-frame) **(** **)** const | | [ARVRPositionalTracker](class_arvrpositionaltracker#class-arvrpositionaltracker) | [get\_tracker](#class-arvrserver-method-get-tracker) **(** [int](class_int#class-int) idx **)** const | | [int](class_int#class-int) | [get\_tracker\_count](#class-arvrserver-method-get-tracker-count) **(** **)** const | | void | [remove\_interface](#class-arvrserver-method-remove-interface) **(** [ARVRInterface](class_arvrinterface#class-arvrinterface) interface **)** | | void | [remove\_tracker](#class-arvrserver-method-remove-tracker) **(** [ARVRPositionalTracker](class_arvrpositionaltracker#class-arvrpositionaltracker) tracker **)** | Signals ------- ### interface\_added ( [String](class_string#class-string) interface\_name ) Emitted when a new interface has been added. ### interface\_removed ( [String](class_string#class-string) interface\_name ) Emitted when an interface is removed. ### tracker\_added ( [String](class_string#class-string) tracker\_name, [int](class_int#class-int) type, [int](class_int#class-int) id ) Emitted when a new tracker has been added. If you don't use a fixed number of controllers or if you're using [ARVRAnchor](class_arvranchor#class-arvranchor)s for an AR solution, it is important to react to this signal to add the appropriate [ARVRController](class_arvrcontroller#class-arvrcontroller) or [ARVRAnchor](class_arvranchor#class-arvranchor) nodes related to this new tracker. ### tracker\_removed ( [String](class_string#class-string) tracker\_name, [int](class_int#class-int) type, [int](class_int#class-int) id ) Emitted when a tracker is removed. You should remove any [ARVRController](class_arvrcontroller#class-arvrcontroller) or [ARVRAnchor](class_arvranchor#class-arvranchor) points if applicable. This is not mandatory, the nodes simply become inactive and will be made active again when a new tracker becomes available (i.e. a new controller is switched on that takes the place of the previous one). Enumerations ------------ enum **TrackerType**: * **TRACKER\_CONTROLLER** = **1** --- The tracker tracks the location of a controller. * **TRACKER\_BASESTATION** = **2** --- The tracker tracks the location of a base station. * **TRACKER\_ANCHOR** = **4** --- The tracker tracks the location and size of an AR anchor. * **TRACKER\_ANY\_KNOWN** = **127** --- Used internally to filter trackers of any known type. * **TRACKER\_UNKNOWN** = **128** --- Used internally if we haven't set the tracker type yet. * **TRACKER\_ANY** = **255** --- Used internally to select all trackers. enum **RotationMode**: * **RESET\_FULL\_ROTATION** = **0** --- Fully reset the orientation of the HMD. Regardless of what direction the user is looking to in the real world. The user will look dead ahead in the virtual world. * **RESET\_BUT\_KEEP\_TILT** = **1** --- Resets the orientation but keeps the tilt of the device. So if we're looking down, we keep looking down but heading will be reset. * **DONT\_RESET\_ROTATION** = **2** --- Does not reset the orientation of the HMD, only the position of the player gets centered. Property Descriptions --------------------- ### [ARVRInterface](class_arvrinterface#class-arvrinterface) primary\_interface | | | | --- | --- | | *Setter* | set\_primary\_interface(value) | | *Getter* | get\_primary\_interface() | The primary [ARVRInterface](class_arvrinterface#class-arvrinterface) currently bound to the `ARVRServer`. ### [float](class_float#class-float) world\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_world\_scale(value) | | *Getter* | get\_world\_scale() | Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter. Method Descriptions ------------------- ### void add\_interface ( [ARVRInterface](class_arvrinterface#class-arvrinterface) interface ) Registers an [ARVRInterface](class_arvrinterface#class-arvrinterface) object. ### void add\_tracker ( [ARVRPositionalTracker](class_arvrpositionaltracker#class-arvrpositionaltracker) tracker ) Registers a new [ARVRPositionalTracker](class_arvrpositionaltracker#class-arvrpositionaltracker) that tracks a spatial location in real space. ### void center\_on\_hmd ( [RotationMode](#enum-arvrserver-rotationmode) rotation\_mode, [bool](class_bool#class-bool) keep\_height ) This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently. For platforms that do not offer spatial tracking, our origin point (0,0,0) is the location of our HMD, but you have little control over the direction the player is facing in the real world. For platforms that do offer spatial tracking, our origin point depends very much on the system. For OpenVR, our origin point is usually the center of the tracking space, on the ground. For other platforms, it's often the location of the tracking camera. This method allows you to center your tracker on the location of the HMD. It will take the current location of the HMD and use that to adjust all your tracking data; in essence, realigning the real world to your player's current position in the game world. For this method to produce usable results, tracking information must be available. This often takes a few frames after starting your game. You should call this method after a few seconds have passed. For instance, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism. ### void clear\_primary\_interface\_if ( [ARVRInterface](class_arvrinterface#class-arvrinterface) interface ) Clears our current primary interface if it is set to the provided interface. ### [ARVRInterface](class_arvrinterface#class-arvrinterface) find\_interface ( [String](class_string#class-string) name ) const Finds an interface by its name. For instance, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it. ### [Transform](class_transform#class-transform) get\_hmd\_transform ( ) Returns the primary interface's transformation. ### [ARVRInterface](class_arvrinterface#class-arvrinterface) get\_interface ( [int](class_int#class-int) idx ) const Returns the interface registered at a given index in our list of interfaces. ### [int](class_int#class-int) get\_interface\_count ( ) const Returns the number of interfaces currently registered with the AR/VR server. If your project supports multiple AR/VR platforms, you can look through the available interface, and either present the user with a selection or simply try to initialize each interface and use the first one that returns `true`. ### [Array](class_array#class-array) get\_interfaces ( ) const Returns a list of available interfaces the ID and name of each interface. ### [int](class_int#class-int) get\_last\_commit\_usec ( ) Returns the absolute timestamp (in μs) of the last `ARVRServer` commit of the AR/VR eyes to [VisualServer](class_visualserver#class-visualserver). The value comes from an internal call to [OS.get\_ticks\_usec](class_os#class-os-method-get-ticks-usec). ### [int](class_int#class-int) get\_last\_frame\_usec ( ) Returns the duration (in μs) of the last frame. This is computed as the difference between [get\_last\_commit\_usec](#class-arvrserver-method-get-last-commit-usec) and [get\_last\_process\_usec](#class-arvrserver-method-get-last-process-usec) when committing. ### [int](class_int#class-int) get\_last\_process\_usec ( ) Returns the absolute timestamp (in μs) of the last `ARVRServer` process callback. The value comes from an internal call to [OS.get\_ticks\_usec](class_os#class-os-method-get-ticks-usec). ### [Transform](class_transform#class-transform) get\_reference\_frame ( ) const Returns the reference frame transform. Mostly used internally and exposed for GDNative build interfaces. ### [ARVRPositionalTracker](class_arvrpositionaltracker#class-arvrpositionaltracker) get\_tracker ( [int](class_int#class-int) idx ) const Returns the positional tracker at the given ID. ### [int](class_int#class-int) get\_tracker\_count ( ) const Returns the number of trackers currently registered. ### void remove\_interface ( [ARVRInterface](class_arvrinterface#class-arvrinterface) interface ) Removes this interface. ### void remove\_tracker ( [ARVRPositionalTracker](class_arvrpositionaltracker#class-arvrpositionaltracker) tracker ) Removes this positional tracker. godot CameraFeed CameraFeed ========== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A camera feed gives you access to a single physical camera attached to your device. Description ----------- A camera feed gives you access to a single physical camera attached to your device. When enabled, Godot will start capturing frames from the camera which can then be used. See also [CameraServer](class_cameraserver#class-cameraserver). **Note:** Many cameras will return YCbCr images which are split into two textures and need to be combined in a shader. Godot does this automatically for you if you set the environment to show the camera image in the background. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [feed\_is\_active](#class-camerafeed-property-feed-is-active) | `false` | | [Transform2D](class_transform2d#class-transform2d) | [feed\_transform](#class-camerafeed-property-feed-transform) | `Transform2D( 1, 0, 0, -1, 0, 1 )` | Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [get\_id](#class-camerafeed-method-get-id) **(** **)** const | | [String](class_string#class-string) | [get\_name](#class-camerafeed-method-get-name) **(** **)** const | | [FeedPosition](#enum-camerafeed-feedposition) | [get\_position](#class-camerafeed-method-get-position) **(** **)** const | Enumerations ------------ enum **FeedDataType**: * **FEED\_NOIMAGE** = **0** --- No image set for the feed. * **FEED\_RGB** = **1** --- Feed supplies RGB images. * **FEED\_YCBCR** = **2** --- Feed supplies YCbCr images that need to be converted to RGB. * **FEED\_YCBCR\_SEP** = **3** --- Feed supplies separate Y and CbCr images that need to be combined and converted to RGB. enum **FeedPosition**: * **FEED\_UNSPECIFIED** = **0** --- Unspecified position. * **FEED\_FRONT** = **1** --- Camera is mounted at the front of the device. * **FEED\_BACK** = **2** --- Camera is mounted at the back of the device. Property Descriptions --------------------- ### [bool](class_bool#class-bool) feed\_is\_active | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_active(value) | | *Getter* | is\_active() | If `true`, the feed is active. ### [Transform2D](class_transform2d#class-transform2d) feed\_transform | | | | --- | --- | | *Default* | `Transform2D( 1, 0, 0, -1, 0, 1 )` | | *Setter* | set\_transform(value) | | *Getter* | get\_transform() | The transform applied to the camera's image. Method Descriptions ------------------- ### [int](class_int#class-int) get\_id ( ) const Returns the unique ID for this feed. ### [String](class_string#class-string) get\_name ( ) const Returns the camera's name. ### [FeedPosition](#enum-camerafeed-feedposition) get\_position ( ) const Returns the position of camera on the device. godot AStar AStar ===== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) An implementation of A\* to find the shortest paths among connected points in space. Description ----------- A\* (A star) is a computer algorithm that is widely used in pathfinding and graph traversal, the process of plotting short paths among vertices (points), passing through a given set of edges (segments). It enjoys widespread use due to its performance and accuracy. Godot's A\* implementation uses points in three-dimensional space and Euclidean distances by default. You must add points manually with [add\_point](#class-astar-method-add-point) and create segments manually with [connect\_points](#class-astar-method-connect-points). Then you can test if there is a path between two points with the [are\_points\_connected](#class-astar-method-are-points-connected) function, get a path containing indices by [get\_id\_path](#class-astar-method-get-id-path), or one containing actual coordinates with [get\_point\_path](#class-astar-method-get-point-path). It is also possible to use non-Euclidean distances. To do so, create a class that extends `AStar` and override methods [\_compute\_cost](#class-astar-method-compute-cost) and [\_estimate\_cost](#class-astar-method-estimate-cost). Both take two indices and return a length, as is shown in the following example. ``` class MyAStar: extends AStar func _compute_cost(u, v): return abs(u - v) func _estimate_cost(u, v): return min(0, abs(u - v) - 1) ``` [\_estimate\_cost](#class-astar-method-estimate-cost) should return a lower bound of the distance, i.e. `_estimate_cost(u, v) <= _compute_cost(u, v)`. This serves as a hint to the algorithm because the custom `_compute_cost` might be computation-heavy. If this is not the case, make [\_estimate\_cost](#class-astar-method-estimate-cost) return the same value as [\_compute\_cost](#class-astar-method-compute-cost) to provide the algorithm with the most accurate information. If the default [\_estimate\_cost](#class-astar-method-estimate-cost) and [\_compute\_cost](#class-astar-method-compute-cost) methods are used, or if the supplied [\_estimate\_cost](#class-astar-method-estimate-cost) method returns a lower bound of the cost, then the paths returned by A\* will be the lowest-cost paths. Here, the cost of a path equals the sum of the [\_compute\_cost](#class-astar-method-compute-cost) results of all segments in the path multiplied by the `weight_scale`s of the endpoints of the respective segments. If the default methods are used and the `weight_scale`s of all points are set to `1.0`, then this equals the sum of Euclidean distances of all segments in the path. Methods ------- | | | | --- | --- | | [float](class_float#class-float) | [\_compute\_cost](#class-astar-method-compute-cost) **(** [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id **)** virtual | | [float](class_float#class-float) | [\_estimate\_cost](#class-astar-method-estimate-cost) **(** [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id **)** virtual | | void | [add\_point](#class-astar-method-add-point) **(** [int](class_int#class-int) id, [Vector3](class_vector3#class-vector3) position, [float](class_float#class-float) weight\_scale=1.0 **)** | | [bool](class_bool#class-bool) | [are\_points\_connected](#class-astar-method-are-points-connected) **(** [int](class_int#class-int) id, [int](class_int#class-int) to\_id, [bool](class_bool#class-bool) bidirectional=true **)** const | | void | [clear](#class-astar-method-clear) **(** **)** | | void | [connect\_points](#class-astar-method-connect-points) **(** [int](class_int#class-int) id, [int](class_int#class-int) to\_id, [bool](class_bool#class-bool) bidirectional=true **)** | | void | [disconnect\_points](#class-astar-method-disconnect-points) **(** [int](class_int#class-int) id, [int](class_int#class-int) to\_id, [bool](class_bool#class-bool) bidirectional=true **)** | | [int](class_int#class-int) | [get\_available\_point\_id](#class-astar-method-get-available-point-id) **(** **)** const | | [int](class_int#class-int) | [get\_closest\_point](#class-astar-method-get-closest-point) **(** [Vector3](class_vector3#class-vector3) to\_position, [bool](class_bool#class-bool) include\_disabled=false **)** const | | [Vector3](class_vector3#class-vector3) | [get\_closest\_position\_in\_segment](#class-astar-method-get-closest-position-in-segment) **(** [Vector3](class_vector3#class-vector3) to\_position **)** const | | [PoolIntArray](class_poolintarray#class-poolintarray) | [get\_id\_path](#class-astar-method-get-id-path) **(** [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id **)** | | [int](class_int#class-int) | [get\_point\_capacity](#class-astar-method-get-point-capacity) **(** **)** const | | [PoolIntArray](class_poolintarray#class-poolintarray) | [get\_point\_connections](#class-astar-method-get-point-connections) **(** [int](class_int#class-int) id **)** | | [int](class_int#class-int) | [get\_point\_count](#class-astar-method-get-point-count) **(** **)** const | | [PoolVector3Array](class_poolvector3array#class-poolvector3array) | [get\_point\_path](#class-astar-method-get-point-path) **(** [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id **)** | | [Vector3](class_vector3#class-vector3) | [get\_point\_position](#class-astar-method-get-point-position) **(** [int](class_int#class-int) id **)** const | | [float](class_float#class-float) | [get\_point\_weight\_scale](#class-astar-method-get-point-weight-scale) **(** [int](class_int#class-int) id **)** const | | [Array](class_array#class-array) | [get\_points](#class-astar-method-get-points) **(** **)** | | [bool](class_bool#class-bool) | [has\_point](#class-astar-method-has-point) **(** [int](class_int#class-int) id **)** const | | [bool](class_bool#class-bool) | [is\_point\_disabled](#class-astar-method-is-point-disabled) **(** [int](class_int#class-int) id **)** const | | void | [remove\_point](#class-astar-method-remove-point) **(** [int](class_int#class-int) id **)** | | void | [reserve\_space](#class-astar-method-reserve-space) **(** [int](class_int#class-int) num\_nodes **)** | | void | [set\_point\_disabled](#class-astar-method-set-point-disabled) **(** [int](class_int#class-int) id, [bool](class_bool#class-bool) disabled=true **)** | | void | [set\_point\_position](#class-astar-method-set-point-position) **(** [int](class_int#class-int) id, [Vector3](class_vector3#class-vector3) position **)** | | void | [set\_point\_weight\_scale](#class-astar-method-set-point-weight-scale) **(** [int](class_int#class-int) id, [float](class_float#class-float) weight\_scale **)** | Method Descriptions ------------------- ### [float](class_float#class-float) \_compute\_cost ( [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id ) virtual Called when computing the cost between two connected points. Note that this function is hidden in the default `AStar` class. ### [float](class_float#class-float) \_estimate\_cost ( [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id ) virtual Called when estimating the cost between a point and the path's ending point. Note that this function is hidden in the default `AStar` class. ### void add\_point ( [int](class_int#class-int) id, [Vector3](class_vector3#class-vector3) position, [float](class_float#class-float) weight\_scale=1.0 ) Adds a new point at the given position with the given identifier. The `id` must be 0 or larger, and the `weight_scale` must be 0.0 or greater. The `weight_scale` is multiplied by the result of [\_compute\_cost](#class-astar-method-compute-cost) when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower `weight_scale`s to form a path. ``` var astar = AStar.new() astar.add_point(1, Vector3(1, 0, 0), 4) # Adds the point (1, 0, 0) with weight_scale 4 and id 1 ``` If there already exists a point for the given `id`, its position and weight scale are updated to the given values. ### [bool](class_bool#class-bool) are\_points\_connected ( [int](class_int#class-int) id, [int](class_int#class-int) to\_id, [bool](class_bool#class-bool) bidirectional=true ) const Returns whether the two given points are directly connected by a segment. If `bidirectional` is `false`, returns whether movement from `id` to `to_id` is possible through this segment. ### void clear ( ) Clears all the points and segments. ### void connect\_points ( [int](class_int#class-int) id, [int](class_int#class-int) to\_id, [bool](class_bool#class-bool) bidirectional=true ) Creates a segment between the given points. If `bidirectional` is `false`, only movement from `id` to `to_id` is allowed, not the reverse direction. ``` var astar = AStar.new() astar.add_point(1, Vector3(1, 1, 0)) astar.add_point(2, Vector3(0, 5, 0)) astar.connect_points(1, 2, false) ``` ### void disconnect\_points ( [int](class_int#class-int) id, [int](class_int#class-int) to\_id, [bool](class_bool#class-bool) bidirectional=true ) Deletes the segment between the given points. If `bidirectional` is `false`, only movement from `id` to `to_id` is prevented, and a unidirectional segment possibly remains. ### [int](class_int#class-int) get\_available\_point\_id ( ) const Returns the next available point ID with no point associated to it. ### [int](class_int#class-int) get\_closest\_point ( [Vector3](class_vector3#class-vector3) to\_position, [bool](class_bool#class-bool) include\_disabled=false ) const Returns the ID of the closest point to `to_position`, optionally taking disabled points into account. Returns `-1` if there are no points in the points pool. **Note:** If several points are the closest to `to_position`, the one with the smallest ID will be returned, ensuring a deterministic result. ### [Vector3](class_vector3#class-vector3) get\_closest\_position\_in\_segment ( [Vector3](class_vector3#class-vector3) to\_position ) const Returns the closest position to `to_position` that resides inside a segment between two connected points. ``` var astar = AStar.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 5, 0)) astar.connect_points(1, 2) var res = astar.get_closest_position_in_segment(Vector3(3, 3, 0)) # Returns (0, 3, 0) ``` The result is in the segment that goes from `y = 0` to `y = 5`. It's the closest position in the segment to the given point. ### [PoolIntArray](class_poolintarray#class-poolintarray) get\_id\_path ( [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id ) Returns an array with the IDs of the points that form the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. ``` var astar = AStar.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 1, 0), 1) # Default weight is 1 astar.add_point(3, Vector3(1, 1, 0)) astar.add_point(4, Vector3(2, 0, 0)) astar.connect_points(1, 2, false) astar.connect_points(2, 3, false) astar.connect_points(4, 3, false) astar.connect_points(1, 4, false) var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] ``` If you change the 2nd point's weight to 3, then the result will be `[1, 4, 3]` instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. ### [int](class_int#class-int) get\_point\_capacity ( ) const Returns the capacity of the structure backing the points, useful in conjunction with `reserve_space`. ### [PoolIntArray](class_poolintarray#class-poolintarray) get\_point\_connections ( [int](class_int#class-int) id ) Returns an array with the IDs of the points that form the connection with the given point. ``` var astar = AStar.new() astar.add_point(1, Vector3(0, 0, 0)) astar.add_point(2, Vector3(0, 1, 0)) astar.add_point(3, Vector3(1, 1, 0)) astar.add_point(4, Vector3(2, 0, 0)) astar.connect_points(1, 2, true) astar.connect_points(1, 3, true) var neighbors = astar.get_point_connections(1) # Returns [2, 3] ``` ### [int](class_int#class-int) get\_point\_count ( ) const Returns the number of points currently in the points pool. ### [PoolVector3Array](class_poolvector3array#class-poolvector3array) get\_point\_path ( [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id ) Returns an array with the points that are in the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path. **Note:** This method is not thread-safe. If called from a [Thread](class_thread#class-thread), it will return an empty [PoolVector3Array](class_poolvector3array#class-poolvector3array) and will print an error message. ### [Vector3](class_vector3#class-vector3) get\_point\_position ( [int](class_int#class-int) id ) const Returns the position of the point associated with the given `id`. ### [float](class_float#class-float) get\_point\_weight\_scale ( [int](class_int#class-int) id ) const Returns the weight scale of the point associated with the given `id`. ### [Array](class_array#class-array) get\_points ( ) Returns an array of all points. ### [bool](class_bool#class-bool) has\_point ( [int](class_int#class-int) id ) const Returns whether a point associated with the given `id` exists. ### [bool](class_bool#class-bool) is\_point\_disabled ( [int](class_int#class-int) id ) const Returns whether a point is disabled or not for pathfinding. By default, all points are enabled. ### void remove\_point ( [int](class_int#class-int) id ) Removes the point associated with the given `id` from the points pool. ### void reserve\_space ( [int](class_int#class-int) num\_nodes ) Reserves space internally for `num_nodes` points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity. ### void set\_point\_disabled ( [int](class_int#class-int) id, [bool](class_bool#class-bool) disabled=true ) Disables or enables the specified point for pathfinding. Useful for making a temporary obstacle. ### void set\_point\_position ( [int](class_int#class-int) id, [Vector3](class_vector3#class-vector3) position ) Sets the `position` for the point with the given `id`. ### void set\_point\_weight\_scale ( [int](class_int#class-int) id, [float](class_float#class-float) weight\_scale ) Sets the `weight_scale` for the point with the given `id`. The `weight_scale` is multiplied by the result of [\_compute\_cost](#class-astar-method-compute-cost) when determining the overall cost of traveling across a segment from a neighboring point to this point.
programming_docs
godot CharFXTransform CharFXTransform =============== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Controls how an individual character will be displayed in a [RichTextEffect](class_richtexteffect#class-richtexteffect). Description ----------- By setting various properties on this object, you can control how individual characters will be displayed in a [RichTextEffect](class_richtexteffect#class-richtexteffect). Tutorials --------- * [BBCode in RichTextLabel](https://docs.godotengine.org/en/3.5/tutorials/ui/bbcode_in_richtextlabel.html) * <https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project> Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [absolute\_index](#class-charfxtransform-property-absolute-index) | `0` | | [int](class_int#class-int) | [character](#class-charfxtransform-property-character) | `0` | | [Color](class_color#class-color) | [color](#class-charfxtransform-property-color) | `Color( 0, 0, 0, 1 )` | | [float](class_float#class-float) | [elapsed\_time](#class-charfxtransform-property-elapsed-time) | `0.0` | | [Dictionary](class_dictionary#class-dictionary) | [env](#class-charfxtransform-property-env) | `{}` | | [Vector2](class_vector2#class-vector2) | [offset](#class-charfxtransform-property-offset) | `Vector2( 0, 0 )` | | [int](class_int#class-int) | [relative\_index](#class-charfxtransform-property-relative-index) | `0` | | [bool](class_bool#class-bool) | [visible](#class-charfxtransform-property-visible) | `true` | Property Descriptions --------------------- ### [int](class_int#class-int) absolute\_index | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_absolute\_index(value) | | *Getter* | get\_absolute\_index() | The index of the current character (starting from 0) for the [RichTextLabel](class_richtextlabel#class-richtextlabel)'s BBCode text. Setting this property won't affect drawing. ### [int](class_int#class-int) character | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_character(value) | | *Getter* | get\_character() | The Unicode codepoint the character will use. This only affects non-whitespace characters. [@GDScript.ord](class_%40gdscript#class-gdscript-method-ord) can be useful here. For example, the following will replace all characters with asterisks: ``` # `char_fx` is the CharFXTransform parameter from `_process_custom_fx()`. # See the RichTextEffect documentation for details. char_fx.character = ord("*") ``` ### [Color](class_color#class-color) color | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 1 )` | | *Setter* | set\_color(value) | | *Getter* | get\_color() | The color the character will be drawn with. ### [float](class_float#class-float) elapsed\_time | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_elapsed\_time(value) | | *Getter* | get\_elapsed\_time() | The time elapsed since the [RichTextLabel](class_richtextlabel#class-richtextlabel) was added to the scene tree (in seconds). Time stops when the [RichTextLabel](class_richtextlabel#class-richtextlabel) is paused (see [Node.pause\_mode](class_node#class-node-property-pause-mode)). Resets when the text in the [RichTextLabel](class_richtextlabel#class-richtextlabel) is changed. **Note:** Time still passes while the [RichTextLabel](class_richtextlabel#class-richtextlabel) is hidden. ### [Dictionary](class_dictionary#class-dictionary) env | | | | --- | --- | | *Default* | `{}` | | *Setter* | set\_environment(value) | | *Getter* | get\_environment() | Contains the arguments passed in the opening BBCode tag. By default, arguments are strings; if their contents match a type such as [bool](class_bool#class-bool), [int](class_int#class-int) or [float](class_float#class-float), they will be converted automatically. Color codes in the form `#rrggbb` or `#rgb` will be converted to an opaque [Color](class_color#class-color). String arguments may not contain spaces, even if they're quoted. If present, quotes will also be present in the final string. For example, the opening BBCode tag `[example foo=hello bar=true baz=42 color=#ffffff]` will map to the following [Dictionary](class_dictionary#class-dictionary): ``` {"foo": "hello", "bar": true, "baz": 42, "color": Color(1, 1, 1, 1)} ``` ### [Vector2](class_vector2#class-vector2) offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_offset(value) | | *Getter* | get\_offset() | The position offset the character will be drawn with (in pixels). ### [int](class_int#class-int) relative\_index | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_relative\_index(value) | | *Getter* | get\_relative\_index() | The index of the current character (starting from 0) for this [RichTextEffect](class_richtexteffect#class-richtexteffect) custom block. Setting this property won't affect drawing. ### [bool](class_bool#class-bool) visible | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_visibility(value) | | *Getter* | is\_visible() | If `true`, the character will be drawn. If `false`, the character will be hidden. Characters around hidden characters will reflow to take the space of hidden characters. If this is not desired, set their [color](#class-charfxtransform-property-color) to `Color(1, 1, 1, 0)` instead. godot AudioEffectPitchShift AudioEffectPitchShift ===================== **Inherits:** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Adds a pitch-shifting audio effect to an Audio bus. Raises or lowers the pitch of original sound. Description ----------- Allows modulation of pitch independently of tempo. All frequencies can be increased/decreased with minimal effect on transients. Properties ---------- | | | | | --- | --- | --- | | [FFT\_Size](#enum-audioeffectpitchshift-fft-size) | [fft\_size](#class-audioeffectpitchshift-property-fft-size) | `3` | | [int](class_int#class-int) | [oversampling](#class-audioeffectpitchshift-property-oversampling) | `4` | | [float](class_float#class-float) | [pitch\_scale](#class-audioeffectpitchshift-property-pitch-scale) | `1.0` | Enumerations ------------ enum **FFT\_Size**: * **FFT\_SIZE\_256** = **0** --- Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time. * **FFT\_SIZE\_512** = **1** --- Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time. * **FFT\_SIZE\_1024** = **2** --- Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time. * **FFT\_SIZE\_2048** = **3** --- Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time. * **FFT\_SIZE\_4096** = **4** --- Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time. * **FFT\_SIZE\_MAX** = **5** --- Represents the size of the [FFT\_Size](#enum-audioeffectpitchshift-fft-size) enum. Property Descriptions --------------------- ### [FFT\_Size](#enum-audioeffectpitchshift-fft-size) fft\_size | | | | --- | --- | | *Default* | `3` | | *Setter* | set\_fft\_size(value) | | *Getter* | get\_fft\_size() | The size of the [Fast Fourier transform](https://en.wikipedia.org/wiki/Fast_Fourier_transform) buffer. Higher values smooth out the effect over time, but have greater latency. The effects of this higher latency are especially noticeable on sounds that have sudden amplitude changes. ### [int](class_int#class-int) oversampling | | | | --- | --- | | *Default* | `4` | | *Setter* | set\_oversampling(value) | | *Getter* | get\_oversampling() | The oversampling factor to use. Higher values result in better quality, but are more demanding on the CPU and may cause audio cracking if the CPU can't keep up. ### [float](class_float#class-float) pitch\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_pitch\_scale(value) | | *Getter* | get\_pitch\_scale() | The pitch scale to use. `1.0` is the default pitch and plays sounds unaltered. [pitch\_scale](#class-audioeffectpitchshift-property-pitch-scale) can range from `0.0` (infinitely low pitch, inaudible) to `16` (16 times higher than the initial pitch). godot VisualShaderNodeTexture VisualShaderNodeTexture ======================= **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Performs a texture lookup within the visual shader graph. Description ----------- Performs a lookup operation on the provided texture, with support for multiple texture sources to choose from. Properties ---------- | | | | | --- | --- | --- | | [Source](#enum-visualshadernodetexture-source) | [source](#class-visualshadernodetexture-property-source) | `0` | | [Texture](class_texture#class-texture) | [texture](#class-visualshadernodetexture-property-texture) | | | [TextureType](#enum-visualshadernodetexture-texturetype) | [texture\_type](#class-visualshadernodetexture-property-texture-type) | `0` | Enumerations ------------ enum **Source**: * **SOURCE\_TEXTURE** = **0** --- Use the texture given as an argument for this function. * **SOURCE\_SCREEN** = **1** --- Use the current viewport's texture as the source. * **SOURCE\_2D\_TEXTURE** = **2** --- Use the texture from this shader's texture built-in (e.g. a texture of a [Sprite](class_sprite#class-sprite)). * **SOURCE\_2D\_NORMAL** = **3** --- Use the texture from this shader's normal map built-in. * **SOURCE\_DEPTH** = **4** --- Use the depth texture available for this shader. * **SOURCE\_PORT** = **5** --- Use the texture provided in the input port for this function. enum **TextureType**: * **TYPE\_DATA** = **0** --- No hints are added to the uniform declaration. * **TYPE\_COLOR** = **1** --- Adds `hint_albedo` as hint to the uniform declaration for proper sRGB to linear conversion. * **TYPE\_NORMALMAP** = **2** --- Adds `hint_normal` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. Property Descriptions --------------------- ### [Source](#enum-visualshadernodetexture-source) source | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_source(value) | | *Getter* | get\_source() | Determines the source for the lookup. See [Source](#enum-visualshadernodetexture-source) for options. ### [Texture](class_texture#class-texture) texture | | | | --- | --- | | *Setter* | set\_texture(value) | | *Getter* | get\_texture() | The source texture, if needed for the selected [source](#class-visualshadernodetexture-property-source). ### [TextureType](#enum-visualshadernodetexture-texturetype) texture\_type | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_texture\_type(value) | | *Getter* | get\_texture\_type() | Specifies the type of the texture if [source](#class-visualshadernodetexture-property-source) is set to [SOURCE\_TEXTURE](#class-visualshadernodetexture-constant-source-texture). See [TextureType](#enum-visualshadernodetexture-texturetype) for options. godot File File ==== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Type to handle file reading and writing operations. Description ----------- File type. This is used to permanently store data into the user device's file system and to read from it. This can be used to store game save data or player configuration files, for example. Here's a sample on how to write and read from a file: ``` func save(content): var file = File.new() file.open("user://save_game.dat", File.WRITE) file.store_string(content) file.close() func load(): var file = File.new() file.open("user://save_game.dat", File.READ) var content = file.get_as_text() file.close() return content ``` In the example above, the file will be saved in the user data folder as specified in the [Data paths](https://docs.godotengine.org/en/3.5/tutorials/io/data_paths.html) documentation. **Note:** To access project resources once exported, it is recommended to use [ResourceLoader](class_resourceloader#class-resourceloader) instead of the `File` API, as some files are converted to engine-specific formats and their original source files might not be present in the exported PCK package. **Note:** Files are automatically closed only if the process exits "normally" (such as by clicking the window manager's close button or pressing **Alt + F4**). If you stop the project execution by pressing **F8** while the project is running, the file won't be closed as the game process will be killed. You can work around this by calling [flush](#class-file-method-flush) at regular intervals. Tutorials --------- * [File system](https://docs.godotengine.org/en/3.5/tutorials/scripting/filesystem.html) * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [endian\_swap](#class-file-property-endian-swap) | `false` | Methods ------- | | | | --- | --- | | void | [close](#class-file-method-close) **(** **)** | | [bool](class_bool#class-bool) | [eof\_reached](#class-file-method-eof-reached) **(** **)** const | | [bool](class_bool#class-bool) | [file\_exists](#class-file-method-file-exists) **(** [String](class_string#class-string) path **)** const | | void | [flush](#class-file-method-flush) **(** **)** | | [int](class_int#class-int) | [get\_16](#class-file-method-get-16) **(** **)** const | | [int](class_int#class-int) | [get\_32](#class-file-method-get-32) **(** **)** const | | [int](class_int#class-int) | [get\_64](#class-file-method-get-64) **(** **)** const | | [int](class_int#class-int) | [get\_8](#class-file-method-get-8) **(** **)** const | | [String](class_string#class-string) | [get\_as\_text](#class-file-method-get-as-text) **(** [bool](class_bool#class-bool) skip\_cr=true **)** const | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [get\_buffer](#class-file-method-get-buffer) **(** [int](class_int#class-int) len **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_csv\_line](#class-file-method-get-csv-line) **(** [String](class_string#class-string) delim="," **)** const | | [float](class_float#class-float) | [get\_double](#class-file-method-get-double) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [get\_error](#class-file-method-get-error) **(** **)** const | | [float](class_float#class-float) | [get\_float](#class-file-method-get-float) **(** **)** const | | [int](class_int#class-int) | [get\_len](#class-file-method-get-len) **(** **)** const | | [String](class_string#class-string) | [get\_line](#class-file-method-get-line) **(** **)** const | | [String](class_string#class-string) | [get\_md5](#class-file-method-get-md5) **(** [String](class_string#class-string) path **)** const | | [int](class_int#class-int) | [get\_modified\_time](#class-file-method-get-modified-time) **(** [String](class_string#class-string) file **)** const | | [String](class_string#class-string) | [get\_pascal\_string](#class-file-method-get-pascal-string) **(** **)** | | [String](class_string#class-string) | [get\_path](#class-file-method-get-path) **(** **)** const | | [String](class_string#class-string) | [get\_path\_absolute](#class-file-method-get-path-absolute) **(** **)** const | | [int](class_int#class-int) | [get\_position](#class-file-method-get-position) **(** **)** const | | [float](class_float#class-float) | [get\_real](#class-file-method-get-real) **(** **)** const | | [String](class_string#class-string) | [get\_sha256](#class-file-method-get-sha256) **(** [String](class_string#class-string) path **)** const | | [Variant](class_variant#class-variant) | [get\_var](#class-file-method-get-var) **(** [bool](class_bool#class-bool) allow\_objects=false **)** const | | [bool](class_bool#class-bool) | [is\_open](#class-file-method-is-open) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [open](#class-file-method-open) **(** [String](class_string#class-string) path, [ModeFlags](#enum-file-modeflags) flags **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [open\_compressed](#class-file-method-open-compressed) **(** [String](class_string#class-string) path, [ModeFlags](#enum-file-modeflags) mode\_flags, [CompressionMode](#enum-file-compressionmode) compression\_mode=0 **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [open\_encrypted](#class-file-method-open-encrypted) **(** [String](class_string#class-string) path, [ModeFlags](#enum-file-modeflags) mode\_flags, [PoolByteArray](class_poolbytearray#class-poolbytearray) key **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [open\_encrypted\_with\_pass](#class-file-method-open-encrypted-with-pass) **(** [String](class_string#class-string) path, [ModeFlags](#enum-file-modeflags) mode\_flags, [String](class_string#class-string) pass **)** | | void | [seek](#class-file-method-seek) **(** [int](class_int#class-int) position **)** | | void | [seek\_end](#class-file-method-seek-end) **(** [int](class_int#class-int) position=0 **)** | | void | [store\_16](#class-file-method-store-16) **(** [int](class_int#class-int) value **)** | | void | [store\_32](#class-file-method-store-32) **(** [int](class_int#class-int) value **)** | | void | [store\_64](#class-file-method-store-64) **(** [int](class_int#class-int) value **)** | | void | [store\_8](#class-file-method-store-8) **(** [int](class_int#class-int) value **)** | | void | [store\_buffer](#class-file-method-store-buffer) **(** [PoolByteArray](class_poolbytearray#class-poolbytearray) buffer **)** | | void | [store\_csv\_line](#class-file-method-store-csv-line) **(** [PoolStringArray](class_poolstringarray#class-poolstringarray) values, [String](class_string#class-string) delim="," **)** | | void | [store\_double](#class-file-method-store-double) **(** [float](class_float#class-float) value **)** | | void | [store\_float](#class-file-method-store-float) **(** [float](class_float#class-float) value **)** | | void | [store\_line](#class-file-method-store-line) **(** [String](class_string#class-string) line **)** | | void | [store\_pascal\_string](#class-file-method-store-pascal-string) **(** [String](class_string#class-string) string **)** | | void | [store\_real](#class-file-method-store-real) **(** [float](class_float#class-float) value **)** | | void | [store\_string](#class-file-method-store-string) **(** [String](class_string#class-string) string **)** | | void | [store\_var](#class-file-method-store-var) **(** [Variant](class_variant#class-variant) value, [bool](class_bool#class-bool) full\_objects=false **)** | Enumerations ------------ enum **ModeFlags**: * **READ** = **1** --- Opens the file for read operations. The cursor is positioned at the beginning of the file. * **WRITE** = **2** --- Opens the file for write operations. The file is created if it does not exist, and truncated if it does. * **READ\_WRITE** = **3** --- Opens the file for read and write operations. Does not truncate the file. The cursor is positioned at the beginning of the file. * **WRITE\_READ** = **7** --- Opens the file for read and write operations. The file is created if it does not exist, and truncated if it does. The cursor is positioned at the beginning of the file. enum **CompressionMode**: * **COMPRESSION\_FASTLZ** = **0** --- Uses the [FastLZ](http://fastlz.org/) compression method. * **COMPRESSION\_DEFLATE** = **1** --- Uses the [DEFLATE](https://en.wikipedia.org/wiki/DEFLATE) compression method. * **COMPRESSION\_ZSTD** = **2** --- Uses the [Zstandard](https://facebook.github.io/zstd/) compression method. * **COMPRESSION\_GZIP** = **3** --- Uses the [gzip](https://www.gzip.org/) compression method. Property Descriptions --------------------- ### [bool](class_bool#class-bool) endian\_swap | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_endian\_swap(value) | | *Getter* | get\_endian\_swap() | If `true`, the file is read with big-endian [endianness](https://en.wikipedia.org/wiki/Endianness). If `false`, the file is read with little-endian endianness. If in doubt, leave this to `false` as most files are written with little-endian endianness. **Note:** [endian\_swap](#class-file-property-endian-swap) is only about the file format, not the CPU type. The CPU endianness doesn't affect the default endianness for files written. **Note:** This is always reset to `false` whenever you open the file. Therefore, you must set [endian\_swap](#class-file-property-endian-swap) *after* opening the file, not before. Method Descriptions ------------------- ### void close ( ) Closes the currently opened file and prevents subsequent read/write operations. Use [flush](#class-file-method-flush) to persist the data to disk without closing the file. ### [bool](class_bool#class-bool) eof\_reached ( ) const Returns `true` if the file cursor has already read past the end of the file. **Note:** `eof_reached() == false` cannot be used to check whether there is more data available. To loop while there is more data available, use: ``` while file.get_position() < file.get_len(): # Read data ``` ### [bool](class_bool#class-bool) file\_exists ( [String](class_string#class-string) path ) const Returns `true` if the file exists in the given path. **Note:** Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. See [ResourceLoader.exists](class_resourceloader#class-resourceloader-method-exists) for an alternative approach that takes resource remapping into account. ### void flush ( ) Writes the file's buffer to disk. Flushing is automatically performed when the file is closed. This means you don't need to call [flush](#class-file-method-flush) manually before closing a file using [close](#class-file-method-close). Still, calling [flush](#class-file-method-flush) can be used to ensure the data is safe even if the project crashes instead of being closed gracefully. **Note:** Only call [flush](#class-file-method-flush) when you actually need it. Otherwise, it will decrease performance due to constant disk writes. ### [int](class_int#class-int) get\_16 ( ) const Returns the next 16 bits from the file as an integer. See [store\_16](#class-file-method-store-16) for details on what values can be stored and retrieved this way. ### [int](class_int#class-int) get\_32 ( ) const Returns the next 32 bits from the file as an integer. See [store\_32](#class-file-method-store-32) for details on what values can be stored and retrieved this way. ### [int](class_int#class-int) get\_64 ( ) const Returns the next 64 bits from the file as an integer. See [store\_64](#class-file-method-store-64) for details on what values can be stored and retrieved this way. ### [int](class_int#class-int) get\_8 ( ) const Returns the next 8 bits from the file as an integer. See [store\_8](#class-file-method-store-8) for details on what values can be stored and retrieved this way. ### [String](class_string#class-string) get\_as\_text ( [bool](class_bool#class-bool) skip\_cr=true ) const Returns the whole file as a [String](class_string#class-string). Text is interpreted as being UTF-8 encoded. If `skip_cr` is `true`, carriage return characters (`\r`, CR) will be ignored when parsing the UTF-8, so that only line feed characters (`\n`, LF) represent a new line (Unix convention). ### [PoolByteArray](class_poolbytearray#class-poolbytearray) get\_buffer ( [int](class_int#class-int) len ) const Returns next `len` bytes of the file as a [PoolByteArray](class_poolbytearray#class-poolbytearray). ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_csv\_line ( [String](class_string#class-string) delim="," ) const Returns the next value of the file in CSV (Comma-Separated Values) format. You can pass a different delimiter `delim` to use other than the default `","` (comma). This delimiter must be one-character long, and cannot be a double quotation mark. Text is interpreted as being UTF-8 encoded. Text values must be enclosed in double quotes if they include the delimiter character. Double quotes within a text value can be escaped by doubling their occurrence. For example, the following CSV lines are valid and will be properly parsed as two strings each: ``` Alice,"Hello, Bob!" Bob,Alice! What a surprise! Alice,"I thought you'd reply with ""Hello, world""." ``` Note how the second line can omit the enclosing quotes as it does not include the delimiter. However it *could* very well use quotes, it was only written without for demonstration purposes. The third line must use `""` for each quotation mark that needs to be interpreted as such instead of the end of a text value. ### [float](class_float#class-float) get\_double ( ) const Returns the next 64 bits from the file as a floating-point number. ### [Error](class_%40globalscope#enum-globalscope-error) get\_error ( ) const Returns the last error that happened when trying to perform operations. Compare with the `ERR_FILE_*` constants from [Error](class_%40globalscope#enum-globalscope-error). ### [float](class_float#class-float) get\_float ( ) const Returns the next 32 bits from the file as a floating-point number. ### [int](class_int#class-int) get\_len ( ) const Returns the size of the file in bytes. ### [String](class_string#class-string) get\_line ( ) const Returns the next line of the file as a [String](class_string#class-string). Text is interpreted as being UTF-8 encoded. ### [String](class_string#class-string) get\_md5 ( [String](class_string#class-string) path ) const Returns an MD5 String representing the file at the given path or an empty [String](class_string#class-string) on failure. ### [int](class_int#class-int) get\_modified\_time ( [String](class_string#class-string) file ) const Returns the last time the `file` was modified in unix timestamp format or returns a [String](class_string#class-string) "ERROR IN `file`". This unix timestamp can be converted to datetime by using [OS.get\_datetime\_from\_unix\_time](class_os#class-os-method-get-datetime-from-unix-time). ### [String](class_string#class-string) get\_pascal\_string ( ) Returns a [String](class_string#class-string) saved in Pascal format from the file. Text is interpreted as being UTF-8 encoded. ### [String](class_string#class-string) get\_path ( ) const Returns the path as a [String](class_string#class-string) for the current open file. ### [String](class_string#class-string) get\_path\_absolute ( ) const Returns the absolute path as a [String](class_string#class-string) for the current open file. ### [int](class_int#class-int) get\_position ( ) const Returns the file cursor's position. ### [float](class_float#class-float) get\_real ( ) const Returns the next bits from the file as a floating-point number. ### [String](class_string#class-string) get\_sha256 ( [String](class_string#class-string) path ) const Returns a SHA-256 [String](class_string#class-string) representing the file at the given path or an empty [String](class_string#class-string) on failure. ### [Variant](class_variant#class-variant) get\_var ( [bool](class_bool#class-bool) allow\_objects=false ) const Returns the next [Variant](class_variant#class-variant) value from the file. If `allow_objects` is `true`, decoding objects is allowed. **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. ### [bool](class_bool#class-bool) is\_open ( ) const Returns `true` if the file is currently opened. ### [Error](class_%40globalscope#enum-globalscope-error) open ( [String](class_string#class-string) path, [ModeFlags](#enum-file-modeflags) flags ) Opens the file for writing or reading, depending on the flags. ### [Error](class_%40globalscope#enum-globalscope-error) open\_compressed ( [String](class_string#class-string) path, [ModeFlags](#enum-file-modeflags) mode\_flags, [CompressionMode](#enum-file-compressionmode) compression\_mode=0 ) Opens a compressed file for reading or writing. **Note:** [open\_compressed](#class-file-method-open-compressed) can only read files that were saved by Godot, not third-party compression formats. See [GitHub issue #28999](https://github.com/godotengine/godot/issues/28999) for a workaround. ### [Error](class_%40globalscope#enum-globalscope-error) open\_encrypted ( [String](class_string#class-string) path, [ModeFlags](#enum-file-modeflags) mode\_flags, [PoolByteArray](class_poolbytearray#class-poolbytearray) key ) Opens an encrypted file in write or read mode. You need to pass a binary key to encrypt/decrypt it. **Note:** The provided key must be 32 bytes long. ### [Error](class_%40globalscope#enum-globalscope-error) open\_encrypted\_with\_pass ( [String](class_string#class-string) path, [ModeFlags](#enum-file-modeflags) mode\_flags, [String](class_string#class-string) pass ) Opens an encrypted file in write or read mode. You need to pass a password to encrypt/decrypt it. ### void seek ( [int](class_int#class-int) position ) Changes the file reading/writing cursor to the specified position (in bytes from the beginning of the file). ### void seek\_end ( [int](class_int#class-int) position=0 ) Changes the file reading/writing cursor to the specified position (in bytes from the end of the file). **Note:** This is an offset, so you should use negative numbers or the cursor will be at the end of the file. ### void store\_16 ( [int](class_int#class-int) value ) Stores an integer as 16 bits in the file. **Note:** The `value` should lie in the interval `[0, 2^16 - 1]`. Any other value will overflow and wrap around. To store a signed integer, use [store\_64](#class-file-method-store-64) or store a signed integer from the interval `[-2^15, 2^15 - 1]` (i.e. keeping one bit for the signedness) and compute its sign manually when reading. For example: ``` const MAX_15B = 1 << 15 const MAX_16B = 1 << 16 func unsigned16_to_signed(unsigned): return (unsigned + MAX_15B) % MAX_16B - MAX_15B func _ready(): var f = File.new() f.open("user://file.dat", File.WRITE_READ) f.store_16(-42) # This wraps around and stores 65494 (2^16 - 42). f.store_16(121) # In bounds, will store 121. f.seek(0) # Go back to start to read the stored value. var read1 = f.get_16() # 65494 var read2 = f.get_16() # 121 var converted1 = unsigned16_to_signed(read1) # -42 var converted2 = unsigned16_to_signed(read2) # 121 ``` ### void store\_32 ( [int](class_int#class-int) value ) Stores an integer as 32 bits in the file. **Note:** The `value` should lie in the interval `[0, 2^32 - 1]`. Any other value will overflow and wrap around. To store a signed integer, use [store\_64](#class-file-method-store-64), or convert it manually (see [store\_16](#class-file-method-store-16) for an example). ### void store\_64 ( [int](class_int#class-int) value ) Stores an integer as 64 bits in the file. **Note:** The `value` must lie in the interval `[-2^63, 2^63 - 1]` (i.e. be a valid [int](class_int#class-int) value). ### void store\_8 ( [int](class_int#class-int) value ) Stores an integer as 8 bits in the file. **Note:** The `value` should lie in the interval `[0, 255]`. Any other value will overflow and wrap around. To store a signed integer, use [store\_64](#class-file-method-store-64), or convert it manually (see [store\_16](#class-file-method-store-16) for an example). ### void store\_buffer ( [PoolByteArray](class_poolbytearray#class-poolbytearray) buffer ) Stores the given array of bytes in the file. ### void store\_csv\_line ( [PoolStringArray](class_poolstringarray#class-poolstringarray) values, [String](class_string#class-string) delim="," ) Store the given [PoolStringArray](class_poolstringarray#class-poolstringarray) in the file as a line formatted in the CSV (Comma-Separated Values) format. You can pass a different delimiter `delim` to use other than the default `","` (comma). This delimiter must be one-character long. Text will be encoded as UTF-8. ### void store\_double ( [float](class_float#class-float) value ) Stores a floating-point number as 64 bits in the file. ### void store\_float ( [float](class_float#class-float) value ) Stores a floating-point number as 32 bits in the file. ### void store\_line ( [String](class_string#class-string) line ) Appends `line` to the file followed by a line return character (`\n`), encoding the text as UTF-8. ### void store\_pascal\_string ( [String](class_string#class-string) string ) Stores the given [String](class_string#class-string) as a line in the file in Pascal format (i.e. also store the length of the string). Text will be encoded as UTF-8. ### void store\_real ( [float](class_float#class-float) value ) Stores a floating-point number in the file. ### void store\_string ( [String](class_string#class-string) string ) Appends `string` to the file without a line return, encoding the text as UTF-8. **Note:** This method is intended to be used to write text files. The string is stored as a UTF-8 encoded buffer without string length or terminating zero, which means that it can't be loaded back easily. If you want to store a retrievable string in a binary file, consider using [store\_pascal\_string](#class-file-method-store-pascal-string) instead. For retrieving strings from a text file, you can use `get_buffer(length).get_string_from_utf8()` (if you know the length) or [get\_as\_text](#class-file-method-get-as-text). ### void store\_var ( [Variant](class_variant#class-variant) value, [bool](class_bool#class-bool) full\_objects=false ) Stores any Variant value in the file. If `full_objects` is `true`, encoding objects is allowed (and can potentially include code). **Note:** Not all properties are included. Only properties that are configured with the [@GlobalScope.PROPERTY\_USAGE\_STORAGE](class_%40globalscope#class-globalscope-constant-property-usage-storage) flag set will be serialized. You can add a new usage flag to a property by overriding the [Object.\_get\_property\_list](class_object#class-object-method-get-property-list) method in your class. You can also check how property usage is configured by calling [Object.\_get\_property\_list](class_object#class-object-method-get-property-list). See [PropertyUsageFlags](class_%40globalscope#enum-globalscope-propertyusageflags) for the possible usage flags.
programming_docs
godot EditorSceneImporterFBX EditorSceneImporterFBX ====================== **Inherits:** [EditorSceneImporter](class_editorsceneimporter#class-editorsceneimporter) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) FBX 3D asset importer. Description ----------- This is an FBX 3D asset importer with full support for most FBX features. If exporting a FBX scene from Autodesk Maya, use these FBX export settings: ``` - Smoothing Groups - Smooth Mesh - Triangluate (for meshes with blend shapes) - Bake Animation - Resample All - Deformed Models - Skins - Blend Shapes - Curve Filters - Constant Key Reducer - Auto Tangents Only - *Do not check* Constraints (as it will break the file) - Can check Embed Media (embeds textures into the exported FBX file) - Note that when importing embedded media, the texture and mesh will be a single immutable file. - You will have to re-export then re-import the FBX if the texture has changed. - Units: Centimeters - Up Axis: Y - Binary format in FBX 2017 ``` godot Input Input ===== **Inherits:** [Object](class_object#class-object) A singleton that deals with inputs. Description ----------- A singleton that deals with inputs. This includes key presses, mouse buttons and movement, joypads, and input actions. Actions and their events can be set in the **Input Map** tab in the **Project > Project Settings**, or with the [InputMap](class_inputmap#class-inputmap) class. Tutorials --------- * [Inputs tutorial index](https://docs.godotengine.org/en/3.5/tutorials/inputs/index.html) * [2D Dodge The Creeps Demo](https://godotengine.org/asset-library/asset/515) * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) Properties ---------- | | | | --- | --- | | [MouseMode](#enum-input-mousemode) | [mouse\_mode](#class-input-property-mouse-mode) | | [bool](class_bool#class-bool) | [use\_accumulated\_input](#class-input-property-use-accumulated-input) | Methods ------- | | | | --- | --- | | void | [action\_press](#class-input-method-action-press) **(** [String](class_string#class-string) action, [float](class_float#class-float) strength=1.0 **)** | | void | [action\_release](#class-input-method-action-release) **(** [String](class_string#class-string) action **)** | | void | [add\_joy\_mapping](#class-input-method-add-joy-mapping) **(** [String](class_string#class-string) mapping, [bool](class_bool#class-bool) update\_existing=false **)** | | void | [flush\_buffered\_events](#class-input-method-flush-buffered-events) **(** **)** | | [Vector3](class_vector3#class-vector3) | [get\_accelerometer](#class-input-method-get-accelerometer) **(** **)** const | | [float](class_float#class-float) | [get\_action\_raw\_strength](#class-input-method-get-action-raw-strength) **(** [String](class_string#class-string) action, [bool](class_bool#class-bool) exact=false **)** const | | [float](class_float#class-float) | [get\_action\_strength](#class-input-method-get-action-strength) **(** [String](class_string#class-string) action, [bool](class_bool#class-bool) exact=false **)** const | | [float](class_float#class-float) | [get\_axis](#class-input-method-get-axis) **(** [String](class_string#class-string) negative\_action, [String](class_string#class-string) positive\_action **)** const | | [Array](class_array#class-array) | [get\_connected\_joypads](#class-input-method-get-connected-joypads) **(** **)** | | [CursorShape](#enum-input-cursorshape) | [get\_current\_cursor\_shape](#class-input-method-get-current-cursor-shape) **(** **)** const | | [Vector3](class_vector3#class-vector3) | [get\_gravity](#class-input-method-get-gravity) **(** **)** const | | [Vector3](class_vector3#class-vector3) | [get\_gyroscope](#class-input-method-get-gyroscope) **(** **)** const | | [float](class_float#class-float) | [get\_joy\_axis](#class-input-method-get-joy-axis) **(** [int](class_int#class-int) device, [int](class_int#class-int) axis **)** const | | [int](class_int#class-int) | [get\_joy\_axis\_index\_from\_string](#class-input-method-get-joy-axis-index-from-string) **(** [String](class_string#class-string) axis **)** | | [String](class_string#class-string) | [get\_joy\_axis\_string](#class-input-method-get-joy-axis-string) **(** [int](class_int#class-int) axis\_index **)** | | [int](class_int#class-int) | [get\_joy\_button\_index\_from\_string](#class-input-method-get-joy-button-index-from-string) **(** [String](class_string#class-string) button **)** | | [String](class_string#class-string) | [get\_joy\_button\_string](#class-input-method-get-joy-button-string) **(** [int](class_int#class-int) button\_index **)** | | [String](class_string#class-string) | [get\_joy\_guid](#class-input-method-get-joy-guid) **(** [int](class_int#class-int) device **)** const | | [String](class_string#class-string) | [get\_joy\_name](#class-input-method-get-joy-name) **(** [int](class_int#class-int) device **)** | | [float](class_float#class-float) | [get\_joy\_vibration\_duration](#class-input-method-get-joy-vibration-duration) **(** [int](class_int#class-int) device **)** | | [Vector2](class_vector2#class-vector2) | [get\_joy\_vibration\_strength](#class-input-method-get-joy-vibration-strength) **(** [int](class_int#class-int) device **)** | | [Vector2](class_vector2#class-vector2) | [get\_last\_mouse\_speed](#class-input-method-get-last-mouse-speed) **(** **)** const | | [Vector3](class_vector3#class-vector3) | [get\_magnetometer](#class-input-method-get-magnetometer) **(** **)** const | | [int](class_int#class-int) | [get\_mouse\_button\_mask](#class-input-method-get-mouse-button-mask) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_vector](#class-input-method-get-vector) **(** [String](class_string#class-string) negative\_x, [String](class_string#class-string) positive\_x, [String](class_string#class-string) negative\_y, [String](class_string#class-string) positive\_y, [float](class_float#class-float) deadzone=-1.0 **)** const | | [bool](class_bool#class-bool) | [is\_action\_just\_pressed](#class-input-method-is-action-just-pressed) **(** [String](class_string#class-string) action, [bool](class_bool#class-bool) exact=false **)** const | | [bool](class_bool#class-bool) | [is\_action\_just\_released](#class-input-method-is-action-just-released) **(** [String](class_string#class-string) action, [bool](class_bool#class-bool) exact=false **)** const | | [bool](class_bool#class-bool) | [is\_action\_pressed](#class-input-method-is-action-pressed) **(** [String](class_string#class-string) action, [bool](class_bool#class-bool) exact=false **)** const | | [bool](class_bool#class-bool) | [is\_joy\_button\_pressed](#class-input-method-is-joy-button-pressed) **(** [int](class_int#class-int) device, [int](class_int#class-int) button **)** const | | [bool](class_bool#class-bool) | [is\_joy\_known](#class-input-method-is-joy-known) **(** [int](class_int#class-int) device **)** | | [bool](class_bool#class-bool) | [is\_key\_pressed](#class-input-method-is-key-pressed) **(** [int](class_int#class-int) scancode **)** const | | [bool](class_bool#class-bool) | [is\_mouse\_button\_pressed](#class-input-method-is-mouse-button-pressed) **(** [int](class_int#class-int) button **)** const | | [bool](class_bool#class-bool) | [is\_physical\_key\_pressed](#class-input-method-is-physical-key-pressed) **(** [int](class_int#class-int) scancode **)** const | | void | [joy\_connection\_changed](#class-input-method-joy-connection-changed) **(** [int](class_int#class-int) device, [bool](class_bool#class-bool) connected, [String](class_string#class-string) name, [String](class_string#class-string) guid **)** | | void | [parse\_input\_event](#class-input-method-parse-input-event) **(** [InputEvent](class_inputevent#class-inputevent) event **)** | | void | [remove\_joy\_mapping](#class-input-method-remove-joy-mapping) **(** [String](class_string#class-string) guid **)** | | void | [set\_accelerometer](#class-input-method-set-accelerometer) **(** [Vector3](class_vector3#class-vector3) value **)** | | void | [set\_custom\_mouse\_cursor](#class-input-method-set-custom-mouse-cursor) **(** [Resource](class_resource#class-resource) image, [CursorShape](#enum-input-cursorshape) shape=0, [Vector2](class_vector2#class-vector2) hotspot=Vector2( 0, 0 ) **)** | | void | [set\_default\_cursor\_shape](#class-input-method-set-default-cursor-shape) **(** [CursorShape](#enum-input-cursorshape) shape=0 **)** | | void | [set\_gravity](#class-input-method-set-gravity) **(** [Vector3](class_vector3#class-vector3) value **)** | | void | [set\_gyroscope](#class-input-method-set-gyroscope) **(** [Vector3](class_vector3#class-vector3) value **)** | | void | [set\_magnetometer](#class-input-method-set-magnetometer) **(** [Vector3](class_vector3#class-vector3) value **)** | | void | [start\_joy\_vibration](#class-input-method-start-joy-vibration) **(** [int](class_int#class-int) device, [float](class_float#class-float) weak\_magnitude, [float](class_float#class-float) strong\_magnitude, [float](class_float#class-float) duration=0 **)** | | void | [stop\_joy\_vibration](#class-input-method-stop-joy-vibration) **(** [int](class_int#class-int) device **)** | | void | [vibrate\_handheld](#class-input-method-vibrate-handheld) **(** [int](class_int#class-int) duration\_ms=500 **)** | | void | [warp\_mouse\_position](#class-input-method-warp-mouse-position) **(** [Vector2](class_vector2#class-vector2) to **)** | Signals ------- ### joy\_connection\_changed ( [int](class_int#class-int) device, [bool](class_bool#class-bool) connected ) Emitted when a joypad device has been connected or disconnected. Enumerations ------------ enum **MouseMode**: * **MOUSE\_MODE\_VISIBLE** = **0** --- Makes the mouse cursor visible if it is hidden. * **MOUSE\_MODE\_HIDDEN** = **1** --- Makes the mouse cursor hidden if it is visible. * **MOUSE\_MODE\_CAPTURED** = **2** --- Captures the mouse. The mouse will be hidden and its position locked at the center of the screen. **Note:** If you want to process the mouse's movement in this mode, you need to use [InputEventMouseMotion.relative](class_inputeventmousemotion#class-inputeventmousemotion-property-relative). * **MOUSE\_MODE\_CONFINED** = **3** --- Makes the mouse cursor visible but confines it to the game window. enum **CursorShape**: * **CURSOR\_ARROW** = **0** --- Arrow cursor. Standard, default pointing cursor. * **CURSOR\_IBEAM** = **1** --- I-beam cursor. Usually used to show where the text cursor will appear when the mouse is clicked. * **CURSOR\_POINTING\_HAND** = **2** --- Pointing hand cursor. Usually used to indicate the pointer is over a link or other interactable item. * **CURSOR\_CROSS** = **3** --- Cross cursor. Typically appears over regions in which a drawing operation can be performed or for selections. * **CURSOR\_WAIT** = **4** --- Wait cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application isn't usable during the operation (e.g. something is blocking its main thread). * **CURSOR\_BUSY** = **5** --- Busy cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application is still usable during the operation. * **CURSOR\_DRAG** = **6** --- Drag cursor. Usually displayed when dragging something. * **CURSOR\_CAN\_DROP** = **7** --- Can drop cursor. Usually displayed when dragging something to indicate that it can be dropped at the current position. * **CURSOR\_FORBIDDEN** = **8** --- Forbidden cursor. Indicates that the current action is forbidden (for example, when dragging something) or that the control at a position is disabled. * **CURSOR\_VSIZE** = **9** --- Vertical resize mouse cursor. A double-headed vertical arrow. It tells the user they can resize the window or the panel vertically. * **CURSOR\_HSIZE** = **10** --- Horizontal resize mouse cursor. A double-headed horizontal arrow. It tells the user they can resize the window or the panel horizontally. * **CURSOR\_BDIAGSIZE** = **11** --- Window resize mouse cursor. The cursor is a double-headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically. * **CURSOR\_FDIAGSIZE** = **12** --- Window resize mouse cursor. The cursor is a double-headed arrow that goes from the top left to the bottom right, the opposite of [CURSOR\_BDIAGSIZE](#class-input-constant-cursor-bdiagsize). It tells the user they can resize the window or the panel both horizontally and vertically. * **CURSOR\_MOVE** = **13** --- Move cursor. Indicates that something can be moved. * **CURSOR\_VSPLIT** = **14** --- Vertical split mouse cursor. On Windows, it's the same as [CURSOR\_VSIZE](#class-input-constant-cursor-vsize). * **CURSOR\_HSPLIT** = **15** --- Horizontal split mouse cursor. On Windows, it's the same as [CURSOR\_HSIZE](#class-input-constant-cursor-hsize). * **CURSOR\_HELP** = **16** --- Help cursor. Usually a question mark. Property Descriptions --------------------- ### [MouseMode](#enum-input-mousemode) mouse\_mode | | | | --- | --- | | *Setter* | set\_mouse\_mode(value) | | *Getter* | get\_mouse\_mode() | Controls the mouse mode. See [MouseMode](#enum-input-mousemode) for more information. ### [bool](class_bool#class-bool) use\_accumulated\_input | | | | --- | --- | | *Setter* | set\_use\_accumulated\_input(value) | | *Getter* | is\_using\_accumulated\_input() | If `true`, similar input events sent by the operating system are accumulated. When input accumulation is enabled, all input events generated during a frame will be merged and emitted when the frame is done rendering. Therefore, this limits the number of input method calls per second to the rendering FPS. Input accumulation can be disabled to get slightly more precise/reactive input at the cost of increased CPU usage. In applications where drawing freehand lines is required, input accumulation should generally be disabled while the user is drawing the line to get results that closely follow the actual input. **Note:** Input accumulation is *enabled* by default. It is recommended to keep it enabled for games which don't require very reactive input, as this will decrease CPU usage. Method Descriptions ------------------- ### void action\_press ( [String](class_string#class-string) action, [float](class_float#class-float) strength=1.0 ) This will simulate pressing the specified action. The strength can be used for non-boolean actions, it's ranged between 0 and 1 representing the intensity of the given action. **Note:** This method will not cause any [Node.\_input](class_node#class-node-method-input) calls. It is intended to be used with [is\_action\_pressed](#class-input-method-is-action-pressed) and [is\_action\_just\_pressed](#class-input-method-is-action-just-pressed). If you want to simulate `_input`, use [parse\_input\_event](#class-input-method-parse-input-event) instead. ### void action\_release ( [String](class_string#class-string) action ) If the specified action is already pressed, this will release it. ### void add\_joy\_mapping ( [String](class_string#class-string) mapping, [bool](class_bool#class-bool) update\_existing=false ) Adds a new mapping entry (in SDL2 format) to the mapping database. Optionally update already connected devices. ### void flush\_buffered\_events ( ) Sends all input events which are in the current buffer to the game loop. These events may have been buffered as a result of accumulated input ([use\_accumulated\_input](#class-input-property-use-accumulated-input)) or agile input flushing ([ProjectSettings.input\_devices/buffering/agile\_event\_flushing](class_projectsettings#class-projectsettings-property-input-devices-buffering-agile-event-flushing)). The engine will already do this itself at key execution points (at least once per frame). However, this can be useful in advanced cases where you want precise control over the timing of event handling. ### [Vector3](class_vector3#class-vector3) get\_accelerometer ( ) const Returns the acceleration of the device's accelerometer sensor, if the device has one. Otherwise, the method returns [Vector3.ZERO](class_vector3#class-vector3-constant-zero). Note this method returns an empty [Vector3](class_vector3#class-vector3) when running from the editor even when your device has an accelerometer. You must export your project to a supported device to read values from the accelerometer. **Note:** This method only works on iOS, Android, and UWP. On other platforms, it always returns [Vector3.ZERO](class_vector3#class-vector3-constant-zero). On Android the unit of measurement for each axis is m/s² while on iOS and UWP it's a multiple of the Earth's gravitational acceleration `g` (~9.81 m/s²). ### [float](class_float#class-float) get\_action\_raw\_strength ( [String](class_string#class-string) action, [bool](class_bool#class-bool) exact=false ) const Returns a value between 0 and 1 representing the raw intensity of the given action, ignoring the action's deadzone. In most cases, you should use [get\_action\_strength](#class-input-method-get-action-strength) instead. If `exact` is `false`, it ignores additional input modifiers for [InputEventKey](class_inputeventkey#class-inputeventkey) and [InputEventMouseButton](class_inputeventmousebutton#class-inputeventmousebutton) events, and the direction for [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion) events. ### [float](class_float#class-float) get\_action\_strength ( [String](class_string#class-string) action, [bool](class_bool#class-bool) exact=false ) const Returns a value between 0 and 1 representing the intensity of the given action. In a joypad, for example, the further away the axis (analog sticks or L2, R2 triggers) is from the dead zone, the closer the value will be to 1. If the action is mapped to a control that has no axis as the keyboard, the value returned will be 0 or 1. If `exact` is `false`, it ignores additional input modifiers for [InputEventKey](class_inputeventkey#class-inputeventkey) and [InputEventMouseButton](class_inputeventmousebutton#class-inputeventmousebutton) events, and the direction for [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion) events. ### [float](class_float#class-float) get\_axis ( [String](class_string#class-string) negative\_action, [String](class_string#class-string) positive\_action ) const Get axis input by specifying two actions, one negative and one positive. This is a shorthand for writing `Input.get_action_strength("positive_action") - Input.get_action_strength("negative_action")`. ### [Array](class_array#class-array) get\_connected\_joypads ( ) Returns an [Array](class_array#class-array) containing the device IDs of all currently connected joypads. ### [CursorShape](#enum-input-cursorshape) get\_current\_cursor\_shape ( ) const Returns the currently assigned cursor shape (see [CursorShape](#enum-input-cursorshape)). ### [Vector3](class_vector3#class-vector3) get\_gravity ( ) const Returns the gravity of the device's accelerometer sensor, if the device has one. Otherwise, the method returns [Vector3.ZERO](class_vector3#class-vector3-constant-zero). **Note:** This method only works on Android and iOS. On other platforms, it always returns [Vector3.ZERO](class_vector3#class-vector3-constant-zero). On Android the unit of measurement for each axis is m/s² while on iOS it's a multiple of the Earth's gravitational acceleration `g` (~9.81 m/s²). ### [Vector3](class_vector3#class-vector3) get\_gyroscope ( ) const Returns the rotation rate in rad/s around a device's X, Y, and Z axes of the gyroscope sensor, if the device has one. Otherwise, the method returns [Vector3.ZERO](class_vector3#class-vector3-constant-zero). **Note:** This method only works on Android and iOS. On other platforms, it always returns [Vector3.ZERO](class_vector3#class-vector3-constant-zero). ### [float](class_float#class-float) get\_joy\_axis ( [int](class_int#class-int) device, [int](class_int#class-int) axis ) const Returns the current value of the joypad axis at given index (see [JoystickList](class_%40globalscope#enum-globalscope-joysticklist)). ### [int](class_int#class-int) get\_joy\_axis\_index\_from\_string ( [String](class_string#class-string) axis ) Returns the index of the provided axis name. ### [String](class_string#class-string) get\_joy\_axis\_string ( [int](class_int#class-int) axis\_index ) Receives a [JoystickList](class_%40globalscope#enum-globalscope-joysticklist) axis and returns its equivalent name as a string. ### [int](class_int#class-int) get\_joy\_button\_index\_from\_string ( [String](class_string#class-string) button ) Returns the index of the provided button name. ### [String](class_string#class-string) get\_joy\_button\_string ( [int](class_int#class-int) button\_index ) Receives a gamepad button from [JoystickList](class_%40globalscope#enum-globalscope-joysticklist) and returns its equivalent name as a string. ### [String](class_string#class-string) get\_joy\_guid ( [int](class_int#class-int) device ) const Returns a SDL2-compatible device GUID on platforms that use gamepad remapping. Returns `"Default Gamepad"` otherwise. ### [String](class_string#class-string) get\_joy\_name ( [int](class_int#class-int) device ) Returns the name of the joypad at the specified device index. ### [float](class_float#class-float) get\_joy\_vibration\_duration ( [int](class_int#class-int) device ) Returns the duration of the current vibration effect in seconds. ### [Vector2](class_vector2#class-vector2) get\_joy\_vibration\_strength ( [int](class_int#class-int) device ) Returns the strength of the joypad vibration: x is the strength of the weak motor, and y is the strength of the strong motor. ### [Vector2](class_vector2#class-vector2) get\_last\_mouse\_speed ( ) const Returns the mouse speed for the last time the cursor was moved, and this until the next frame where the mouse moves. This means that even if the mouse is not moving, this function will still return the value of the last motion. ### [Vector3](class_vector3#class-vector3) get\_magnetometer ( ) const Returns the magnetic field strength in micro-Tesla for all axes of the device's magnetometer sensor, if the device has one. Otherwise, the method returns [Vector3.ZERO](class_vector3#class-vector3-constant-zero). **Note:** This method only works on Android, iOS and UWP. On other platforms, it always returns [Vector3.ZERO](class_vector3#class-vector3-constant-zero). ### [int](class_int#class-int) get\_mouse\_button\_mask ( ) const Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. ### [Vector2](class_vector2#class-vector2) get\_vector ( [String](class_string#class-string) negative\_x, [String](class_string#class-string) positive\_x, [String](class_string#class-string) negative\_y, [String](class_string#class-string) positive\_y, [float](class_float#class-float) deadzone=-1.0 ) const Gets an input vector by specifying four actions for the positive and negative X and Y axes. This method is useful when getting vector input, such as from a joystick, directional pad, arrows, or WASD. The vector has its length limited to 1 and has a circular deadzone, which is useful for using vector input as movement. By default, the deadzone is automatically calculated from the average of the action deadzones. However, you can override the deadzone to be whatever you want (on the range of 0 to 1). ### [bool](class_bool#class-bool) is\_action\_just\_pressed ( [String](class_string#class-string) action, [bool](class_bool#class-bool) exact=false ) const Returns `true` when the user starts pressing the action event, meaning it's `true` only on the frame that the user pressed down the button. This is useful for code that needs to run only once when an action is pressed, instead of every frame while it's pressed. If `exact` is `false`, it ignores additional input modifiers for [InputEventKey](class_inputeventkey#class-inputeventkey) and [InputEventMouseButton](class_inputeventmousebutton#class-inputeventmousebutton) events, and the direction for [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion) events. **Note:** Due to keyboard ghosting, [is\_action\_just\_pressed](#class-input-method-is-action-just-pressed) may return `false` even if one of the action's keys is pressed. See [Input examples](https://docs.godotengine.org/en/3.5/tutorials/inputs/input_examples.html#keyboard-events) in the documentation for more information. ### [bool](class_bool#class-bool) is\_action\_just\_released ( [String](class_string#class-string) action, [bool](class_bool#class-bool) exact=false ) const Returns `true` when the user stops pressing the action event, meaning it's `true` only on the frame that the user released the button. If `exact` is `false`, it ignores additional input modifiers for [InputEventKey](class_inputeventkey#class-inputeventkey) and [InputEventMouseButton](class_inputeventmousebutton#class-inputeventmousebutton) events, and the direction for [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion) events. ### [bool](class_bool#class-bool) is\_action\_pressed ( [String](class_string#class-string) action, [bool](class_bool#class-bool) exact=false ) const Returns `true` if you are pressing the action event. Note that if an action has multiple buttons assigned and more than one of them is pressed, releasing one button will release the action, even if some other button assigned to this action is still pressed. If `exact` is `false`, it ignores additional input modifiers for [InputEventKey](class_inputeventkey#class-inputeventkey) and [InputEventMouseButton](class_inputeventmousebutton#class-inputeventmousebutton) events, and the direction for [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion) events. **Note:** Due to keyboard ghosting, [is\_action\_pressed](#class-input-method-is-action-pressed) may return `false` even if one of the action's keys is pressed. See [Input examples](https://docs.godotengine.org/en/3.5/tutorials/inputs/input_examples.html#keyboard-events) in the documentation for more information. ### [bool](class_bool#class-bool) is\_joy\_button\_pressed ( [int](class_int#class-int) device, [int](class_int#class-int) button ) const Returns `true` if you are pressing the joypad button (see [JoystickList](class_%40globalscope#enum-globalscope-joysticklist)). ### [bool](class_bool#class-bool) is\_joy\_known ( [int](class_int#class-int) device ) Returns `true` if the system knows the specified device. This means that it sets all button and axis indices exactly as defined in [JoystickList](class_%40globalscope#enum-globalscope-joysticklist). Unknown joypads are not expected to match these constants, but you can still retrieve events from them. ### [bool](class_bool#class-bool) is\_key\_pressed ( [int](class_int#class-int) scancode ) const Returns `true` if you are pressing the key in the current keyboard layout. You can pass a [KeyList](class_%40globalscope#enum-globalscope-keylist) constant. [is\_key\_pressed](#class-input-method-is-key-pressed) is only recommended over [is\_physical\_key\_pressed](#class-input-method-is-physical-key-pressed) in non-game applications. This ensures that shortcut keys behave as expected depending on the user's keyboard layout, as keyboard shortcuts are generally dependent on the keyboard layout in non-game applications. If in doubt, use [is\_physical\_key\_pressed](#class-input-method-is-physical-key-pressed). **Note:** Due to keyboard ghosting, [is\_key\_pressed](#class-input-method-is-key-pressed) may return `false` even if one of the action's keys is pressed. See [Input examples](https://docs.godotengine.org/en/3.5/tutorials/inputs/input_examples.html#keyboard-events) in the documentation for more information. ### [bool](class_bool#class-bool) is\_mouse\_button\_pressed ( [int](class_int#class-int) button ) const Returns `true` if you are pressing the mouse button specified with [ButtonList](class_%40globalscope#enum-globalscope-buttonlist). ### [bool](class_bool#class-bool) is\_physical\_key\_pressed ( [int](class_int#class-int) scancode ) const Returns `true` if you are pressing the key in the physical location on the 101/102-key US QWERTY keyboard. You can pass a [KeyList](class_%40globalscope#enum-globalscope-keylist) constant. [is\_physical\_key\_pressed](#class-input-method-is-physical-key-pressed) is recommended over [is\_key\_pressed](#class-input-method-is-key-pressed) for in-game actions, as it will make W/A/S/D layouts work regardless of the user's keyboard layout. [is\_physical\_key\_pressed](#class-input-method-is-physical-key-pressed) will also ensure that the top row number keys work on any keyboard layout. If in doubt, use [is\_physical\_key\_pressed](#class-input-method-is-physical-key-pressed). **Note:** Due to keyboard ghosting, [is\_physical\_key\_pressed](#class-input-method-is-physical-key-pressed) may return `false` even if one of the action's keys is pressed. See [Input examples](https://docs.godotengine.org/en/3.5/tutorials/inputs/input_examples.html#keyboard-events) in the documentation for more information. ### void joy\_connection\_changed ( [int](class_int#class-int) device, [bool](class_bool#class-bool) connected, [String](class_string#class-string) name, [String](class_string#class-string) guid ) Notifies the `Input` singleton that a connection has changed, to update the state for the `device` index. This is used internally and should not have to be called from user scripts. See [joy\_connection\_changed](#class-input-signal-joy-connection-changed) for the signal emitted when this is triggered internally. ### void parse\_input\_event ( [InputEvent](class_inputevent#class-inputevent) event ) Feeds an [InputEvent](class_inputevent#class-inputevent) to the game. Can be used to artificially trigger input events from code. Also generates [Node.\_input](class_node#class-node-method-input) calls. Example: ``` var a = InputEventAction.new() a.action = "ui_cancel" a.pressed = true Input.parse_input_event(a) ``` ### void remove\_joy\_mapping ( [String](class_string#class-string) guid ) Removes all mappings from the internal database that match the given GUID. ### void set\_accelerometer ( [Vector3](class_vector3#class-vector3) value ) Sets the acceleration value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. ### void set\_custom\_mouse\_cursor ( [Resource](class_resource#class-resource) image, [CursorShape](#enum-input-cursorshape) shape=0, [Vector2](class_vector2#class-vector2) hotspot=Vector2( 0, 0 ) ) Sets a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. Passing `null` to the image parameter resets to the system cursor. See [CursorShape](#enum-input-cursorshape) for the list of shapes. `image`'s size must be lower than 256×256. `hotspot` must be within `image`'s size. **Note:** [AnimatedTexture](class_animatedtexture#class-animatedtexture)s aren't supported as custom mouse cursors. If using an [AnimatedTexture](class_animatedtexture#class-animatedtexture), only the first frame will be displayed. **Note:** Only images imported with the **Lossless**, **Lossy** or **Uncompressed** compression modes are supported. The **Video RAM** compression mode can't be used for custom cursors. ### void set\_default\_cursor\_shape ( [CursorShape](#enum-input-cursorshape) shape=0 ) Sets the default cursor shape to be used in the viewport instead of [CURSOR\_ARROW](#class-input-constant-cursor-arrow). **Note:** If you want to change the default cursor shape for [Control](class_control#class-control)'s nodes, use [Control.mouse\_default\_cursor\_shape](class_control#class-control-property-mouse-default-cursor-shape) instead. **Note:** This method generates an [InputEventMouseMotion](class_inputeventmousemotion#class-inputeventmousemotion) to update cursor immediately. ### void set\_gravity ( [Vector3](class_vector3#class-vector3) value ) Sets the gravity value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. ### void set\_gyroscope ( [Vector3](class_vector3#class-vector3) value ) Sets the value of the rotation rate of the gyroscope sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. ### void set\_magnetometer ( [Vector3](class_vector3#class-vector3) value ) Sets the value of the magnetic field of the magnetometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. ### void start\_joy\_vibration ( [int](class_int#class-int) device, [float](class_float#class-float) weak\_magnitude, [float](class_float#class-float) strong\_magnitude, [float](class_float#class-float) duration=0 ) Starts to vibrate the joypad. Joypads usually come with two rumble motors, a strong and a weak one. `weak_magnitude` is the strength of the weak motor (between 0 and 1) and `strong_magnitude` is the strength of the strong motor (between 0 and 1). `duration` is the duration of the effect in seconds (a duration of 0 will try to play the vibration indefinitely). **Note:** Not every hardware is compatible with long effect durations; it is recommended to restart an effect if it has to be played for more than a few seconds. ### void stop\_joy\_vibration ( [int](class_int#class-int) device ) Stops the vibration of the joypad. ### void vibrate\_handheld ( [int](class_int#class-int) duration\_ms=500 ) Vibrate handheld devices. **Note:** This method is implemented on Android, iOS, and HTML5. **Note:** For Android, it requires enabling the `VIBRATE` permission in the export preset. **Note:** For iOS, specifying the duration is supported in iOS 13 and later. **Note:** Some web browsers such as Safari and Firefox for Android do not support this method. ### void warp\_mouse\_position ( [Vector2](class_vector2#class-vector2) to ) Sets the mouse position to the specified vector, provided in pixels and relative to an origin at the upper left corner of the game window. Mouse position is clipped to the limits of the screen resolution, or to the limits of the game window if [MouseMode](#enum-input-mousemode) is set to [MOUSE\_MODE\_CONFINED](#class-input-constant-mouse-mode-confined).
programming_docs
godot ToolButton ToolButton ========== **Inherits:** [Button](class_button#class-button) **<** [BaseButton](class_basebutton#class-basebutton) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Flat button helper class. Description ----------- This is a helper class to generate a flat [Button](class_button#class-button) (see [Button.flat](class_button#class-button-property-flat)), creating a `ToolButton` is equivalent to: ``` var btn = Button.new() btn.flat = true ``` Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | flat | `true` (overrides [Button](class_button#class-button-property-flat)) | Theme Properties ---------------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [font\_color](#class-toolbutton-theme-color-font-color) | `Color( 0.88, 0.88, 0.88, 1 )` | | [Color](class_color#class-color) | [font\_color\_disabled](#class-toolbutton-theme-color-font-color-disabled) | `Color( 0.9, 0.95, 1, 0.3 )` | | [Color](class_color#class-color) | [font\_color\_focus](#class-toolbutton-theme-color-font-color-focus) | `Color( 0.94, 0.94, 0.94, 1 )` | | [Color](class_color#class-color) | [font\_color\_hover](#class-toolbutton-theme-color-font-color-hover) | `Color( 0.94, 0.94, 0.94, 1 )` | | [Color](class_color#class-color) | [font\_color\_pressed](#class-toolbutton-theme-color-font-color-pressed) | `Color( 1, 1, 1, 1 )` | | [int](class_int#class-int) | [hseparation](#class-toolbutton-theme-constant-hseparation) | `3` | | [Font](class_font#class-font) | [font](#class-toolbutton-theme-font-font) | | | [StyleBox](class_stylebox#class-stylebox) | [disabled](#class-toolbutton-theme-style-disabled) | | | [StyleBox](class_stylebox#class-stylebox) | [focus](#class-toolbutton-theme-style-focus) | | | [StyleBox](class_stylebox#class-stylebox) | [hover](#class-toolbutton-theme-style-hover) | | | [StyleBox](class_stylebox#class-stylebox) | [normal](#class-toolbutton-theme-style-normal) | | | [StyleBox](class_stylebox#class-stylebox) | [pressed](#class-toolbutton-theme-style-pressed) | | Theme Property Descriptions --------------------------- ### [Color](class_color#class-color) font\_color | | | | --- | --- | | *Default* | `Color( 0.88, 0.88, 0.88, 1 )` | Default text [Color](class_color#class-color) of the `ToolButton`. ### [Color](class_color#class-color) font\_color\_disabled | | | | --- | --- | | *Default* | `Color( 0.9, 0.95, 1, 0.3 )` | Text [Color](class_color#class-color) used when the `ToolButton` is disabled. ### [Color](class_color#class-color) font\_color\_focus | | | | --- | --- | | *Default* | `Color( 0.94, 0.94, 0.94, 1 )` | Text [Color](class_color#class-color) used when the `ToolButton` is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color. ### [Color](class_color#class-color) font\_color\_hover | | | | --- | --- | | *Default* | `Color( 0.94, 0.94, 0.94, 1 )` | Text [Color](class_color#class-color) used when the `ToolButton` is being hovered. ### [Color](class_color#class-color) font\_color\_pressed | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | Text [Color](class_color#class-color) used when the `ToolButton` is being pressed. ### [int](class_int#class-int) hseparation | | | | --- | --- | | *Default* | `3` | The horizontal space between `ToolButton`'s icon and text. ### [Font](class_font#class-font) font [Font](class_font#class-font) of the `ToolButton`'s text. ### [StyleBox](class_stylebox#class-stylebox) disabled [StyleBox](class_stylebox#class-stylebox) used when the `ToolButton` is disabled. ### [StyleBox](class_stylebox#class-stylebox) focus [StyleBox](class_stylebox#class-stylebox) used when the `ToolButton` is focused. It is displayed over the current [StyleBox](class_stylebox#class-stylebox), so using [StyleBoxEmpty](class_styleboxempty#class-styleboxempty) will just disable the focus visual effect. ### [StyleBox](class_stylebox#class-stylebox) hover [StyleBox](class_stylebox#class-stylebox) used when the `ToolButton` is being hovered. ### [StyleBox](class_stylebox#class-stylebox) normal Default [StyleBox](class_stylebox#class-stylebox) for the `ToolButton`. ### [StyleBox](class_stylebox#class-stylebox) pressed [StyleBox](class_stylebox#class-stylebox) used when the `ToolButton` is being pressed. godot VisualScriptEditor VisualScriptEditor ================== **Inherits:** [Object](class_object#class-object) Methods ------- | | | | --- | --- | | void | [add\_custom\_node](#class-visualscripteditor-method-add-custom-node) **(** [String](class_string#class-string) name, [String](class_string#class-string) category, [Script](class_script#class-script) script **)** | | void | [remove\_custom\_node](#class-visualscripteditor-method-remove-custom-node) **(** [String](class_string#class-string) name, [String](class_string#class-string) category **)** | Signals ------- ### custom\_nodes\_updated ( ) Emitted when a custom Visual Script node is added or removed. Method Descriptions ------------------- ### void add\_custom\_node ( [String](class_string#class-string) name, [String](class_string#class-string) category, [Script](class_script#class-script) script ) Add a custom Visual Script node to the editor. It'll be placed under "Custom Nodes" with the `category` as the parameter. ### void remove\_custom\_node ( [String](class_string#class-string) name, [String](class_string#class-string) category ) Remove a custom Visual Script node from the editor. Custom nodes already placed on scripts won't be removed. godot InputEventScreenDrag InputEventScreenDrag ==================== **Inherits:** [InputEvent](class_inputevent#class-inputevent) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Input event type for screen drag events. Only available on mobile devices. Description ----------- Contains screen drag information. See [Node.\_input](class_node#class-node-method-input). Tutorials --------- * [Using InputEvent](https://docs.godotengine.org/en/3.5/tutorials/inputs/inputevent.html) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [index](#class-inputeventscreendrag-property-index) | `0` | | [Vector2](class_vector2#class-vector2) | [position](#class-inputeventscreendrag-property-position) | `Vector2( 0, 0 )` | | [Vector2](class_vector2#class-vector2) | [relative](#class-inputeventscreendrag-property-relative) | `Vector2( 0, 0 )` | | [Vector2](class_vector2#class-vector2) | [speed](#class-inputeventscreendrag-property-speed) | `Vector2( 0, 0 )` | Property Descriptions --------------------- ### [int](class_int#class-int) index | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_index(value) | | *Getter* | get\_index() | The drag event index in the case of a multi-drag event. ### [Vector2](class_vector2#class-vector2) position | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_position(value) | | *Getter* | get\_position() | The drag position. ### [Vector2](class_vector2#class-vector2) relative | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_relative(value) | | *Getter* | get\_relative() | The drag position relative to the previous position (position at the last frame). ### [Vector2](class_vector2#class-vector2) speed | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_speed(value) | | *Getter* | get\_speed() | The drag speed. godot VideoStream VideoStream =========== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [VideoStreamGDNative](class_videostreamgdnative#class-videostreamgdnative), [VideoStreamTheora](class_videostreamtheora#class-videostreamtheora), [VideoStreamWebm](class_videostreamwebm#class-videostreamwebm) Base resource for video streams. Description ----------- Base resource type for all video streams. Classes that derive from `VideoStream` can all be used as resource types to play back videos in [VideoPlayer](class_videoplayer#class-videoplayer). godot FileSystemDock FileSystemDock ============== **Inherits:** [VBoxContainer](class_vboxcontainer#class-vboxcontainer) **<** [BoxContainer](class_boxcontainer#class-boxcontainer) **<** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [can\_drop\_data\_fw](#class-filesystemdock-method-can-drop-data-fw) **(** [Vector2](class_vector2#class-vector2) point, [Variant](class_variant#class-variant) data, [Control](class_control#class-control) from **)** const | | void | [drop\_data\_fw](#class-filesystemdock-method-drop-data-fw) **(** [Vector2](class_vector2#class-vector2) point, [Variant](class_variant#class-variant) data, [Control](class_control#class-control) from **)** | | [Variant](class_variant#class-variant) | [get\_drag\_data\_fw](#class-filesystemdock-method-get-drag-data-fw) **(** [Vector2](class_vector2#class-vector2) point, [Control](class_control#class-control) from **)** | | void | [navigate\_to\_path](#class-filesystemdock-method-navigate-to-path) **(** [String](class_string#class-string) path **)** | Signals ------- ### display\_mode\_changed ( ) ### file\_removed ( [String](class_string#class-string) file ) ### files\_moved ( [String](class_string#class-string) old\_file, [String](class_string#class-string) new\_file ) ### folder\_moved ( [String](class_string#class-string) old\_folder, [String](class_string#class-string) new\_file ) ### folder\_removed ( [String](class_string#class-string) folder ) ### inherit ( [String](class_string#class-string) file ) ### instance ( [PoolStringArray](class_poolstringarray#class-poolstringarray) files ) Method Descriptions ------------------- ### [bool](class_bool#class-bool) can\_drop\_data\_fw ( [Vector2](class_vector2#class-vector2) point, [Variant](class_variant#class-variant) data, [Control](class_control#class-control) from ) const ### void drop\_data\_fw ( [Vector2](class_vector2#class-vector2) point, [Variant](class_variant#class-variant) data, [Control](class_control#class-control) from ) ### [Variant](class_variant#class-variant) get\_drag\_data\_fw ( [Vector2](class_vector2#class-vector2) point, [Control](class_control#class-control) from ) ### void navigate\_to\_path ( [String](class_string#class-string) path ) godot Slider Slider ====== **Inherits:** [Range](class_range#class-range) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [HSlider](class_hslider#class-hslider), [VSlider](class_vslider#class-vslider) Base class for GUI sliders. Description ----------- Base class for GUI sliders. **Note:** The [Range.changed](class_range#class-range-signal-changed) and [Range.value\_changed](class_range#class-range-signal-value-changed) signals are part of the [Range](class_range#class-range) class which this class inherits from. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [editable](#class-slider-property-editable) | `true` | | [FocusMode](class_control#enum-control-focusmode) | focus\_mode | `2` (overrides [Control](class_control#class-control-property-focus-mode)) | | [bool](class_bool#class-bool) | [scrollable](#class-slider-property-scrollable) | `true` | | [int](class_int#class-int) | size\_flags\_vertical | `0` (overrides [Control](class_control#class-control-property-size-flags-vertical)) | | [int](class_int#class-int) | [tick\_count](#class-slider-property-tick-count) | `0` | | [bool](class_bool#class-bool) | [ticks\_on\_borders](#class-slider-property-ticks-on-borders) | `false` | Signals ------- ### drag\_ended ( [bool](class_bool#class-bool) value\_changed ) Emitted when dragging stops. If `value_changed` is true, [Range.value](class_range#class-range-property-value) is different from the value when you started the dragging. ### drag\_started ( ) Emitted when dragging is started. Property Descriptions --------------------- ### [bool](class_bool#class-bool) editable | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_editable(value) | | *Getter* | is\_editable() | If `true`, the slider can be interacted with. If `false`, the value can be changed only by code. ### [bool](class_bool#class-bool) scrollable | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_scrollable(value) | | *Getter* | is\_scrollable() | If `true`, the value can be changed using the mouse wheel. ### [int](class_int#class-int) tick\_count | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_ticks(value) | | *Getter* | get\_ticks() | Number of ticks displayed on the slider, including border ticks. Ticks are uniformly-distributed value markers. ### [bool](class_bool#class-bool) ticks\_on\_borders | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_ticks\_on\_borders(value) | | *Getter* | get\_ticks\_on\_borders() | If `true`, the slider will display ticks for minimum and maximum values. godot Skeleton Skeleton ======== **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Skeleton for characters and animated objects. Description ----------- Skeleton provides a hierarchical interface for managing bones, including pose, rest and animation (see [Animation](class_animation#class-animation)). It can also use ragdoll physics. The overall transform of a bone with respect to the skeleton is determined by the following hierarchical order: rest pose, custom pose and pose. Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it not the actual global/world transform of the bone. Tutorials --------- * [3D Inverse Kinematics Demo](https://godotengine.org/asset-library/asset/523) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) Methods ------- | | | | --- | --- | | void | [add\_bone](#class-skeleton-method-add-bone) **(** [String](class_string#class-string) name **)** | | void | [bind\_child\_node\_to\_bone](#class-skeleton-method-bind-child-node-to-bone) **(** [int](class_int#class-int) bone\_idx, [Node](class_node#class-node) node **)** | | void | [clear\_bones](#class-skeleton-method-clear-bones) **(** **)** | | void | [clear\_bones\_global\_pose\_override](#class-skeleton-method-clear-bones-global-pose-override) **(** **)** | | [int](class_int#class-int) | [find\_bone](#class-skeleton-method-find-bone) **(** [String](class_string#class-string) name **)** const | | [int](class_int#class-int) | [get\_bone\_count](#class-skeleton-method-get-bone-count) **(** **)** const | | [Transform](class_transform#class-transform) | [get\_bone\_custom\_pose](#class-skeleton-method-get-bone-custom-pose) **(** [int](class_int#class-int) bone\_idx **)** const | | [Transform](class_transform#class-transform) | [get\_bone\_global\_pose](#class-skeleton-method-get-bone-global-pose) **(** [int](class_int#class-int) bone\_idx **)** const | | [Transform](class_transform#class-transform) | [get\_bone\_global\_pose\_no\_override](#class-skeleton-method-get-bone-global-pose-no-override) **(** [int](class_int#class-int) bone\_idx **)** const | | [String](class_string#class-string) | [get\_bone\_name](#class-skeleton-method-get-bone-name) **(** [int](class_int#class-int) bone\_idx **)** const | | [int](class_int#class-int) | [get\_bone\_parent](#class-skeleton-method-get-bone-parent) **(** [int](class_int#class-int) bone\_idx **)** const | | [Transform](class_transform#class-transform) | [get\_bone\_pose](#class-skeleton-method-get-bone-pose) **(** [int](class_int#class-int) bone\_idx **)** const | | [Transform](class_transform#class-transform) | [get\_bone\_rest](#class-skeleton-method-get-bone-rest) **(** [int](class_int#class-int) bone\_idx **)** const | | [Array](class_array#class-array) | [get\_bound\_child\_nodes\_to\_bone](#class-skeleton-method-get-bound-child-nodes-to-bone) **(** [int](class_int#class-int) bone\_idx **)** const | | [bool](class_bool#class-bool) | [is\_bone\_rest\_disabled](#class-skeleton-method-is-bone-rest-disabled) **(** [int](class_int#class-int) bone\_idx **)** const | | void | [localize\_rests](#class-skeleton-method-localize-rests) **(** **)** | | void | [physical\_bones\_add\_collision\_exception](#class-skeleton-method-physical-bones-add-collision-exception) **(** [RID](class_rid#class-rid) exception **)** | | void | [physical\_bones\_remove\_collision\_exception](#class-skeleton-method-physical-bones-remove-collision-exception) **(** [RID](class_rid#class-rid) exception **)** | | void | [physical\_bones\_start\_simulation](#class-skeleton-method-physical-bones-start-simulation) **(** [Array](class_array#class-array) bones=[ ] **)** | | void | [physical\_bones\_stop\_simulation](#class-skeleton-method-physical-bones-stop-simulation) **(** **)** | | [SkinReference](class_skinreference#class-skinreference) | [register\_skin](#class-skeleton-method-register-skin) **(** [Skin](class_skin#class-skin) skin **)** | | void | [set\_bone\_custom\_pose](#class-skeleton-method-set-bone-custom-pose) **(** [int](class_int#class-int) bone\_idx, [Transform](class_transform#class-transform) custom\_pose **)** | | void | [set\_bone\_disable\_rest](#class-skeleton-method-set-bone-disable-rest) **(** [int](class_int#class-int) bone\_idx, [bool](class_bool#class-bool) disable **)** | | void | [set\_bone\_global\_pose\_override](#class-skeleton-method-set-bone-global-pose-override) **(** [int](class_int#class-int) bone\_idx, [Transform](class_transform#class-transform) pose, [float](class_float#class-float) amount, [bool](class_bool#class-bool) persistent=false **)** | | void | [set\_bone\_name](#class-skeleton-method-set-bone-name) **(** [int](class_int#class-int) bone\_idx, [String](class_string#class-string) name **)** | | void | [set\_bone\_parent](#class-skeleton-method-set-bone-parent) **(** [int](class_int#class-int) bone\_idx, [int](class_int#class-int) parent\_idx **)** | | void | [set\_bone\_pose](#class-skeleton-method-set-bone-pose) **(** [int](class_int#class-int) bone\_idx, [Transform](class_transform#class-transform) pose **)** | | void | [set\_bone\_rest](#class-skeleton-method-set-bone-rest) **(** [int](class_int#class-int) bone\_idx, [Transform](class_transform#class-transform) rest **)** | | void | [unbind\_child\_node\_from\_bone](#class-skeleton-method-unbind-child-node-from-bone) **(** [int](class_int#class-int) bone\_idx, [Node](class_node#class-node) node **)** | | void | [unparent\_bone\_and\_rest](#class-skeleton-method-unparent-bone-and-rest) **(** [int](class_int#class-int) bone\_idx **)** | Signals ------- ### skeleton\_updated ( ) Constants --------- ### NOTIFICATION\_UPDATE\_SKELETON = 50 Method Descriptions ------------------- ### void add\_bone ( [String](class_string#class-string) name ) Adds a bone, with name `name`. [get\_bone\_count](#class-skeleton-method-get-bone-count) will become the bone index. ### void bind\_child\_node\_to\_bone ( [int](class_int#class-int) bone\_idx, [Node](class_node#class-node) node ) *Deprecated soon.* ### void clear\_bones ( ) Clear all the bones in this skeleton. ### void clear\_bones\_global\_pose\_override ( ) ### [int](class_int#class-int) find\_bone ( [String](class_string#class-string) name ) const Returns the bone index that matches `name` as its name. ### [int](class_int#class-int) get\_bone\_count ( ) const Returns the amount of bones in the skeleton. ### [Transform](class_transform#class-transform) get\_bone\_custom\_pose ( [int](class_int#class-int) bone\_idx ) const Returns the custom pose of the specified bone. Custom pose is applied on top of the rest pose. ### [Transform](class_transform#class-transform) get\_bone\_global\_pose ( [int](class_int#class-int) bone\_idx ) const Returns the overall transform of the specified bone, with respect to the skeleton. Being relative to the skeleton frame, this is not the actual "global" transform of the bone. ### [Transform](class_transform#class-transform) get\_bone\_global\_pose\_no\_override ( [int](class_int#class-int) bone\_idx ) const Returns the overall transform of the specified bone, with respect to the skeleton, but without any global pose overrides. Being relative to the skeleton frame, this is not the actual "global" transform of the bone. ### [String](class_string#class-string) get\_bone\_name ( [int](class_int#class-int) bone\_idx ) const Returns the name of the bone at index `index`. ### [int](class_int#class-int) get\_bone\_parent ( [int](class_int#class-int) bone\_idx ) const Returns the bone index which is the parent of the bone at `bone_idx`. If -1, then bone has no parent. **Note:** The parent bone returned will always be less than `bone_idx`. ### [Transform](class_transform#class-transform) get\_bone\_pose ( [int](class_int#class-int) bone\_idx ) const Returns the pose transform of the specified bone. Pose is applied on top of the custom pose, which is applied on top the rest pose. ### [Transform](class_transform#class-transform) get\_bone\_rest ( [int](class_int#class-int) bone\_idx ) const Returns the rest transform for a bone `bone_idx`. ### [Array](class_array#class-array) get\_bound\_child\_nodes\_to\_bone ( [int](class_int#class-int) bone\_idx ) const *Deprecated soon.* ### [bool](class_bool#class-bool) is\_bone\_rest\_disabled ( [int](class_int#class-int) bone\_idx ) const ### void localize\_rests ( ) ### void physical\_bones\_add\_collision\_exception ( [RID](class_rid#class-rid) exception ) ### void physical\_bones\_remove\_collision\_exception ( [RID](class_rid#class-rid) exception ) ### void physical\_bones\_start\_simulation ( [Array](class_array#class-array) bones=[ ] ) ### void physical\_bones\_stop\_simulation ( ) ### [SkinReference](class_skinreference#class-skinreference) register\_skin ( [Skin](class_skin#class-skin) skin ) ### void set\_bone\_custom\_pose ( [int](class_int#class-int) bone\_idx, [Transform](class_transform#class-transform) custom\_pose ) ### void set\_bone\_disable\_rest ( [int](class_int#class-int) bone\_idx, [bool](class_bool#class-bool) disable ) ### void set\_bone\_global\_pose\_override ( [int](class_int#class-int) bone\_idx, [Transform](class_transform#class-transform) pose, [float](class_float#class-float) amount, [bool](class_bool#class-bool) persistent=false ) ### void set\_bone\_name ( [int](class_int#class-int) bone\_idx, [String](class_string#class-string) name ) ### void set\_bone\_parent ( [int](class_int#class-int) bone\_idx, [int](class_int#class-int) parent\_idx ) Sets the bone index `parent_idx` as the parent of the bone at `bone_idx`. If -1, then bone has no parent. **Note:** `parent_idx` must be less than `bone_idx`. ### void set\_bone\_pose ( [int](class_int#class-int) bone\_idx, [Transform](class_transform#class-transform) pose ) Sets the pose transform for bone `bone_idx`. ### void set\_bone\_rest ( [int](class_int#class-int) bone\_idx, [Transform](class_transform#class-transform) rest ) Sets the rest transform for bone `bone_idx`. ### void unbind\_child\_node\_from\_bone ( [int](class_int#class-int) bone\_idx, [Node](class_node#class-node) node ) *Deprecated soon.* ### void unparent\_bone\_and\_rest ( [int](class_int#class-int) bone\_idx )
programming_docs
godot CanvasModulate CanvasModulate ============== **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Tint the entire canvas. Description ----------- `CanvasModulate` tints the canvas elements using its assigned [color](#class-canvasmodulate-property-color). Properties ---------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [color](#class-canvasmodulate-property-color) | `Color( 1, 1, 1, 1 )` | Property Descriptions --------------------- ### [Color](class_color#class-color) color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_color(value) | | *Getter* | get\_color() | The tint color to apply. godot Range Range ===== **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [EditorSpinSlider](class_editorspinslider#class-editorspinslider), [ProgressBar](class_progressbar#class-progressbar), [ScrollBar](class_scrollbar#class-scrollbar), [Slider](class_slider#class-slider), [SpinBox](class_spinbox#class-spinbox), [TextureProgress](class_textureprogress#class-textureprogress) Abstract base class for range-based controls. Description ----------- Range is a base class for [Control](class_control#class-control) nodes that change a floating-point [value](#class-range-property-value) between a [min\_value](#class-range-property-min-value) and [max\_value](#class-range-property-max-value), using a configured [step](#class-range-property-step) and [page](#class-range-property-page) size. See e.g. [ScrollBar](class_scrollbar#class-scrollbar) and [Slider](class_slider#class-slider) for examples of higher level nodes using Range. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [allow\_greater](#class-range-property-allow-greater) | `false` | | [bool](class_bool#class-bool) | [allow\_lesser](#class-range-property-allow-lesser) | `false` | | [bool](class_bool#class-bool) | [exp\_edit](#class-range-property-exp-edit) | `false` | | [float](class_float#class-float) | [max\_value](#class-range-property-max-value) | `100.0` | | [float](class_float#class-float) | [min\_value](#class-range-property-min-value) | `0.0` | | [float](class_float#class-float) | [page](#class-range-property-page) | `0.0` | | [float](class_float#class-float) | [ratio](#class-range-property-ratio) | | | [bool](class_bool#class-bool) | [rounded](#class-range-property-rounded) | `false` | | [float](class_float#class-float) | [step](#class-range-property-step) | `1.0` | | [float](class_float#class-float) | [value](#class-range-property-value) | `0.0` | Methods ------- | | | | --- | --- | | void | [share](#class-range-method-share) **(** [Node](class_node#class-node) with **)** | | void | [unshare](#class-range-method-unshare) **(** **)** | Signals ------- ### changed ( ) Emitted when [min\_value](#class-range-property-min-value), [max\_value](#class-range-property-max-value), [page](#class-range-property-page), or [step](#class-range-property-step) change. ### value\_changed ( [float](class_float#class-float) value ) Emitted when [value](#class-range-property-value) changes. When used on a [Slider](class_slider#class-slider), this is called continuously while dragging (potentially every frame). If you are performing an expensive operation in a function connected to [value\_changed](#class-range-signal-value-changed), consider using a *debouncing* [Timer](class_timer#class-timer) to call the function less often. **Note:** Unlike signals such as [LineEdit.text\_changed](class_lineedit#class-lineedit-signal-text-changed), [value\_changed](#class-range-signal-value-changed) is also emitted when `value` is set directly via code. Property Descriptions --------------------- ### [bool](class_bool#class-bool) allow\_greater | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_allow\_greater(value) | | *Getter* | is\_greater\_allowed() | If `true`, [value](#class-range-property-value) may be greater than [max\_value](#class-range-property-max-value). ### [bool](class_bool#class-bool) allow\_lesser | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_allow\_lesser(value) | | *Getter* | is\_lesser\_allowed() | If `true`, [value](#class-range-property-value) may be less than [min\_value](#class-range-property-min-value). ### [bool](class_bool#class-bool) exp\_edit | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_exp\_ratio(value) | | *Getter* | is\_ratio\_exp() | If `true`, and `min_value` is greater than 0, `value` will be represented exponentially rather than linearly. ### [float](class_float#class-float) max\_value | | | | --- | --- | | *Default* | `100.0` | | *Setter* | set\_max(value) | | *Getter* | get\_max() | Maximum value. Range is clamped if `value` is greater than `max_value`. ### [float](class_float#class-float) min\_value | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_min(value) | | *Getter* | get\_min() | Minimum value. Range is clamped if `value` is less than `min_value`. ### [float](class_float#class-float) page | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_page(value) | | *Getter* | get\_page() | Page size. Used mainly for [ScrollBar](class_scrollbar#class-scrollbar). ScrollBar's length is its size multiplied by `page` over the difference between `min_value` and `max_value`. ### [float](class_float#class-float) ratio | | | | --- | --- | | *Setter* | set\_as\_ratio(value) | | *Getter* | get\_as\_ratio() | The value mapped between 0 and 1. ### [bool](class_bool#class-bool) rounded | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_rounded\_values(value) | | *Getter* | is\_using\_rounded\_values() | If `true`, `value` will always be rounded to the nearest integer. ### [float](class_float#class-float) step | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_step(value) | | *Getter* | get\_step() | If greater than 0, `value` will always be rounded to a multiple of `step`. If `rounded` is also `true`, `value` will first be rounded to a multiple of `step` then rounded to the nearest integer. ### [float](class_float#class-float) value | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_value(value) | | *Getter* | get\_value() | Range's current value. Method Descriptions ------------------- ### void share ( [Node](class_node#class-node) with ) Binds two `Range`s together along with any ranges previously grouped with either of them. When any of range's member variables change, it will share the new value with all other ranges in its group. ### void unshare ( ) Stops the `Range` from sharing its member variables with any other. godot TextEdit TextEdit ======== **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Multiline text editing control. Description ----------- TextEdit is meant for editing large, multiline text. It also has facilities for editing code, such as syntax highlighting support and multiple levels of undo/redo. **Note:** When holding down `Alt`, the vertical scroll wheel will scroll 5 times as fast as it would normally do. This also works in the Godot script editor. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [bookmark\_gutter](#class-textedit-property-bookmark-gutter) | `false` | | [bool](class_bool#class-bool) | [breakpoint\_gutter](#class-textedit-property-breakpoint-gutter) | `false` | | [bool](class_bool#class-bool) | [caret\_blink](#class-textedit-property-caret-blink) | `false` | | [float](class_float#class-float) | [caret\_blink\_speed](#class-textedit-property-caret-blink-speed) | `0.65` | | [bool](class_bool#class-bool) | [caret\_block\_mode](#class-textedit-property-caret-block-mode) | `false` | | [bool](class_bool#class-bool) | [caret\_moving\_by\_right\_click](#class-textedit-property-caret-moving-by-right-click) | `true` | | [bool](class_bool#class-bool) | [context\_menu\_enabled](#class-textedit-property-context-menu-enabled) | `true` | | [bool](class_bool#class-bool) | [deselect\_on\_focus\_loss\_enabled](#class-textedit-property-deselect-on-focus-loss-enabled) | `true` | | [bool](class_bool#class-bool) | [drag\_and\_drop\_selection\_enabled](#class-textedit-property-drag-and-drop-selection-enabled) | `true` | | [bool](class_bool#class-bool) | [draw\_spaces](#class-textedit-property-draw-spaces) | `false` | | [bool](class_bool#class-bool) | [draw\_tabs](#class-textedit-property-draw-tabs) | `false` | | [FocusMode](class_control#enum-control-focusmode) | focus\_mode | `2` (overrides [Control](class_control#class-control-property-focus-mode)) | | [bool](class_bool#class-bool) | [fold\_gutter](#class-textedit-property-fold-gutter) | `false` | | [bool](class_bool#class-bool) | [hiding\_enabled](#class-textedit-property-hiding-enabled) | `false` | | [bool](class_bool#class-bool) | [highlight\_all\_occurrences](#class-textedit-property-highlight-all-occurrences) | `false` | | [bool](class_bool#class-bool) | [highlight\_current\_line](#class-textedit-property-highlight-current-line) | `false` | | [bool](class_bool#class-bool) | [middle\_mouse\_paste\_enabled](#class-textedit-property-middle-mouse-paste-enabled) | `true` | | [bool](class_bool#class-bool) | [minimap\_draw](#class-textedit-property-minimap-draw) | `false` | | [int](class_int#class-int) | [minimap\_width](#class-textedit-property-minimap-width) | `80` | | [CursorShape](class_control#enum-control-cursorshape) | mouse\_default\_cursor\_shape | `1` (overrides [Control](class_control#class-control-property-mouse-default-cursor-shape)) | | [bool](class_bool#class-bool) | [override\_selected\_font\_color](#class-textedit-property-override-selected-font-color) | `false` | | [bool](class_bool#class-bool) | [readonly](#class-textedit-property-readonly) | `false` | | [int](class_int#class-int) | [scroll\_horizontal](#class-textedit-property-scroll-horizontal) | `0` | | [float](class_float#class-float) | [scroll\_vertical](#class-textedit-property-scroll-vertical) | `0.0` | | [bool](class_bool#class-bool) | [selecting\_enabled](#class-textedit-property-selecting-enabled) | `true` | | [bool](class_bool#class-bool) | [shortcut\_keys\_enabled](#class-textedit-property-shortcut-keys-enabled) | `true` | | [bool](class_bool#class-bool) | [show\_line\_numbers](#class-textedit-property-show-line-numbers) | `false` | | [bool](class_bool#class-bool) | [smooth\_scrolling](#class-textedit-property-smooth-scrolling) | `false` | | [bool](class_bool#class-bool) | [syntax\_highlighting](#class-textedit-property-syntax-highlighting) | `false` | | [String](class_string#class-string) | [text](#class-textedit-property-text) | `""` | | [float](class_float#class-float) | [v\_scroll\_speed](#class-textedit-property-v-scroll-speed) | `80.0` | | [bool](class_bool#class-bool) | [virtual\_keyboard\_enabled](#class-textedit-property-virtual-keyboard-enabled) | `true` | | [bool](class_bool#class-bool) | [wrap\_enabled](#class-textedit-property-wrap-enabled) | `false` | Methods ------- | | | | --- | --- | | void | [add\_color\_region](#class-textedit-method-add-color-region) **(** [String](class_string#class-string) begin\_key, [String](class_string#class-string) end\_key, [Color](class_color#class-color) color, [bool](class_bool#class-bool) line\_only=false **)** | | void | [add\_keyword\_color](#class-textedit-method-add-keyword-color) **(** [String](class_string#class-string) keyword, [Color](class_color#class-color) color **)** | | [bool](class_bool#class-bool) | [can\_fold](#class-textedit-method-can-fold) **(** [int](class_int#class-int) line **)** const | | void | [center\_viewport\_to\_cursor](#class-textedit-method-center-viewport-to-cursor) **(** **)** | | void | [clear\_colors](#class-textedit-method-clear-colors) **(** **)** | | void | [clear\_undo\_history](#class-textedit-method-clear-undo-history) **(** **)** | | void | [copy](#class-textedit-method-copy) **(** **)** | | [int](class_int#class-int) | [cursor\_get\_column](#class-textedit-method-cursor-get-column) **(** **)** const | | [int](class_int#class-int) | [cursor\_get\_line](#class-textedit-method-cursor-get-line) **(** **)** const | | void | [cursor\_set\_column](#class-textedit-method-cursor-set-column) **(** [int](class_int#class-int) column, [bool](class_bool#class-bool) adjust\_viewport=true **)** | | void | [cursor\_set\_line](#class-textedit-method-cursor-set-line) **(** [int](class_int#class-int) line, [bool](class_bool#class-bool) adjust\_viewport=true, [bool](class_bool#class-bool) can\_be\_hidden=true, [int](class_int#class-int) wrap\_index=0 **)** | | void | [cut](#class-textedit-method-cut) **(** **)** | | void | [deselect](#class-textedit-method-deselect) **(** **)** | | void | [fold\_all\_lines](#class-textedit-method-fold-all-lines) **(** **)** | | void | [fold\_line](#class-textedit-method-fold-line) **(** [int](class_int#class-int) line **)** | | [Array](class_array#class-array) | [get\_breakpoints](#class-textedit-method-get-breakpoints) **(** **)** const | | [Color](class_color#class-color) | [get\_keyword\_color](#class-textedit-method-get-keyword-color) **(** [String](class_string#class-string) keyword **)** const | | [String](class_string#class-string) | [get\_line](#class-textedit-method-get-line) **(** [int](class_int#class-int) line **)** const | | [Vector2](class_vector2#class-vector2) | [get\_line\_column\_at\_pos](#class-textedit-method-get-line-column-at-pos) **(** [Vector2](class_vector2#class-vector2) position **)** const | | [int](class_int#class-int) | [get\_line\_count](#class-textedit-method-get-line-count) **(** **)** const | | [int](class_int#class-int) | [get\_line\_height](#class-textedit-method-get-line-height) **(** **)** const | | [int](class_int#class-int) | [get\_line\_width](#class-textedit-method-get-line-width) **(** [int](class_int#class-int) line, [int](class_int#class-int) wrap\_index=-1 **)** const | | [int](class_int#class-int) | [get\_line\_wrap\_count](#class-textedit-method-get-line-wrap-count) **(** [int](class_int#class-int) line **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_line\_wrapped\_text](#class-textedit-method-get-line-wrapped-text) **(** [int](class_int#class-int) line **)** const | | [PopupMenu](class_popupmenu#class-popupmenu) | [get\_menu](#class-textedit-method-get-menu) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_pos\_at\_line\_column](#class-textedit-method-get-pos-at-line-column) **(** [int](class_int#class-int) line, [int](class_int#class-int) column **)** const | | [Rect2](class_rect2#class-rect2) | [get\_rect\_at\_line\_column](#class-textedit-method-get-rect-at-line-column) **(** [int](class_int#class-int) line, [int](class_int#class-int) column **)** const | | [int](class_int#class-int) | [get\_selection\_from\_column](#class-textedit-method-get-selection-from-column) **(** **)** const | | [int](class_int#class-int) | [get\_selection\_from\_line](#class-textedit-method-get-selection-from-line) **(** **)** const | | [String](class_string#class-string) | [get\_selection\_text](#class-textedit-method-get-selection-text) **(** **)** const | | [int](class_int#class-int) | [get\_selection\_to\_column](#class-textedit-method-get-selection-to-column) **(** **)** const | | [int](class_int#class-int) | [get\_selection\_to\_line](#class-textedit-method-get-selection-to-line) **(** **)** const | | [int](class_int#class-int) | [get\_total\_gutter\_width](#class-textedit-method-get-total-gutter-width) **(** **)** const | | [int](class_int#class-int) | [get\_total\_visible\_rows](#class-textedit-method-get-total-visible-rows) **(** **)** const | | [int](class_int#class-int) | [get\_visible\_rows](#class-textedit-method-get-visible-rows) **(** **)** const | | [String](class_string#class-string) | [get\_word\_under\_cursor](#class-textedit-method-get-word-under-cursor) **(** **)** const | | [bool](class_bool#class-bool) | [has\_keyword\_color](#class-textedit-method-has-keyword-color) **(** [String](class_string#class-string) keyword **)** const | | [bool](class_bool#class-bool) | [has\_redo](#class-textedit-method-has-redo) **(** **)** const | | [bool](class_bool#class-bool) | [has\_undo](#class-textedit-method-has-undo) **(** **)** const | | void | [insert\_text\_at\_cursor](#class-textedit-method-insert-text-at-cursor) **(** [String](class_string#class-string) text **)** | | [bool](class_bool#class-bool) | [is\_folded](#class-textedit-method-is-folded) **(** [int](class_int#class-int) line **)** const | | [bool](class_bool#class-bool) | [is\_line\_hidden](#class-textedit-method-is-line-hidden) **(** [int](class_int#class-int) line **)** const | | [bool](class_bool#class-bool) | [is\_line\_set\_as\_bookmark](#class-textedit-method-is-line-set-as-bookmark) **(** [int](class_int#class-int) line **)** const | | [bool](class_bool#class-bool) | [is\_line\_set\_as\_breakpoint](#class-textedit-method-is-line-set-as-breakpoint) **(** [int](class_int#class-int) line **)** const | | [bool](class_bool#class-bool) | [is\_line\_set\_as\_safe](#class-textedit-method-is-line-set-as-safe) **(** [int](class_int#class-int) line **)** const | | [bool](class_bool#class-bool) | [is\_line\_wrapped](#class-textedit-method-is-line-wrapped) **(** [int](class_int#class-int) line **)** const | | [bool](class_bool#class-bool) | [is\_mouse\_over\_selection](#class-textedit-method-is-mouse-over-selection) **(** [bool](class_bool#class-bool) edges **)** const | | [bool](class_bool#class-bool) | [is\_selection\_active](#class-textedit-method-is-selection-active) **(** **)** const | | void | [menu\_option](#class-textedit-method-menu-option) **(** [int](class_int#class-int) option **)** | | void | [paste](#class-textedit-method-paste) **(** **)** | | void | [redo](#class-textedit-method-redo) **(** **)** | | void | [remove\_breakpoints](#class-textedit-method-remove-breakpoints) **(** **)** | | [PoolIntArray](class_poolintarray#class-poolintarray) | [search](#class-textedit-method-search) **(** [String](class_string#class-string) key, [int](class_int#class-int) flags, [int](class_int#class-int) from\_line, [int](class_int#class-int) from\_column **)** const | | void | [select](#class-textedit-method-select) **(** [int](class_int#class-int) from\_line, [int](class_int#class-int) from\_column, [int](class_int#class-int) to\_line, [int](class_int#class-int) to\_column **)** | | void | [select\_all](#class-textedit-method-select-all) **(** **)** | | void | [set\_line](#class-textedit-method-set-line) **(** [int](class_int#class-int) line, [String](class_string#class-string) new\_text **)** | | void | [set\_line\_as\_bookmark](#class-textedit-method-set-line-as-bookmark) **(** [int](class_int#class-int) line, [bool](class_bool#class-bool) bookmark **)** | | void | [set\_line\_as\_breakpoint](#class-textedit-method-set-line-as-breakpoint) **(** [int](class_int#class-int) line, [bool](class_bool#class-bool) breakpoint **)** | | void | [set\_line\_as\_hidden](#class-textedit-method-set-line-as-hidden) **(** [int](class_int#class-int) line, [bool](class_bool#class-bool) enable **)** | | void | [set\_line\_as\_safe](#class-textedit-method-set-line-as-safe) **(** [int](class_int#class-int) line, [bool](class_bool#class-bool) safe **)** | | void | [toggle\_fold\_line](#class-textedit-method-toggle-fold-line) **(** [int](class_int#class-int) line **)** | | void | [undo](#class-textedit-method-undo) **(** **)** | | void | [unfold\_line](#class-textedit-method-unfold-line) **(** [int](class_int#class-int) line **)** | | void | [unhide\_all\_lines](#class-textedit-method-unhide-all-lines) **(** **)** | Theme Properties ---------------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [background\_color](#class-textedit-theme-color-background-color) | `Color( 0, 0, 0, 0 )` | | [Color](class_color#class-color) | [bookmark\_color](#class-textedit-theme-color-bookmark-color) | `Color( 0.08, 0.49, 0.98, 1 )` | | [Color](class_color#class-color) | [brace\_mismatch\_color](#class-textedit-theme-color-brace-mismatch-color) | `Color( 1, 0.2, 0.2, 1 )` | | [Color](class_color#class-color) | [breakpoint\_color](#class-textedit-theme-color-breakpoint-color) | `Color( 0.8, 0.8, 0.4, 0.2 )` | | [Color](class_color#class-color) | [caret\_background\_color](#class-textedit-theme-color-caret-background-color) | `Color( 0, 0, 0, 1 )` | | [Color](class_color#class-color) | [caret\_color](#class-textedit-theme-color-caret-color) | `Color( 0.88, 0.88, 0.88, 1 )` | | [Color](class_color#class-color) | [code\_folding\_color](#class-textedit-theme-color-code-folding-color) | `Color( 0.8, 0.8, 0.8, 0.8 )` | | [Color](class_color#class-color) | [completion\_background\_color](#class-textedit-theme-color-completion-background-color) | `Color( 0.17, 0.16, 0.2, 1 )` | | [Color](class_color#class-color) | [completion\_existing\_color](#class-textedit-theme-color-completion-existing-color) | `Color( 0.87, 0.87, 0.87, 0.13 )` | | [Color](class_color#class-color) | [completion\_font\_color](#class-textedit-theme-color-completion-font-color) | `Color( 0.67, 0.67, 0.67, 1 )` | | [Color](class_color#class-color) | [completion\_scroll\_color](#class-textedit-theme-color-completion-scroll-color) | `Color( 1, 1, 1, 0.29 )` | | [Color](class_color#class-color) | [completion\_selected\_color](#class-textedit-theme-color-completion-selected-color) | `Color( 0.26, 0.26, 0.27, 1 )` | | [Color](class_color#class-color) | [current\_line\_color](#class-textedit-theme-color-current-line-color) | `Color( 0.25, 0.25, 0.26, 0.8 )` | | [Color](class_color#class-color) | [executing\_line\_color](#class-textedit-theme-color-executing-line-color) | `Color( 0.2, 0.8, 0.2, 0.4 )` | | [Color](class_color#class-color) | [font\_color](#class-textedit-theme-color-font-color) | `Color( 0.88, 0.88, 0.88, 1 )` | | [Color](class_color#class-color) | [font\_color\_readonly](#class-textedit-theme-color-font-color-readonly) | `Color( 0.88, 0.88, 0.88, 0.5 )` | | [Color](class_color#class-color) | [font\_color\_selected](#class-textedit-theme-color-font-color-selected) | `Color( 0, 0, 0, 1 )` | | [Color](class_color#class-color) | [function\_color](#class-textedit-theme-color-function-color) | `Color( 0.4, 0.64, 0.81, 1 )` | | [Color](class_color#class-color) | [line\_number\_color](#class-textedit-theme-color-line-number-color) | `Color( 0.67, 0.67, 0.67, 0.4 )` | | [Color](class_color#class-color) | [mark\_color](#class-textedit-theme-color-mark-color) | `Color( 1, 0.4, 0.4, 0.4 )` | | [Color](class_color#class-color) | [member\_variable\_color](#class-textedit-theme-color-member-variable-color) | `Color( 0.9, 0.31, 0.35, 1 )` | | [Color](class_color#class-color) | [number\_color](#class-textedit-theme-color-number-color) | `Color( 0.92, 0.58, 0.2, 1 )` | | [Color](class_color#class-color) | [safe\_line\_number\_color](#class-textedit-theme-color-safe-line-number-color) | `Color( 0.67, 0.78, 0.67, 0.6 )` | | [Color](class_color#class-color) | [selection\_color](#class-textedit-theme-color-selection-color) | `Color( 0.49, 0.49, 0.49, 1 )` | | [Color](class_color#class-color) | [symbol\_color](#class-textedit-theme-color-symbol-color) | `Color( 0.94, 0.94, 0.94, 1 )` | | [Color](class_color#class-color) | [word\_highlighted\_color](#class-textedit-theme-color-word-highlighted-color) | `Color( 0.8, 0.9, 0.9, 0.15 )` | | [int](class_int#class-int) | [completion\_lines](#class-textedit-theme-constant-completion-lines) | `7` | | [int](class_int#class-int) | [completion\_max\_width](#class-textedit-theme-constant-completion-max-width) | `50` | | [int](class_int#class-int) | [completion\_scroll\_width](#class-textedit-theme-constant-completion-scroll-width) | `6` | | [int](class_int#class-int) | [line\_spacing](#class-textedit-theme-constant-line-spacing) | `4` | | [Font](class_font#class-font) | [font](#class-textedit-theme-font-font) | | | [Texture](class_texture#class-texture) | [fold](#class-textedit-theme-icon-fold) | | | [Texture](class_texture#class-texture) | [folded](#class-textedit-theme-icon-folded) | | | [Texture](class_texture#class-texture) | [space](#class-textedit-theme-icon-space) | | | [Texture](class_texture#class-texture) | [tab](#class-textedit-theme-icon-tab) | | | [StyleBox](class_stylebox#class-stylebox) | [completion](#class-textedit-theme-style-completion) | | | [StyleBox](class_stylebox#class-stylebox) | [focus](#class-textedit-theme-style-focus) | | | [StyleBox](class_stylebox#class-stylebox) | [normal](#class-textedit-theme-style-normal) | | | [StyleBox](class_stylebox#class-stylebox) | [read\_only](#class-textedit-theme-style-read-only) | | Signals ------- ### breakpoint\_toggled ( [int](class_int#class-int) row ) Emitted when a breakpoint is placed via the breakpoint gutter. ### cursor\_changed ( ) Emitted when the cursor changes. ### info\_clicked ( [int](class_int#class-int) row, [String](class_string#class-string) info ) Emitted when the info icon is clicked. ### request\_completion ( ) ### symbol\_lookup ( [String](class_string#class-string) symbol, [int](class_int#class-int) row, [int](class_int#class-int) column ) ### text\_changed ( ) Emitted when the text changes. Enumerations ------------ enum **SearchFlags**: * **SEARCH\_MATCH\_CASE** = **1** --- Match case when searching. * **SEARCH\_WHOLE\_WORDS** = **2** --- Match whole words when searching. * **SEARCH\_BACKWARDS** = **4** --- Search from end to beginning. enum **SearchResult**: * **SEARCH\_RESULT\_COLUMN** = **0** --- Used to access the result column from [search](#class-textedit-method-search). * **SEARCH\_RESULT\_LINE** = **1** --- Used to access the result line from [search](#class-textedit-method-search). enum **MenuItems**: * **MENU\_CUT** = **0** --- Cuts (copies and clears) the selected text. * **MENU\_COPY** = **1** --- Copies the selected text. * **MENU\_PASTE** = **2** --- Pastes the clipboard text over the selected text (or at the cursor's position). * **MENU\_CLEAR** = **3** --- Erases the whole `TextEdit` text. * **MENU\_SELECT\_ALL** = **4** --- Selects the whole `TextEdit` text. * **MENU\_UNDO** = **5** --- Undoes the previous action. * **MENU\_REDO** = **6** --- Redoes the previous action. * **MENU\_MAX** = **7** --- Represents the size of the [MenuItems](#enum-textedit-menuitems) enum. Property Descriptions --------------------- ### [bool](class_bool#class-bool) bookmark\_gutter | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_bookmark\_gutter\_enabled(value) | | *Getter* | is\_bookmark\_gutter\_enabled() | If `true`, the bookmark gutter is visible. ### [bool](class_bool#class-bool) breakpoint\_gutter | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_breakpoint\_gutter\_enabled(value) | | *Getter* | is\_breakpoint\_gutter\_enabled() | If `true`, the breakpoint gutter is visible. ### [bool](class_bool#class-bool) caret\_blink | | | | --- | --- | | *Default* | `false` | | *Setter* | cursor\_set\_blink\_enabled(value) | | *Getter* | cursor\_get\_blink\_enabled() | If `true`, the caret (visual cursor) blinks. ### [float](class_float#class-float) caret\_blink\_speed | | | | --- | --- | | *Default* | `0.65` | | *Setter* | cursor\_set\_blink\_speed(value) | | *Getter* | cursor\_get\_blink\_speed() | Duration (in seconds) of a caret's blinking cycle. ### [bool](class_bool#class-bool) caret\_block\_mode | | | | --- | --- | | *Default* | `false` | | *Setter* | cursor\_set\_block\_mode(value) | | *Getter* | cursor\_is\_block\_mode() | If `true`, the caret displays as a rectangle. If `false`, the caret displays as a bar. ### [bool](class_bool#class-bool) caret\_moving\_by\_right\_click | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_right\_click\_moves\_caret(value) | | *Getter* | is\_right\_click\_moving\_caret() | If `true`, a right-click moves the cursor at the mouse position before displaying the context menu. If `false`, the context menu disregards mouse location. ### [bool](class_bool#class-bool) context\_menu\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_context\_menu\_enabled(value) | | *Getter* | is\_context\_menu\_enabled() | If `true`, a right-click displays the context menu. ### [bool](class_bool#class-bool) deselect\_on\_focus\_loss\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_deselect\_on\_focus\_loss\_enabled(value) | | *Getter* | is\_deselect\_on\_focus\_loss\_enabled() | If `true`, the selected text will be deselected when focus is lost. ### [bool](class_bool#class-bool) drag\_and\_drop\_selection\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_drag\_and\_drop\_selection\_enabled(value) | | *Getter* | is\_drag\_and\_drop\_selection\_enabled() | If `true`, allow drag and drop of selected text. ### [bool](class_bool#class-bool) draw\_spaces | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_draw\_spaces(value) | | *Getter* | is\_drawing\_spaces() | If `true`, the "space" character will have a visible representation. ### [bool](class_bool#class-bool) draw\_tabs | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_draw\_tabs(value) | | *Getter* | is\_drawing\_tabs() | If `true`, the "tab" character will have a visible representation. ### [bool](class_bool#class-bool) fold\_gutter | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_draw\_fold\_gutter(value) | | *Getter* | is\_drawing\_fold\_gutter() | If `true`, the fold gutter is visible. This enables folding groups of indented lines. ### [bool](class_bool#class-bool) hiding\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_hiding\_enabled(value) | | *Getter* | is\_hiding\_enabled() | If `true`, all lines that have been set to hidden by [set\_line\_as\_hidden](#class-textedit-method-set-line-as-hidden), will not be visible. ### [bool](class_bool#class-bool) highlight\_all\_occurrences | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_highlight\_all\_occurrences(value) | | *Getter* | is\_highlight\_all\_occurrences\_enabled() | If `true`, all occurrences of the selected text will be highlighted. ### [bool](class_bool#class-bool) highlight\_current\_line | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_highlight\_current\_line(value) | | *Getter* | is\_highlight\_current\_line\_enabled() | If `true`, the line containing the cursor is highlighted. ### [bool](class_bool#class-bool) middle\_mouse\_paste\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_middle\_mouse\_paste\_enabled(value) | | *Getter* | is\_middle\_mouse\_paste\_enabled() | If `false`, using middle mouse button to paste clipboard will be disabled. **Note:** This method is only implemented on Linux. ### [bool](class_bool#class-bool) minimap\_draw | | | | --- | --- | | *Default* | `false` | | *Setter* | draw\_minimap(value) | | *Getter* | is\_drawing\_minimap() | If `true`, a minimap is shown, providing an outline of your source code. ### [int](class_int#class-int) minimap\_width | | | | --- | --- | | *Default* | `80` | | *Setter* | set\_minimap\_width(value) | | *Getter* | get\_minimap\_width() | The width, in pixels, of the minimap. ### [bool](class_bool#class-bool) override\_selected\_font\_color | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_override\_selected\_font\_color(value) | | *Getter* | is\_overriding\_selected\_font\_color() | If `true`, custom `font_color_selected` will be used for selected text. ### [bool](class_bool#class-bool) readonly | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_readonly(value) | | *Getter* | is\_readonly() | If `true`, read-only mode is enabled. Existing text cannot be modified and new text cannot be added. ### [int](class_int#class-int) scroll\_horizontal | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_h\_scroll(value) | | *Getter* | get\_h\_scroll() | If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels. ### [float](class_float#class-float) scroll\_vertical | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_v\_scroll(value) | | *Getter* | get\_v\_scroll() | If there is a vertical scrollbar, this determines the current vertical scroll value in line numbers, starting at 0 for the top line. ### [bool](class_bool#class-bool) selecting\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_selecting\_enabled(value) | | *Getter* | is\_selecting\_enabled() | If `true`, text can be selected. If `false`, text can not be selected by the user or by the [select](#class-textedit-method-select) or [select\_all](#class-textedit-method-select-all) methods. ### [bool](class_bool#class-bool) shortcut\_keys\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_shortcut\_keys\_enabled(value) | | *Getter* | is\_shortcut\_keys\_enabled() | If `true`, shortcut keys for context menu items are enabled, even if the context menu is disabled. ### [bool](class_bool#class-bool) show\_line\_numbers | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_show\_line\_numbers(value) | | *Getter* | is\_show\_line\_numbers\_enabled() | If `true`, line numbers are displayed to the left of the text. ### [bool](class_bool#class-bool) smooth\_scrolling | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_smooth\_scroll\_enable(value) | | *Getter* | is\_smooth\_scroll\_enabled() | If `true`, sets the `step` of the scrollbars to `0.25` which results in smoother scrolling. ### [bool](class_bool#class-bool) syntax\_highlighting | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_syntax\_coloring(value) | | *Getter* | is\_syntax\_coloring\_enabled() | If `true`, any custom color properties that have been set for this `TextEdit` will be visible. ### [String](class_string#class-string) text | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_text(value) | | *Getter* | get\_text() | String value of the `TextEdit`. ### [float](class_float#class-float) v\_scroll\_speed | | | | --- | --- | | *Default* | `80.0` | | *Setter* | set\_v\_scroll\_speed(value) | | *Getter* | get\_v\_scroll\_speed() | Vertical scroll sensitivity. ### [bool](class_bool#class-bool) virtual\_keyboard\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_virtual\_keyboard\_enabled(value) | | *Getter* | is\_virtual\_keyboard\_enabled() | If `true`, the native virtual keyboard is shown when focused on platforms that support it. ### [bool](class_bool#class-bool) wrap\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_wrap\_enabled(value) | | *Getter* | is\_wrap\_enabled() | If `true`, enables text wrapping when it goes beyond the edge of what is visible. Method Descriptions ------------------- ### void add\_color\_region ( [String](class_string#class-string) begin\_key, [String](class_string#class-string) end\_key, [Color](class_color#class-color) color, [bool](class_bool#class-bool) line\_only=false ) Adds color region (given the delimiters) and its colors. ### void add\_keyword\_color ( [String](class_string#class-string) keyword, [Color](class_color#class-color) color ) Adds a `keyword` and its [Color](class_color#class-color). ### [bool](class_bool#class-bool) can\_fold ( [int](class_int#class-int) line ) const Returns if the given line is foldable, that is, it has indented lines right below it. ### void center\_viewport\_to\_cursor ( ) Centers the viewport on the line the editing cursor is at. This also resets the [scroll\_horizontal](#class-textedit-property-scroll-horizontal) value to `0`. ### void clear\_colors ( ) Clears all custom syntax coloring information previously added with [add\_color\_region](#class-textedit-method-add-color-region) or [add\_keyword\_color](#class-textedit-method-add-keyword-color). ### void clear\_undo\_history ( ) Clears the undo history. ### void copy ( ) Copy's the current text selection. ### [int](class_int#class-int) cursor\_get\_column ( ) const Returns the column the editing cursor is at. ### [int](class_int#class-int) cursor\_get\_line ( ) const Returns the line the editing cursor is at. ### void cursor\_set\_column ( [int](class_int#class-int) column, [bool](class_bool#class-bool) adjust\_viewport=true ) Moves the cursor at the specified `column` index. If `adjust_viewport` is set to `true`, the viewport will center at the cursor position after the move occurs. ### void cursor\_set\_line ( [int](class_int#class-int) line, [bool](class_bool#class-bool) adjust\_viewport=true, [bool](class_bool#class-bool) can\_be\_hidden=true, [int](class_int#class-int) wrap\_index=0 ) Moves the cursor at the specified `line` index. If `adjust_viewport` is set to `true`, the viewport will center at the cursor position after the move occurs. If `can_be_hidden` is set to `true`, the specified `line` can be hidden using [set\_line\_as\_hidden](#class-textedit-method-set-line-as-hidden). ### void cut ( ) Cut's the current selection. ### void deselect ( ) Deselects the current selection. ### void fold\_all\_lines ( ) Folds all lines that are possible to be folded (see [can\_fold](#class-textedit-method-can-fold)). ### void fold\_line ( [int](class_int#class-int) line ) Folds the given line, if possible (see [can\_fold](#class-textedit-method-can-fold)). ### [Array](class_array#class-array) get\_breakpoints ( ) const Returns an array containing the line number of each breakpoint. ### [Color](class_color#class-color) get\_keyword\_color ( [String](class_string#class-string) keyword ) const Returns the [Color](class_color#class-color) of the specified `keyword`. ### [String](class_string#class-string) get\_line ( [int](class_int#class-int) line ) const Returns the text of a specific line. ### [Vector2](class_vector2#class-vector2) get\_line\_column\_at\_pos ( [Vector2](class_vector2#class-vector2) position ) const Returns the line and column at the given position. In the returned vector, `x` is the column, `y` is the line. ### [int](class_int#class-int) get\_line\_count ( ) const Returns the amount of total lines in the text. ### [int](class_int#class-int) get\_line\_height ( ) const Returns the height of a largest line. ### [int](class_int#class-int) get\_line\_width ( [int](class_int#class-int) line, [int](class_int#class-int) wrap\_index=-1 ) const Returns the width in pixels of the `wrap_index` on `line`. ### [int](class_int#class-int) get\_line\_wrap\_count ( [int](class_int#class-int) line ) const Returns the number of times the given line is wrapped. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_line\_wrapped\_text ( [int](class_int#class-int) line ) const Returns an array of [String](class_string#class-string)s representing each wrapped index. ### [PopupMenu](class_popupmenu#class-popupmenu) get\_menu ( ) const Returns the [PopupMenu](class_popupmenu#class-popupmenu) of this `TextEdit`. By default, this menu is displayed when right-clicking on the `TextEdit`. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. ### [Vector2](class_vector2#class-vector2) get\_pos\_at\_line\_column ( [int](class_int#class-int) line, [int](class_int#class-int) column ) const Returns the local position for the given `line` and `column`. If `x` or `y` of the returned vector equal `-1`, the position is outside of the viewable area of the control. **Note:** The Y position corresponds to the bottom side of the line. Use [get\_rect\_at\_line\_column](#class-textedit-method-get-rect-at-line-column) to get the top side position. ### [Rect2](class_rect2#class-rect2) get\_rect\_at\_line\_column ( [int](class_int#class-int) line, [int](class_int#class-int) column ) const Returns the local position and size for the grapheme at the given `line` and `column`. If `x` or `y` position of the returned rect equal `-1`, the position is outside of the viewable area of the control. **Note:** The Y position of the returned rect corresponds to the top side of the line, unlike [get\_pos\_at\_line\_column](#class-textedit-method-get-pos-at-line-column) which returns the bottom side. ### [int](class_int#class-int) get\_selection\_from\_column ( ) const Returns the selection begin column. ### [int](class_int#class-int) get\_selection\_from\_line ( ) const Returns the selection begin line. ### [String](class_string#class-string) get\_selection\_text ( ) const Returns the text inside the selection. ### [int](class_int#class-int) get\_selection\_to\_column ( ) const Returns the selection end column. ### [int](class_int#class-int) get\_selection\_to\_line ( ) const Returns the selection end line. ### [int](class_int#class-int) get\_total\_gutter\_width ( ) const Returns the total width of all gutters and internal padding. ### [int](class_int#class-int) get\_total\_visible\_rows ( ) const Returns the total amount of lines that could be drawn. ### [int](class_int#class-int) get\_visible\_rows ( ) const Returns the number of visible lines, including wrapped text. ### [String](class_string#class-string) get\_word\_under\_cursor ( ) const Returns a [String](class_string#class-string) text with the word under the caret (text cursor) location. ### [bool](class_bool#class-bool) has\_keyword\_color ( [String](class_string#class-string) keyword ) const Returns whether the specified `keyword` has a color set to it or not. ### [bool](class_bool#class-bool) has\_redo ( ) const Returns `true` if a "redo" action is available. ### [bool](class_bool#class-bool) has\_undo ( ) const Returns `true` if an "undo" action is available. ### void insert\_text\_at\_cursor ( [String](class_string#class-string) text ) Insert the specified text at the cursor position. ### [bool](class_bool#class-bool) is\_folded ( [int](class_int#class-int) line ) const Returns whether the line at the specified index is folded or not. ### [bool](class_bool#class-bool) is\_line\_hidden ( [int](class_int#class-int) line ) const Returns whether the line at the specified index is hidden or not. ### [bool](class_bool#class-bool) is\_line\_set\_as\_bookmark ( [int](class_int#class-int) line ) const Returns `true` when the specified `line` is bookmarked. ### [bool](class_bool#class-bool) is\_line\_set\_as\_breakpoint ( [int](class_int#class-int) line ) const Returns `true` when the specified `line` has a breakpoint. ### [bool](class_bool#class-bool) is\_line\_set\_as\_safe ( [int](class_int#class-int) line ) const Returns `true` when the specified `line` is marked as safe. ### [bool](class_bool#class-bool) is\_line\_wrapped ( [int](class_int#class-int) line ) const Returns if the given line is wrapped. ### [bool](class_bool#class-bool) is\_mouse\_over\_selection ( [bool](class_bool#class-bool) edges ) const Returns whether the mouse is over selection. If `edges` is `true`, the edges are considered part of the selection. ### [bool](class_bool#class-bool) is\_selection\_active ( ) const Returns `true` if the selection is active. ### void menu\_option ( [int](class_int#class-int) option ) Triggers a right-click menu action by the specified index. See [MenuItems](#enum-textedit-menuitems) for a list of available indexes. ### void paste ( ) Paste the current selection. ### void redo ( ) Perform redo operation. ### void remove\_breakpoints ( ) Removes all the breakpoints. This will not fire the [breakpoint\_toggled](#class-textedit-signal-breakpoint-toggled) signal. ### [PoolIntArray](class_poolintarray#class-poolintarray) search ( [String](class_string#class-string) key, [int](class_int#class-int) flags, [int](class_int#class-int) from\_line, [int](class_int#class-int) from\_column ) const Perform a search inside the text. Search flags can be specified in the [SearchFlags](#enum-textedit-searchflags) enum. Returns an empty `PoolIntArray` if no result was found. Otherwise, the result line and column can be accessed at indices specified in the [SearchResult](#enum-textedit-searchresult) enum, e.g: ``` var result = search(key, flags, line, column) if result.size() > 0: # Result found. var res_line = result[TextEdit.SEARCH_RESULT_LINE] var res_column = result[TextEdit.SEARCH_RESULT_COLUMN] ``` ### void select ( [int](class_int#class-int) from\_line, [int](class_int#class-int) from\_column, [int](class_int#class-int) to\_line, [int](class_int#class-int) to\_column ) Perform selection, from line/column to line/column. If [selecting\_enabled](#class-textedit-property-selecting-enabled) is `false`, no selection will occur. ### void select\_all ( ) Select all the text. If [selecting\_enabled](#class-textedit-property-selecting-enabled) is `false`, no selection will occur. ### void set\_line ( [int](class_int#class-int) line, [String](class_string#class-string) new\_text ) Sets the text for a specific line. ### void set\_line\_as\_bookmark ( [int](class_int#class-int) line, [bool](class_bool#class-bool) bookmark ) Bookmarks the `line` if `bookmark` is `true`. Deletes the bookmark if `bookmark` is `false`. Bookmarks are shown in the [breakpoint\_gutter](#class-textedit-property-breakpoint-gutter). ### void set\_line\_as\_breakpoint ( [int](class_int#class-int) line, [bool](class_bool#class-bool) breakpoint ) Adds or removes the breakpoint in `line`. Breakpoints are shown in the [breakpoint\_gutter](#class-textedit-property-breakpoint-gutter). ### void set\_line\_as\_hidden ( [int](class_int#class-int) line, [bool](class_bool#class-bool) enable ) If `true`, hides the line of the specified index. ### void set\_line\_as\_safe ( [int](class_int#class-int) line, [bool](class_bool#class-bool) safe ) If `true`, marks the `line` as safe. This will show the line number with the color provided in the `safe_line_number_color` theme property. ### void toggle\_fold\_line ( [int](class_int#class-int) line ) Toggle the folding of the code block at the given line. ### void undo ( ) Perform undo operation. ### void unfold\_line ( [int](class_int#class-int) line ) Unfolds the given line, if folded. ### void unhide\_all\_lines ( ) Unhide all lines that were previously set to hidden by [set\_line\_as\_hidden](#class-textedit-method-set-line-as-hidden). Theme Property Descriptions --------------------------- ### [Color](class_color#class-color) background\_color | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 0 )` | Sets the background [Color](class_color#class-color) of this `TextEdit`. [syntax\_highlighting](#class-textedit-property-syntax-highlighting) has to be enabled. ### [Color](class_color#class-color) bookmark\_color | | | | --- | --- | | *Default* | `Color( 0.08, 0.49, 0.98, 1 )` | Sets the [Color](class_color#class-color) of the bookmark marker. [syntax\_highlighting](#class-textedit-property-syntax-highlighting) has to be enabled. ### [Color](class_color#class-color) brace\_mismatch\_color | | | | --- | --- | | *Default* | `Color( 1, 0.2, 0.2, 1 )` | ### [Color](class_color#class-color) breakpoint\_color | | | | --- | --- | | *Default* | `Color( 0.8, 0.8, 0.4, 0.2 )` | Sets the [Color](class_color#class-color) of the breakpoints. [breakpoint\_gutter](#class-textedit-property-breakpoint-gutter) has to be enabled. ### [Color](class_color#class-color) caret\_background\_color | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 1 )` | ### [Color](class_color#class-color) caret\_color | | | | --- | --- | | *Default* | `Color( 0.88, 0.88, 0.88, 1 )` | ### [Color](class_color#class-color) code\_folding\_color | | | | --- | --- | | *Default* | `Color( 0.8, 0.8, 0.8, 0.8 )` | ### [Color](class_color#class-color) completion\_background\_color | | | | --- | --- | | *Default* | `Color( 0.17, 0.16, 0.2, 1 )` | ### [Color](class_color#class-color) completion\_existing\_color | | | | --- | --- | | *Default* | `Color( 0.87, 0.87, 0.87, 0.13 )` | ### [Color](class_color#class-color) completion\_font\_color | | | | --- | --- | | *Default* | `Color( 0.67, 0.67, 0.67, 1 )` | ### [Color](class_color#class-color) completion\_scroll\_color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 0.29 )` | ### [Color](class_color#class-color) completion\_selected\_color | | | | --- | --- | | *Default* | `Color( 0.26, 0.26, 0.27, 1 )` | ### [Color](class_color#class-color) current\_line\_color | | | | --- | --- | | *Default* | `Color( 0.25, 0.25, 0.26, 0.8 )` | Sets the [Color](class_color#class-color) of the breakpoints. [breakpoint\_gutter](#class-textedit-property-breakpoint-gutter) has to be enabled. ### [Color](class_color#class-color) executing\_line\_color | | | | --- | --- | | *Default* | `Color( 0.2, 0.8, 0.2, 0.4 )` | ### [Color](class_color#class-color) font\_color | | | | --- | --- | | *Default* | `Color( 0.88, 0.88, 0.88, 1 )` | Sets the font [Color](class_color#class-color). ### [Color](class_color#class-color) font\_color\_readonly | | | | --- | --- | | *Default* | `Color( 0.88, 0.88, 0.88, 0.5 )` | ### [Color](class_color#class-color) font\_color\_selected | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 1 )` | Sets the [Color](class_color#class-color) of the selected text. [override\_selected\_font\_color](#class-textedit-property-override-selected-font-color) has to be enabled. ### [Color](class_color#class-color) function\_color | | | | --- | --- | | *Default* | `Color( 0.4, 0.64, 0.81, 1 )` | ### [Color](class_color#class-color) line\_number\_color | | | | --- | --- | | *Default* | `Color( 0.67, 0.67, 0.67, 0.4 )` | Sets the [Color](class_color#class-color) of the line numbers. [show\_line\_numbers](#class-textedit-property-show-line-numbers) has to be enabled. ### [Color](class_color#class-color) mark\_color | | | | --- | --- | | *Default* | `Color( 1, 0.4, 0.4, 0.4 )` | Sets the [Color](class_color#class-color) of marked text. ### [Color](class_color#class-color) member\_variable\_color | | | | --- | --- | | *Default* | `Color( 0.9, 0.31, 0.35, 1 )` | ### [Color](class_color#class-color) number\_color | | | | --- | --- | | *Default* | `Color( 0.92, 0.58, 0.2, 1 )` | ### [Color](class_color#class-color) safe\_line\_number\_color | | | | --- | --- | | *Default* | `Color( 0.67, 0.78, 0.67, 0.6 )` | ### [Color](class_color#class-color) selection\_color | | | | --- | --- | | *Default* | `Color( 0.49, 0.49, 0.49, 1 )` | Sets the highlight [Color](class_color#class-color) of text selections. ### [Color](class_color#class-color) symbol\_color | | | | --- | --- | | *Default* | `Color( 0.94, 0.94, 0.94, 1 )` | ### [Color](class_color#class-color) word\_highlighted\_color | | | | --- | --- | | *Default* | `Color( 0.8, 0.9, 0.9, 0.15 )` | Sets the highlight [Color](class_color#class-color) of multiple occurrences. [highlight\_all\_occurrences](#class-textedit-property-highlight-all-occurrences) has to be enabled. ### [int](class_int#class-int) completion\_lines | | | | --- | --- | | *Default* | `7` | ### [int](class_int#class-int) completion\_max\_width | | | | --- | --- | | *Default* | `50` | ### [int](class_int#class-int) completion\_scroll\_width | | | | --- | --- | | *Default* | `6` | ### [int](class_int#class-int) line\_spacing | | | | --- | --- | | *Default* | `4` | Sets the spacing between the lines. ### [Font](class_font#class-font) font Sets the default [Font](class_font#class-font). ### [Texture](class_texture#class-texture) fold ### [Texture](class_texture#class-texture) folded ### [Texture](class_texture#class-texture) space ### [Texture](class_texture#class-texture) tab Sets a custom [Texture](class_texture#class-texture) for tab text characters. ### [StyleBox](class_stylebox#class-stylebox) completion ### [StyleBox](class_stylebox#class-stylebox) focus ### [StyleBox](class_stylebox#class-stylebox) normal Sets the [StyleBox](class_stylebox#class-stylebox) of this `TextEdit`. ### [StyleBox](class_stylebox#class-stylebox) read\_only Sets the [StyleBox](class_stylebox#class-stylebox) of this `TextEdit` when [readonly](#class-textedit-property-readonly) is enabled.
programming_docs
godot TileMap TileMap ======= **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Node for 2D tile-based maps. Description ----------- Node for 2D tile-based maps. Tilemaps use a [TileSet](class_tileset#class-tileset) which contain a list of tiles (textures plus optional collision, navigation, and/or occluder shapes) which are used to create grid-based maps. When doing physics queries against the tilemap, the cell coordinates are encoded as `metadata` for each detected collision shape returned by methods such as [Physics2DDirectSpaceState.intersect\_shape](class_physics2ddirectspacestate#class-physics2ddirectspacestate-method-intersect-shape), [Physics2DDirectBodyState.get\_contact\_collider\_shape\_metadata](class_physics2ddirectbodystate#class-physics2ddirectbodystate-method-get-contact-collider-shape-metadata), etc. Tutorials --------- * [Using Tilemaps](https://docs.godotengine.org/en/3.5/tutorials/2d/using_tilemaps.html) * [2D Platformer Demo](https://godotengine.org/asset-library/asset/120) * [2D Isometric Demo](https://godotengine.org/asset-library/asset/112) * [2D Hexagonal Demo](https://godotengine.org/asset-library/asset/111) * [2D Navigation Astar Demo](https://godotengine.org/asset-library/asset/519) * [2D Role Playing Game Demo](https://godotengine.org/asset-library/asset/520) * [2D Kinematic Character Demo](https://godotengine.org/asset-library/asset/113) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [bake\_navigation](#class-tilemap-property-bake-navigation) | `false` | | [bool](class_bool#class-bool) | [cell\_clip\_uv](#class-tilemap-property-cell-clip-uv) | `false` | | [Transform2D](class_transform2d#class-transform2d) | [cell\_custom\_transform](#class-tilemap-property-cell-custom-transform) | `Transform2D( 64, 0, 0, 64, 0, 0 )` | | [HalfOffset](#enum-tilemap-halfoffset) | [cell\_half\_offset](#class-tilemap-property-cell-half-offset) | `2` | | [int](class_int#class-int) | [cell\_quadrant\_size](#class-tilemap-property-cell-quadrant-size) | `16` | | [Vector2](class_vector2#class-vector2) | [cell\_size](#class-tilemap-property-cell-size) | `Vector2( 64, 64 )` | | [TileOrigin](#enum-tilemap-tileorigin) | [cell\_tile\_origin](#class-tilemap-property-cell-tile-origin) | `0` | | [bool](class_bool#class-bool) | [cell\_y\_sort](#class-tilemap-property-cell-y-sort) | `false` | | [bool](class_bool#class-bool) | [centered\_textures](#class-tilemap-property-centered-textures) | `false` | | [float](class_float#class-float) | [collision\_bounce](#class-tilemap-property-collision-bounce) | `0.0` | | [float](class_float#class-float) | [collision\_friction](#class-tilemap-property-collision-friction) | `1.0` | | [int](class_int#class-int) | [collision\_layer](#class-tilemap-property-collision-layer) | `1` | | [int](class_int#class-int) | [collision\_mask](#class-tilemap-property-collision-mask) | `1` | | [bool](class_bool#class-bool) | [collision\_use\_kinematic](#class-tilemap-property-collision-use-kinematic) | `false` | | [bool](class_bool#class-bool) | [collision\_use\_parent](#class-tilemap-property-collision-use-parent) | `false` | | [bool](class_bool#class-bool) | [compatibility\_mode](#class-tilemap-property-compatibility-mode) | `false` | | [Mode](#enum-tilemap-mode) | [mode](#class-tilemap-property-mode) | `0` | | [int](class_int#class-int) | [navigation\_layers](#class-tilemap-property-navigation-layers) | `1` | | [int](class_int#class-int) | [occluder\_light\_mask](#class-tilemap-property-occluder-light-mask) | `1` | | [bool](class_bool#class-bool) | [show\_collision](#class-tilemap-property-show-collision) | `false` | | [TileSet](class_tileset#class-tileset) | [tile\_set](#class-tilemap-property-tile-set) | | Methods ------- | | | | --- | --- | | void | [clear](#class-tilemap-method-clear) **(** **)** | | void | [fix\_invalid\_tiles](#class-tilemap-method-fix-invalid-tiles) **(** **)** | | [int](class_int#class-int) | [get\_cell](#class-tilemap-method-get-cell) **(** [int](class_int#class-int) x, [int](class_int#class-int) y **)** const | | [Vector2](class_vector2#class-vector2) | [get\_cell\_autotile\_coord](#class-tilemap-method-get-cell-autotile-coord) **(** [int](class_int#class-int) x, [int](class_int#class-int) y **)** const | | [int](class_int#class-int) | [get\_cellv](#class-tilemap-method-get-cellv) **(** [Vector2](class_vector2#class-vector2) position **)** const | | [bool](class_bool#class-bool) | [get\_collision\_layer\_bit](#class-tilemap-method-get-collision-layer-bit) **(** [int](class_int#class-int) bit **)** const | | [bool](class_bool#class-bool) | [get\_collision\_mask\_bit](#class-tilemap-method-get-collision-mask-bit) **(** [int](class_int#class-int) bit **)** const | | [Array](class_array#class-array) | [get\_used\_cells](#class-tilemap-method-get-used-cells) **(** **)** const | | [Array](class_array#class-array) | [get\_used\_cells\_by\_id](#class-tilemap-method-get-used-cells-by-id) **(** [int](class_int#class-int) id **)** const | | [Rect2](class_rect2#class-rect2) | [get\_used\_rect](#class-tilemap-method-get-used-rect) **(** **)** | | [bool](class_bool#class-bool) | [is\_cell\_transposed](#class-tilemap-method-is-cell-transposed) **(** [int](class_int#class-int) x, [int](class_int#class-int) y **)** const | | [bool](class_bool#class-bool) | [is\_cell\_x\_flipped](#class-tilemap-method-is-cell-x-flipped) **(** [int](class_int#class-int) x, [int](class_int#class-int) y **)** const | | [bool](class_bool#class-bool) | [is\_cell\_y\_flipped](#class-tilemap-method-is-cell-y-flipped) **(** [int](class_int#class-int) x, [int](class_int#class-int) y **)** const | | [Vector2](class_vector2#class-vector2) | [map\_to\_world](#class-tilemap-method-map-to-world) **(** [Vector2](class_vector2#class-vector2) map\_position, [bool](class_bool#class-bool) ignore\_half\_ofs=false **)** const | | void | [set\_cell](#class-tilemap-method-set-cell) **(** [int](class_int#class-int) x, [int](class_int#class-int) y, [int](class_int#class-int) tile, [bool](class_bool#class-bool) flip\_x=false, [bool](class_bool#class-bool) flip\_y=false, [bool](class_bool#class-bool) transpose=false, [Vector2](class_vector2#class-vector2) autotile\_coord=Vector2( 0, 0 ) **)** | | void | [set\_cellv](#class-tilemap-method-set-cellv) **(** [Vector2](class_vector2#class-vector2) position, [int](class_int#class-int) tile, [bool](class_bool#class-bool) flip\_x=false, [bool](class_bool#class-bool) flip\_y=false, [bool](class_bool#class-bool) transpose=false, [Vector2](class_vector2#class-vector2) autotile\_coord=Vector2( 0, 0 ) **)** | | void | [set\_collision\_layer\_bit](#class-tilemap-method-set-collision-layer-bit) **(** [int](class_int#class-int) bit, [bool](class_bool#class-bool) value **)** | | void | [set\_collision\_mask\_bit](#class-tilemap-method-set-collision-mask-bit) **(** [int](class_int#class-int) bit, [bool](class_bool#class-bool) value **)** | | void | [update\_bitmask\_area](#class-tilemap-method-update-bitmask-area) **(** [Vector2](class_vector2#class-vector2) position **)** | | void | [update\_bitmask\_region](#class-tilemap-method-update-bitmask-region) **(** [Vector2](class_vector2#class-vector2) start=Vector2( 0, 0 ), [Vector2](class_vector2#class-vector2) end=Vector2( 0, 0 ) **)** | | void | [update\_dirty\_quadrants](#class-tilemap-method-update-dirty-quadrants) **(** **)** | | [Vector2](class_vector2#class-vector2) | [world\_to\_map](#class-tilemap-method-world-to-map) **(** [Vector2](class_vector2#class-vector2) world\_position **)** const | Signals ------- ### settings\_changed ( ) Emitted when a tilemap setting has changed. Enumerations ------------ enum **Mode**: * **MODE\_SQUARE** = **0** --- Orthogonal orientation mode. * **MODE\_ISOMETRIC** = **1** --- Isometric orientation mode. * **MODE\_CUSTOM** = **2** --- Custom orientation mode. enum **HalfOffset**: * **HALF\_OFFSET\_X** = **0** --- Half offset on the X coordinate. * **HALF\_OFFSET\_Y** = **1** --- Half offset on the Y coordinate. * **HALF\_OFFSET\_DISABLED** = **2** --- Half offset disabled. * **HALF\_OFFSET\_NEGATIVE\_X** = **3** --- Half offset on the X coordinate (negative). * **HALF\_OFFSET\_NEGATIVE\_Y** = **4** --- Half offset on the Y coordinate (negative). enum **TileOrigin**: * **TILE\_ORIGIN\_TOP\_LEFT** = **0** --- Tile origin at its top-left corner. * **TILE\_ORIGIN\_CENTER** = **1** --- Tile origin at its center. * **TILE\_ORIGIN\_BOTTOM\_LEFT** = **2** --- Tile origin at its bottom-left corner. Constants --------- ### INVALID\_CELL = -1 --- Returned when a cell doesn't exist. Property Descriptions --------------------- ### [bool](class_bool#class-bool) bake\_navigation | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_bake\_navigation(value) | | *Getter* | is\_baking\_navigation() | If `true`, this TileMap bakes a navigation region. ### [bool](class_bool#class-bool) cell\_clip\_uv | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_clip\_uv(value) | | *Getter* | get\_clip\_uv() | If `true`, the cell's UVs will be clipped. ### [Transform2D](class_transform2d#class-transform2d) cell\_custom\_transform | | | | --- | --- | | *Default* | `Transform2D( 64, 0, 0, 64, 0, 0 )` | | *Setter* | set\_custom\_transform(value) | | *Getter* | get\_custom\_transform() | The custom [Transform2D](class_transform2d#class-transform2d) to be applied to the TileMap's cells. ### [HalfOffset](#enum-tilemap-halfoffset) cell\_half\_offset | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_half\_offset(value) | | *Getter* | get\_half\_offset() | Amount to offset alternating tiles. See [HalfOffset](#enum-tilemap-halfoffset) for possible values. ### [int](class_int#class-int) cell\_quadrant\_size | | | | --- | --- | | *Default* | `16` | | *Setter* | set\_quadrant\_size(value) | | *Getter* | get\_quadrant\_size() | The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size. ### [Vector2](class_vector2#class-vector2) cell\_size | | | | --- | --- | | *Default* | `Vector2( 64, 64 )` | | *Setter* | set\_cell\_size(value) | | *Getter* | get\_cell\_size() | The TileMap's cell size. ### [TileOrigin](#enum-tilemap-tileorigin) cell\_tile\_origin | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_tile\_origin(value) | | *Getter* | get\_tile\_origin() | Position for tile origin. See [TileOrigin](#enum-tilemap-tileorigin) for possible values. ### [bool](class_bool#class-bool) cell\_y\_sort | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_y\_sort\_mode(value) | | *Getter* | is\_y\_sort\_mode\_enabled() | If `true`, the TileMap's direct children will be drawn in order of their Y coordinate. ### [bool](class_bool#class-bool) centered\_textures | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_centered\_textures(value) | | *Getter* | is\_centered\_textures\_enabled() | If `true`, the textures will be centered in the middle of each tile. This is useful for certain isometric or top-down modes when textures are made larger or smaller than the tiles (e.g. to avoid flickering on tile edges). The offset is still applied, but from the center of the tile. If used, [compatibility\_mode](#class-tilemap-property-compatibility-mode) is ignored. If `false`, the texture position start in the top-left corner unless [compatibility\_mode](#class-tilemap-property-compatibility-mode) is enabled. ### [float](class_float#class-float) collision\_bounce | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_collision\_bounce(value) | | *Getter* | get\_collision\_bounce() | Bounce value for static body collisions (see `collision_use_kinematic`). ### [float](class_float#class-float) collision\_friction | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_collision\_friction(value) | | *Getter* | get\_collision\_friction() | Friction value for static body collisions (see `collision_use_kinematic`). ### [int](class_int#class-int) collision\_layer | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_collision\_layer(value) | | *Getter* | get\_collision\_layer() | The collision layer(s) for all colliders in the TileMap. See [Collision layers and masks](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. ### [int](class_int#class-int) collision\_mask | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_collision\_mask(value) | | *Getter* | get\_collision\_mask() | The collision mask(s) for all colliders in the TileMap. See [Collision layers and masks](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. ### [bool](class_bool#class-bool) collision\_use\_kinematic | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_collision\_use\_kinematic(value) | | *Getter* | get\_collision\_use\_kinematic() | If `true`, TileMap collisions will be handled as a kinematic body. If `false`, collisions will be handled as static body. ### [bool](class_bool#class-bool) collision\_use\_parent | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_collision\_use\_parent(value) | | *Getter* | get\_collision\_use\_parent() | If `true`, this tilemap's collision shape will be added to the collision shape of the parent. The parent has to be a [CollisionObject2D](class_collisionobject2d#class-collisionobject2d). ### [bool](class_bool#class-bool) compatibility\_mode | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_compatibility\_mode(value) | | *Getter* | is\_compatibility\_mode\_enabled() | If `true`, the compatibility with the tilemaps made in Godot 3.1 or earlier is maintained (textures move when the tile origin changes and rotate if the texture size is not homogeneous). This mode presents problems when doing `flip_h`, `flip_v` and `transpose` tile operations on non-homogeneous isometric tiles (e.g. 2:1), in which the texture could not coincide with the collision, thus it is not recommended for isometric or non-square tiles. If `false`, the textures do not move when doing `flip_h`, `flip_v` operations if no offset is used, nor when changing the tile origin. The compatibility mode doesn't work with the [centered\_textures](#class-tilemap-property-centered-textures) option, because displacing textures with the [cell\_tile\_origin](#class-tilemap-property-cell-tile-origin) option or in irregular tiles is not relevant when centering those textures. ### [Mode](#enum-tilemap-mode) mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_mode(value) | | *Getter* | get\_mode() | The TileMap orientation mode. See [Mode](#enum-tilemap-mode) for possible values. ### [int](class_int#class-int) navigation\_layers | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_navigation\_layers(value) | | *Getter* | get\_navigation\_layers() | The navigation layers the TileMap generates its navigation regions in. ### [int](class_int#class-int) occluder\_light\_mask | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_occluder\_light\_mask(value) | | *Getter* | get\_occluder\_light\_mask() | The light mask assigned to all light occluders in the TileMap. The TileSet's light occluders will cast shadows only from Light2D(s) that have the same light mask(s). ### [bool](class_bool#class-bool) show\_collision | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_show\_collision(value) | | *Getter* | is\_show\_collision\_enabled() | If `true`, collision shapes are visible in the editor. Doesn't affect collision shapes visibility at runtime. To show collision shapes at runtime, enable **Visible Collision Shapes** in the **Debug** menu instead. ### [TileSet](class_tileset#class-tileset) tile\_set | | | | --- | --- | | *Setter* | set\_tileset(value) | | *Getter* | get\_tileset() | The assigned [TileSet](class_tileset#class-tileset). Method Descriptions ------------------- ### void clear ( ) Clears all cells. ### void fix\_invalid\_tiles ( ) Clears cells that do not exist in the tileset. ### [int](class_int#class-int) get\_cell ( [int](class_int#class-int) x, [int](class_int#class-int) y ) const Returns the tile index of the given cell. If no tile exists in the cell, returns [INVALID\_CELL](#class-tilemap-constant-invalid-cell). ### [Vector2](class_vector2#class-vector2) get\_cell\_autotile\_coord ( [int](class_int#class-int) x, [int](class_int#class-int) y ) const Returns the coordinate (subtile column and row) of the autotile variation in the tileset. Returns a zero vector if the cell doesn't have autotiling. ### [int](class_int#class-int) get\_cellv ( [Vector2](class_vector2#class-vector2) position ) const Returns the tile index of the cell given by a Vector2. If no tile exists in the cell, returns [INVALID\_CELL](#class-tilemap-constant-invalid-cell). ### [bool](class_bool#class-bool) get\_collision\_layer\_bit ( [int](class_int#class-int) bit ) const Returns `true` if the given collision layer bit is set. ### [bool](class_bool#class-bool) get\_collision\_mask\_bit ( [int](class_int#class-int) bit ) const Returns `true` if the given collision mask bit is set. ### [Array](class_array#class-array) get\_used\_cells ( ) const Returns a [Vector2](class_vector2#class-vector2) array with the positions of all cells containing a tile from the tileset (i.e. a tile index different from `-1`). ### [Array](class_array#class-array) get\_used\_cells\_by\_id ( [int](class_int#class-int) id ) const Returns an array of all cells with the given tile index specified in `id`. ### [Rect2](class_rect2#class-rect2) get\_used\_rect ( ) Returns a rectangle enclosing the used (non-empty) tiles of the map. ### [bool](class_bool#class-bool) is\_cell\_transposed ( [int](class_int#class-int) x, [int](class_int#class-int) y ) const Returns `true` if the given cell is transposed, i.e. the X and Y axes are swapped. ### [bool](class_bool#class-bool) is\_cell\_x\_flipped ( [int](class_int#class-int) x, [int](class_int#class-int) y ) const Returns `true` if the given cell is flipped in the X axis. ### [bool](class_bool#class-bool) is\_cell\_y\_flipped ( [int](class_int#class-int) x, [int](class_int#class-int) y ) const Returns `true` if the given cell is flipped in the Y axis. ### [Vector2](class_vector2#class-vector2) map\_to\_world ( [Vector2](class_vector2#class-vector2) map\_position, [bool](class_bool#class-bool) ignore\_half\_ofs=false ) const Returns the local position of the top left corner of the cell corresponding to the given tilemap (grid-based) coordinates. To get the global position, use [Node2D.to\_global](class_node2d#class-node2d-method-to-global): ``` var local_position = my_tilemap.map_to_world(map_position) var global_position = my_tilemap.to_global(local_position) ``` Optionally, the tilemap's half offset can be ignored. ### void set\_cell ( [int](class_int#class-int) x, [int](class_int#class-int) y, [int](class_int#class-int) tile, [bool](class_bool#class-bool) flip\_x=false, [bool](class_bool#class-bool) flip\_y=false, [bool](class_bool#class-bool) transpose=false, [Vector2](class_vector2#class-vector2) autotile\_coord=Vector2( 0, 0 ) ) Sets the tile index for the given cell. An index of `-1` clears the cell. Optionally, the tile can also be flipped, transposed, or given autotile coordinates. The autotile coordinate refers to the column and row of the subtile. **Note:** Data such as navigation polygons and collision shapes are not immediately updated for performance reasons. If you need these to be immediately updated, you can call [update\_dirty\_quadrants](#class-tilemap-method-update-dirty-quadrants). Overriding this method also overrides it internally, allowing custom logic to be implemented when tiles are placed/removed: ``` func set_cell(x, y, tile, flip_x=false, flip_y=false, transpose=false, autotile_coord=Vector2()): # Write your custom logic here. # To call the default method: .set_cell(x, y, tile, flip_x, flip_y, transpose, autotile_coord) ``` ### void set\_cellv ( [Vector2](class_vector2#class-vector2) position, [int](class_int#class-int) tile, [bool](class_bool#class-bool) flip\_x=false, [bool](class_bool#class-bool) flip\_y=false, [bool](class_bool#class-bool) transpose=false, [Vector2](class_vector2#class-vector2) autotile\_coord=Vector2( 0, 0 ) ) Sets the tile index for the cell given by a Vector2. An index of `-1` clears the cell. Optionally, the tile can also be flipped, transposed, or given autotile coordinates. The autotile coordinate refers to the column and row of the subtile. **Note:** Data such as navigation polygons and collision shapes are not immediately updated for performance reasons. If you need these to be immediately updated, you can call [update\_dirty\_quadrants](#class-tilemap-method-update-dirty-quadrants). ### void set\_collision\_layer\_bit ( [int](class_int#class-int) bit, [bool](class_bool#class-bool) value ) Sets the given collision layer bit. ### void set\_collision\_mask\_bit ( [int](class_int#class-int) bit, [bool](class_bool#class-bool) value ) Sets the given collision mask bit. ### void update\_bitmask\_area ( [Vector2](class_vector2#class-vector2) position ) Applies autotiling rules to the cell (and its adjacent cells) referenced by its grid-based X and Y coordinates. ### void update\_bitmask\_region ( [Vector2](class_vector2#class-vector2) start=Vector2( 0, 0 ), [Vector2](class_vector2#class-vector2) end=Vector2( 0, 0 ) ) Applies autotiling rules to the cells in the given region (specified by grid-based X and Y coordinates). Calling with invalid (or missing) parameters applies autotiling rules for the entire tilemap. ### void update\_dirty\_quadrants ( ) Updates the tile map's quadrants, allowing things such as navigation and collision shapes to be immediately used if modified. ### [Vector2](class_vector2#class-vector2) world\_to\_map ( [Vector2](class_vector2#class-vector2) world\_position ) const Returns the tilemap (grid-based) coordinates corresponding to the given local position. To use this with a global position, first determine the local position with [Node2D.to\_local](class_node2d#class-node2d-method-to-local): ``` var local_position = my_tilemap.to_local(global_position) var map_position = my_tilemap.world_to_map(local_position) ```
programming_docs
godot Curve2D Curve2D ======= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Describes a Bézier curve in 2D space. Description ----------- This class describes a Bézier curve in 2D space. It is mainly used to give a shape to a [Path2D](class_path2d#class-path2d), but can be manually sampled for other purposes. It keeps a cache of precalculated points along the curve, to speed up further calculations. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [bake\_interval](#class-curve2d-property-bake-interval) | `5.0` | Methods ------- | | | | --- | --- | | void | [add\_point](#class-curve2d-method-add-point) **(** [Vector2](class_vector2#class-vector2) position, [Vector2](class_vector2#class-vector2) in=Vector2( 0, 0 ), [Vector2](class_vector2#class-vector2) out=Vector2( 0, 0 ), [int](class_int#class-int) index=-1 **)** | | void | [clear\_points](#class-curve2d-method-clear-points) **(** **)** | | [float](class_float#class-float) | [get\_baked\_length](#class-curve2d-method-get-baked-length) **(** **)** const | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [get\_baked\_points](#class-curve2d-method-get-baked-points) **(** **)** const | | [float](class_float#class-float) | [get\_closest\_offset](#class-curve2d-method-get-closest-offset) **(** [Vector2](class_vector2#class-vector2) to\_point **)** const | | [Vector2](class_vector2#class-vector2) | [get\_closest\_point](#class-curve2d-method-get-closest-point) **(** [Vector2](class_vector2#class-vector2) to\_point **)** const | | [int](class_int#class-int) | [get\_point\_count](#class-curve2d-method-get-point-count) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_point\_in](#class-curve2d-method-get-point-in) **(** [int](class_int#class-int) idx **)** const | | [Vector2](class_vector2#class-vector2) | [get\_point\_out](#class-curve2d-method-get-point-out) **(** [int](class_int#class-int) idx **)** const | | [Vector2](class_vector2#class-vector2) | [get\_point\_position](#class-curve2d-method-get-point-position) **(** [int](class_int#class-int) idx **)** const | | [Vector2](class_vector2#class-vector2) | [interpolate](#class-curve2d-method-interpolate) **(** [int](class_int#class-int) idx, [float](class_float#class-float) t **)** const | | [Vector2](class_vector2#class-vector2) | [interpolate\_baked](#class-curve2d-method-interpolate-baked) **(** [float](class_float#class-float) offset, [bool](class_bool#class-bool) cubic=false **)** const | | [Vector2](class_vector2#class-vector2) | [interpolatef](#class-curve2d-method-interpolatef) **(** [float](class_float#class-float) fofs **)** const | | void | [remove\_point](#class-curve2d-method-remove-point) **(** [int](class_int#class-int) idx **)** | | void | [set\_point\_in](#class-curve2d-method-set-point-in) **(** [int](class_int#class-int) idx, [Vector2](class_vector2#class-vector2) position **)** | | void | [set\_point\_out](#class-curve2d-method-set-point-out) **(** [int](class_int#class-int) idx, [Vector2](class_vector2#class-vector2) position **)** | | void | [set\_point\_position](#class-curve2d-method-set-point-position) **(** [int](class_int#class-int) idx, [Vector2](class_vector2#class-vector2) position **)** | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [tessellate](#class-curve2d-method-tessellate) **(** [int](class_int#class-int) max\_stages=5, [float](class_float#class-float) tolerance\_degrees=4 **)** const | Property Descriptions --------------------- ### [float](class_float#class-float) bake\_interval | | | | --- | --- | | *Default* | `5.0` | | *Setter* | set\_bake\_interval(value) | | *Getter* | get\_bake\_interval() | The distance in pixels between two adjacent cached points. Changing it forces the cache to be recomputed the next time the [get\_baked\_points](#class-curve2d-method-get-baked-points) or [get\_baked\_length](#class-curve2d-method-get-baked-length) function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. Method Descriptions ------------------- ### void add\_point ( [Vector2](class_vector2#class-vector2) position, [Vector2](class_vector2#class-vector2) in=Vector2( 0, 0 ), [Vector2](class_vector2#class-vector2) out=Vector2( 0, 0 ), [int](class_int#class-int) index=-1 ) Adds a point with the specified `position` relative to the curve's own position, with control points `in` and `out`. Appends the new point at the end of the point list. If `index` is given, the new point is inserted before the existing point identified by index `index`. Every existing point starting from `index` is shifted further down the list of points. The index must be greater than or equal to `0` and must not exceed the number of existing points in the line. See [get\_point\_count](#class-curve2d-method-get-point-count). ### void clear\_points ( ) Removes all points from the curve. ### [float](class_float#class-float) get\_baked\_length ( ) const Returns the total length of the curve, based on the cached points. Given enough density (see [bake\_interval](#class-curve2d-property-bake-interval)), it should be approximate enough. ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) get\_baked\_points ( ) const Returns the cache of points as a [PoolVector2Array](class_poolvector2array#class-poolvector2array). ### [float](class_float#class-float) get\_closest\_offset ( [Vector2](class_vector2#class-vector2) to\_point ) const Returns the closest offset to `to_point`. This offset is meant to be used in [interpolate\_baked](#class-curve2d-method-interpolate-baked). `to_point` must be in this curve's local space. ### [Vector2](class_vector2#class-vector2) get\_closest\_point ( [Vector2](class_vector2#class-vector2) to\_point ) const Returns the closest baked point (in curve's local space) to `to_point`. `to_point` must be in this curve's local space. ### [int](class_int#class-int) get\_point\_count ( ) const Returns the number of points describing the curve. ### [Vector2](class_vector2#class-vector2) get\_point\_in ( [int](class_int#class-int) idx ) const Returns the position of the control point leading to the vertex `idx`. The returned position is relative to the vertex `idx`. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0)`. ### [Vector2](class_vector2#class-vector2) get\_point\_out ( [int](class_int#class-int) idx ) const Returns the position of the control point leading out of the vertex `idx`. The returned position is relative to the vertex `idx`. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0)`. ### [Vector2](class_vector2#class-vector2) get\_point\_position ( [int](class_int#class-int) idx ) const Returns the position of the vertex `idx`. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0)`. ### [Vector2](class_vector2#class-vector2) interpolate ( [int](class_int#class-int) idx, [float](class_float#class-float) t ) const Returns the position between the vertex `idx` and the vertex `idx + 1`, where `t` controls if the point is the first vertex (`t = 0.0`), the last vertex (`t = 1.0`), or in between. Values of `t` outside the range (`0.0 >= t <=1`) give strange, but predictable results. If `idx` is out of bounds it is truncated to the first or last vertex, and `t` is ignored. If the curve has no points, the function sends an error to the console, and returns `(0, 0)`. ### [Vector2](class_vector2#class-vector2) interpolate\_baked ( [float](class_float#class-float) offset, [bool](class_bool#class-bool) cubic=false ) const Returns a point within the curve at position `offset`, where `offset` is measured as a pixel distance along the curve. To do that, it finds the two cached points where the `offset` lies between, then interpolates the values. This interpolation is cubic if `cubic` is set to `true`, or linear if set to `false`. Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough). ### [Vector2](class_vector2#class-vector2) interpolatef ( [float](class_float#class-float) fofs ) const Returns the position at the vertex `fofs`. It calls [interpolate](#class-curve2d-method-interpolate) using the integer part of `fofs` as `idx`, and its fractional part as `t`. ### void remove\_point ( [int](class_int#class-int) idx ) Deletes the point `idx` from the curve. Sends an error to the console if `idx` is out of bounds. ### void set\_point\_in ( [int](class_int#class-int) idx, [Vector2](class_vector2#class-vector2) position ) Sets the position of the control point leading to the vertex `idx`. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. ### void set\_point\_out ( [int](class_int#class-int) idx, [Vector2](class_vector2#class-vector2) position ) Sets the position of the control point leading out of the vertex `idx`. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. ### void set\_point\_position ( [int](class_int#class-int) idx, [Vector2](class_vector2#class-vector2) position ) Sets the position for the vertex `idx`. If the index is out of bounds, the function sends an error to the console. ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) tessellate ( [int](class_int#class-int) max\_stages=5, [float](class_float#class-float) tolerance\_degrees=4 ) const Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts. This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough. `max_stages` controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! `tolerance_degrees` controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. godot VisualShaderNodeScalarDerivativeFunc VisualShaderNodeScalarDerivativeFunc ==================================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Calculates a scalar derivative within the visual shader graph. Description ----------- This node is only available in `Fragment` and `Light` visual shaders. Properties ---------- | | | | | --- | --- | --- | | [Function](#enum-visualshadernodescalarderivativefunc-function) | [function](#class-visualshadernodescalarderivativefunc-property-function) | `0` | Enumerations ------------ enum **Function**: * **FUNC\_SUM** = **0** --- Sum of absolute derivative in `x` and `y`. * **FUNC\_X** = **1** --- Derivative in `x` using local differencing. * **FUNC\_Y** = **2** --- Derivative in `y` using local differencing. Property Descriptions --------------------- ### [Function](#enum-visualshadernodescalarderivativefunc-function) function | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_function(value) | | *Getter* | get\_function() | The derivative type. See [Function](#enum-visualshadernodescalarderivativefunc-function) for options. godot PoolVector2Array PoolVector2Array ================ A pooled array of [Vector2](class_vector2#class-vector2)s. Description ----------- An array specifically designed to hold [Vector2](class_vector2#class-vector2). Optimized for memory usage, does not fragment the memory. **Note:** This type is passed by value and not by reference. This means that when *mutating* a class property of type `PoolVector2Array` or mutating a `PoolVector2Array` within an [Array](class_array#class-array) or [Dictionary](class_dictionary#class-dictionary), changes will be lost: ``` var array = [PoolVector2Array()] array[0].push_back(Vector2(12, 34)) print(array) # [[]] (empty PoolVector2Array within an Array) ``` Instead, the entire `PoolVector2Array` property must be *reassigned* with `=` for it to be changed: ``` var array = [PoolVector2Array()] var pool_array = array[0] pool_array.push_back(Vector2(12, 34)) array[0] = pool_array print(array) # [[(12, 34)]] (PoolVector2Array with 1 element inside an Array) ``` Tutorials --------- * [2D Navigation Astar Demo](https://godotengine.org/asset-library/asset/519) Methods ------- | | | | --- | --- | | [PoolVector2Array](#class-poolvector2array) | [PoolVector2Array](#class-poolvector2array-method-poolvector2array) **(** [Array](class_array#class-array) from **)** | | void | [append](#class-poolvector2array-method-append) **(** [Vector2](class_vector2#class-vector2) vector2 **)** | | void | [append\_array](#class-poolvector2array-method-append-array) **(** [PoolVector2Array](#class-poolvector2array) array **)** | | [int](class_int#class-int) | [count](#class-poolvector2array-method-count) **(** [Vector2](class_vector2#class-vector2) value **)** | | [bool](class_bool#class-bool) | [empty](#class-poolvector2array-method-empty) **(** **)** | | void | [fill](#class-poolvector2array-method-fill) **(** [Vector2](class_vector2#class-vector2) vector2 **)** | | [int](class_int#class-int) | [find](#class-poolvector2array-method-find) **(** [Vector2](class_vector2#class-vector2) value, [int](class_int#class-int) from=0 **)** | | [bool](class_bool#class-bool) | [has](#class-poolvector2array-method-has) **(** [Vector2](class_vector2#class-vector2) value **)** | | [int](class_int#class-int) | [insert](#class-poolvector2array-method-insert) **(** [int](class_int#class-int) idx, [Vector2](class_vector2#class-vector2) vector2 **)** | | void | [invert](#class-poolvector2array-method-invert) **(** **)** | | void | [push\_back](#class-poolvector2array-method-push-back) **(** [Vector2](class_vector2#class-vector2) vector2 **)** | | void | [remove](#class-poolvector2array-method-remove) **(** [int](class_int#class-int) idx **)** | | void | [resize](#class-poolvector2array-method-resize) **(** [int](class_int#class-int) idx **)** | | [int](class_int#class-int) | [rfind](#class-poolvector2array-method-rfind) **(** [Vector2](class_vector2#class-vector2) value, [int](class_int#class-int) from=-1 **)** | | void | [set](#class-poolvector2array-method-set) **(** [int](class_int#class-int) idx, [Vector2](class_vector2#class-vector2) vector2 **)** | | [int](class_int#class-int) | [size](#class-poolvector2array-method-size) **(** **)** | | void | [sort](#class-poolvector2array-method-sort) **(** **)** | Method Descriptions ------------------- ### [PoolVector2Array](#class-poolvector2array) PoolVector2Array ( [Array](class_array#class-array) from ) Constructs a new `PoolVector2Array`. Optionally, you can pass in a generic [Array](class_array#class-array) that will be converted. ### void append ( [Vector2](class_vector2#class-vector2) vector2 ) Appends an element at the end of the array (alias of [push\_back](#class-poolvector2array-method-push-back)). ### void append\_array ( [PoolVector2Array](#class-poolvector2array) array ) Appends a `PoolVector2Array` at the end of this array. ### [int](class_int#class-int) count ( [Vector2](class_vector2#class-vector2) value ) Returns the number of times an element is in the array. ### [bool](class_bool#class-bool) empty ( ) Returns `true` if the array is empty. ### void fill ( [Vector2](class_vector2#class-vector2) vector2 ) Assigns the given value to all elements in the array. This can typically be used together with [resize](#class-poolvector2array-method-resize) to create an array with a given size and initialized elements. ### [int](class_int#class-int) find ( [Vector2](class_vector2#class-vector2) value, [int](class_int#class-int) from=0 ) Searches the array for a value and returns its index or `-1` if not found. Optionally, the initial search index can be passed. Returns `-1` if `from` is out of bounds. ### [bool](class_bool#class-bool) has ( [Vector2](class_vector2#class-vector2) value ) Returns `true` if the array contains the given value. **Note:** This is equivalent to using the `in` operator. ### [int](class_int#class-int) insert ( [int](class_int#class-int) idx, [Vector2](class_vector2#class-vector2) vector2 ) Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (`idx == size()`). ### void invert ( ) Reverses the order of the elements in the array. ### void push\_back ( [Vector2](class_vector2#class-vector2) vector2 ) Inserts a [Vector2](class_vector2#class-vector2) at the end. ### void remove ( [int](class_int#class-int) idx ) Removes an element from the array by index. ### void resize ( [int](class_int#class-int) idx ) Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. ### [int](class_int#class-int) rfind ( [Vector2](class_vector2#class-vector2) value, [int](class_int#class-int) from=-1 ) Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. ### void set ( [int](class_int#class-int) idx, [Vector2](class_vector2#class-vector2) vector2 ) Changes the [Vector2](class_vector2#class-vector2) at the given index. ### [int](class_int#class-int) size ( ) Returns the number of elements in the array. ### void sort ( ) Sorts the elements of the array in ascending order. godot NetworkedMultiplayerPeer NetworkedMultiplayerPeer ======================== **Inherits:** [PacketPeer](class_packetpeer#class-packetpeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [MultiplayerPeerGDNative](class_multiplayerpeergdnative#class-multiplayerpeergdnative), [NetworkedMultiplayerCustom](class_networkedmultiplayercustom#class-networkedmultiplayercustom), [NetworkedMultiplayerENet](class_networkedmultiplayerenet#class-networkedmultiplayerenet), [WebRTCMultiplayer](class_webrtcmultiplayer#class-webrtcmultiplayer), [WebSocketMultiplayerPeer](class_websocketmultiplayerpeer#class-websocketmultiplayerpeer) A high-level network interface to simplify multiplayer interactions. Description ----------- Manages the connection to network peers. Assigns unique IDs to each client connected to the server. See also [MultiplayerAPI](class_multiplayerapi#class-multiplayerapi). **Note:** The high-level multiplayer API protocol is an implementation detail and isn't meant to be used by non-Godot servers. It may change without notice. Tutorials --------- * [High-level multiplayer](https://docs.godotengine.org/en/3.5/tutorials/networking/high_level_multiplayer.html) * [WebRTC Signaling Demo](https://godotengine.org/asset-library/asset/537) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [refuse\_new\_connections](#class-networkedmultiplayerpeer-property-refuse-new-connections) | `false` | | [TransferMode](#enum-networkedmultiplayerpeer-transfermode) | [transfer\_mode](#class-networkedmultiplayerpeer-property-transfer-mode) | `2` | Methods ------- | | | | --- | --- | | [ConnectionStatus](#enum-networkedmultiplayerpeer-connectionstatus) | [get\_connection\_status](#class-networkedmultiplayerpeer-method-get-connection-status) **(** **)** const | | [int](class_int#class-int) | [get\_packet\_peer](#class-networkedmultiplayerpeer-method-get-packet-peer) **(** **)** const | | [int](class_int#class-int) | [get\_unique\_id](#class-networkedmultiplayerpeer-method-get-unique-id) **(** **)** const | | void | [poll](#class-networkedmultiplayerpeer-method-poll) **(** **)** | | void | [set\_target\_peer](#class-networkedmultiplayerpeer-method-set-target-peer) **(** [int](class_int#class-int) id **)** | Signals ------- ### connection\_failed ( ) Emitted when a connection attempt fails. ### connection\_succeeded ( ) Emitted when a connection attempt succeeds. ### peer\_connected ( [int](class_int#class-int) id ) Emitted by the server when a client connects. ### peer\_disconnected ( [int](class_int#class-int) id ) Emitted by the server when a client disconnects. ### server\_disconnected ( ) Emitted by clients when the server disconnects. Enumerations ------------ enum **TransferMode**: * **TRANSFER\_MODE\_UNRELIABLE** = **0** --- Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than [TRANSFER\_MODE\_UNRELIABLE\_ORDERED](#class-networkedmultiplayerpeer-constant-transfer-mode-unreliable-ordered). Use for non-critical data, and always consider whether the order matters. * **TRANSFER\_MODE\_UNRELIABLE\_ORDERED** = **1** --- Packets are not acknowledged, no resend attempts are made for lost packets. Packets are received in the order they were sent in. Potentially faster than [TRANSFER\_MODE\_RELIABLE](#class-networkedmultiplayerpeer-constant-transfer-mode-reliable). Use for non-critical data or data that would be outdated if received late due to resend attempt(s) anyway, for example movement and positional data. * **TRANSFER\_MODE\_RELIABLE** = **2** --- Packets must be received and resend attempts should be made until the packets are acknowledged. Packets must be received in the order they were sent in. Most reliable transfer mode, but potentially the slowest due to the overhead. Use for critical data that must be transmitted and arrive in order, for example an ability being triggered or a chat message. Consider carefully if the information really is critical, and use sparingly. enum **ConnectionStatus**: * **CONNECTION\_DISCONNECTED** = **0** --- The ongoing connection disconnected. * **CONNECTION\_CONNECTING** = **1** --- A connection attempt is ongoing. * **CONNECTION\_CONNECTED** = **2** --- The connection attempt succeeded. Constants --------- * **TARGET\_PEER\_BROADCAST** = **0** --- Packets are sent to the server and then redistributed to other peers. * **TARGET\_PEER\_SERVER** = **1** --- Packets are sent to the server alone. Property Descriptions --------------------- ### [bool](class_bool#class-bool) refuse\_new\_connections | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_refuse\_new\_connections(value) | | *Getter* | is\_refusing\_new\_connections() | If `true`, this `NetworkedMultiplayerPeer` refuses new connections. ### [TransferMode](#enum-networkedmultiplayerpeer-transfermode) transfer\_mode | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_transfer\_mode(value) | | *Getter* | get\_transfer\_mode() | The manner in which to send packets to the `target_peer`. See [TransferMode](#enum-networkedmultiplayerpeer-transfermode). Method Descriptions ------------------- ### [ConnectionStatus](#enum-networkedmultiplayerpeer-connectionstatus) get\_connection\_status ( ) const Returns the current state of the connection. See [ConnectionStatus](#enum-networkedmultiplayerpeer-connectionstatus). ### [int](class_int#class-int) get\_packet\_peer ( ) const Returns the ID of the `NetworkedMultiplayerPeer` who sent the most recent packet. ### [int](class_int#class-int) get\_unique\_id ( ) const Returns the ID of this `NetworkedMultiplayerPeer`. ### void poll ( ) Waits up to 1 second to receive a new network event. ### void set\_target\_peer ( [int](class_int#class-int) id ) Sets the peer to which packets will be sent. The `id` can be one of: [TARGET\_PEER\_BROADCAST](#class-networkedmultiplayerpeer-constant-target-peer-broadcast) to send to all connected peers, [TARGET\_PEER\_SERVER](#class-networkedmultiplayerpeer-constant-target-peer-server) to send to the peer acting as server, a valid peer ID to send to that specific peer, a negative peer ID to send to all peers except that one. By default, the target peer is [TARGET\_PEER\_BROADCAST](#class-networkedmultiplayerpeer-constant-target-peer-broadcast).
programming_docs
godot Gradient Gradient ======== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A color interpolator resource which can be used to generate colors between user-defined color points. Description ----------- Given a set of colors, this resource will interpolate them in order. This means that if you have color 1, color 2 and color 3, the gradient will interpolate from color 1 to color 2 and from color 2 to color 3. The gradient will initially have 2 colors (black and white), one (black) at gradient lower offset 0 and the other (white) at the gradient higher offset 1. See also [Curve](class_curve#class-curve) which supports more complex easing methods, but does not support colors. Properties ---------- | | | | | --- | --- | --- | | [PoolColorArray](class_poolcolorarray#class-poolcolorarray) | [colors](#class-gradient-property-colors) | `PoolColorArray( 0, 0, 0, 1, 1, 1, 1, 1 )` | | [InterpolationMode](#enum-gradient-interpolationmode) | [interpolation\_mode](#class-gradient-property-interpolation-mode) | `0` | | [PoolRealArray](class_poolrealarray#class-poolrealarray) | [offsets](#class-gradient-property-offsets) | `PoolRealArray( 0, 1 )` | Methods ------- | | | | --- | --- | | void | [add\_point](#class-gradient-method-add-point) **(** [float](class_float#class-float) offset, [Color](class_color#class-color) color **)** | | [Color](class_color#class-color) | [get\_color](#class-gradient-method-get-color) **(** [int](class_int#class-int) point **)** | | [float](class_float#class-float) | [get\_offset](#class-gradient-method-get-offset) **(** [int](class_int#class-int) point **)** | | [int](class_int#class-int) | [get\_point\_count](#class-gradient-method-get-point-count) **(** **)** const | | [Color](class_color#class-color) | [interpolate](#class-gradient-method-interpolate) **(** [float](class_float#class-float) offset **)** | | void | [remove\_point](#class-gradient-method-remove-point) **(** [int](class_int#class-int) point **)** | | void | [set\_color](#class-gradient-method-set-color) **(** [int](class_int#class-int) point, [Color](class_color#class-color) color **)** | | void | [set\_offset](#class-gradient-method-set-offset) **(** [int](class_int#class-int) point, [float](class_float#class-float) offset **)** | Enumerations ------------ enum **InterpolationMode**: * **GRADIENT\_INTERPOLATE\_LINEAR** = **0** --- Linear interpolation. * **GRADIENT\_INTERPOLATE\_CONSTANT** = **1** --- Constant interpolation, color changes abruptly at each point and stays uniform between. This might cause visible aliasing when used for a gradient texture in some cases. * **GRADIENT\_INTERPOLATE\_CUBIC** = **2** --- Cubic interpolation. Property Descriptions --------------------- ### [PoolColorArray](class_poolcolorarray#class-poolcolorarray) colors | | | | --- | --- | | *Default* | `PoolColorArray( 0, 0, 0, 1, 1, 1, 1, 1 )` | | *Setter* | set\_colors(value) | | *Getter* | get\_colors() | Gradient's colors returned as a [PoolColorArray](class_poolcolorarray#class-poolcolorarray). ### [InterpolationMode](#enum-gradient-interpolationmode) interpolation\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_interpolation\_mode(value) | | *Getter* | get\_interpolation\_mode() | Defines how the colors between points of the gradient are interpolated. See [InterpolationMode](#enum-gradient-interpolationmode) for available modes. ### [PoolRealArray](class_poolrealarray#class-poolrealarray) offsets | | | | --- | --- | | *Default* | `PoolRealArray( 0, 1 )` | | *Setter* | set\_offsets(value) | | *Getter* | get\_offsets() | Gradient's offsets returned as a [PoolRealArray](class_poolrealarray#class-poolrealarray). Method Descriptions ------------------- ### void add\_point ( [float](class_float#class-float) offset, [Color](class_color#class-color) color ) Adds the specified color to the end of the ramp, with the specified offset. ### [Color](class_color#class-color) get\_color ( [int](class_int#class-int) point ) Returns the color of the ramp color at index `point`. ### [float](class_float#class-float) get\_offset ( [int](class_int#class-int) point ) Returns the offset of the ramp color at index `point`. ### [int](class_int#class-int) get\_point\_count ( ) const Returns the number of colors in the ramp. ### [Color](class_color#class-color) interpolate ( [float](class_float#class-float) offset ) Returns the interpolated color specified by `offset`. ### void remove\_point ( [int](class_int#class-int) point ) Removes the color at the index `point`. ### void set\_color ( [int](class_int#class-int) point, [Color](class_color#class-color) color ) Sets the color of the ramp color at index `point`. ### void set\_offset ( [int](class_int#class-int) point, [float](class_float#class-float) offset ) Sets the offset for the ramp color at index `point`. godot MenuButton MenuButton ========== **Inherits:** [Button](class_button#class-button) **<** [BaseButton](class_basebutton#class-basebutton) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Special button that brings up a [PopupMenu](class_popupmenu#class-popupmenu) when clicked. Description ----------- Special button that brings up a [PopupMenu](class_popupmenu#class-popupmenu) when clicked. New items can be created inside this [PopupMenu](class_popupmenu#class-popupmenu) using `get_popup().add_item("My Item Name")`. You can also create them directly from the editor. To do so, select the `MenuButton` node, then in the toolbar at the top of the 2D editor, click **Items** then click **Add** in the popup. You will be able to give each item new properties. See also [BaseButton](class_basebutton#class-basebutton) which contains common properties and methods associated with this node. Properties ---------- | | | | | --- | --- | --- | | [ActionMode](class_basebutton#enum-basebutton-actionmode) | action\_mode | `0` (overrides [BaseButton](class_basebutton#class-basebutton-property-action-mode)) | | [bool](class_bool#class-bool) | flat | `true` (overrides [Button](class_button#class-button-property-flat)) | | [FocusMode](class_control#enum-control-focusmode) | focus\_mode | `0` (overrides [Control](class_control#class-control-property-focus-mode)) | | [bool](class_bool#class-bool) | [switch\_on\_hover](#class-menubutton-property-switch-on-hover) | `false` | | [bool](class_bool#class-bool) | toggle\_mode | `true` (overrides [BaseButton](class_basebutton#class-basebutton-property-toggle-mode)) | Methods ------- | | | | --- | --- | | [PopupMenu](class_popupmenu#class-popupmenu) | [get\_popup](#class-menubutton-method-get-popup) **(** **)** const | | void | [set\_disable\_shortcuts](#class-menubutton-method-set-disable-shortcuts) **(** [bool](class_bool#class-bool) disabled **)** | Theme Properties ---------------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [font\_color](#class-menubutton-theme-color-font-color) | `Color( 0.88, 0.88, 0.88, 1 )` | | [Color](class_color#class-color) | [font\_color\_disabled](#class-menubutton-theme-color-font-color-disabled) | `Color( 1, 1, 1, 0.3 )` | | [Color](class_color#class-color) | [font\_color\_focus](#class-menubutton-theme-color-font-color-focus) | `Color( 0.94, 0.94, 0.94, 1 )` | | [Color](class_color#class-color) | [font\_color\_hover](#class-menubutton-theme-color-font-color-hover) | `Color( 0.94, 0.94, 0.94, 1 )` | | [Color](class_color#class-color) | [font\_color\_pressed](#class-menubutton-theme-color-font-color-pressed) | `Color( 1, 1, 1, 1 )` | | [int](class_int#class-int) | [hseparation](#class-menubutton-theme-constant-hseparation) | `3` | | [Font](class_font#class-font) | [font](#class-menubutton-theme-font-font) | | | [StyleBox](class_stylebox#class-stylebox) | [disabled](#class-menubutton-theme-style-disabled) | | | [StyleBox](class_stylebox#class-stylebox) | [focus](#class-menubutton-theme-style-focus) | | | [StyleBox](class_stylebox#class-stylebox) | [hover](#class-menubutton-theme-style-hover) | | | [StyleBox](class_stylebox#class-stylebox) | [normal](#class-menubutton-theme-style-normal) | | | [StyleBox](class_stylebox#class-stylebox) | [pressed](#class-menubutton-theme-style-pressed) | | Signals ------- ### about\_to\_show ( ) Emitted when [PopupMenu](class_popupmenu#class-popupmenu) of this MenuButton is about to show. Property Descriptions --------------------- ### [bool](class_bool#class-bool) switch\_on\_hover | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_switch\_on\_hover(value) | | *Getter* | is\_switch\_on\_hover() | If `true`, when the cursor hovers above another `MenuButton` within the same parent which also has `switch_on_hover` enabled, it will close the current `MenuButton` and open the other one. Method Descriptions ------------------- ### [PopupMenu](class_popupmenu#class-popupmenu) get\_popup ( ) const Returns the [PopupMenu](class_popupmenu#class-popupmenu) contained in this button. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. ### void set\_disable\_shortcuts ( [bool](class_bool#class-bool) disabled ) If `true`, shortcuts are disabled and cannot be used to trigger the button. Theme Property Descriptions --------------------------- ### [Color](class_color#class-color) font\_color | | | | --- | --- | | *Default* | `Color( 0.88, 0.88, 0.88, 1 )` | Default text [Color](class_color#class-color) of the `MenuButton`. ### [Color](class_color#class-color) font\_color\_disabled | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 0.3 )` | Text [Color](class_color#class-color) used when the `MenuButton` is disabled. ### [Color](class_color#class-color) font\_color\_focus | | | | --- | --- | | *Default* | `Color( 0.94, 0.94, 0.94, 1 )` | Text [Color](class_color#class-color) used when the `MenuButton` is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color. ### [Color](class_color#class-color) font\_color\_hover | | | | --- | --- | | *Default* | `Color( 0.94, 0.94, 0.94, 1 )` | Text [Color](class_color#class-color) used when the `MenuButton` is being hovered. ### [Color](class_color#class-color) font\_color\_pressed | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | Text [Color](class_color#class-color) used when the `MenuButton` is being pressed. ### [int](class_int#class-int) hseparation | | | | --- | --- | | *Default* | `3` | The horizontal space between `MenuButton`'s icon and text. ### [Font](class_font#class-font) font [Font](class_font#class-font) of the `MenuButton`'s text. ### [StyleBox](class_stylebox#class-stylebox) disabled [StyleBox](class_stylebox#class-stylebox) used when the `MenuButton` is disabled. ### [StyleBox](class_stylebox#class-stylebox) focus [StyleBox](class_stylebox#class-stylebox) used when the `MenuButton` is focused. It is displayed over the current [StyleBox](class_stylebox#class-stylebox), so using [StyleBoxEmpty](class_styleboxempty#class-styleboxempty) will just disable the focus visual effect. ### [StyleBox](class_stylebox#class-stylebox) hover [StyleBox](class_stylebox#class-stylebox) used when the `MenuButton` is being hovered. ### [StyleBox](class_stylebox#class-stylebox) normal Default [StyleBox](class_stylebox#class-stylebox) for the `MenuButton`. ### [StyleBox](class_stylebox#class-stylebox) pressed [StyleBox](class_stylebox#class-stylebox) used when the `MenuButton` is being pressed. godot ARVROrigin ARVROrigin ========== **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) The origin point in AR/VR. Description ----------- This is a special node within the AR/VR system that maps the physical location of the center of our tracking space to the virtual location within our game world. There should be only one of these nodes in your scene and you must have one. All the ARVRCamera, ARVRController and ARVRAnchor nodes should be direct children of this node for spatial tracking to work correctly. It is the position of this node that you update when your character needs to move through your game world while we're not moving in the real world. Movement in the real world is always in relation to this origin point. For example, if your character is driving a car, the ARVROrigin node should be a child node of this car. Or, if you're implementing a teleport system to move your character, you should change the position of this node. Tutorials --------- * [XR (AR/VR)](https://docs.godotengine.org/en/3.5/tutorials/vr/index.html) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [world\_scale](#class-arvrorigin-property-world-scale) | `1.0` | Property Descriptions --------------------- ### [float](class_float#class-float) world\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_world\_scale(value) | | *Getter* | get\_world\_scale() | Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter. **Note:** This method is a passthrough to the [ARVRServer](class_arvrserver#class-arvrserver) itself. godot Skeleton2D Skeleton2D ========== **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Skeleton for 2D characters and animated objects. Description ----------- Skeleton2D parents a hierarchy of [Bone2D](class_bone2d#class-bone2d) objects. It is a requirement of [Bone2D](class_bone2d#class-bone2d). Skeleton2D holds a reference to the rest pose of its children and acts as a single point of access to its bones. Tutorials --------- * [2D skeletons](https://docs.godotengine.org/en/3.5/tutorials/animation/2d_skeletons.html) Methods ------- | | | | --- | --- | | [Bone2D](class_bone2d#class-bone2d) | [get\_bone](#class-skeleton2d-method-get-bone) **(** [int](class_int#class-int) idx **)** | | [int](class_int#class-int) | [get\_bone\_count](#class-skeleton2d-method-get-bone-count) **(** **)** const | | [RID](class_rid#class-rid) | [get\_skeleton](#class-skeleton2d-method-get-skeleton) **(** **)** const | Signals ------- ### bone\_setup\_changed ( ) Method Descriptions ------------------- ### [Bone2D](class_bone2d#class-bone2d) get\_bone ( [int](class_int#class-int) idx ) Returns a [Bone2D](class_bone2d#class-bone2d) from the node hierarchy parented by Skeleton2D. The object to return is identified by the parameter `idx`. Bones are indexed by descending the node hierarchy from top to bottom, adding the children of each branch before moving to the next sibling. ### [int](class_int#class-int) get\_bone\_count ( ) const Returns the number of [Bone2D](class_bone2d#class-bone2d) nodes in the node hierarchy parented by Skeleton2D. ### [RID](class_rid#class-rid) get\_skeleton ( ) const Returns the [RID](class_rid#class-rid) of a Skeleton2D instance. godot Panel Panel ===== **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Provides an opaque background for [Control](class_control#class-control) children. Description ----------- Panel is a [Control](class_control#class-control) that displays an opaque background. It's commonly used as a parent and container for other types of [Control](class_control#class-control) nodes. Tutorials --------- * [2D Role Playing Game Demo](https://godotengine.org/asset-library/asset/520) * [2D Finite State Machine Demo](https://godotengine.org/asset-library/asset/516) * [3D Inverse Kinematics Demo](https://godotengine.org/asset-library/asset/523) Theme Properties ---------------- | | | | --- | --- | | [StyleBox](class_stylebox#class-stylebox) | [panel](#class-panel-theme-style-panel) | Theme Property Descriptions --------------------------- ### [StyleBox](class_stylebox#class-stylebox) panel The style of this `Panel`. godot SpriteBase3D SpriteBase3D ============ **Inherits:** [GeometryInstance](class_geometryinstance#class-geometryinstance) **<** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [AnimatedSprite3D](class_animatedsprite3d#class-animatedsprite3d), [Sprite3D](class_sprite3d#class-sprite3d) 2D sprite node in 3D environment. Description ----------- A node that displays 2D texture information in a 3D environment. Properties ---------- | | | | | --- | --- | --- | | [AlphaCutMode](#enum-spritebase3d-alphacutmode) | [alpha\_cut](#class-spritebase3d-property-alpha-cut) | `0` | | Vector3.Axis | [axis](#class-spritebase3d-property-axis) | `2` | | [BillboardMode](class_spatialmaterial#enum-spatialmaterial-billboardmode) | [billboard](#class-spritebase3d-property-billboard) | `0` | | [bool](class_bool#class-bool) | [centered](#class-spritebase3d-property-centered) | `true` | | [bool](class_bool#class-bool) | [double\_sided](#class-spritebase3d-property-double-sided) | `true` | | [bool](class_bool#class-bool) | [fixed\_size](#class-spritebase3d-property-fixed-size) | `false` | | [bool](class_bool#class-bool) | [flip\_h](#class-spritebase3d-property-flip-h) | `false` | | [bool](class_bool#class-bool) | [flip\_v](#class-spritebase3d-property-flip-v) | `false` | | [Color](class_color#class-color) | [modulate](#class-spritebase3d-property-modulate) | `Color( 1, 1, 1, 1 )` | | [bool](class_bool#class-bool) | [no\_depth\_test](#class-spritebase3d-property-no-depth-test) | `false` | | [Vector2](class_vector2#class-vector2) | [offset](#class-spritebase3d-property-offset) | `Vector2( 0, 0 )` | | [float](class_float#class-float) | [opacity](#class-spritebase3d-property-opacity) | `1.0` | | [float](class_float#class-float) | [pixel\_size](#class-spritebase3d-property-pixel-size) | `0.01` | | [int](class_int#class-int) | [render\_priority](#class-spritebase3d-property-render-priority) | `0` | | [bool](class_bool#class-bool) | [shaded](#class-spritebase3d-property-shaded) | `false` | | [bool](class_bool#class-bool) | [transparent](#class-spritebase3d-property-transparent) | `true` | Methods ------- | | | | --- | --- | | [TriangleMesh](class_trianglemesh#class-trianglemesh) | [generate\_triangle\_mesh](#class-spritebase3d-method-generate-triangle-mesh) **(** **)** const | | [bool](class_bool#class-bool) | [get\_draw\_flag](#class-spritebase3d-method-get-draw-flag) **(** [DrawFlags](#enum-spritebase3d-drawflags) flag **)** const | | [Rect2](class_rect2#class-rect2) | [get\_item\_rect](#class-spritebase3d-method-get-item-rect) **(** **)** const | | void | [set\_draw\_flag](#class-spritebase3d-method-set-draw-flag) **(** [DrawFlags](#enum-spritebase3d-drawflags) flag, [bool](class_bool#class-bool) enabled **)** | Enumerations ------------ enum **DrawFlags**: * **FLAG\_TRANSPARENT** = **0** --- If set, the texture's transparency and the opacity are used to make those parts of the sprite invisible. * **FLAG\_SHADED** = **1** --- If set, lights in the environment affect the sprite. * **FLAG\_DOUBLE\_SIDED** = **2** --- If set, texture can be seen from the back as well, if not, it is invisible when looking at it from behind. * **FLAG\_DISABLE\_DEPTH\_TEST** = **3** --- Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it. * **FLAG\_FIXED\_SIZE** = **4** --- Sprite is scaled by depth so that it always appears the same size on screen. * **FLAG\_MAX** = **5** --- Represents the size of the [DrawFlags](#enum-spritebase3d-drawflags) enum. enum **AlphaCutMode**: * **ALPHA\_CUT\_DISABLED** = **0** * **ALPHA\_CUT\_DISCARD** = **1** * **ALPHA\_CUT\_OPAQUE\_PREPASS** = **2** Property Descriptions --------------------- ### [AlphaCutMode](#enum-spritebase3d-alphacutmode) alpha\_cut | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_alpha\_cut\_mode(value) | | *Getter* | get\_alpha\_cut\_mode() | ### Vector3.Axis axis | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_axis(value) | | *Getter* | get\_axis() | The direction in which the front of the texture faces. ### [BillboardMode](class_spatialmaterial#enum-spatialmaterial-billboardmode) billboard | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_billboard\_mode(value) | | *Getter* | get\_billboard\_mode() | ### [bool](class_bool#class-bool) centered | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_centered(value) | | *Getter* | is\_centered() | If `true`, texture will be centered. ### [bool](class_bool#class-bool) double\_sided | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_draw\_flag(value) | | *Getter* | get\_draw\_flag() | If `true`, texture can be seen from the back as well, if `false`, it is invisible when looking at it from behind. ### [bool](class_bool#class-bool) fixed\_size | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_draw\_flag(value) | | *Getter* | get\_draw\_flag() | If `true`, the label is rendered at the same size regardless of distance. ### [bool](class_bool#class-bool) flip\_h | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flip\_h(value) | | *Getter* | is\_flipped\_h() | If `true`, texture is flipped horizontally. ### [bool](class_bool#class-bool) flip\_v | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flip\_v(value) | | *Getter* | is\_flipped\_v() | If `true`, texture is flipped vertically. ### [Color](class_color#class-color) modulate | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_modulate(value) | | *Getter* | get\_modulate() | A color value used to *multiply* the texture's colors. Can be used for mood-coloring or to simulate the color of light. **Note:** If a [GeometryInstance.material\_override](class_geometryinstance#class-geometryinstance-property-material-override) is defined on the `SpriteBase3D`, the material override must be configured to take vertex colors into account for albedo. Otherwise, the color defined in [modulate](#class-spritebase3d-property-modulate) will be ignored. For a [SpatialMaterial](class_spatialmaterial#class-spatialmaterial), [SpatialMaterial.vertex\_color\_use\_as\_albedo](class_spatialmaterial#class-spatialmaterial-property-vertex-color-use-as-albedo) must be `true`. For a [ShaderMaterial](class_shadermaterial#class-shadermaterial), `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. ### [bool](class_bool#class-bool) no\_depth\_test | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_draw\_flag(value) | | *Getter* | get\_draw\_flag() | If `true`, depth testing is disabled and the object will be drawn in render order. ### [Vector2](class_vector2#class-vector2) offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_offset(value) | | *Getter* | get\_offset() | The texture's drawing offset. ### [float](class_float#class-float) opacity | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_opacity(value) | | *Getter* | get\_opacity() | The texture's visibility on a scale from `0` (fully invisible) to `1` (fully visible). [opacity](#class-spritebase3d-property-opacity) is a multiplier for the [modulate](#class-spritebase3d-property-modulate) color's alpha channel. **Note:** If a [GeometryInstance.material\_override](class_geometryinstance#class-geometryinstance-property-material-override) is defined on the `SpriteBase3D`, the material override must be configured to take vertex colors into account for albedo. Otherwise, the opacity defined in [opacity](#class-spritebase3d-property-opacity) will be ignored. For a [SpatialMaterial](class_spatialmaterial#class-spatialmaterial), [SpatialMaterial.vertex\_color\_use\_as\_albedo](class_spatialmaterial#class-spatialmaterial-property-vertex-color-use-as-albedo) must be `true`. For a [ShaderMaterial](class_shadermaterial#class-shadermaterial), `ALPHA *= COLOR.a;` must be inserted in the shader's `fragment()` function. ### [float](class_float#class-float) pixel\_size | | | | --- | --- | | *Default* | `0.01` | | *Setter* | set\_pixel\_size(value) | | *Getter* | get\_pixel\_size() | The size of one pixel's width on the sprite to scale it in 3D. ### [int](class_int#class-int) render\_priority | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_render\_priority(value) | | *Getter* | get\_render\_priority() | Sets the render priority for the sprite. Higher priority objects will be sorted in front of lower priority objects. **Note:** This only applies if [alpha\_cut](#class-spritebase3d-property-alpha-cut) is set to [ALPHA\_CUT\_DISABLED](#class-spritebase3d-constant-alpha-cut-disabled) (default value). **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). ### [bool](class_bool#class-bool) shaded | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_draw\_flag(value) | | *Getter* | get\_draw\_flag() | If `true`, the [Light](class_light#class-light) in the [Environment](class_environment#class-environment) has effects on the sprite. ### [bool](class_bool#class-bool) transparent | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_draw\_flag(value) | | *Getter* | get\_draw\_flag() | If `true`, the texture's transparency and the opacity are used to make those parts of the sprite invisible. Method Descriptions ------------------- ### [TriangleMesh](class_trianglemesh#class-trianglemesh) generate\_triangle\_mesh ( ) const ### [bool](class_bool#class-bool) get\_draw\_flag ( [DrawFlags](#enum-spritebase3d-drawflags) flag ) const Returns the value of the specified flag. ### [Rect2](class_rect2#class-rect2) get\_item\_rect ( ) const Returns the rectangle representing this sprite. ### void set\_draw\_flag ( [DrawFlags](#enum-spritebase3d-drawflags) flag, [bool](class_bool#class-bool) enabled ) If `true`, the specified flag will be enabled.
programming_docs
godot StyleBoxTexture StyleBoxTexture =============== **Inherits:** [StyleBox](class_stylebox#class-stylebox) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Texture-based nine-patch [StyleBox](class_stylebox#class-stylebox). Description ----------- Texture-based nine-patch [StyleBox](class_stylebox#class-stylebox), in a way similar to [NinePatchRect](class_ninepatchrect#class-ninepatchrect). This stylebox performs a 3×3 scaling of a texture, where only the center cell is fully stretched. This makes it possible to design bordered styles regardless of the stylebox's size. Properties ---------- | | | | | --- | --- | --- | | [AxisStretchMode](#enum-styleboxtexture-axisstretchmode) | [axis\_stretch\_horizontal](#class-styleboxtexture-property-axis-stretch-horizontal) | `0` | | [AxisStretchMode](#enum-styleboxtexture-axisstretchmode) | [axis\_stretch\_vertical](#class-styleboxtexture-property-axis-stretch-vertical) | `0` | | [bool](class_bool#class-bool) | [draw\_center](#class-styleboxtexture-property-draw-center) | `true` | | [float](class_float#class-float) | [expand\_margin\_bottom](#class-styleboxtexture-property-expand-margin-bottom) | `0.0` | | [float](class_float#class-float) | [expand\_margin\_left](#class-styleboxtexture-property-expand-margin-left) | `0.0` | | [float](class_float#class-float) | [expand\_margin\_right](#class-styleboxtexture-property-expand-margin-right) | `0.0` | | [float](class_float#class-float) | [expand\_margin\_top](#class-styleboxtexture-property-expand-margin-top) | `0.0` | | [float](class_float#class-float) | [margin\_bottom](#class-styleboxtexture-property-margin-bottom) | `0.0` | | [float](class_float#class-float) | [margin\_left](#class-styleboxtexture-property-margin-left) | `0.0` | | [float](class_float#class-float) | [margin\_right](#class-styleboxtexture-property-margin-right) | `0.0` | | [float](class_float#class-float) | [margin\_top](#class-styleboxtexture-property-margin-top) | `0.0` | | [Color](class_color#class-color) | [modulate\_color](#class-styleboxtexture-property-modulate-color) | `Color( 1, 1, 1, 1 )` | | [Texture](class_texture#class-texture) | [normal\_map](#class-styleboxtexture-property-normal-map) | | | [Rect2](class_rect2#class-rect2) | [region\_rect](#class-styleboxtexture-property-region-rect) | `Rect2( 0, 0, 0, 0 )` | | [Texture](class_texture#class-texture) | [texture](#class-styleboxtexture-property-texture) | | Methods ------- | | | | --- | --- | | [float](class_float#class-float) | [get\_expand\_margin\_size](#class-styleboxtexture-method-get-expand-margin-size) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin **)** const | | [float](class_float#class-float) | [get\_margin\_size](#class-styleboxtexture-method-get-margin-size) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin **)** const | | void | [set\_expand\_margin\_all](#class-styleboxtexture-method-set-expand-margin-all) **(** [float](class_float#class-float) size **)** | | void | [set\_expand\_margin\_individual](#class-styleboxtexture-method-set-expand-margin-individual) **(** [float](class_float#class-float) size\_left, [float](class_float#class-float) size\_top, [float](class_float#class-float) size\_right, [float](class_float#class-float) size\_bottom **)** | | void | [set\_expand\_margin\_size](#class-styleboxtexture-method-set-expand-margin-size) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) size **)** | | void | [set\_margin\_size](#class-styleboxtexture-method-set-margin-size) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) size **)** | Signals ------- ### texture\_changed ( ) Emitted when the stylebox's texture is changed. Enumerations ------------ enum **AxisStretchMode**: * **AXIS\_STRETCH\_MODE\_STRETCH** = **0** --- Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly. * **AXIS\_STRETCH\_MODE\_TILE** = **1** --- Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. * **AXIS\_STRETCH\_MODE\_TILE\_FIT** = **2** --- Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. Unlike [AXIS\_STRETCH\_MODE\_TILE](#class-styleboxtexture-constant-axis-stretch-mode-tile), the texture may be slightly stretched to make the nine-patch texture tile seamlessly. Property Descriptions --------------------- ### [AxisStretchMode](#enum-styleboxtexture-axisstretchmode) axis\_stretch\_horizontal | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_h\_axis\_stretch\_mode(value) | | *Getter* | get\_h\_axis\_stretch\_mode() | Controls how the stylebox's texture will be stretched or tiled horizontally. See [AxisStretchMode](#enum-styleboxtexture-axisstretchmode) for possible values. ### [AxisStretchMode](#enum-styleboxtexture-axisstretchmode) axis\_stretch\_vertical | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_v\_axis\_stretch\_mode(value) | | *Getter* | get\_v\_axis\_stretch\_mode() | Controls how the stylebox's texture will be stretched or tiled vertically. See [AxisStretchMode](#enum-styleboxtexture-axisstretchmode) for possible values. ### [bool](class_bool#class-bool) draw\_center | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_draw\_center(value) | | *Getter* | is\_draw\_center\_enabled() | If `true`, the nine-patch texture's center tile will be drawn. ### [float](class_float#class-float) expand\_margin\_bottom | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_expand\_margin\_size(value) | | *Getter* | get\_expand\_margin\_size() | Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested. ### [float](class_float#class-float) expand\_margin\_left | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_expand\_margin\_size(value) | | *Getter* | get\_expand\_margin\_size() | Expands the left margin of this style box when drawing, causing it to be drawn larger than requested. ### [float](class_float#class-float) expand\_margin\_right | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_expand\_margin\_size(value) | | *Getter* | get\_expand\_margin\_size() | Expands the right margin of this style box when drawing, causing it to be drawn larger than requested. ### [float](class_float#class-float) expand\_margin\_top | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_expand\_margin\_size(value) | | *Getter* | get\_expand\_margin\_size() | Expands the top margin of this style box when drawing, causing it to be drawn larger than requested. ### [float](class_float#class-float) margin\_bottom | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_margin\_size(value) | | *Getter* | get\_margin\_size() | Increases the bottom margin of the 3×3 texture box. A higher value means more of the source texture is considered to be part of the bottom border of the 3×3 box. This is also the value used as fallback for [StyleBox.content\_margin\_bottom](class_stylebox#class-stylebox-property-content-margin-bottom) if it is negative. ### [float](class_float#class-float) margin\_left | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_margin\_size(value) | | *Getter* | get\_margin\_size() | Increases the left margin of the 3×3 texture box. A higher value means more of the source texture is considered to be part of the left border of the 3×3 box. This is also the value used as fallback for [StyleBox.content\_margin\_left](class_stylebox#class-stylebox-property-content-margin-left) if it is negative. ### [float](class_float#class-float) margin\_right | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_margin\_size(value) | | *Getter* | get\_margin\_size() | Increases the right margin of the 3×3 texture box. A higher value means more of the source texture is considered to be part of the right border of the 3×3 box. This is also the value used as fallback for [StyleBox.content\_margin\_right](class_stylebox#class-stylebox-property-content-margin-right) if it is negative. ### [float](class_float#class-float) margin\_top | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_margin\_size(value) | | *Getter* | get\_margin\_size() | Increases the top margin of the 3×3 texture box. A higher value means more of the source texture is considered to be part of the top border of the 3×3 box. This is also the value used as fallback for [StyleBox.content\_margin\_top](class_stylebox#class-stylebox-property-content-margin-top) if it is negative. ### [Color](class_color#class-color) modulate\_color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_modulate(value) | | *Getter* | get\_modulate() | Modulates the color of the texture when this style box is drawn. ### [Texture](class_texture#class-texture) normal\_map | | | | --- | --- | | *Setter* | set\_normal\_map(value) | | *Getter* | get\_normal\_map() | The normal map to use when drawing this style box. **Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [this page](http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates) for a comparison of normal map coordinates expected by popular engines. ### [Rect2](class_rect2#class-rect2) region\_rect | | | | --- | --- | | *Default* | `Rect2( 0, 0, 0, 0 )` | | *Setter* | set\_region\_rect(value) | | *Getter* | get\_region\_rect() | Species a sub-region of the texture to use. This is equivalent to first wrapping the texture in an [AtlasTexture](class_atlastexture#class-atlastexture) with the same region. ### [Texture](class_texture#class-texture) texture | | | | --- | --- | | *Setter* | set\_texture(value) | | *Getter* | get\_texture() | The texture to use when drawing this style box. Method Descriptions ------------------- ### [float](class_float#class-float) get\_expand\_margin\_size ( [Margin](class_%40globalscope#enum-globalscope-margin) margin ) const Returns the size of the given `margin`'s expand margin. See [Margin](class_%40globalscope#enum-globalscope-margin) for possible values. ### [float](class_float#class-float) get\_margin\_size ( [Margin](class_%40globalscope#enum-globalscope-margin) margin ) const Returns the size of the given `margin`. See [Margin](class_%40globalscope#enum-globalscope-margin) for possible values. ### void set\_expand\_margin\_all ( [float](class_float#class-float) size ) Sets the expand margin to `size` pixels for all margins. ### void set\_expand\_margin\_individual ( [float](class_float#class-float) size\_left, [float](class_float#class-float) size\_top, [float](class_float#class-float) size\_right, [float](class_float#class-float) size\_bottom ) Sets the expand margin for each margin to `size_left`, `size_top`, `size_right`, and `size_bottom` pixels. ### void set\_expand\_margin\_size ( [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) size ) Sets the expand margin to `size` pixels for the given `margin`. See [Margin](class_%40globalscope#enum-globalscope-margin) for possible values. ### void set\_margin\_size ( [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) size ) Sets the margin to `size` pixels for the given `margin`. See [Margin](class_%40globalscope#enum-globalscope-margin) for possible values. godot AnimationNodeStateMachine AnimationNodeStateMachine ========================= **Inherits:** [AnimationRootNode](class_animationrootnode#class-animationrootnode) **<** [AnimationNode](class_animationnode#class-animationnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) State machine for control of animations. Description ----------- Contains multiple nodes representing animation states, connected in a graph. Node transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the [AnimationNodeStateMachinePlayback](class_animationnodestatemachineplayback#class-animationnodestatemachineplayback) object from the [AnimationTree](class_animationtree#class-animationtree) node to control it programmatically. **Example:** ``` var state_machine = $AnimationTree.get("parameters/playback") state_machine.travel("some_state") ``` Tutorials --------- * [Using AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html) Methods ------- | | | | --- | --- | | void | [add\_node](#class-animationnodestatemachine-method-add-node) **(** [String](class_string#class-string) name, [AnimationNode](class_animationnode#class-animationnode) node, [Vector2](class_vector2#class-vector2) position=Vector2( 0, 0 ) **)** | | void | [add\_transition](#class-animationnodestatemachine-method-add-transition) **(** [String](class_string#class-string) from, [String](class_string#class-string) to, [AnimationNodeStateMachineTransition](class_animationnodestatemachinetransition#class-animationnodestatemachinetransition) transition **)** | | [String](class_string#class-string) | [get\_end\_node](#class-animationnodestatemachine-method-get-end-node) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_graph\_offset](#class-animationnodestatemachine-method-get-graph-offset) **(** **)** const | | [AnimationNode](class_animationnode#class-animationnode) | [get\_node](#class-animationnodestatemachine-method-get-node) **(** [String](class_string#class-string) name **)** const | | [String](class_string#class-string) | [get\_node\_name](#class-animationnodestatemachine-method-get-node-name) **(** [AnimationNode](class_animationnode#class-animationnode) node **)** const | | [Vector2](class_vector2#class-vector2) | [get\_node\_position](#class-animationnodestatemachine-method-get-node-position) **(** [String](class_string#class-string) name **)** const | | [String](class_string#class-string) | [get\_start\_node](#class-animationnodestatemachine-method-get-start-node) **(** **)** const | | [AnimationNodeStateMachineTransition](class_animationnodestatemachinetransition#class-animationnodestatemachinetransition) | [get\_transition](#class-animationnodestatemachine-method-get-transition) **(** [int](class_int#class-int) idx **)** const | | [int](class_int#class-int) | [get\_transition\_count](#class-animationnodestatemachine-method-get-transition-count) **(** **)** const | | [String](class_string#class-string) | [get\_transition\_from](#class-animationnodestatemachine-method-get-transition-from) **(** [int](class_int#class-int) idx **)** const | | [String](class_string#class-string) | [get\_transition\_to](#class-animationnodestatemachine-method-get-transition-to) **(** [int](class_int#class-int) idx **)** const | | [bool](class_bool#class-bool) | [has\_node](#class-animationnodestatemachine-method-has-node) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [has\_transition](#class-animationnodestatemachine-method-has-transition) **(** [String](class_string#class-string) from, [String](class_string#class-string) to **)** const | | void | [remove\_node](#class-animationnodestatemachine-method-remove-node) **(** [String](class_string#class-string) name **)** | | void | [remove\_transition](#class-animationnodestatemachine-method-remove-transition) **(** [String](class_string#class-string) from, [String](class_string#class-string) to **)** | | void | [remove\_transition\_by\_index](#class-animationnodestatemachine-method-remove-transition-by-index) **(** [int](class_int#class-int) idx **)** | | void | [rename\_node](#class-animationnodestatemachine-method-rename-node) **(** [String](class_string#class-string) name, [String](class_string#class-string) new\_name **)** | | void | [replace\_node](#class-animationnodestatemachine-method-replace-node) **(** [String](class_string#class-string) name, [AnimationNode](class_animationnode#class-animationnode) node **)** | | void | [set\_end\_node](#class-animationnodestatemachine-method-set-end-node) **(** [String](class_string#class-string) name **)** | | void | [set\_graph\_offset](#class-animationnodestatemachine-method-set-graph-offset) **(** [Vector2](class_vector2#class-vector2) offset **)** | | void | [set\_node\_position](#class-animationnodestatemachine-method-set-node-position) **(** [String](class_string#class-string) name, [Vector2](class_vector2#class-vector2) position **)** | | void | [set\_start\_node](#class-animationnodestatemachine-method-set-start-node) **(** [String](class_string#class-string) name **)** | Method Descriptions ------------------- ### void add\_node ( [String](class_string#class-string) name, [AnimationNode](class_animationnode#class-animationnode) node, [Vector2](class_vector2#class-vector2) position=Vector2( 0, 0 ) ) Adds a new node to the graph. The `position` is used for display in the editor. ### void add\_transition ( [String](class_string#class-string) from, [String](class_string#class-string) to, [AnimationNodeStateMachineTransition](class_animationnodestatemachinetransition#class-animationnodestatemachinetransition) transition ) Adds a transition between the given nodes. ### [String](class_string#class-string) get\_end\_node ( ) const Returns the graph's end node. ### [Vector2](class_vector2#class-vector2) get\_graph\_offset ( ) const Returns the draw offset of the graph. Used for display in the editor. ### [AnimationNode](class_animationnode#class-animationnode) get\_node ( [String](class_string#class-string) name ) const Returns the animation node with the given name. ### [String](class_string#class-string) get\_node\_name ( [AnimationNode](class_animationnode#class-animationnode) node ) const Returns the given animation node's name. ### [Vector2](class_vector2#class-vector2) get\_node\_position ( [String](class_string#class-string) name ) const Returns the given node's coordinates. Used for display in the editor. ### [String](class_string#class-string) get\_start\_node ( ) const Returns the graph's end node. ### [AnimationNodeStateMachineTransition](class_animationnodestatemachinetransition#class-animationnodestatemachinetransition) get\_transition ( [int](class_int#class-int) idx ) const Returns the given transition. ### [int](class_int#class-int) get\_transition\_count ( ) const Returns the number of connections in the graph. ### [String](class_string#class-string) get\_transition\_from ( [int](class_int#class-int) idx ) const Returns the given transition's start node. ### [String](class_string#class-string) get\_transition\_to ( [int](class_int#class-int) idx ) const Returns the given transition's end node. ### [bool](class_bool#class-bool) has\_node ( [String](class_string#class-string) name ) const Returns `true` if the graph contains the given node. ### [bool](class_bool#class-bool) has\_transition ( [String](class_string#class-string) from, [String](class_string#class-string) to ) const Returns `true` if there is a transition between the given nodes. ### void remove\_node ( [String](class_string#class-string) name ) Deletes the given node from the graph. ### void remove\_transition ( [String](class_string#class-string) from, [String](class_string#class-string) to ) Deletes the transition between the two specified nodes. ### void remove\_transition\_by\_index ( [int](class_int#class-int) idx ) Deletes the given transition by index. ### void rename\_node ( [String](class_string#class-string) name, [String](class_string#class-string) new\_name ) Renames the given node. ### void replace\_node ( [String](class_string#class-string) name, [AnimationNode](class_animationnode#class-animationnode) node ) Replaces the node and keeps its transitions unchanged. ### void set\_end\_node ( [String](class_string#class-string) name ) Sets the given node as the graph end point. ### void set\_graph\_offset ( [Vector2](class_vector2#class-vector2) offset ) Sets the draw offset of the graph. Used for display in the editor. ### void set\_node\_position ( [String](class_string#class-string) name, [Vector2](class_vector2#class-vector2) position ) Sets the node's coordinates. Used for display in the editor. ### void set\_start\_node ( [String](class_string#class-string) name ) Sets the given node as the graph start point.
programming_docs
godot Array Array ===== A generic array datatype. Description ----------- A generic array that can contain several elements of any type, accessible by a numerical index starting at 0. Negative indices can be used to count from the back, like in Python (-1 is the last element, -2 is the second to last, etc.). **Example:** ``` var array = ["One", 2, 3, "Four"] print(array[0]) # One. print(array[2]) # 3. print(array[-1]) # Four. array[2] = "Three" print(array[-2]) # Three. ``` Arrays can be concatenated using the `+` operator: ``` var array1 = ["One", 2] var array2 = [3, "Four"] print(array1 + array2) # ["One", 2, 3, "Four"] ``` **Note:** Concatenating with the `+=` operator will create a new array, which has a cost. If you want to append another array to an existing array, [append\_array](#class-array-method-append-array) is more efficient. **Note:** Arrays are always passed by reference. To get a copy of an array that can be modified independently of the original array, use [duplicate](#class-array-method-duplicate). **Note:** When declaring an array with `const`, the array itself can still be mutated by defining the values at individual indices or pushing/removing elements. Using `const` will only prevent assigning the constant with another value after it was initialized. Methods ------- | | | | --- | --- | | [Array](#class-array) | [Array](#class-array-method-array) **(** [PoolColorArray](class_poolcolorarray#class-poolcolorarray) from **)** | | [Array](#class-array) | [Array](#class-array-method-array) **(** [PoolVector3Array](class_poolvector3array#class-poolvector3array) from **)** | | [Array](#class-array) | [Array](#class-array-method-array) **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) from **)** | | [Array](#class-array) | [Array](#class-array-method-array) **(** [PoolStringArray](class_poolstringarray#class-poolstringarray) from **)** | | [Array](#class-array) | [Array](#class-array-method-array) **(** [PoolRealArray](class_poolrealarray#class-poolrealarray) from **)** | | [Array](#class-array) | [Array](#class-array-method-array) **(** [PoolIntArray](class_poolintarray#class-poolintarray) from **)** | | [Array](#class-array) | [Array](#class-array-method-array) **(** [PoolByteArray](class_poolbytearray#class-poolbytearray) from **)** | | void | [append](#class-array-method-append) **(** [Variant](class_variant#class-variant) value **)** | | void | [append\_array](#class-array-method-append-array) **(** [Array](#class-array) array **)** | | [Variant](class_variant#class-variant) | [back](#class-array-method-back) **(** **)** | | [int](class_int#class-int) | [bsearch](#class-array-method-bsearch) **(** [Variant](class_variant#class-variant) value, [bool](class_bool#class-bool) before=true **)** | | [int](class_int#class-int) | [bsearch\_custom](#class-array-method-bsearch-custom) **(** [Variant](class_variant#class-variant) value, [Object](class_object#class-object) obj, [String](class_string#class-string) func, [bool](class_bool#class-bool) before=true **)** | | void | [clear](#class-array-method-clear) **(** **)** | | [int](class_int#class-int) | [count](#class-array-method-count) **(** [Variant](class_variant#class-variant) value **)** | | [Array](#class-array) | [duplicate](#class-array-method-duplicate) **(** [bool](class_bool#class-bool) deep=false **)** | | [bool](class_bool#class-bool) | [empty](#class-array-method-empty) **(** **)** | | void | [erase](#class-array-method-erase) **(** [Variant](class_variant#class-variant) value **)** | | void | [fill](#class-array-method-fill) **(** [Variant](class_variant#class-variant) value **)** | | [int](class_int#class-int) | [find](#class-array-method-find) **(** [Variant](class_variant#class-variant) what, [int](class_int#class-int) from=0 **)** | | [int](class_int#class-int) | [find\_last](#class-array-method-find-last) **(** [Variant](class_variant#class-variant) value **)** | | [Variant](class_variant#class-variant) | [front](#class-array-method-front) **(** **)** | | [bool](class_bool#class-bool) | [has](#class-array-method-has) **(** [Variant](class_variant#class-variant) value **)** | | [int](class_int#class-int) | [hash](#class-array-method-hash) **(** **)** | | void | [insert](#class-array-method-insert) **(** [int](class_int#class-int) position, [Variant](class_variant#class-variant) value **)** | | void | [invert](#class-array-method-invert) **(** **)** | | [Variant](class_variant#class-variant) | [max](#class-array-method-max) **(** **)** | | [Variant](class_variant#class-variant) | [min](#class-array-method-min) **(** **)** | | [Variant](class_variant#class-variant) | [pop\_at](#class-array-method-pop-at) **(** [int](class_int#class-int) position **)** | | [Variant](class_variant#class-variant) | [pop\_back](#class-array-method-pop-back) **(** **)** | | [Variant](class_variant#class-variant) | [pop\_front](#class-array-method-pop-front) **(** **)** | | void | [push\_back](#class-array-method-push-back) **(** [Variant](class_variant#class-variant) value **)** | | void | [push\_front](#class-array-method-push-front) **(** [Variant](class_variant#class-variant) value **)** | | void | [remove](#class-array-method-remove) **(** [int](class_int#class-int) position **)** | | void | [resize](#class-array-method-resize) **(** [int](class_int#class-int) size **)** | | [int](class_int#class-int) | [rfind](#class-array-method-rfind) **(** [Variant](class_variant#class-variant) what, [int](class_int#class-int) from=-1 **)** | | void | [shuffle](#class-array-method-shuffle) **(** **)** | | [int](class_int#class-int) | [size](#class-array-method-size) **(** **)** | | [Array](#class-array) | [slice](#class-array-method-slice) **(** [int](class_int#class-int) begin, [int](class_int#class-int) end, [int](class_int#class-int) step=1, [bool](class_bool#class-bool) deep=false **)** | | void | [sort](#class-array-method-sort) **(** **)** | | void | [sort\_custom](#class-array-method-sort-custom) **(** [Object](class_object#class-object) obj, [String](class_string#class-string) func **)** | Method Descriptions ------------------- ### [Array](#class-array) Array ( [PoolColorArray](class_poolcolorarray#class-poolcolorarray) from ) Constructs an array from a [PoolColorArray](class_poolcolorarray#class-poolcolorarray). * [Array](#class-array) **Array** **(** [PoolVector3Array](class_poolvector3array#class-poolvector3array) from **)** Constructs an array from a [PoolVector3Array](class_poolvector3array#class-poolvector3array). * [Array](#class-array) **Array** **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) from **)** Constructs an array from a [PoolVector2Array](class_poolvector2array#class-poolvector2array). * [Array](#class-array) **Array** **(** [PoolStringArray](class_poolstringarray#class-poolstringarray) from **)** Constructs an array from a [PoolStringArray](class_poolstringarray#class-poolstringarray). * [Array](#class-array) **Array** **(** [PoolRealArray](class_poolrealarray#class-poolrealarray) from **)** Constructs an array from a [PoolRealArray](class_poolrealarray#class-poolrealarray). * [Array](#class-array) **Array** **(** [PoolIntArray](class_poolintarray#class-poolintarray) from **)** Constructs an array from a [PoolIntArray](class_poolintarray#class-poolintarray). * [Array](#class-array) **Array** **(** [PoolByteArray](class_poolbytearray#class-poolbytearray) from **)** Constructs an array from a [PoolByteArray](class_poolbytearray#class-poolbytearray). ### void append ( [Variant](class_variant#class-variant) value ) Appends an element at the end of the array (alias of [push\_back](#class-array-method-push-back)). ### void append\_array ( [Array](#class-array) array ) Appends another array at the end of this array. ``` var array1 = [1, 2, 3] var array2 = [4, 5, 6] array1.append_array(array2) print(array1) # Prints [1, 2, 3, 4, 5, 6]. ``` ### [Variant](class_variant#class-variant) back ( ) Returns the last element of the array. Prints an error and returns `null` if the array is empty. **Note:** Calling this function is not the same as writing `array[-1]`. If the array is empty, accessing by index will pause project execution when running from the editor. ### [int](class_int#class-int) bsearch ( [Variant](class_variant#class-variant) value, [bool](class_bool#class-bool) before=true ) Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a `before` specifier can be passed. If `false`, the returned index comes after all existing entries of the value in the array. **Note:** Calling [bsearch](#class-array-method-bsearch) on an unsorted array results in unexpected behavior. ### [int](class_int#class-int) bsearch\_custom ( [Variant](class_variant#class-variant) value, [Object](class_object#class-object) obj, [String](class_string#class-string) func, [bool](class_bool#class-bool) before=true ) Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search and a custom comparison method declared in the `obj`. Optionally, a `before` specifier can be passed. If `false`, the returned index comes after all existing entries of the value in the array. The custom method receives two arguments (an element from the array and the value searched for) and must return `true` if the first argument is less than the second, and return `false` otherwise. ``` func cardinal_to_algebraic(a): match a: "one": return 1 "two": return 2 "three": return 3 "four": return 4 _: return 0 func compare(a, b): return cardinal_to_algebraic(a) < cardinal_to_algebraic(b) func _ready(): var a = ["one", "two", "three", "four"] # `compare` is defined in this object, so we use `self` as the `obj` parameter. print(a.bsearch_custom("three", self, "compare", true)) # Expected value is 2. ``` **Note:** Calling [bsearch\_custom](#class-array-method-bsearch-custom) on an unsorted array results in unexpected behavior. ### void clear ( ) Clears the array. This is equivalent to using [resize](#class-array-method-resize) with a size of `0`. ### [int](class_int#class-int) count ( [Variant](class_variant#class-variant) value ) Returns the number of times an element is in the array. ### [Array](#class-array) duplicate ( [bool](class_bool#class-bool) deep=false ) Returns a copy of the array. If `deep` is `true`, a deep copy is performed: all nested arrays and dictionaries are duplicated and will not be shared with the original array. If `false`, a shallow copy is made and references to the original nested arrays and dictionaries are kept, so that modifying a sub-array or dictionary in the copy will also impact those referenced in the source array. ### [bool](class_bool#class-bool) empty ( ) Returns `true` if the array is empty. ### void erase ( [Variant](class_variant#class-variant) value ) Removes the first occurrence of a value from the array. If the value does not exist in the array, nothing happens. To remove an element by index, use [remove](#class-array-method-remove) instead. **Note:** This method acts in-place and doesn't return a value. **Note:** On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed. ### void fill ( [Variant](class_variant#class-variant) value ) Assigns the given value to all elements in the array. This can typically be used together with [resize](#class-array-method-resize) to create an array with a given size and initialized elements: ``` var array = [] array.resize(10) array.fill(0) # Initialize the 10 elements to 0. ``` ### [int](class_int#class-int) find ( [Variant](class_variant#class-variant) what, [int](class_int#class-int) from=0 ) Searches the array for a value and returns its index or `-1` if not found. Optionally, the initial search index can be passed. Returns `-1` if `from` is out of bounds. ### [int](class_int#class-int) find\_last ( [Variant](class_variant#class-variant) value ) Searches the array in reverse order for a value and returns its index or `-1` if not found. ### [Variant](class_variant#class-variant) front ( ) Returns the first element of the array. Prints an error and returns `null` if the array is empty. **Note:** Calling this function is not the same as writing `array[0]`. If the array is empty, accessing by index will pause project execution when running from the editor. ### [bool](class_bool#class-bool) has ( [Variant](class_variant#class-variant) value ) Returns `true` if the array contains the given value. ``` ["inside", 7].has("inside") # True ["inside", 7].has("outside") # False ["inside", 7].has(7) # True ["inside", 7].has("7") # False ``` **Note:** This is equivalent to using the `in` operator as follows: ``` # Will evaluate to `true`. if 2 in [2, 4, 6, 8]: pass ``` ### [int](class_int#class-int) hash ( ) Returns a hashed 32-bit integer value representing the array and its contents. **Note:** `Array`s with equal content will always produce identical hash values. However, the reverse is not true. Returning identical hash values does *not* imply the arrays are equal, because different arrays can have identical hash values due to hash collisions. ### void insert ( [int](class_int#class-int) position, [Variant](class_variant#class-variant) value ) Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (`pos == size()`). **Note:** This method acts in-place and doesn't return a value. **Note:** On large arrays, this method will be slower if the inserted element is close to the beginning of the array (index 0). This is because all elements placed after the newly inserted element have to be reindexed. ### void invert ( ) Reverses the order of the elements in the array. ### [Variant](class_variant#class-variant) max ( ) Returns the maximum value contained in the array if all elements are of comparable types. If the elements can't be compared, `null` is returned. ### [Variant](class_variant#class-variant) min ( ) Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, `null` is returned. ### [Variant](class_variant#class-variant) pop\_at ( [int](class_int#class-int) position ) Removes and returns the element of the array at index `position`. If negative, `position` is considered relative to the end of the array. Leaves the array untouched and returns `null` if the array is empty or if it's accessed out of bounds. An error message is printed when the array is accessed out of bounds, but not when the array is empty. **Note:** On large arrays, this method can be slower than [pop\_back](#class-array-method-pop-back) as it will reindex the array's elements that are located after the removed element. The larger the array and the lower the index of the removed element, the slower [pop\_at](#class-array-method-pop-at) will be. ### [Variant](class_variant#class-variant) pop\_back ( ) Removes and returns the last element of the array. Returns `null` if the array is empty, without printing an error message. See also [pop\_front](#class-array-method-pop-front). ### [Variant](class_variant#class-variant) pop\_front ( ) Removes and returns the first element of the array. Returns `null` if the array is empty, without printing an error message. See also [pop\_back](#class-array-method-pop-back). **Note:** On large arrays, this method is much slower than [pop\_back](#class-array-method-pop-back) as it will reindex all the array's elements every time it's called. The larger the array, the slower [pop\_front](#class-array-method-pop-front) will be. ### void push\_back ( [Variant](class_variant#class-variant) value ) Appends an element at the end of the array. See also [push\_front](#class-array-method-push-front). ### void push\_front ( [Variant](class_variant#class-variant) value ) Adds an element at the beginning of the array. See also [push\_back](#class-array-method-push-back). **Note:** On large arrays, this method is much slower than [push\_back](#class-array-method-push-back) as it will reindex all the array's elements every time it's called. The larger the array, the slower [push\_front](#class-array-method-push-front) will be. ### void remove ( [int](class_int#class-int) position ) Removes an element from the array by index. If the index does not exist in the array, nothing happens. To remove an element by searching for its value, use [erase](#class-array-method-erase) instead. **Note:** This method acts in-place and doesn't return a value. **Note:** On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed. ### void resize ( [int](class_int#class-int) size ) Resizes the array to contain a different number of elements. If the array size is smaller, elements are cleared, if bigger, new elements are `null`. ### [int](class_int#class-int) rfind ( [Variant](class_variant#class-variant) what, [int](class_int#class-int) from=-1 ) Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array. ### void shuffle ( ) Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as [@GDScript.randi](class_%40gdscript#class-gdscript-method-randi). Call [@GDScript.randomize](class_%40gdscript#class-gdscript-method-randomize) to ensure that a new seed will be used each time if you want non-reproducible shuffling. ### [int](class_int#class-int) size ( ) Returns the number of elements in the array. ### [Array](#class-array) slice ( [int](class_int#class-int) begin, [int](class_int#class-int) end, [int](class_int#class-int) step=1, [bool](class_bool#class-bool) deep=false ) Duplicates the subset described in the function and returns it in an array, deeply copying the array if `deep` is `true`. Lower and upper index are inclusive, with the `step` describing the change between indices while slicing. ### void sort ( ) Sorts the array. **Note:** Strings are sorted in alphabetical order (as opposed to natural order). This may lead to unexpected behavior when sorting an array of strings ending with a sequence of numbers. Consider the following example: ``` var strings = ["string1", "string2", "string10", "string11"] strings.sort() print(strings) # Prints [string1, string10, string11, string2] ``` ### void sort\_custom ( [Object](class_object#class-object) obj, [String](class_string#class-string) func ) Sorts the array using a custom method. The arguments are an object that holds the method and the name of such method. The custom method receives two arguments (a pair of elements from the array) and must return either `true` or `false`. For two elements `a` and `b`, if the given method returns `true`, element `b` will be after element `a` in the array. **Note:** You cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior. ``` class MyCustomSorter: static func sort_ascending(a, b): if a[0] < b[0]: return true return false var my_items = [[5, "Potato"], [9, "Rice"], [4, "Tomato"]] my_items.sort_custom(MyCustomSorter, "sort_ascending") print(my_items) # Prints [[4, Tomato], [5, Potato], [9, Rice]]. ```
programming_docs
godot VisualScriptVariableGet VisualScriptVariableGet ======================= **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Gets a variable's value. Description ----------- Returns a variable's value. "Var Name" must be supplied, with an optional type. **Input Ports:** none **Output Ports:** * Data (variant): `value` Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [var\_name](#class-visualscriptvariableget-property-var-name) | `""` | Property Descriptions --------------------- ### [String](class_string#class-string) var\_name | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_variable(value) | | *Getter* | get\_variable() | The variable's name. godot VBoxContainer VBoxContainer ============= **Inherits:** [BoxContainer](class_boxcontainer#class-boxcontainer) **<** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [FileSystemDock](class_filesystemdock#class-filesystemdock) Vertical box container. Description ----------- Vertical box container. See [BoxContainer](class_boxcontainer#class-boxcontainer). Tutorials --------- * [GUI containers](https://docs.godotengine.org/en/3.5/tutorials/ui/gui_containers.html) * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) Theme Properties ---------------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [separation](#class-vboxcontainer-theme-constant-separation) | `4` | Theme Property Descriptions --------------------------- ### [int](class_int#class-int) separation | | | | --- | --- | | *Default* | `4` | The vertical space between the `VBoxContainer`'s elements. godot MeshInstance2D MeshInstance2D ============== **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Node used for displaying a [Mesh](class_mesh#class-mesh) in 2D. Description ----------- Node used for displaying a [Mesh](class_mesh#class-mesh) in 2D. A `MeshInstance2D` can be automatically created from an existing [Sprite](class_sprite#class-sprite) via a tool in the editor toolbar. Select the [Sprite](class_sprite#class-sprite) node, then choose **Sprite > Convert to MeshInstance2D** at the top of the 2D editor viewport. Tutorials --------- * [2D meshes](https://docs.godotengine.org/en/3.5/tutorials/2d/2d_meshes.html) Properties ---------- | | | | --- | --- | | [Mesh](class_mesh#class-mesh) | [mesh](#class-meshinstance2d-property-mesh) | | [Texture](class_texture#class-texture) | [normal\_map](#class-meshinstance2d-property-normal-map) | | [Texture](class_texture#class-texture) | [texture](#class-meshinstance2d-property-texture) | Signals ------- ### texture\_changed ( ) Emitted when the [texture](#class-meshinstance2d-property-texture) is changed. Property Descriptions --------------------- ### [Mesh](class_mesh#class-mesh) mesh | | | | --- | --- | | *Setter* | set\_mesh(value) | | *Getter* | get\_mesh() | The [Mesh](class_mesh#class-mesh) that will be drawn by the `MeshInstance2D`. ### [Texture](class_texture#class-texture) normal\_map | | | | --- | --- | | *Setter* | set\_normal\_map(value) | | *Getter* | get\_normal\_map() | The normal map that will be used if using the default [CanvasItemMaterial](class_canvasitemmaterial#class-canvasitemmaterial). **Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [this page](http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates) for a comparison of normal map coordinates expected by popular engines. ### [Texture](class_texture#class-texture) texture | | | | --- | --- | | *Setter* | set\_texture(value) | | *Getter* | get\_texture() | The [Texture](class_texture#class-texture) that will be used if using the default [CanvasItemMaterial](class_canvasitemmaterial#class-canvasitemmaterial). Can be accessed as `TEXTURE` in CanvasItem shader. godot WebSocketServer WebSocketServer =============== **Inherits:** [WebSocketMultiplayerPeer](class_websocketmultiplayerpeer#class-websocketmultiplayerpeer) **<** [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer) **<** [PacketPeer](class_packetpeer#class-packetpeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A WebSocket server implementation. Description ----------- This class implements a WebSocket server that can also support the high-level multiplayer API. After starting the server ([listen](#class-websocketserver-method-listen)), you will need to [NetworkedMultiplayerPeer.poll](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-method-poll) it at regular intervals (e.g. inside [Node.\_process](class_node#class-node-method-process)). When clients connect, disconnect, or send data, you will receive the appropriate signal. **Note:** Not available in HTML5 exports. Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [bind\_ip](#class-websocketserver-property-bind-ip) | `"*"` | | [X509Certificate](class_x509certificate#class-x509certificate) | [ca\_chain](#class-websocketserver-property-ca-chain) | | | [float](class_float#class-float) | [handshake\_timeout](#class-websocketserver-property-handshake-timeout) | `3.0` | | [CryptoKey](class_cryptokey#class-cryptokey) | [private\_key](#class-websocketserver-property-private-key) | | | [X509Certificate](class_x509certificate#class-x509certificate) | [ssl\_certificate](#class-websocketserver-property-ssl-certificate) | | Methods ------- | | | | --- | --- | | void | [disconnect\_peer](#class-websocketserver-method-disconnect-peer) **(** [int](class_int#class-int) id, [int](class_int#class-int) code=1000, [String](class_string#class-string) reason="" **)** | | [String](class_string#class-string) | [get\_peer\_address](#class-websocketserver-method-get-peer-address) **(** [int](class_int#class-int) id **)** const | | [int](class_int#class-int) | [get\_peer\_port](#class-websocketserver-method-get-peer-port) **(** [int](class_int#class-int) id **)** const | | [bool](class_bool#class-bool) | [has\_peer](#class-websocketserver-method-has-peer) **(** [int](class_int#class-int) id **)** const | | [bool](class_bool#class-bool) | [is\_listening](#class-websocketserver-method-is-listening) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [listen](#class-websocketserver-method-listen) **(** [int](class_int#class-int) port, [PoolStringArray](class_poolstringarray#class-poolstringarray) protocols=PoolStringArray( ), [bool](class_bool#class-bool) gd\_mp\_api=false **)** | | void | [set\_extra\_headers](#class-websocketserver-method-set-extra-headers) **(** [PoolStringArray](class_poolstringarray#class-poolstringarray) headers=PoolStringArray( ) **)** | | void | [stop](#class-websocketserver-method-stop) **(** **)** | Signals ------- ### client\_close\_request ( [int](class_int#class-int) id, [int](class_int#class-int) code, [String](class_string#class-string) reason ) Emitted when a client requests a clean close. You should keep polling until you get a [client\_disconnected](#class-websocketserver-signal-client-disconnected) signal with the same `id` to achieve the clean close. See [WebSocketPeer.close](class_websocketpeer#class-websocketpeer-method-close) for more details. ### client\_connected ( [int](class_int#class-int) id, [String](class_string#class-string) protocol ) Emitted when a new client connects. "protocol" will be the sub-protocol agreed with the client. ### client\_disconnected ( [int](class_int#class-int) id, [bool](class_bool#class-bool) was\_clean\_close ) Emitted when a client disconnects. `was_clean_close` will be `true` if the connection was shutdown cleanly. ### data\_received ( [int](class_int#class-int) id ) Emitted when a new message is received. **Note:** This signal is *not* emitted when used as high-level multiplayer peer. Property Descriptions --------------------- ### [String](class_string#class-string) bind\_ip | | | | --- | --- | | *Default* | `"*"` | | *Setter* | set\_bind\_ip(value) | | *Getter* | get\_bind\_ip() | When not set to `*` will restrict incoming connections to the specified IP address. Setting `bind_ip` to `127.0.0.1` will cause the server to listen only to the local host. ### [X509Certificate](class_x509certificate#class-x509certificate) ca\_chain | | | | --- | --- | | *Setter* | set\_ca\_chain(value) | | *Getter* | get\_ca\_chain() | When using SSL (see [private\_key](#class-websocketserver-property-private-key) and [ssl\_certificate](#class-websocketserver-property-ssl-certificate)), you can set this to a valid [X509Certificate](class_x509certificate#class-x509certificate) to be provided as additional CA chain information during the SSL handshake. ### [float](class_float#class-float) handshake\_timeout | | | | --- | --- | | *Default* | `3.0` | | *Setter* | set\_handshake\_timeout(value) | | *Getter* | get\_handshake\_timeout() | The time in seconds before a pending client (i.e. a client that has not yet finished the HTTP handshake) is considered stale and forcefully disconnected. ### [CryptoKey](class_cryptokey#class-cryptokey) private\_key | | | | --- | --- | | *Setter* | set\_private\_key(value) | | *Getter* | get\_private\_key() | When set to a valid [CryptoKey](class_cryptokey#class-cryptokey) (along with [ssl\_certificate](#class-websocketserver-property-ssl-certificate)) will cause the server to require SSL instead of regular TCP (i.e. the `wss://` protocol). ### [X509Certificate](class_x509certificate#class-x509certificate) ssl\_certificate | | | | --- | --- | | *Setter* | set\_ssl\_certificate(value) | | *Getter* | get\_ssl\_certificate() | When set to a valid [X509Certificate](class_x509certificate#class-x509certificate) (along with [private\_key](#class-websocketserver-property-private-key)) will cause the server to require SSL instead of regular TCP (i.e. the `wss://` protocol). Method Descriptions ------------------- ### void disconnect\_peer ( [int](class_int#class-int) id, [int](class_int#class-int) code=1000, [String](class_string#class-string) reason="" ) Disconnects the peer identified by `id` from the server. See [WebSocketPeer.close](class_websocketpeer#class-websocketpeer-method-close) for more information. ### [String](class_string#class-string) get\_peer\_address ( [int](class_int#class-int) id ) const Returns the IP address of the given peer. ### [int](class_int#class-int) get\_peer\_port ( [int](class_int#class-int) id ) const Returns the remote port of the given peer. ### [bool](class_bool#class-bool) has\_peer ( [int](class_int#class-int) id ) const Returns `true` if a peer with the given ID is connected. ### [bool](class_bool#class-bool) is\_listening ( ) const Returns `true` if the server is actively listening on a port. ### [Error](class_%40globalscope#enum-globalscope-error) listen ( [int](class_int#class-int) port, [PoolStringArray](class_poolstringarray#class-poolstringarray) protocols=PoolStringArray( ), [bool](class_bool#class-bool) gd\_mp\_api=false ) Starts listening on the given port. You can specify the desired subprotocols via the "protocols" array. If the list empty (default), no sub-protocol will be requested. If `true` is passed as `gd_mp_api`, the server will behave like a network peer for the [MultiplayerAPI](class_multiplayerapi#class-multiplayerapi), connections from non-Godot clients will not work, and [data\_received](#class-websocketserver-signal-data-received) will not be emitted. If `false` is passed instead (default), you must call [PacketPeer](class_packetpeer#class-packetpeer) functions (`put_packet`, `get_packet`, etc.), on the [WebSocketPeer](class_websocketpeer#class-websocketpeer) returned via `get_peer(id)` to communicate with the peer with given `id` (e.g. `get_peer(id).get_available_packet_count`). ### void set\_extra\_headers ( [PoolStringArray](class_poolstringarray#class-poolstringarray) headers=PoolStringArray( ) ) Sets additional headers to be sent to clients during the HTTP handshake. ### void stop ( ) Stops the server and clear its state. godot VisualShaderNodeUniformRef VisualShaderNodeUniformRef ========================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A reference to an existing [VisualShaderNodeUniform](class_visualshadernodeuniform#class-visualshadernodeuniform). Description ----------- Creating a reference to a [VisualShaderNodeUniform](class_visualshadernodeuniform#class-visualshadernodeuniform) allows you to reuse this uniform in different shaders or shader stages easily. Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [uniform\_name](#class-visualshadernodeuniformref-property-uniform-name) | `"[None]"` | Property Descriptions --------------------- ### [String](class_string#class-string) uniform\_name | | | | --- | --- | | *Default* | `"[None]"` | | *Setter* | set\_uniform\_name(value) | | *Getter* | get\_uniform\_name() | The name of the uniform which this reference points to. godot ButtonGroup ButtonGroup =========== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Group of Buttons. Description ----------- Group of [Button](class_button#class-button). All direct and indirect children buttons become radios. Only one allows being pressed. [BaseButton.toggle\_mode](class_basebutton#class-basebutton-property-toggle-mode) should be `true`. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | resource\_local\_to\_scene | `true` (overrides [Resource](class_resource#class-resource-property-resource-local-to-scene)) | Methods ------- | | | | --- | --- | | [Array](class_array#class-array) | [get\_buttons](#class-buttongroup-method-get-buttons) **(** **)** | | [BaseButton](class_basebutton#class-basebutton) | [get\_pressed\_button](#class-buttongroup-method-get-pressed-button) **(** **)** | Signals ------- ### pressed ( [Object](class_object#class-object) button ) Emitted when one of the buttons of the group is pressed. Method Descriptions ------------------- ### [Array](class_array#class-array) get\_buttons ( ) Returns an [Array](class_array#class-array) of [Button](class_button#class-button)s who have this as their `ButtonGroup` (see [BaseButton.group](class_basebutton#class-basebutton-property-group)). ### [BaseButton](class_basebutton#class-basebutton) get\_pressed\_button ( ) Returns the current pressed button. godot PrismMesh PrismMesh ========= **Inherits:** [PrimitiveMesh](class_primitivemesh#class-primitivemesh) **<** [Mesh](class_mesh#class-mesh) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Class representing a prism-shaped [PrimitiveMesh](class_primitivemesh#class-primitivemesh). Description ----------- Class representing a prism-shaped [PrimitiveMesh](class_primitivemesh#class-primitivemesh). Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [left\_to\_right](#class-prismmesh-property-left-to-right) | `0.5` | | [Vector3](class_vector3#class-vector3) | [size](#class-prismmesh-property-size) | `Vector3( 2, 2, 2 )` | | [int](class_int#class-int) | [subdivide\_depth](#class-prismmesh-property-subdivide-depth) | `0` | | [int](class_int#class-int) | [subdivide\_height](#class-prismmesh-property-subdivide-height) | `0` | | [int](class_int#class-int) | [subdivide\_width](#class-prismmesh-property-subdivide-width) | `0` | Property Descriptions --------------------- ### [float](class_float#class-float) left\_to\_right | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_left\_to\_right(value) | | *Getter* | get\_left\_to\_right() | Displacement of the upper edge along the X axis. 0.0 positions edge straight above the bottom-left edge. ### [Vector3](class_vector3#class-vector3) size | | | | --- | --- | | *Default* | `Vector3( 2, 2, 2 )` | | *Setter* | set\_size(value) | | *Getter* | get\_size() | Size of the prism. ### [int](class_int#class-int) subdivide\_depth | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_subdivide\_depth(value) | | *Getter* | get\_subdivide\_depth() | Number of added edge loops along the Z axis. ### [int](class_int#class-int) subdivide\_height | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_subdivide\_height(value) | | *Getter* | get\_subdivide\_height() | Number of added edge loops along the Y axis. ### [int](class_int#class-int) subdivide\_width | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_subdivide\_width(value) | | *Getter* | get\_subdivide\_width() | Number of added edge loops along the X axis. godot SceneTree SceneTree ========= **Inherits:** [MainLoop](class_mainloop#class-mainloop) **<** [Object](class_object#class-object) Manages the game loop via a hierarchy of nodes. Description ----------- As one of the most important classes, the `SceneTree` manages the hierarchy of nodes in a scene as well as scenes themselves. Nodes can be added, retrieved and removed. The whole scene tree (and thus the current scene) can be paused. Scenes can be loaded, switched and reloaded. You can also use the `SceneTree` to organize your nodes into groups: every node can be assigned as many groups as you want to create, e.g. an "enemy" group. You can then iterate these groups or even call methods and set properties on all the group's members at once. `SceneTree` is the default [MainLoop](class_mainloop#class-mainloop) implementation used by scenes, and is thus in charge of the game loop. Tutorials --------- * [Using SceneTree](https://docs.godotengine.org/en/3.5/tutorials/scripting/scene_tree.html) * [Multiple resolutions](https://docs.godotengine.org/en/3.5/tutorials/rendering/multiple_resolutions.html) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [auto\_accept\_quit](#class-scenetree-property-auto-accept-quit) | `true` | | [Node](class_node#class-node) | [current\_scene](#class-scenetree-property-current-scene) | | | [bool](class_bool#class-bool) | [debug\_collisions\_hint](#class-scenetree-property-debug-collisions-hint) | `false` | | [bool](class_bool#class-bool) | [debug\_navigation\_hint](#class-scenetree-property-debug-navigation-hint) | `false` | | [Node](class_node#class-node) | [edited\_scene\_root](#class-scenetree-property-edited-scene-root) | | | [MultiplayerAPI](class_multiplayerapi#class-multiplayerapi) | [multiplayer](#class-scenetree-property-multiplayer) | | | [bool](class_bool#class-bool) | [multiplayer\_poll](#class-scenetree-property-multiplayer-poll) | `true` | | [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer) | [network\_peer](#class-scenetree-property-network-peer) | | | [bool](class_bool#class-bool) | [paused](#class-scenetree-property-paused) | `false` | | [bool](class_bool#class-bool) | [physics\_interpolation](#class-scenetree-property-physics-interpolation) | `false` | | [bool](class_bool#class-bool) | [quit\_on\_go\_back](#class-scenetree-property-quit-on-go-back) | `true` | | [bool](class_bool#class-bool) | [refuse\_new\_network\_connections](#class-scenetree-property-refuse-new-network-connections) | `false` | | [Viewport](class_viewport#class-viewport) | [root](#class-scenetree-property-root) | | | [bool](class_bool#class-bool) | [use\_font\_oversampling](#class-scenetree-property-use-font-oversampling) | `false` | Methods ------- | | | | --- | --- | | [Variant](class_variant#class-variant) | [call\_group](#class-scenetree-method-call-group) **(** [String](class_string#class-string) group, [String](class_string#class-string) method, ... **)** vararg | | [Variant](class_variant#class-variant) | [call\_group\_flags](#class-scenetree-method-call-group-flags) **(** [int](class_int#class-int) flags, [String](class_string#class-string) group, [String](class_string#class-string) method, ... **)** vararg | | [Error](class_%40globalscope#enum-globalscope-error) | [change\_scene](#class-scenetree-method-change-scene) **(** [String](class_string#class-string) path **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [change\_scene\_to](#class-scenetree-method-change-scene-to) **(** [PackedScene](class_packedscene#class-packedscene) packed\_scene **)** | | [SceneTreeTimer](class_scenetreetimer#class-scenetreetimer) | [create\_timer](#class-scenetree-method-create-timer) **(** [float](class_float#class-float) time\_sec, [bool](class_bool#class-bool) pause\_mode\_process=true **)** | | [SceneTreeTween](class_scenetreetween#class-scenetreetween) | [create\_tween](#class-scenetree-method-create-tween) **(** **)** | | [int](class_int#class-int) | [get\_frame](#class-scenetree-method-get-frame) **(** **)** const | | [PoolIntArray](class_poolintarray#class-poolintarray) | [get\_network\_connected\_peers](#class-scenetree-method-get-network-connected-peers) **(** **)** const | | [int](class_int#class-int) | [get\_network\_unique\_id](#class-scenetree-method-get-network-unique-id) **(** **)** const | | [int](class_int#class-int) | [get\_node\_count](#class-scenetree-method-get-node-count) **(** **)** const | | [Array](class_array#class-array) | [get\_nodes\_in\_group](#class-scenetree-method-get-nodes-in-group) **(** [String](class_string#class-string) group **)** | | [Array](class_array#class-array) | [get\_processed\_tweens](#class-scenetree-method-get-processed-tweens) **(** **)** | | [int](class_int#class-int) | [get\_rpc\_sender\_id](#class-scenetree-method-get-rpc-sender-id) **(** **)** const | | [bool](class_bool#class-bool) | [has\_group](#class-scenetree-method-has-group) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [has\_network\_peer](#class-scenetree-method-has-network-peer) **(** **)** const | | [bool](class_bool#class-bool) | [is\_input\_handled](#class-scenetree-method-is-input-handled) **(** **)** | | [bool](class_bool#class-bool) | [is\_network\_server](#class-scenetree-method-is-network-server) **(** **)** const | | void | [notify\_group](#class-scenetree-method-notify-group) **(** [String](class_string#class-string) group, [int](class_int#class-int) notification **)** | | void | [notify\_group\_flags](#class-scenetree-method-notify-group-flags) **(** [int](class_int#class-int) call\_flags, [String](class_string#class-string) group, [int](class_int#class-int) notification **)** | | void | [queue\_delete](#class-scenetree-method-queue-delete) **(** [Object](class_object#class-object) obj **)** | | void | [quit](#class-scenetree-method-quit) **(** [int](class_int#class-int) exit\_code=-1 **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [reload\_current\_scene](#class-scenetree-method-reload-current-scene) **(** **)** | | void | [set\_group](#class-scenetree-method-set-group) **(** [String](class_string#class-string) group, [String](class_string#class-string) property, [Variant](class_variant#class-variant) value **)** | | void | [set\_group\_flags](#class-scenetree-method-set-group-flags) **(** [int](class_int#class-int) call\_flags, [String](class_string#class-string) group, [String](class_string#class-string) property, [Variant](class_variant#class-variant) value **)** | | void | [set\_input\_as\_handled](#class-scenetree-method-set-input-as-handled) **(** **)** | | void | [set\_screen\_stretch](#class-scenetree-method-set-screen-stretch) **(** [StretchMode](#enum-scenetree-stretchmode) mode, [StretchAspect](#enum-scenetree-stretchaspect) aspect, [Vector2](class_vector2#class-vector2) minsize, [float](class_float#class-float) scale=1 **)** | Signals ------- ### connected\_to\_server ( ) Emitted whenever this `SceneTree`'s [network\_peer](#class-scenetree-property-network-peer) successfully connected to a server. Only emitted on clients. ### connection\_failed ( ) Emitted whenever this `SceneTree`'s [network\_peer](#class-scenetree-property-network-peer) fails to establish a connection to a server. Only emitted on clients. ### files\_dropped ( [PoolStringArray](class_poolstringarray#class-poolstringarray) files, [int](class_int#class-int) screen ) Emitted when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated. ### global\_menu\_action ( [Variant](class_variant#class-variant) id, [Variant](class_variant#class-variant) meta ) Emitted whenever global menu item is clicked. ### idle\_frame ( ) Emitted immediately before [Node.\_process](class_node#class-node-method-process) is called on every node in the `SceneTree`. ### network\_peer\_connected ( [int](class_int#class-int) id ) Emitted whenever this `SceneTree`'s [network\_peer](#class-scenetree-property-network-peer) connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1). ### network\_peer\_disconnected ( [int](class_int#class-int) id ) Emitted whenever this `SceneTree`'s [network\_peer](#class-scenetree-property-network-peer) disconnects from a peer. Clients get notified when other clients disconnect from the same server. ### node\_added ( [Node](class_node#class-node) node ) Emitted whenever a node is added to the `SceneTree`. ### node\_configuration\_warning\_changed ( [Node](class_node#class-node) node ) Emitted when a node's configuration changed. Only emitted in `tool` mode. ### node\_removed ( [Node](class_node#class-node) node ) Emitted whenever a node is removed from the `SceneTree`. ### node\_renamed ( [Node](class_node#class-node) node ) Emitted whenever a node is renamed. ### physics\_frame ( ) Emitted immediately before [Node.\_physics\_process](class_node#class-node-method-physics-process) is called on every node in the `SceneTree`. ### screen\_resized ( ) Emitted when the screen resolution (fullscreen) or window size (windowed) changes. ### server\_disconnected ( ) Emitted whenever this `SceneTree`'s [network\_peer](#class-scenetree-property-network-peer) disconnected from server. Only emitted on clients. ### tree\_changed ( ) Emitted whenever the `SceneTree` hierarchy changed (children being moved or renamed, etc.). Enumerations ------------ enum **GroupCallFlags**: * **GROUP\_CALL\_DEFAULT** = **0** --- Call a group with no flags (default). * **GROUP\_CALL\_REVERSE** = **1** --- Call a group in reverse scene order. * **GROUP\_CALL\_REALTIME** = **2** --- Call a group immediately (calls are normally made on idle). * **GROUP\_CALL\_UNIQUE** = **4** --- Call a group only once even if the call is executed many times. enum **StretchMode**: * **STRETCH\_MODE\_DISABLED** = **0** --- No stretching. * **STRETCH\_MODE\_2D** = **1** --- Render stretching in higher resolution (interpolated). * **STRETCH\_MODE\_VIEWPORT** = **2** --- Keep the specified display resolution. No interpolation. Content may appear pixelated. enum **StretchAspect**: * **STRETCH\_ASPECT\_IGNORE** = **0** --- Fill the window with the content stretched to cover excessive space. Content may appear stretched. * **STRETCH\_ASPECT\_KEEP** = **1** --- Retain the same aspect ratio by padding with black bars on either axis. This prevents distortion. * **STRETCH\_ASPECT\_KEEP\_WIDTH** = **2** --- Expand vertically. Left/right black bars may appear if the window is too wide. * **STRETCH\_ASPECT\_KEEP\_HEIGHT** = **3** --- Expand horizontally. Top/bottom black bars may appear if the window is too tall. * **STRETCH\_ASPECT\_EXPAND** = **4** --- Expand in both directions, retaining the same aspect ratio. This prevents distortion while avoiding black bars. Property Descriptions --------------------- ### [bool](class_bool#class-bool) auto\_accept\_quit | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_auto\_accept\_quit(value) | | *Getter* | is\_auto\_accept\_quit() | If `true`, the application automatically accepts quitting. For mobile platforms, see [quit\_on\_go\_back](#class-scenetree-property-quit-on-go-back). ### [Node](class_node#class-node) current\_scene | | | | --- | --- | | *Setter* | set\_current\_scene(value) | | *Getter* | get\_current\_scene() | The current scene. ### [bool](class_bool#class-bool) debug\_collisions\_hint | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_debug\_collisions\_hint(value) | | *Getter* | is\_debugging\_collisions\_hint() | If `true`, collision shapes will be visible when running the game from the editor for debugging purposes. **Note:** This property is not designed to be changed at run-time. Changing the value of [debug\_collisions\_hint](#class-scenetree-property-debug-collisions-hint) while the project is running will not have the desired effect. ### [bool](class_bool#class-bool) debug\_navigation\_hint | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_debug\_navigation\_hint(value) | | *Getter* | is\_debugging\_navigation\_hint() | If `true`, navigation polygons will be visible when running the game from the editor for debugging purposes. **Note:** This property is not designed to be changed at run-time. Changing the value of [debug\_navigation\_hint](#class-scenetree-property-debug-navigation-hint) while the project is running will not have the desired effect. ### [Node](class_node#class-node) edited\_scene\_root | | | | --- | --- | | *Setter* | set\_edited\_scene\_root(value) | | *Getter* | get\_edited\_scene\_root() | The root of the edited scene. ### [MultiplayerAPI](class_multiplayerapi#class-multiplayerapi) multiplayer | | | | --- | --- | | *Setter* | set\_multiplayer(value) | | *Getter* | get\_multiplayer() | The default [MultiplayerAPI](class_multiplayerapi#class-multiplayerapi) instance for this `SceneTree`. ### [bool](class_bool#class-bool) multiplayer\_poll | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_multiplayer\_poll\_enabled(value) | | *Getter* | is\_multiplayer\_poll\_enabled() | If `true` (default value), enables automatic polling of the [MultiplayerAPI](class_multiplayerapi#class-multiplayerapi) for this SceneTree during [idle\_frame](#class-scenetree-signal-idle-frame). If `false`, you need to manually call [MultiplayerAPI.poll](class_multiplayerapi#class-multiplayerapi-method-poll) to process network packets and deliver RPCs/RSETs. This allows running RPCs/RSETs in a different loop (e.g. physics, thread, specific time step) and for manual [Mutex](class_mutex#class-mutex) protection when accessing the [MultiplayerAPI](class_multiplayerapi#class-multiplayerapi) from threads. ### [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer) network\_peer | | | | --- | --- | | *Setter* | set\_network\_peer(value) | | *Getter* | get\_network\_peer() | The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the `SceneTree` will become a network server (check with [is\_network\_server](#class-scenetree-method-is-network-server)) and will set the root node's network mode to master, or it will become a regular peer with the root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to `SceneTree`'s signals. ### [bool](class_bool#class-bool) paused | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_pause(value) | | *Getter* | is\_paused() | If `true`, the `SceneTree` is paused. Doing so will have the following behavior: * 2D and 3D physics will be stopped. This includes signals and collision detection. * [Node.\_process](class_node#class-node-method-process), [Node.\_physics\_process](class_node#class-node-method-physics-process) and [Node.\_input](class_node#class-node-method-input) will not be called anymore in nodes. ### [bool](class_bool#class-bool) physics\_interpolation | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_physics\_interpolation\_enabled(value) | | *Getter* | is\_physics\_interpolation\_enabled() | Although physics interpolation would normally be globally turned on and off using [ProjectSettings.physics/common/physics\_interpolation](class_projectsettings#class-projectsettings-property-physics-common-physics-interpolation), this property allows control over interpolation at runtime. ### [bool](class_bool#class-bool) quit\_on\_go\_back | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_quit\_on\_go\_back(value) | | *Getter* | is\_quit\_on\_go\_back() | If `true`, the application quits automatically on going back (e.g. on Android). To handle 'Go Back' button when this option is disabled, use [MainLoop.NOTIFICATION\_WM\_GO\_BACK\_REQUEST](class_mainloop#class-mainloop-constant-notification-wm-go-back-request). ### [bool](class_bool#class-bool) refuse\_new\_network\_connections | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_refuse\_new\_network\_connections(value) | | *Getter* | is\_refusing\_new\_network\_connections() | If `true`, the `SceneTree`'s [network\_peer](#class-scenetree-property-network-peer) refuses new incoming connections. ### [Viewport](class_viewport#class-viewport) root | | | | --- | --- | | *Getter* | get\_root() | The `SceneTree`'s root [Viewport](class_viewport#class-viewport). ### [bool](class_bool#class-bool) use\_font\_oversampling | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_font\_oversampling(value) | | *Getter* | is\_using\_font\_oversampling() | If `true`, font oversampling is enabled. This means that [DynamicFont](class_dynamicfont#class-dynamicfont)s will be rendered at higher or lower size than configured based on the viewport's scaling ratio. For example, in a viewport scaled with a factor 1.5, a font configured with size 14 would be rendered with size 21 (`14 * 1.5`). **Note:** Font oversampling is only used if the viewport stretch mode is [STRETCH\_MODE\_VIEWPORT](#class-scenetree-constant-stretch-mode-viewport), and if the stretch aspect mode is different from [STRETCH\_ASPECT\_IGNORE](#class-scenetree-constant-stretch-aspect-ignore). **Note:** This property is set automatically for the active `SceneTree` when the project starts based on the configuration of `rendering/quality/dynamic_fonts/use_oversampling` in [ProjectSettings](class_projectsettings#class-projectsettings). The property can however be overridden at runtime as needed. Method Descriptions ------------------- ### [Variant](class_variant#class-variant) call\_group ( [String](class_string#class-string) group, [String](class_string#class-string) method, ... ) vararg Calls `method` on each member of the given group. You can pass arguments to `method` by specifying them at the end of the method call. This method is equivalent of calling [call\_group\_flags](#class-scenetree-method-call-group-flags) with [GROUP\_CALL\_DEFAULT](#class-scenetree-constant-group-call-default) flag. **Note:** `method` may only have 5 arguments at most (7 arguments passed to this method in total). **Note:** Due to design limitations, [call\_group](#class-scenetree-method-call-group) will fail silently if one of the arguments is `null`. **Note:** [call\_group](#class-scenetree-method-call-group) will always call methods with an one-frame delay, in a way similar to [Object.call\_deferred](class_object#class-object-method-call-deferred). To call methods immediately, use [call\_group\_flags](#class-scenetree-method-call-group-flags) with the [GROUP\_CALL\_REALTIME](#class-scenetree-constant-group-call-realtime) flag. ### [Variant](class_variant#class-variant) call\_group\_flags ( [int](class_int#class-int) flags, [String](class_string#class-string) group, [String](class_string#class-string) method, ... ) vararg Calls `method` on each member of the given group, respecting the given [GroupCallFlags](#enum-scenetree-groupcallflags). You can pass arguments to `method` by specifying them at the end of the method call. **Note:** `method` may only have 5 arguments at most (8 arguments passed to this method in total). **Note:** Due to design limitations, [call\_group\_flags](#class-scenetree-method-call-group-flags) will fail silently if one of the arguments is `null`. ``` # Call the method immediately and in reverse order. get_tree().call_group_flags(SceneTree.GROUP_CALL_REALTIME | SceneTree.GROUP_CALL_REVERSE, "bases", "destroy") ``` ### [Error](class_%40globalscope#enum-globalscope-error) change\_scene ( [String](class_string#class-string) path ) Changes the running scene to the one at the given `path`, after loading it into a [PackedScene](class_packedscene#class-packedscene) and creating a new instance. Returns [@GlobalScope.OK](class_%40globalscope#class-globalscope-constant-ok) on success, [@GlobalScope.ERR\_CANT\_OPEN](class_%40globalscope#class-globalscope-constant-err-cant-open) if the `path` cannot be loaded into a [PackedScene](class_packedscene#class-packedscene), or [@GlobalScope.ERR\_CANT\_CREATE](class_%40globalscope#class-globalscope-constant-err-cant-create) if that scene cannot be instantiated. **Note:** The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the [change\_scene](#class-scenetree-method-change-scene) call. ### [Error](class_%40globalscope#enum-globalscope-error) change\_scene\_to ( [PackedScene](class_packedscene#class-packedscene) packed\_scene ) Changes the running scene to a new instance of the given [PackedScene](class_packedscene#class-packedscene). Returns [@GlobalScope.OK](class_%40globalscope#class-globalscope-constant-ok) on success or [@GlobalScope.ERR\_CANT\_CREATE](class_%40globalscope#class-globalscope-constant-err-cant-create) if the scene cannot be instantiated. **Note:** The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the [change\_scene\_to](#class-scenetree-method-change-scene-to) call. **Note:** Passing a value of `null` into the method will unload the current scene without loading a new one. ### [SceneTreeTimer](class_scenetreetimer#class-scenetreetimer) create\_timer ( [float](class_float#class-float) time\_sec, [bool](class_bool#class-bool) pause\_mode\_process=true ) Returns a [SceneTreeTimer](class_scenetreetimer#class-scenetreetimer) which will [SceneTreeTimer.timeout](class_scenetreetimer#class-scenetreetimer-signal-timeout) after the given time in seconds elapsed in this `SceneTree`. If `pause_mode_process` is set to `false`, pausing the `SceneTree` will also pause the timer. Commonly used to create a one-shot delay timer as in the following example: ``` func some_function(): print("start") yield(get_tree().create_timer(1.0), "timeout") print("end") ``` The timer will be automatically freed after its time elapses. ### [SceneTreeTween](class_scenetreetween#class-scenetreetween) create\_tween ( ) Creates and returns a new [SceneTreeTween](class_scenetreetween#class-scenetreetween). ### [int](class_int#class-int) get\_frame ( ) const Returns the current frame number, i.e. the total frame count since the application started. ### [PoolIntArray](class_poolintarray#class-poolintarray) get\_network\_connected\_peers ( ) const Returns the peer IDs of all connected peers of this `SceneTree`'s [network\_peer](#class-scenetree-property-network-peer). ### [int](class_int#class-int) get\_network\_unique\_id ( ) const Returns the unique peer ID of this `SceneTree`'s [network\_peer](#class-scenetree-property-network-peer). ### [int](class_int#class-int) get\_node\_count ( ) const Returns the number of nodes in this `SceneTree`. ### [Array](class_array#class-array) get\_nodes\_in\_group ( [String](class_string#class-string) group ) Returns a list of all nodes assigned to the given group. ### [Array](class_array#class-array) get\_processed\_tweens ( ) Returns an array of currently existing [SceneTreeTween](class_scenetreetween#class-scenetreetween)s in the `SceneTree` (both running and paused). ### [int](class_int#class-int) get\_rpc\_sender\_id ( ) const Returns the sender's peer ID for the most recently received RPC call. ### [bool](class_bool#class-bool) has\_group ( [String](class_string#class-string) name ) const Returns `true` if the given group exists. ### [bool](class_bool#class-bool) has\_network\_peer ( ) const Returns `true` if there is a [network\_peer](#class-scenetree-property-network-peer) set. ### [bool](class_bool#class-bool) is\_input\_handled ( ) Returns `true` if the most recent [InputEvent](class_inputevent#class-inputevent) was marked as handled with [set\_input\_as\_handled](#class-scenetree-method-set-input-as-handled). ### [bool](class_bool#class-bool) is\_network\_server ( ) const Returns `true` if this `SceneTree`'s [network\_peer](#class-scenetree-property-network-peer) is in server mode (listening for connections). ### void notify\_group ( [String](class_string#class-string) group, [int](class_int#class-int) notification ) Sends the given notification to all members of the `group`. ### void notify\_group\_flags ( [int](class_int#class-int) call\_flags, [String](class_string#class-string) group, [int](class_int#class-int) notification ) Sends the given notification to all members of the `group`, respecting the given [GroupCallFlags](#enum-scenetree-groupcallflags). ### void queue\_delete ( [Object](class_object#class-object) obj ) Queues the given object for deletion, delaying the call to [Object.free](class_object#class-object-method-free) to after the current frame. ### void quit ( [int](class_int#class-int) exit\_code=-1 ) Quits the application at the end of the current iteration. A process `exit_code` can optionally be passed as an argument. If this argument is `0` or greater, it will override the [OS.exit\_code](class_os#class-os-property-exit-code) defined before quitting the application. **Note:** On iOS this method doesn't work. Instead, as recommended by the iOS Human Interface Guidelines, the user is expected to close apps via the Home button. ### [Error](class_%40globalscope#enum-globalscope-error) reload\_current\_scene ( ) Reloads the currently active scene. Returns [@GlobalScope.OK](class_%40globalscope#class-globalscope-constant-ok) on success, [@GlobalScope.ERR\_UNCONFIGURED](class_%40globalscope#class-globalscope-constant-err-unconfigured) if no [current\_scene](#class-scenetree-property-current-scene) was defined yet, [@GlobalScope.ERR\_CANT\_OPEN](class_%40globalscope#class-globalscope-constant-err-cant-open) if [current\_scene](#class-scenetree-property-current-scene) cannot be loaded into a [PackedScene](class_packedscene#class-packedscene), or [@GlobalScope.ERR\_CANT\_CREATE](class_%40globalscope#class-globalscope-constant-err-cant-create) if the scene cannot be instantiated. ### void set\_group ( [String](class_string#class-string) group, [String](class_string#class-string) property, [Variant](class_variant#class-variant) value ) Sets the given `property` to `value` on all members of the given group. ### void set\_group\_flags ( [int](class_int#class-int) call\_flags, [String](class_string#class-string) group, [String](class_string#class-string) property, [Variant](class_variant#class-variant) value ) Sets the given `property` to `value` on all members of the given group, respecting the given [GroupCallFlags](#enum-scenetree-groupcallflags). ### void set\_input\_as\_handled ( ) Marks the most recent [InputEvent](class_inputevent#class-inputevent) as handled. ### void set\_screen\_stretch ( [StretchMode](#enum-scenetree-stretchmode) mode, [StretchAspect](#enum-scenetree-stretchaspect) aspect, [Vector2](class_vector2#class-vector2) minsize, [float](class_float#class-float) scale=1 ) Configures screen stretching to the given [StretchMode](#enum-scenetree-stretchmode), [StretchAspect](#enum-scenetree-stretchaspect), minimum size and `scale`.
programming_docs
godot VisualScriptIterator VisualScriptIterator ==================== **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Steps through items in a given input. Description ----------- This node steps through each item in a given input. Input can be any sequence data type, such as an [Array](class_array#class-array) or [String](class_string#class-string). When each item has been processed, execution passed out the `exit` Sequence port. **Input Ports:** * Sequence: `for (elem) in (input)` * Data (variant): `input` **Output Ports:** * Sequence: `each` * Sequence: `exit` * Data (variant): `elem` godot VehicleBody VehicleBody =========== **Inherits:** [RigidBody](class_rigidbody#class-rigidbody) **<** [PhysicsBody](class_physicsbody#class-physicsbody) **<** [CollisionObject](class_collisionobject#class-collisionobject) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Physics body that simulates the behavior of a car. Description ----------- This node implements all the physics logic needed to simulate a car. It is based on the raycast vehicle system commonly found in physics engines. You will need to add a [CollisionShape](class_collisionshape#class-collisionshape) for the main body of your vehicle and add [VehicleWheel](class_vehiclewheel#class-vehiclewheel) nodes for the wheels. You should also add a [MeshInstance](class_meshinstance#class-meshinstance) to this node for the 3D model of your car but this model should not include meshes for the wheels. You should control the vehicle by using the [brake](#class-vehiclebody-property-brake), [engine\_force](#class-vehiclebody-property-engine-force), and [steering](#class-vehiclebody-property-steering) properties and not change the position or orientation of this node directly. **Note:** The origin point of your VehicleBody will determine the center of gravity of your vehicle so it is better to keep this low and move the [CollisionShape](class_collisionshape#class-collisionshape) and [MeshInstance](class_meshinstance#class-meshinstance) upwards. **Note:** This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another [PhysicsBody](class_physicsbody#class-physicsbody) class. Tutorials --------- * [3D Truck Town Demo](https://godotengine.org/asset-library/asset/524) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [brake](#class-vehiclebody-property-brake) | `0.0` | | [float](class_float#class-float) | [engine\_force](#class-vehiclebody-property-engine-force) | `0.0` | | [float](class_float#class-float) | mass | `40.0` (overrides [RigidBody](class_rigidbody#class-rigidbody-property-mass)) | | [float](class_float#class-float) | [steering](#class-vehiclebody-property-steering) | `0.0` | | [float](class_float#class-float) | weight | `392.0` (overrides [RigidBody](class_rigidbody#class-rigidbody-property-weight)) | Property Descriptions --------------------- ### [float](class_float#class-float) brake | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_brake(value) | | *Getter* | get\_brake() | Slows down the vehicle by applying a braking force. The vehicle is only slowed down if the wheels are in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the [RigidBody.mass](class_rigidbody#class-rigidbody-property-mass) of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking. ### [float](class_float#class-float) engine\_force | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_engine\_force(value) | | *Getter* | get\_engine\_force() | Accelerates the vehicle by applying an engine force. The vehicle is only sped up if the wheels that have [VehicleWheel.use\_as\_traction](class_vehiclewheel#class-vehiclewheel-property-use-as-traction) set to `true` and are in contact with a surface. The [RigidBody.mass](class_rigidbody#class-rigidbody-property-mass) of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. **Note:** The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. A negative value will result in the vehicle reversing. ### [float](class_float#class-float) steering | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_steering(value) | | *Getter* | get\_steering() | The steering angle for the vehicle. Setting this to a non-zero value will result in the vehicle turning when it's moving. Wheels that have [VehicleWheel.use\_as\_steering](class_vehiclewheel#class-vehiclewheel-property-use-as-steering) set to `true` will automatically be rotated. godot ARVRCamera ARVRCamera ========== **Inherits:** [Camera](class_camera#class-camera) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) A camera node with a few overrules for AR/VR applied, such as location tracking. Description ----------- This is a helper spatial node for our camera; note that, if stereoscopic rendering is applicable (VR-HMD), most of the camera properties are ignored, as the HMD information overrides them. The only properties that can be trusted are the near and far planes. The position and orientation of this node is automatically updated by the ARVR Server to represent the location of the HMD if such tracking is available and can thus be used by game logic. Note that, in contrast to the ARVR Controller, the render thread has access to the most up-to-date tracking data of the HMD and the location of the ARVRCamera can lag a few milliseconds behind what is used for rendering as a result. Tutorials --------- * [XR (AR/VR)](https://docs.godotengine.org/en/3.5/tutorials/vr/index.html) godot StyleBoxFlat StyleBoxFlat ============ **Inherits:** [StyleBox](class_stylebox#class-stylebox) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Customizable [StyleBox](class_stylebox#class-stylebox) with a given set of parameters (no texture required). Description ----------- This [StyleBox](class_stylebox#class-stylebox) can be used to achieve all kinds of looks without the need of a texture. The following properties are customizable: * Color * Border width (individual width for each border) * Rounded corners (individual radius for each corner) * Shadow (with blur and offset) Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will switch to a relative system. Example: ``` height = 30 corner_radius_top_left = 50 corner_radius_bottom_left = 100 ``` The relative system now would take the 1:2 ratio of the two left corners to calculate the actual corner width. Both corners added will **never** be more than the height. Result: ``` corner_radius_top_left: 10 corner_radius_bottom_left: 20 ``` Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [anti\_aliasing](#class-styleboxflat-property-anti-aliasing) | `true` | | [float](class_float#class-float) | [anti\_aliasing\_size](#class-styleboxflat-property-anti-aliasing-size) | `0.625` | | [Color](class_color#class-color) | [bg\_color](#class-styleboxflat-property-bg-color) | `Color( 0.6, 0.6, 0.6, 1 )` | | [bool](class_bool#class-bool) | [border\_blend](#class-styleboxflat-property-border-blend) | `false` | | [Color](class_color#class-color) | [border\_color](#class-styleboxflat-property-border-color) | `Color( 0.8, 0.8, 0.8, 1 )` | | [int](class_int#class-int) | [border\_width\_bottom](#class-styleboxflat-property-border-width-bottom) | `0` | | [int](class_int#class-int) | [border\_width\_left](#class-styleboxflat-property-border-width-left) | `0` | | [int](class_int#class-int) | [border\_width\_right](#class-styleboxflat-property-border-width-right) | `0` | | [int](class_int#class-int) | [border\_width\_top](#class-styleboxflat-property-border-width-top) | `0` | | [int](class_int#class-int) | [corner\_detail](#class-styleboxflat-property-corner-detail) | `8` | | [int](class_int#class-int) | [corner\_radius\_bottom\_left](#class-styleboxflat-property-corner-radius-bottom-left) | `0` | | [int](class_int#class-int) | [corner\_radius\_bottom\_right](#class-styleboxflat-property-corner-radius-bottom-right) | `0` | | [int](class_int#class-int) | [corner\_radius\_top\_left](#class-styleboxflat-property-corner-radius-top-left) | `0` | | [int](class_int#class-int) | [corner\_radius\_top\_right](#class-styleboxflat-property-corner-radius-top-right) | `0` | | [bool](class_bool#class-bool) | [draw\_center](#class-styleboxflat-property-draw-center) | `true` | | [float](class_float#class-float) | [expand\_margin\_bottom](#class-styleboxflat-property-expand-margin-bottom) | `0.0` | | [float](class_float#class-float) | [expand\_margin\_left](#class-styleboxflat-property-expand-margin-left) | `0.0` | | [float](class_float#class-float) | [expand\_margin\_right](#class-styleboxflat-property-expand-margin-right) | `0.0` | | [float](class_float#class-float) | [expand\_margin\_top](#class-styleboxflat-property-expand-margin-top) | `0.0` | | [Color](class_color#class-color) | [shadow\_color](#class-styleboxflat-property-shadow-color) | `Color( 0, 0, 0, 0.6 )` | | [Vector2](class_vector2#class-vector2) | [shadow\_offset](#class-styleboxflat-property-shadow-offset) | `Vector2( 0, 0 )` | | [int](class_int#class-int) | [shadow\_size](#class-styleboxflat-property-shadow-size) | `0` | | [Vector2](class_vector2#class-vector2) | [skew](#class-styleboxflat-property-skew) | `Vector2( 0, 0 )` | Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [get\_border\_width](#class-styleboxflat-method-get-border-width) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin **)** const | | [int](class_int#class-int) | [get\_border\_width\_min](#class-styleboxflat-method-get-border-width-min) **(** **)** const | | [int](class_int#class-int) | [get\_corner\_radius](#class-styleboxflat-method-get-corner-radius) **(** [Corner](class_%40globalscope#enum-globalscope-corner) corner **)** const | | [float](class_float#class-float) | [get\_expand\_margin](#class-styleboxflat-method-get-expand-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin **)** const | | void | [set\_border\_width](#class-styleboxflat-method-set-border-width) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin, [int](class_int#class-int) width **)** | | void | [set\_border\_width\_all](#class-styleboxflat-method-set-border-width-all) **(** [int](class_int#class-int) width **)** | | void | [set\_corner\_radius](#class-styleboxflat-method-set-corner-radius) **(** [Corner](class_%40globalscope#enum-globalscope-corner) corner, [int](class_int#class-int) radius **)** | | void | [set\_corner\_radius\_all](#class-styleboxflat-method-set-corner-radius-all) **(** [int](class_int#class-int) radius **)** | | void | [set\_corner\_radius\_individual](#class-styleboxflat-method-set-corner-radius-individual) **(** [int](class_int#class-int) radius\_top\_left, [int](class_int#class-int) radius\_top\_right, [int](class_int#class-int) radius\_bottom\_right, [int](class_int#class-int) radius\_bottom\_left **)** | | void | [set\_expand\_margin](#class-styleboxflat-method-set-expand-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) size **)** | | void | [set\_expand\_margin\_all](#class-styleboxflat-method-set-expand-margin-all) **(** [float](class_float#class-float) size **)** | | void | [set\_expand\_margin\_individual](#class-styleboxflat-method-set-expand-margin-individual) **(** [float](class_float#class-float) size\_left, [float](class_float#class-float) size\_top, [float](class_float#class-float) size\_right, [float](class_float#class-float) size\_bottom **)** | Property Descriptions --------------------- ### [bool](class_bool#class-bool) anti\_aliasing | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_anti\_aliased(value) | | *Getter* | is\_anti\_aliased() | Antialiasing draws a small ring around the edges, which fades to transparency. As a result, edges look much smoother. This is only noticeable when using rounded corners or [skew](#class-styleboxflat-property-skew). **Note:** When using beveled corners with 45-degree angles ([corner\_detail](#class-styleboxflat-property-corner-detail) = 1), it is recommended to set [anti\_aliasing](#class-styleboxflat-property-anti-aliasing) to `false` to ensure crisp visuals and avoid possible visual glitches. ### [float](class_float#class-float) anti\_aliasing\_size | | | | --- | --- | | *Default* | `0.625` | | *Setter* | set\_aa\_size(value) | | *Getter* | get\_aa\_size() | This changes the size of the faded ring. Higher values can be used to achieve a "blurry" effect. ### [Color](class_color#class-color) bg\_color | | | | --- | --- | | *Default* | `Color( 0.6, 0.6, 0.6, 1 )` | | *Setter* | set\_bg\_color(value) | | *Getter* | get\_bg\_color() | The background color of the stylebox. ### [bool](class_bool#class-bool) border\_blend | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_border\_blend(value) | | *Getter* | get\_border\_blend() | If `true`, the border will fade into the background color. ### [Color](class_color#class-color) border\_color | | | | --- | --- | | *Default* | `Color( 0.8, 0.8, 0.8, 1 )` | | *Setter* | set\_border\_color(value) | | *Getter* | get\_border\_color() | Sets the color of the border. ### [int](class_int#class-int) border\_width\_bottom | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_border\_width(value) | | *Getter* | get\_border\_width() | Border width for the bottom border. ### [int](class_int#class-int) border\_width\_left | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_border\_width(value) | | *Getter* | get\_border\_width() | Border width for the left border. ### [int](class_int#class-int) border\_width\_right | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_border\_width(value) | | *Getter* | get\_border\_width() | Border width for the right border. ### [int](class_int#class-int) border\_width\_top | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_border\_width(value) | | *Getter* | get\_border\_width() | Border width for the top border. ### [int](class_int#class-int) corner\_detail | | | | --- | --- | | *Default* | `8` | | *Setter* | set\_corner\_detail(value) | | *Getter* | get\_corner\_detail() | This sets the number of vertices used for each corner. Higher values result in rounder corners but take more processing power to compute. When choosing a value, you should take the corner radius ([set\_corner\_radius\_all](#class-styleboxflat-method-set-corner-radius-all)) into account. For corner radii less than 10, `4` or `5` should be enough. For corner radii less than 30, values between `8` and `12` should be enough. A corner detail of `1` will result in chamfered corners instead of rounded corners, which is useful for some artistic effects. ### [int](class_int#class-int) corner\_radius\_bottom\_left | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_corner\_radius(value) | | *Getter* | get\_corner\_radius() | The bottom-left corner's radius. If `0`, the corner is not rounded. ### [int](class_int#class-int) corner\_radius\_bottom\_right | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_corner\_radius(value) | | *Getter* | get\_corner\_radius() | The bottom-right corner's radius. If `0`, the corner is not rounded. ### [int](class_int#class-int) corner\_radius\_top\_left | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_corner\_radius(value) | | *Getter* | get\_corner\_radius() | The top-left corner's radius. If `0`, the corner is not rounded. ### [int](class_int#class-int) corner\_radius\_top\_right | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_corner\_radius(value) | | *Getter* | get\_corner\_radius() | The top-right corner's radius. If `0`, the corner is not rounded. ### [bool](class_bool#class-bool) draw\_center | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_draw\_center(value) | | *Getter* | is\_draw\_center\_enabled() | Toggles drawing of the inner part of the stylebox. ### [float](class_float#class-float) expand\_margin\_bottom | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_expand\_margin(value) | | *Getter* | get\_expand\_margin() | Expands the stylebox outside of the control rect on the bottom edge. Useful in combination with [border\_width\_bottom](#class-styleboxflat-property-border-width-bottom) to draw a border outside the control rect. **Note:** Unlike [StyleBox.content\_margin\_bottom](class_stylebox#class-stylebox-property-content-margin-bottom), [expand\_margin\_bottom](#class-styleboxflat-property-expand-margin-bottom) does *not* affect the size of the clickable area for [Control](class_control#class-control)s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks. ### [float](class_float#class-float) expand\_margin\_left | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_expand\_margin(value) | | *Getter* | get\_expand\_margin() | Expands the stylebox outside of the control rect on the left edge. Useful in combination with [border\_width\_left](#class-styleboxflat-property-border-width-left) to draw a border outside the control rect. **Note:** Unlike [StyleBox.content\_margin\_left](class_stylebox#class-stylebox-property-content-margin-left), [expand\_margin\_left](#class-styleboxflat-property-expand-margin-left) does *not* affect the size of the clickable area for [Control](class_control#class-control)s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks. ### [float](class_float#class-float) expand\_margin\_right | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_expand\_margin(value) | | *Getter* | get\_expand\_margin() | Expands the stylebox outside of the control rect on the right edge. Useful in combination with [border\_width\_right](#class-styleboxflat-property-border-width-right) to draw a border outside the control rect. **Note:** Unlike [StyleBox.content\_margin\_right](class_stylebox#class-stylebox-property-content-margin-right), [expand\_margin\_right](#class-styleboxflat-property-expand-margin-right) does *not* affect the size of the clickable area for [Control](class_control#class-control)s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks. ### [float](class_float#class-float) expand\_margin\_top | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_expand\_margin(value) | | *Getter* | get\_expand\_margin() | Expands the stylebox outside of the control rect on the top edge. Useful in combination with [border\_width\_top](#class-styleboxflat-property-border-width-top) to draw a border outside the control rect. **Note:** Unlike [StyleBox.content\_margin\_top](class_stylebox#class-stylebox-property-content-margin-top), [expand\_margin\_top](#class-styleboxflat-property-expand-margin-top) does *not* affect the size of the clickable area for [Control](class_control#class-control)s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks. ### [Color](class_color#class-color) shadow\_color | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 0.6 )` | | *Setter* | set\_shadow\_color(value) | | *Getter* | get\_shadow\_color() | The color of the shadow. This has no effect if [shadow\_size](#class-styleboxflat-property-shadow-size) is lower than 1. ### [Vector2](class_vector2#class-vector2) shadow\_offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_shadow\_offset(value) | | *Getter* | get\_shadow\_offset() | The shadow offset in pixels. Adjusts the position of the shadow relatively to the stylebox. ### [int](class_int#class-int) shadow\_size | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_shadow\_size(value) | | *Getter* | get\_shadow\_size() | The shadow size in pixels. ### [Vector2](class_vector2#class-vector2) skew | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_skew(value) | | *Getter* | get\_skew() | If set to a non-zero value on either axis, [skew](#class-styleboxflat-property-skew) distorts the StyleBox horizontally and/or vertically. This can be used for "futuristic"-style UIs. Positive values skew the StyleBox towards the right (X axis) and upwards (Y axis), while negative values skew the StyleBox towards the left (X axis) and downwards (Y axis). **Note:** To ensure text does not touch the StyleBox's edges, consider increasing the [StyleBox](class_stylebox#class-stylebox)'s content margin (see [StyleBox.content\_margin\_bottom](class_stylebox#class-stylebox-property-content-margin-bottom)). It is preferable to increase the content margin instead of the expand margin (see [expand\_margin\_bottom](#class-styleboxflat-property-expand-margin-bottom)), as increasing the expand margin does not increase the size of the clickable area for [Control](class_control#class-control)s. Method Descriptions ------------------- ### [int](class_int#class-int) get\_border\_width ( [Margin](class_%40globalscope#enum-globalscope-margin) margin ) const Returns the given `margin`'s border width. See [Margin](class_%40globalscope#enum-globalscope-margin) for possible values. ### [int](class_int#class-int) get\_border\_width\_min ( ) const Returns the smallest border width out of all four borders. ### [int](class_int#class-int) get\_corner\_radius ( [Corner](class_%40globalscope#enum-globalscope-corner) corner ) const Returns the given `corner`'s radius. See [Corner](class_%40globalscope#enum-globalscope-corner) for possible values. ### [float](class_float#class-float) get\_expand\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin ) const Returns the size of the given `margin`'s expand margin. See [Margin](class_%40globalscope#enum-globalscope-margin) for possible values. ### void set\_border\_width ( [Margin](class_%40globalscope#enum-globalscope-margin) margin, [int](class_int#class-int) width ) Sets the border width to `width` pixels for the given `margin`. See [Margin](class_%40globalscope#enum-globalscope-margin) for possible values. ### void set\_border\_width\_all ( [int](class_int#class-int) width ) Sets the border width to `width` pixels for all margins. ### void set\_corner\_radius ( [Corner](class_%40globalscope#enum-globalscope-corner) corner, [int](class_int#class-int) radius ) Sets the corner radius to `radius` pixels for the given `corner`. See [Corner](class_%40globalscope#enum-globalscope-corner) for possible values. ### void set\_corner\_radius\_all ( [int](class_int#class-int) radius ) Sets the corner radius to `radius` pixels for all corners. ### void set\_corner\_radius\_individual ( [int](class_int#class-int) radius\_top\_left, [int](class_int#class-int) radius\_top\_right, [int](class_int#class-int) radius\_bottom\_right, [int](class_int#class-int) radius\_bottom\_left ) Sets the corner radius for each corner to `radius_top_left`, `radius_top_right`, `radius_bottom_right`, and `radius_bottom_left` pixels. ### void set\_expand\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) size ) Sets the expand margin to `size` pixels for the given `margin`. See [Margin](class_%40globalscope#enum-globalscope-margin) for possible values. ### void set\_expand\_margin\_all ( [float](class_float#class-float) size ) Sets the expand margin to `size` pixels for all margins. ### void set\_expand\_margin\_individual ( [float](class_float#class-float) size\_left, [float](class_float#class-float) size\_top, [float](class_float#class-float) size\_right, [float](class_float#class-float) size\_bottom ) Sets the expand margin for each margin to `size_left`, `size_top`, `size_right`, and `size_bottom` pixels.
programming_docs
godot Basis Basis ===== 3×3 matrix datatype. Description ----------- 3×3 matrix used for 3D rotation and scale. Almost always used as an orthogonal basis for a Transform. Contains 3 vector fields X, Y and Z as its columns, which are typically interpreted as the local basis vectors of a transformation. For such use, it is composed of a scaling and a rotation matrix, in that order (M = R.S). Can also be accessed as array of 3D vectors. These vectors are normally orthogonal to each other, but are not necessarily normalized (due to scaling). For more information, read the "Matrices and transforms" documentation article. Tutorials --------- * [Math tutorial index](https://docs.godotengine.org/en/3.5/tutorials/math/index.html) * [Matrices and transforms](https://docs.godotengine.org/en/3.5/tutorials/math/matrices_and_transforms.html) * [Using 3D transforms](https://docs.godotengine.org/en/3.5/tutorials/3d/using_transforms.html) * [Matrix Transform Demo](https://godotengine.org/asset-library/asset/584) * [3D Platformer Demo](https://godotengine.org/asset-library/asset/125) * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) * [2.5D Demo](https://godotengine.org/asset-library/asset/583) Properties ---------- | | | | | --- | --- | --- | | [Vector3](class_vector3#class-vector3) | [x](#class-basis-property-x) | `Vector3( 1, 0, 0 )` | | [Vector3](class_vector3#class-vector3) | [y](#class-basis-property-y) | `Vector3( 0, 1, 0 )` | | [Vector3](class_vector3#class-vector3) | [z](#class-basis-property-z) | `Vector3( 0, 0, 1 )` | Methods ------- | | | | --- | --- | | [Basis](#class-basis) | [Basis](#class-basis-method-basis) **(** [Quat](class_quat#class-quat) from **)** | | [Basis](#class-basis) | [Basis](#class-basis-method-basis) **(** [Vector3](class_vector3#class-vector3) from **)** | | [Basis](#class-basis) | [Basis](#class-basis-method-basis) **(** [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle **)** | | [Basis](#class-basis) | [Basis](#class-basis-method-basis) **(** [Vector3](class_vector3#class-vector3) x\_axis, [Vector3](class_vector3#class-vector3) y\_axis, [Vector3](class_vector3#class-vector3) z\_axis **)** | | [float](class_float#class-float) | [determinant](#class-basis-method-determinant) **(** **)** | | [Vector3](class_vector3#class-vector3) | [get\_euler](#class-basis-method-get-euler) **(** **)** | | [int](class_int#class-int) | [get\_orthogonal\_index](#class-basis-method-get-orthogonal-index) **(** **)** | | [Quat](class_quat#class-quat) | [get\_rotation\_quat](#class-basis-method-get-rotation-quat) **(** **)** | | [Vector3](class_vector3#class-vector3) | [get\_scale](#class-basis-method-get-scale) **(** **)** | | [Basis](#class-basis) | [inverse](#class-basis-method-inverse) **(** **)** | | [bool](class_bool#class-bool) | [is\_equal\_approx](#class-basis-method-is-equal-approx) **(** [Basis](#class-basis) b, [float](class_float#class-float) epsilon=1e-05 **)** | | [Basis](#class-basis) | [orthonormalized](#class-basis-method-orthonormalized) **(** **)** | | [Basis](#class-basis) | [rotated](#class-basis-method-rotated) **(** [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle **)** | | [Basis](#class-basis) | [scaled](#class-basis-method-scaled) **(** [Vector3](class_vector3#class-vector3) scale **)** | | [Basis](#class-basis) | [slerp](#class-basis-method-slerp) **(** [Basis](#class-basis) to, [float](class_float#class-float) weight **)** | | [float](class_float#class-float) | [tdotx](#class-basis-method-tdotx) **(** [Vector3](class_vector3#class-vector3) with **)** | | [float](class_float#class-float) | [tdoty](#class-basis-method-tdoty) **(** [Vector3](class_vector3#class-vector3) with **)** | | [float](class_float#class-float) | [tdotz](#class-basis-method-tdotz) **(** [Vector3](class_vector3#class-vector3) with **)** | | [Basis](#class-basis) | [transposed](#class-basis-method-transposed) **(** **)** | | [Vector3](class_vector3#class-vector3) | [xform](#class-basis-method-xform) **(** [Vector3](class_vector3#class-vector3) v **)** | | [Vector3](class_vector3#class-vector3) | [xform\_inv](#class-basis-method-xform-inv) **(** [Vector3](class_vector3#class-vector3) v **)** | Constants --------- ### IDENTITY = Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 ) --- The identity basis, with no rotation or scaling applied. This is identical to calling `Basis()` without any parameters. This constant can be used to make your code clearer, and for consistency with C#. * **FLIP\_X** = **Basis( -1, 0, 0, 0, 1, 0, 0, 0, 1 )** --- The basis that will flip something along the X axis when used in a transformation. * **FLIP\_Y** = **Basis( 1, 0, 0, 0, -1, 0, 0, 0, 1 )** --- The basis that will flip something along the Y axis when used in a transformation. * **FLIP\_Z** = **Basis( 1, 0, 0, 0, 1, 0, 0, 0, -1 )** --- The basis that will flip something along the Z axis when used in a transformation. Property Descriptions --------------------- ### [Vector3](class_vector3#class-vector3) x | | | | --- | --- | | *Default* | `Vector3( 1, 0, 0 )` | The basis matrix's X vector (column 0). Equivalent to array index `0`. ### [Vector3](class_vector3#class-vector3) y | | | | --- | --- | | *Default* | `Vector3( 0, 1, 0 )` | The basis matrix's Y vector (column 1). Equivalent to array index `1`. ### [Vector3](class_vector3#class-vector3) z | | | | --- | --- | | *Default* | `Vector3( 0, 0, 1 )` | The basis matrix's Z vector (column 2). Equivalent to array index `2`. Method Descriptions ------------------- ### [Basis](#class-basis) Basis ( [Quat](class_quat#class-quat) from ) Constructs a pure rotation basis matrix from the given quaternion. * [Basis](#class-basis) **Basis** **(** [Vector3](class_vector3#class-vector3) from **)** Constructs a pure rotation basis matrix from the given Euler angles (in the YXZ convention: when \*composing\*, first Y, then X, and Z last), given in the vector format as (X angle, Y angle, Z angle). Consider using the [Quat](class_quat#class-quat) constructor instead, which uses a quaternion instead of Euler angles. * [Basis](#class-basis) **Basis** **(** [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle **)** Constructs a pure rotation basis matrix, rotated around the given `axis` by `angle` (in radians). The axis must be a normalized vector. * [Basis](#class-basis) **Basis** **(** [Vector3](class_vector3#class-vector3) x\_axis, [Vector3](class_vector3#class-vector3) y\_axis, [Vector3](class_vector3#class-vector3) z\_axis **)** Constructs a basis matrix from 3 axis vectors (matrix columns). ### [float](class_float#class-float) determinant ( ) Returns the determinant of the basis matrix. If the basis is uniformly scaled, its determinant is the square of the scale. A negative determinant means the basis has a negative scale. A zero determinant means the basis isn't invertible, and is usually considered invalid. ### [Vector3](class_vector3#class-vector3) get\_euler ( ) Returns the basis's rotation in the form of Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last). The returned vector contains the rotation angles in the format (X angle, Y angle, Z angle). Consider using the [get\_rotation\_quat](#class-basis-method-get-rotation-quat) method instead, which returns a [Quat](class_quat#class-quat) quaternion instead of Euler angles. ### [int](class_int#class-int) get\_orthogonal\_index ( ) This function considers a discretization of rotations into 24 points on unit sphere, lying along the vectors (x,y,z) with each component being either -1, 0, or 1, and returns the index of the point best representing the orientation of the object. It is mainly used by the [GridMap](class_gridmap#class-gridmap) editor. For further details, refer to the Godot source code. ### [Quat](class_quat#class-quat) get\_rotation\_quat ( ) Returns the basis's rotation in the form of a quaternion. See [get\_euler](#class-basis-method-get-euler) if you need Euler angles, but keep in mind quaternions should generally be preferred to Euler angles. ### [Vector3](class_vector3#class-vector3) get\_scale ( ) Assuming that the matrix is the combination of a rotation and scaling, return the absolute value of scaling factors along each axis. ### [Basis](#class-basis) inverse ( ) Returns the inverse of the matrix. ### [bool](class_bool#class-bool) is\_equal\_approx ( [Basis](#class-basis) b, [float](class_float#class-float) epsilon=1e-05 ) Returns `true` if this basis and `b` are approximately equal, by calling `is_equal_approx` on each component. **Note:** For complicated reasons, the epsilon argument is always discarded. Don't use the epsilon argument, it does nothing. ### [Basis](#class-basis) orthonormalized ( ) Returns the orthonormalized version of the matrix (useful to call from time to time to avoid rounding error for orthogonal matrices). This performs a Gram-Schmidt orthonormalization on the basis of the matrix. ### [Basis](#class-basis) rotated ( [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle ) Introduce an additional rotation around the given axis by `angle` (in radians). The axis must be a normalized vector. ### [Basis](#class-basis) scaled ( [Vector3](class_vector3#class-vector3) scale ) Introduce an additional scaling specified by the given 3D scaling factor. ### [Basis](#class-basis) slerp ( [Basis](#class-basis) to, [float](class_float#class-float) weight ) Assuming that the matrix is a proper rotation matrix, slerp performs a spherical-linear interpolation with another rotation matrix. ### [float](class_float#class-float) tdotx ( [Vector3](class_vector3#class-vector3) with ) Transposed dot product with the X axis of the matrix. ### [float](class_float#class-float) tdoty ( [Vector3](class_vector3#class-vector3) with ) Transposed dot product with the Y axis of the matrix. ### [float](class_float#class-float) tdotz ( [Vector3](class_vector3#class-vector3) with ) Transposed dot product with the Z axis of the matrix. ### [Basis](#class-basis) transposed ( ) Returns the transposed version of the matrix. ### [Vector3](class_vector3#class-vector3) xform ( [Vector3](class_vector3#class-vector3) v ) Returns a vector transformed (multiplied) by the matrix. ### [Vector3](class_vector3#class-vector3) xform\_inv ( [Vector3](class_vector3#class-vector3) v ) Returns a vector transformed (multiplied) by the transposed basis matrix. **Note:** This results in a multiplication by the inverse of the matrix only if it represents a rotation-reflection. godot VisualScriptMathConstant VisualScriptMathConstant ======================== **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Commonly used mathematical constants. Description ----------- Provides common math constants, such as Pi, on an output Data port. **Input Ports:** none **Output Ports:** * Data (variant): `get` Properties ---------- | | | | | --- | --- | --- | | [MathConstant](#enum-visualscriptmathconstant-mathconstant) | [constant](#class-visualscriptmathconstant-property-constant) | `0` | Enumerations ------------ enum **MathConstant**: * **MATH\_CONSTANT\_ONE** = **0** --- Unity: `1`. * **MATH\_CONSTANT\_PI** = **1** --- Pi: `3.141593`. * **MATH\_CONSTANT\_HALF\_PI** = **2** --- Pi divided by two: `1.570796`. * **MATH\_CONSTANT\_TAU** = **3** --- Tau: `6.283185`. * **MATH\_CONSTANT\_E** = **4** --- Mathematical constant `e`, the natural log base: `2.718282`. * **MATH\_CONSTANT\_SQRT2** = **5** --- Square root of two: `1.414214`. * **MATH\_CONSTANT\_INF** = **6** --- Infinity: `inf`. * **MATH\_CONSTANT\_NAN** = **7** --- Not a number: `nan`. * **MATH\_CONSTANT\_MAX** = **8** --- Represents the size of the [MathConstant](#enum-visualscriptmathconstant-mathconstant) enum. Property Descriptions --------------------- ### [MathConstant](#enum-visualscriptmathconstant-mathconstant) constant | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_math\_constant(value) | | *Getter* | get\_math\_constant() | The math constant. godot PackedScene PackedScene =========== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [PackedSceneGLTF](class_packedscenegltf#class-packedscenegltf) An abstraction of a serialized scene. Description ----------- A simplified interface to a scene file. Provides access to operations and checks that can be performed on the scene resource itself. Can be used to save a node to a file. When saving, the node as well as all the nodes it owns get saved (see `owner` property on [Node](class_node#class-node)). **Note:** The node doesn't need to own itself. **Example of loading a saved scene:** ``` # Use `load()` instead of `preload()` if the path isn't known at compile-time. var scene = preload("res://scene.tscn").instance() # Add the node as a child of the node the script is attached to. add_child(scene) ``` **Example of saving a node with different owners:** The following example creates 3 objects: `Node2D` (`node`), `RigidBody2D` (`rigid`) and `CollisionObject2D` (`collision`). `collision` is a child of `rigid` which is a child of `node`. Only `rigid` is owned by `node` and `pack` will therefore only save those two nodes, but not `collision`. ``` # Create the objects. var node = Node2D.new() var rigid = RigidBody2D.new() var collision = CollisionShape2D.new() # Create the object hierarchy. rigid.add_child(collision) node.add_child(rigid) # Change owner of `rigid`, but not of `collision`. rigid.owner = node var scene = PackedScene.new() # Only `node` and `rigid` are now packed. var result = scene.pack(node) if result == OK: var error = ResourceSaver.save("res://path/name.scn", scene) # Or "user://..." if error != OK: push_error("An error occurred while saving the scene to disk.") ``` Tutorials --------- * [2D Role Playing Game Demo](https://godotengine.org/asset-library/asset/520) Properties ---------- | | | | | --- | --- | --- | | [Dictionary](class_dictionary#class-dictionary) | [\_bundled](#class-packedscene-property-bundled) | `{"conn_count": 0,"conns": PoolIntArray(  ),"editable_instances": [  ],"names": PoolStringArray(  ),"node_count": 0,"node_paths": [  ],"nodes": PoolIntArray(  ),"variants": [  ],"version": 2}` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [can\_instance](#class-packedscene-method-can-instance) **(** **)** const | | [SceneState](class_scenestate#class-scenestate) | [get\_state](#class-packedscene-method-get-state) **(** **)** | | [Node](class_node#class-node) | [instance](#class-packedscene-method-instance) **(** [GenEditState](#enum-packedscene-geneditstate) edit\_state=0 **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [pack](#class-packedscene-method-pack) **(** [Node](class_node#class-node) path **)** | Enumerations ------------ enum **GenEditState**: * **GEN\_EDIT\_STATE\_DISABLED** = **0** --- If passed to [instance](#class-packedscene-method-instance), blocks edits to the scene state. * **GEN\_EDIT\_STATE\_INSTANCE** = **1** --- If passed to [instance](#class-packedscene-method-instance), provides local scene resources to the local scene. **Note:** Only available in editor builds. * **GEN\_EDIT\_STATE\_MAIN** = **2** --- If passed to [instance](#class-packedscene-method-instance), provides local scene resources to the local scene. Only the main scene should receive the main edit state. **Note:** Only available in editor builds. * **GEN\_EDIT\_STATE\_MAIN\_INHERITED** = **3** --- It's similar to [GEN\_EDIT\_STATE\_MAIN](#class-packedscene-constant-gen-edit-state-main), but for the case where the scene is being instantiated to be the base of another one. **Note:** Only available in editor builds. Property Descriptions --------------------- ### [Dictionary](class_dictionary#class-dictionary) \_bundled | | | | --- | --- | | *Default* | `{"conn_count": 0,"conns": PoolIntArray(  ),"editable_instances": [  ],"names": PoolStringArray(  ),"node_count": 0,"node_paths": [  ],"nodes": PoolIntArray(  ),"variants": [  ],"version": 2}` | A dictionary representation of the scene contents. Available keys include "rnames" and "variants" for resources, "node\_count", "nodes", "node\_paths" for nodes, "editable\_instances" for base scene children overrides, "conn\_count" and "conns" for signal connections, and "version" for the format style of the PackedScene. Method Descriptions ------------------- ### [bool](class_bool#class-bool) can\_instance ( ) const Returns `true` if the scene file has nodes. ### [SceneState](class_scenestate#class-scenestate) get\_state ( ) Returns the `SceneState` representing the scene file contents. ### [Node](class_node#class-node) instance ( [GenEditState](#enum-packedscene-geneditstate) edit\_state=0 ) const Instantiates the scene's node hierarchy. Triggers child scene instantiation(s). Triggers a [Node.NOTIFICATION\_INSTANCED](class_node#class-node-constant-notification-instanced) notification on the root node. ### [Error](class_%40globalscope#enum-globalscope-error) pack ( [Node](class_node#class-node) path ) Pack will ignore any sub-nodes not owned by given node. See [Node.owner](class_node#class-node-property-owner). godot VisualScriptVariableSet VisualScriptVariableSet ======================= **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Changes a variable's value. Description ----------- Changes a variable's value to the given input. **Input Ports:** * Sequence * Data (variant): `set` **Output Ports:** * Sequence Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [var\_name](#class-visualscriptvariableset-property-var-name) | `""` | Property Descriptions --------------------- ### [String](class_string#class-string) var\_name | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_variable(value) | | *Getter* | get\_variable() | The variable's name. godot VisualShaderNodeTransformVecMult VisualShaderNodeTransformVecMult ================================ **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Multiplies a [Transform](class_transform#class-transform) and a [Vector3](class_vector3#class-vector3) within the visual shader graph. Description ----------- A multiplication operation on a transform (4x4 matrix) and a vector, with support for different multiplication operators. Properties ---------- | | | | | --- | --- | --- | | [Operator](#enum-visualshadernodetransformvecmult-operator) | [operator](#class-visualshadernodetransformvecmult-property-operator) | `0` | Enumerations ------------ enum **Operator**: * **OP\_AxB** = **0** --- Multiplies transform `a` by the vector `b`. * **OP\_BxA** = **1** --- Multiplies vector `b` by the transform `a`. * **OP\_3x3\_AxB** = **2** --- Multiplies transform `a` by the vector `b`, skipping the last row and column of the transform. * **OP\_3x3\_BxA** = **3** --- Multiplies vector `b` by the transform `a`, skipping the last row and column of the transform. Property Descriptions --------------------- ### [Operator](#enum-visualshadernodetransformvecmult-operator) operator | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_operator(value) | | *Getter* | get\_operator() | The multiplication type to be performed. See [Operator](#enum-visualshadernodetransformvecmult-operator) for options.
programming_docs
godot Generic6DOFJoint Generic6DOFJoint ================ **Inherits:** [Joint](class_joint#class-joint) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) The generic 6-degrees-of-freedom joint can implement a variety of joint types by locking certain axes' rotation or translation. Description ----------- The first 3 DOF axes are linear axes, which represent translation of Bodies, and the latter 3 DOF axes represent the angular motion. Each axis can be either locked, or limited. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [angular\_limit\_x/damping](#class-generic6dofjoint-property-angular-limit-x-damping) | `1.0` | | [bool](class_bool#class-bool) | [angular\_limit\_x/enabled](#class-generic6dofjoint-property-angular-limit-x-enabled) | `true` | | [float](class_float#class-float) | [angular\_limit\_x/erp](#class-generic6dofjoint-property-angular-limit-x-erp) | `0.5` | | [float](class_float#class-float) | [angular\_limit\_x/force\_limit](#class-generic6dofjoint-property-angular-limit-x-force-limit) | `0.0` | | [float](class_float#class-float) | [angular\_limit\_x/lower\_angle](#class-generic6dofjoint-property-angular-limit-x-lower-angle) | `0.0` | | [float](class_float#class-float) | [angular\_limit\_x/restitution](#class-generic6dofjoint-property-angular-limit-x-restitution) | `0.0` | | [float](class_float#class-float) | [angular\_limit\_x/softness](#class-generic6dofjoint-property-angular-limit-x-softness) | `0.5` | | [float](class_float#class-float) | [angular\_limit\_x/upper\_angle](#class-generic6dofjoint-property-angular-limit-x-upper-angle) | `0.0` | | [float](class_float#class-float) | [angular\_limit\_y/damping](#class-generic6dofjoint-property-angular-limit-y-damping) | `1.0` | | [bool](class_bool#class-bool) | [angular\_limit\_y/enabled](#class-generic6dofjoint-property-angular-limit-y-enabled) | `true` | | [float](class_float#class-float) | [angular\_limit\_y/erp](#class-generic6dofjoint-property-angular-limit-y-erp) | `0.5` | | [float](class_float#class-float) | [angular\_limit\_y/force\_limit](#class-generic6dofjoint-property-angular-limit-y-force-limit) | `0.0` | | [float](class_float#class-float) | [angular\_limit\_y/lower\_angle](#class-generic6dofjoint-property-angular-limit-y-lower-angle) | `0.0` | | [float](class_float#class-float) | [angular\_limit\_y/restitution](#class-generic6dofjoint-property-angular-limit-y-restitution) | `0.0` | | [float](class_float#class-float) | [angular\_limit\_y/softness](#class-generic6dofjoint-property-angular-limit-y-softness) | `0.5` | | [float](class_float#class-float) | [angular\_limit\_y/upper\_angle](#class-generic6dofjoint-property-angular-limit-y-upper-angle) | `0.0` | | [float](class_float#class-float) | [angular\_limit\_z/damping](#class-generic6dofjoint-property-angular-limit-z-damping) | `1.0` | | [bool](class_bool#class-bool) | [angular\_limit\_z/enabled](#class-generic6dofjoint-property-angular-limit-z-enabled) | `true` | | [float](class_float#class-float) | [angular\_limit\_z/erp](#class-generic6dofjoint-property-angular-limit-z-erp) | `0.5` | | [float](class_float#class-float) | [angular\_limit\_z/force\_limit](#class-generic6dofjoint-property-angular-limit-z-force-limit) | `0.0` | | [float](class_float#class-float) | [angular\_limit\_z/lower\_angle](#class-generic6dofjoint-property-angular-limit-z-lower-angle) | `0.0` | | [float](class_float#class-float) | [angular\_limit\_z/restitution](#class-generic6dofjoint-property-angular-limit-z-restitution) | `0.0` | | [float](class_float#class-float) | [angular\_limit\_z/softness](#class-generic6dofjoint-property-angular-limit-z-softness) | `0.5` | | [float](class_float#class-float) | [angular\_limit\_z/upper\_angle](#class-generic6dofjoint-property-angular-limit-z-upper-angle) | `0.0` | | [bool](class_bool#class-bool) | [angular\_motor\_x/enabled](#class-generic6dofjoint-property-angular-motor-x-enabled) | `false` | | [float](class_float#class-float) | [angular\_motor\_x/force\_limit](#class-generic6dofjoint-property-angular-motor-x-force-limit) | `300.0` | | [float](class_float#class-float) | [angular\_motor\_x/target\_velocity](#class-generic6dofjoint-property-angular-motor-x-target-velocity) | `0.0` | | [bool](class_bool#class-bool) | [angular\_motor\_y/enabled](#class-generic6dofjoint-property-angular-motor-y-enabled) | `false` | | [float](class_float#class-float) | [angular\_motor\_y/force\_limit](#class-generic6dofjoint-property-angular-motor-y-force-limit) | `300.0` | | [float](class_float#class-float) | [angular\_motor\_y/target\_velocity](#class-generic6dofjoint-property-angular-motor-y-target-velocity) | `0.0` | | [bool](class_bool#class-bool) | [angular\_motor\_z/enabled](#class-generic6dofjoint-property-angular-motor-z-enabled) | `false` | | [float](class_float#class-float) | [angular\_motor\_z/force\_limit](#class-generic6dofjoint-property-angular-motor-z-force-limit) | `300.0` | | [float](class_float#class-float) | [angular\_motor\_z/target\_velocity](#class-generic6dofjoint-property-angular-motor-z-target-velocity) | `0.0` | | [float](class_float#class-float) | [angular\_spring\_x/damping](#class-generic6dofjoint-property-angular-spring-x-damping) | `0.0` | | [bool](class_bool#class-bool) | [angular\_spring\_x/enabled](#class-generic6dofjoint-property-angular-spring-x-enabled) | `false` | | [float](class_float#class-float) | [angular\_spring\_x/equilibrium\_point](#class-generic6dofjoint-property-angular-spring-x-equilibrium-point) | `0.0` | | [float](class_float#class-float) | [angular\_spring\_x/stiffness](#class-generic6dofjoint-property-angular-spring-x-stiffness) | `0.0` | | [float](class_float#class-float) | [angular\_spring\_y/damping](#class-generic6dofjoint-property-angular-spring-y-damping) | `0.0` | | [bool](class_bool#class-bool) | [angular\_spring\_y/enabled](#class-generic6dofjoint-property-angular-spring-y-enabled) | `false` | | [float](class_float#class-float) | [angular\_spring\_y/equilibrium\_point](#class-generic6dofjoint-property-angular-spring-y-equilibrium-point) | `0.0` | | [float](class_float#class-float) | [angular\_spring\_y/stiffness](#class-generic6dofjoint-property-angular-spring-y-stiffness) | `0.0` | | [float](class_float#class-float) | [angular\_spring\_z/damping](#class-generic6dofjoint-property-angular-spring-z-damping) | `0.0` | | [bool](class_bool#class-bool) | [angular\_spring\_z/enabled](#class-generic6dofjoint-property-angular-spring-z-enabled) | `false` | | [float](class_float#class-float) | [angular\_spring\_z/equilibrium\_point](#class-generic6dofjoint-property-angular-spring-z-equilibrium-point) | `0.0` | | [float](class_float#class-float) | [angular\_spring\_z/stiffness](#class-generic6dofjoint-property-angular-spring-z-stiffness) | `0.0` | | [float](class_float#class-float) | [linear\_limit\_x/damping](#class-generic6dofjoint-property-linear-limit-x-damping) | `1.0` | | [bool](class_bool#class-bool) | [linear\_limit\_x/enabled](#class-generic6dofjoint-property-linear-limit-x-enabled) | `true` | | [float](class_float#class-float) | [linear\_limit\_x/lower\_distance](#class-generic6dofjoint-property-linear-limit-x-lower-distance) | `0.0` | | [float](class_float#class-float) | [linear\_limit\_x/restitution](#class-generic6dofjoint-property-linear-limit-x-restitution) | `0.5` | | [float](class_float#class-float) | [linear\_limit\_x/softness](#class-generic6dofjoint-property-linear-limit-x-softness) | `0.7` | | [float](class_float#class-float) | [linear\_limit\_x/upper\_distance](#class-generic6dofjoint-property-linear-limit-x-upper-distance) | `0.0` | | [float](class_float#class-float) | [linear\_limit\_y/damping](#class-generic6dofjoint-property-linear-limit-y-damping) | `1.0` | | [bool](class_bool#class-bool) | [linear\_limit\_y/enabled](#class-generic6dofjoint-property-linear-limit-y-enabled) | `true` | | [float](class_float#class-float) | [linear\_limit\_y/lower\_distance](#class-generic6dofjoint-property-linear-limit-y-lower-distance) | `0.0` | | [float](class_float#class-float) | [linear\_limit\_y/restitution](#class-generic6dofjoint-property-linear-limit-y-restitution) | `0.5` | | [float](class_float#class-float) | [linear\_limit\_y/softness](#class-generic6dofjoint-property-linear-limit-y-softness) | `0.7` | | [float](class_float#class-float) | [linear\_limit\_y/upper\_distance](#class-generic6dofjoint-property-linear-limit-y-upper-distance) | `0.0` | | [float](class_float#class-float) | [linear\_limit\_z/damping](#class-generic6dofjoint-property-linear-limit-z-damping) | `1.0` | | [bool](class_bool#class-bool) | [linear\_limit\_z/enabled](#class-generic6dofjoint-property-linear-limit-z-enabled) | `true` | | [float](class_float#class-float) | [linear\_limit\_z/lower\_distance](#class-generic6dofjoint-property-linear-limit-z-lower-distance) | `0.0` | | [float](class_float#class-float) | [linear\_limit\_z/restitution](#class-generic6dofjoint-property-linear-limit-z-restitution) | `0.5` | | [float](class_float#class-float) | [linear\_limit\_z/softness](#class-generic6dofjoint-property-linear-limit-z-softness) | `0.7` | | [float](class_float#class-float) | [linear\_limit\_z/upper\_distance](#class-generic6dofjoint-property-linear-limit-z-upper-distance) | `0.0` | | [bool](class_bool#class-bool) | [linear\_motor\_x/enabled](#class-generic6dofjoint-property-linear-motor-x-enabled) | `false` | | [float](class_float#class-float) | [linear\_motor\_x/force\_limit](#class-generic6dofjoint-property-linear-motor-x-force-limit) | `0.0` | | [float](class_float#class-float) | [linear\_motor\_x/target\_velocity](#class-generic6dofjoint-property-linear-motor-x-target-velocity) | `0.0` | | [bool](class_bool#class-bool) | [linear\_motor\_y/enabled](#class-generic6dofjoint-property-linear-motor-y-enabled) | `false` | | [float](class_float#class-float) | [linear\_motor\_y/force\_limit](#class-generic6dofjoint-property-linear-motor-y-force-limit) | `0.0` | | [float](class_float#class-float) | [linear\_motor\_y/target\_velocity](#class-generic6dofjoint-property-linear-motor-y-target-velocity) | `0.0` | | [bool](class_bool#class-bool) | [linear\_motor\_z/enabled](#class-generic6dofjoint-property-linear-motor-z-enabled) | `false` | | [float](class_float#class-float) | [linear\_motor\_z/force\_limit](#class-generic6dofjoint-property-linear-motor-z-force-limit) | `0.0` | | [float](class_float#class-float) | [linear\_motor\_z/target\_velocity](#class-generic6dofjoint-property-linear-motor-z-target-velocity) | `0.0` | | [float](class_float#class-float) | [linear\_spring\_x/damping](#class-generic6dofjoint-property-linear-spring-x-damping) | `0.01` | | [bool](class_bool#class-bool) | [linear\_spring\_x/enabled](#class-generic6dofjoint-property-linear-spring-x-enabled) | `false` | | [float](class_float#class-float) | [linear\_spring\_x/equilibrium\_point](#class-generic6dofjoint-property-linear-spring-x-equilibrium-point) | `0.0` | | [float](class_float#class-float) | [linear\_spring\_x/stiffness](#class-generic6dofjoint-property-linear-spring-x-stiffness) | `0.01` | | [float](class_float#class-float) | [linear\_spring\_y/damping](#class-generic6dofjoint-property-linear-spring-y-damping) | `0.01` | | [bool](class_bool#class-bool) | [linear\_spring\_y/enabled](#class-generic6dofjoint-property-linear-spring-y-enabled) | `false` | | [float](class_float#class-float) | [linear\_spring\_y/equilibrium\_point](#class-generic6dofjoint-property-linear-spring-y-equilibrium-point) | `0.0` | | [float](class_float#class-float) | [linear\_spring\_y/stiffness](#class-generic6dofjoint-property-linear-spring-y-stiffness) | `0.01` | | [float](class_float#class-float) | [linear\_spring\_z/damping](#class-generic6dofjoint-property-linear-spring-z-damping) | `0.01` | | [bool](class_bool#class-bool) | [linear\_spring\_z/enabled](#class-generic6dofjoint-property-linear-spring-z-enabled) | `false` | | [float](class_float#class-float) | [linear\_spring\_z/equilibrium\_point](#class-generic6dofjoint-property-linear-spring-z-equilibrium-point) | `0.0` | | [float](class_float#class-float) | [linear\_spring\_z/stiffness](#class-generic6dofjoint-property-linear-spring-z-stiffness) | `0.01` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [get\_flag\_x](#class-generic6dofjoint-method-get-flag-x) **(** [Flag](#enum-generic6dofjoint-flag) flag **)** const | | [bool](class_bool#class-bool) | [get\_flag\_y](#class-generic6dofjoint-method-get-flag-y) **(** [Flag](#enum-generic6dofjoint-flag) flag **)** const | | [bool](class_bool#class-bool) | [get\_flag\_z](#class-generic6dofjoint-method-get-flag-z) **(** [Flag](#enum-generic6dofjoint-flag) flag **)** const | | [float](class_float#class-float) | [get\_param\_x](#class-generic6dofjoint-method-get-param-x) **(** [Param](#enum-generic6dofjoint-param) param **)** const | | [float](class_float#class-float) | [get\_param\_y](#class-generic6dofjoint-method-get-param-y) **(** [Param](#enum-generic6dofjoint-param) param **)** const | | [float](class_float#class-float) | [get\_param\_z](#class-generic6dofjoint-method-get-param-z) **(** [Param](#enum-generic6dofjoint-param) param **)** const | | void | [set\_flag\_x](#class-generic6dofjoint-method-set-flag-x) **(** [Flag](#enum-generic6dofjoint-flag) flag, [bool](class_bool#class-bool) value **)** | | void | [set\_flag\_y](#class-generic6dofjoint-method-set-flag-y) **(** [Flag](#enum-generic6dofjoint-flag) flag, [bool](class_bool#class-bool) value **)** | | void | [set\_flag\_z](#class-generic6dofjoint-method-set-flag-z) **(** [Flag](#enum-generic6dofjoint-flag) flag, [bool](class_bool#class-bool) value **)** | | void | [set\_param\_x](#class-generic6dofjoint-method-set-param-x) **(** [Param](#enum-generic6dofjoint-param) param, [float](class_float#class-float) value **)** | | void | [set\_param\_y](#class-generic6dofjoint-method-set-param-y) **(** [Param](#enum-generic6dofjoint-param) param, [float](class_float#class-float) value **)** | | void | [set\_param\_z](#class-generic6dofjoint-method-set-param-z) **(** [Param](#enum-generic6dofjoint-param) param, [float](class_float#class-float) value **)** | Enumerations ------------ enum **Param**: * **PARAM\_LINEAR\_LOWER\_LIMIT** = **0** --- The minimum difference between the pivot points' axes. * **PARAM\_LINEAR\_UPPER\_LIMIT** = **1** --- The maximum difference between the pivot points' axes. * **PARAM\_LINEAR\_LIMIT\_SOFTNESS** = **2** --- A factor applied to the movement across the axes. The lower, the slower the movement. * **PARAM\_LINEAR\_RESTITUTION** = **3** --- The amount of restitution on the axes' movement. The lower, the more momentum gets lost. * **PARAM\_LINEAR\_DAMPING** = **4** --- The amount of damping that happens at the linear motion across the axes. * **PARAM\_LINEAR\_MOTOR\_TARGET\_VELOCITY** = **5** --- The velocity the linear motor will try to reach. * **PARAM\_LINEAR\_MOTOR\_FORCE\_LIMIT** = **6** --- The maximum force the linear motor will apply while trying to reach the velocity target. * **PARAM\_LINEAR\_SPRING\_STIFFNESS** = **7** * **PARAM\_LINEAR\_SPRING\_DAMPING** = **8** * **PARAM\_LINEAR\_SPRING\_EQUILIBRIUM\_POINT** = **9** * **PARAM\_ANGULAR\_LOWER\_LIMIT** = **10** --- The minimum rotation in negative direction to break loose and rotate around the axes. * **PARAM\_ANGULAR\_UPPER\_LIMIT** = **11** --- The minimum rotation in positive direction to break loose and rotate around the axes. * **PARAM\_ANGULAR\_LIMIT\_SOFTNESS** = **12** --- The speed of all rotations across the axes. * **PARAM\_ANGULAR\_DAMPING** = **13** --- The amount of rotational damping across the axes. The lower, the more dampening occurs. * **PARAM\_ANGULAR\_RESTITUTION** = **14** --- The amount of rotational restitution across the axes. The lower, the more restitution occurs. * **PARAM\_ANGULAR\_FORCE\_LIMIT** = **15** --- The maximum amount of force that can occur, when rotating around the axes. * **PARAM\_ANGULAR\_ERP** = **16** --- When rotating across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. * **PARAM\_ANGULAR\_MOTOR\_TARGET\_VELOCITY** = **17** --- Target speed for the motor at the axes. * **PARAM\_ANGULAR\_MOTOR\_FORCE\_LIMIT** = **18** --- Maximum acceleration for the motor at the axes. * **PARAM\_ANGULAR\_SPRING\_STIFFNESS** = **19** * **PARAM\_ANGULAR\_SPRING\_DAMPING** = **20** * **PARAM\_ANGULAR\_SPRING\_EQUILIBRIUM\_POINT** = **21** * **PARAM\_MAX** = **22** --- Represents the size of the [Param](#enum-generic6dofjoint-param) enum. enum **Flag**: * **FLAG\_ENABLE\_LINEAR\_LIMIT** = **0** --- If enabled, linear motion is possible within the given limits. * **FLAG\_ENABLE\_ANGULAR\_LIMIT** = **1** --- If enabled, rotational motion is possible within the given limits. * **FLAG\_ENABLE\_LINEAR\_SPRING** = **3** * **FLAG\_ENABLE\_ANGULAR\_SPRING** = **2** * **FLAG\_ENABLE\_MOTOR** = **4** --- If enabled, there is a rotational motor across these axes. * **FLAG\_ENABLE\_LINEAR\_MOTOR** = **5** --- If enabled, there is a linear motor across these axes. * **FLAG\_MAX** = **6** --- Represents the size of the [Flag](#enum-generic6dofjoint-flag) enum. Property Descriptions --------------------- ### [float](class_float#class-float) angular\_limit\_x/damping | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | The amount of rotational damping across the X axis. The lower, the longer an impulse from one side takes to travel to the other side. ### [bool](class_bool#class-bool) angular\_limit\_x/enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_flag\_x(value) | | *Getter* | get\_flag\_x() | If `true`, rotation across the X axis is limited. ### [float](class_float#class-float) angular\_limit\_x/erp | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | When rotating across the X axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. ### [float](class_float#class-float) angular\_limit\_x/force\_limit | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | The maximum amount of force that can occur, when rotating around the X axis. ### [float](class_float#class-float) angular\_limit\_x/lower\_angle | | | | --- | --- | | *Default* | `0.0` | The minimum rotation in negative direction to break loose and rotate around the X axis. ### [float](class_float#class-float) angular\_limit\_x/restitution | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | The amount of rotational restitution across the X axis. The lower, the more restitution occurs. ### [float](class_float#class-float) angular\_limit\_x/softness | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | The speed of all rotations across the X axis. ### [float](class_float#class-float) angular\_limit\_x/upper\_angle | | | | --- | --- | | *Default* | `0.0` | The minimum rotation in positive direction to break loose and rotate around the X axis. ### [float](class_float#class-float) angular\_limit\_y/damping | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | The amount of rotational damping across the Y axis. The lower, the more dampening occurs. ### [bool](class_bool#class-bool) angular\_limit\_y/enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_flag\_y(value) | | *Getter* | get\_flag\_y() | If `true`, rotation across the Y axis is limited. ### [float](class_float#class-float) angular\_limit\_y/erp | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | When rotating across the Y axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. ### [float](class_float#class-float) angular\_limit\_y/force\_limit | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | The maximum amount of force that can occur, when rotating around the Y axis. ### [float](class_float#class-float) angular\_limit\_y/lower\_angle | | | | --- | --- | | *Default* | `0.0` | The minimum rotation in negative direction to break loose and rotate around the Y axis. ### [float](class_float#class-float) angular\_limit\_y/restitution | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | The amount of rotational restitution across the Y axis. The lower, the more restitution occurs. ### [float](class_float#class-float) angular\_limit\_y/softness | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | The speed of all rotations across the Y axis. ### [float](class_float#class-float) angular\_limit\_y/upper\_angle | | | | --- | --- | | *Default* | `0.0` | The minimum rotation in positive direction to break loose and rotate around the Y axis. ### [float](class_float#class-float) angular\_limit\_z/damping | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | The amount of rotational damping across the Z axis. The lower, the more dampening occurs. ### [bool](class_bool#class-bool) angular\_limit\_z/enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_flag\_z(value) | | *Getter* | get\_flag\_z() | If `true`, rotation across the Z axis is limited. ### [float](class_float#class-float) angular\_limit\_z/erp | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | When rotating across the Z axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. ### [float](class_float#class-float) angular\_limit\_z/force\_limit | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | The maximum amount of force that can occur, when rotating around the Z axis. ### [float](class_float#class-float) angular\_limit\_z/lower\_angle | | | | --- | --- | | *Default* | `0.0` | The minimum rotation in negative direction to break loose and rotate around the Z axis. ### [float](class_float#class-float) angular\_limit\_z/restitution | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | The amount of rotational restitution across the Z axis. The lower, the more restitution occurs. ### [float](class_float#class-float) angular\_limit\_z/softness | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | The speed of all rotations across the Z axis. ### [float](class_float#class-float) angular\_limit\_z/upper\_angle | | | | --- | --- | | *Default* | `0.0` | The minimum rotation in positive direction to break loose and rotate around the Z axis. ### [bool](class_bool#class-bool) angular\_motor\_x/enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag\_x(value) | | *Getter* | get\_flag\_x() | If `true`, a rotating motor at the X axis is enabled. ### [float](class_float#class-float) angular\_motor\_x/force\_limit | | | | --- | --- | | *Default* | `300.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | Maximum acceleration for the motor at the X axis. ### [float](class_float#class-float) angular\_motor\_x/target\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | Target speed for the motor at the X axis. ### [bool](class_bool#class-bool) angular\_motor\_y/enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag\_y(value) | | *Getter* | get\_flag\_y() | If `true`, a rotating motor at the Y axis is enabled. ### [float](class_float#class-float) angular\_motor\_y/force\_limit | | | | --- | --- | | *Default* | `300.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | Maximum acceleration for the motor at the Y axis. ### [float](class_float#class-float) angular\_motor\_y/target\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | Target speed for the motor at the Y axis. ### [bool](class_bool#class-bool) angular\_motor\_z/enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag\_z(value) | | *Getter* | get\_flag\_z() | If `true`, a rotating motor at the Z axis is enabled. ### [float](class_float#class-float) angular\_motor\_z/force\_limit | | | | --- | --- | | *Default* | `300.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | Maximum acceleration for the motor at the Z axis. ### [float](class_float#class-float) angular\_motor\_z/target\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | Target speed for the motor at the Z axis. ### [float](class_float#class-float) angular\_spring\_x/damping | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | ### [bool](class_bool#class-bool) angular\_spring\_x/enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag\_x(value) | | *Getter* | get\_flag\_x() | ### [float](class_float#class-float) angular\_spring\_x/equilibrium\_point | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | ### [float](class_float#class-float) angular\_spring\_x/stiffness | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | ### [float](class_float#class-float) angular\_spring\_y/damping | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | ### [bool](class_bool#class-bool) angular\_spring\_y/enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag\_y(value) | | *Getter* | get\_flag\_y() | ### [float](class_float#class-float) angular\_spring\_y/equilibrium\_point | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | ### [float](class_float#class-float) angular\_spring\_y/stiffness | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | ### [float](class_float#class-float) angular\_spring\_z/damping | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | ### [bool](class_bool#class-bool) angular\_spring\_z/enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag\_z(value) | | *Getter* | get\_flag\_z() | ### [float](class_float#class-float) angular\_spring\_z/equilibrium\_point | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | ### [float](class_float#class-float) angular\_spring\_z/stiffness | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | ### [float](class_float#class-float) linear\_limit\_x/damping | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | The amount of damping that happens at the X motion. ### [bool](class_bool#class-bool) linear\_limit\_x/enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_flag\_x(value) | | *Getter* | get\_flag\_x() | If `true`, the linear motion across the X axis is limited. ### [float](class_float#class-float) linear\_limit\_x/lower\_distance | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | The minimum difference between the pivot points' X axis. ### [float](class_float#class-float) linear\_limit\_x/restitution | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | The amount of restitution on the X axis movement. The lower, the more momentum gets lost. ### [float](class_float#class-float) linear\_limit\_x/softness | | | | --- | --- | | *Default* | `0.7` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | A factor applied to the movement across the X axis. The lower, the slower the movement. ### [float](class_float#class-float) linear\_limit\_x/upper\_distance | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | The maximum difference between the pivot points' X axis. ### [float](class_float#class-float) linear\_limit\_y/damping | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | The amount of damping that happens at the Y motion. ### [bool](class_bool#class-bool) linear\_limit\_y/enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_flag\_y(value) | | *Getter* | get\_flag\_y() | If `true`, the linear motion across the Y axis is limited. ### [float](class_float#class-float) linear\_limit\_y/lower\_distance | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | The minimum difference between the pivot points' Y axis. ### [float](class_float#class-float) linear\_limit\_y/restitution | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | The amount of restitution on the Y axis movement. The lower, the more momentum gets lost. ### [float](class_float#class-float) linear\_limit\_y/softness | | | | --- | --- | | *Default* | `0.7` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | A factor applied to the movement across the Y axis. The lower, the slower the movement. ### [float](class_float#class-float) linear\_limit\_y/upper\_distance | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | The maximum difference between the pivot points' Y axis. ### [float](class_float#class-float) linear\_limit\_z/damping | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | The amount of damping that happens at the Z motion. ### [bool](class_bool#class-bool) linear\_limit\_z/enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_flag\_z(value) | | *Getter* | get\_flag\_z() | If `true`, the linear motion across the Z axis is limited. ### [float](class_float#class-float) linear\_limit\_z/lower\_distance | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | The minimum difference between the pivot points' Z axis. ### [float](class_float#class-float) linear\_limit\_z/restitution | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | The amount of restitution on the Z axis movement. The lower, the more momentum gets lost. ### [float](class_float#class-float) linear\_limit\_z/softness | | | | --- | --- | | *Default* | `0.7` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | A factor applied to the movement across the Z axis. The lower, the slower the movement. ### [float](class_float#class-float) linear\_limit\_z/upper\_distance | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | The maximum difference between the pivot points' Z axis. ### [bool](class_bool#class-bool) linear\_motor\_x/enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag\_x(value) | | *Getter* | get\_flag\_x() | If `true`, then there is a linear motor on the X axis. It will attempt to reach the target velocity while staying within the force limits. ### [float](class_float#class-float) linear\_motor\_x/force\_limit | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | The maximum force the linear motor can apply on the X axis while trying to reach the target velocity. ### [float](class_float#class-float) linear\_motor\_x/target\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | The speed that the linear motor will attempt to reach on the X axis. ### [bool](class_bool#class-bool) linear\_motor\_y/enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag\_y(value) | | *Getter* | get\_flag\_y() | If `true`, then there is a linear motor on the Y axis. It will attempt to reach the target velocity while staying within the force limits. ### [float](class_float#class-float) linear\_motor\_y/force\_limit | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | The maximum force the linear motor can apply on the Y axis while trying to reach the target velocity. ### [float](class_float#class-float) linear\_motor\_y/target\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | The speed that the linear motor will attempt to reach on the Y axis. ### [bool](class_bool#class-bool) linear\_motor\_z/enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag\_z(value) | | *Getter* | get\_flag\_z() | If `true`, then there is a linear motor on the Z axis. It will attempt to reach the target velocity while staying within the force limits. ### [float](class_float#class-float) linear\_motor\_z/force\_limit | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | The maximum force the linear motor can apply on the Z axis while trying to reach the target velocity. ### [float](class_float#class-float) linear\_motor\_z/target\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | The speed that the linear motor will attempt to reach on the Z axis. ### [float](class_float#class-float) linear\_spring\_x/damping | | | | --- | --- | | *Default* | `0.01` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | ### [bool](class_bool#class-bool) linear\_spring\_x/enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag\_x(value) | | *Getter* | get\_flag\_x() | ### [float](class_float#class-float) linear\_spring\_x/equilibrium\_point | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | ### [float](class_float#class-float) linear\_spring\_x/stiffness | | | | --- | --- | | *Default* | `0.01` | | *Setter* | set\_param\_x(value) | | *Getter* | get\_param\_x() | ### [float](class_float#class-float) linear\_spring\_y/damping | | | | --- | --- | | *Default* | `0.01` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | ### [bool](class_bool#class-bool) linear\_spring\_y/enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag\_y(value) | | *Getter* | get\_flag\_y() | ### [float](class_float#class-float) linear\_spring\_y/equilibrium\_point | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | ### [float](class_float#class-float) linear\_spring\_y/stiffness | | | | --- | --- | | *Default* | `0.01` | | *Setter* | set\_param\_y(value) | | *Getter* | get\_param\_y() | ### [float](class_float#class-float) linear\_spring\_z/damping | | | | --- | --- | | *Default* | `0.01` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | ### [bool](class_bool#class-bool) linear\_spring\_z/enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag\_z(value) | | *Getter* | get\_flag\_z() | ### [float](class_float#class-float) linear\_spring\_z/equilibrium\_point | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | ### [float](class_float#class-float) linear\_spring\_z/stiffness | | | | --- | --- | | *Default* | `0.01` | | *Setter* | set\_param\_z(value) | | *Getter* | get\_param\_z() | Method Descriptions ------------------- ### [bool](class_bool#class-bool) get\_flag\_x ( [Flag](#enum-generic6dofjoint-flag) flag ) const ### [bool](class_bool#class-bool) get\_flag\_y ( [Flag](#enum-generic6dofjoint-flag) flag ) const ### [bool](class_bool#class-bool) get\_flag\_z ( [Flag](#enum-generic6dofjoint-flag) flag ) const ### [float](class_float#class-float) get\_param\_x ( [Param](#enum-generic6dofjoint-param) param ) const ### [float](class_float#class-float) get\_param\_y ( [Param](#enum-generic6dofjoint-param) param ) const ### [float](class_float#class-float) get\_param\_z ( [Param](#enum-generic6dofjoint-param) param ) const ### void set\_flag\_x ( [Flag](#enum-generic6dofjoint-flag) flag, [bool](class_bool#class-bool) value ) ### void set\_flag\_y ( [Flag](#enum-generic6dofjoint-flag) flag, [bool](class_bool#class-bool) value ) ### void set\_flag\_z ( [Flag](#enum-generic6dofjoint-flag) flag, [bool](class_bool#class-bool) value ) ### void set\_param\_x ( [Param](#enum-generic6dofjoint-param) param, [float](class_float#class-float) value ) ### void set\_param\_y ( [Param](#enum-generic6dofjoint-param) param, [float](class_float#class-float) value ) ### void set\_param\_z ( [Param](#enum-generic6dofjoint-param) param, [float](class_float#class-float) value )
programming_docs
godot MultiMeshInstance2D MultiMeshInstance2D =================== **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Node that instances a [MultiMesh](class_multimesh#class-multimesh) in 2D. Description ----------- `MultiMeshInstance2D` is a specialized node to instance a [MultiMesh](class_multimesh#class-multimesh) resource in 2D. Usage is the same as [MultiMeshInstance](class_multimeshinstance#class-multimeshinstance). Properties ---------- | | | | --- | --- | | [MultiMesh](class_multimesh#class-multimesh) | [multimesh](#class-multimeshinstance2d-property-multimesh) | | [Texture](class_texture#class-texture) | [normal\_map](#class-multimeshinstance2d-property-normal-map) | | [Texture](class_texture#class-texture) | [texture](#class-multimeshinstance2d-property-texture) | Signals ------- ### texture\_changed ( ) Emitted when the [texture](#class-multimeshinstance2d-property-texture) is changed. Property Descriptions --------------------- ### [MultiMesh](class_multimesh#class-multimesh) multimesh | | | | --- | --- | | *Setter* | set\_multimesh(value) | | *Getter* | get\_multimesh() | The [MultiMesh](class_multimesh#class-multimesh) that will be drawn by the `MultiMeshInstance2D`. ### [Texture](class_texture#class-texture) normal\_map | | | | --- | --- | | *Setter* | set\_normal\_map(value) | | *Getter* | get\_normal\_map() | The normal map that will be used if using the default [CanvasItemMaterial](class_canvasitemmaterial#class-canvasitemmaterial). **Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [this page](http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates) for a comparison of normal map coordinates expected by popular engines. ### [Texture](class_texture#class-texture) texture | | | | --- | --- | | *Setter* | set\_texture(value) | | *Getter* | get\_texture() | The [Texture](class_texture#class-texture) that will be used if using the default [CanvasItemMaterial](class_canvasitemmaterial#class-canvasitemmaterial). Can be accessed as `TEXTURE` in CanvasItem shader. godot AudioEffectHighPassFilter AudioEffectHighPassFilter ========================= **Inherits:** [AudioEffectFilter](class_audioeffectfilter#class-audioeffectfilter) **<** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Adds a high-pass filter to the Audio Bus. Description ----------- Cuts frequencies lower than the [AudioEffectFilter.cutoff\_hz](class_audioeffectfilter#class-audioeffectfilter-property-cutoff-hz) and allows higher frequencies to pass. godot AudioEffectEQ6 AudioEffectEQ6 ============== **Inherits:** [AudioEffectEQ](class_audioeffecteq#class-audioeffecteq) **<** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Adds a 6-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 32 Hz to 10000 Hz. Each frequency can be modulated between -60/+24 dB. Description ----------- Frequency bands: Band 1: 32 Hz Band 2: 100 Hz Band 3: 320 Hz Band 4: 1000 Hz Band 5: 3200 Hz Band 6: 10000 Hz See also [AudioEffectEQ](class_audioeffecteq#class-audioeffecteq), [AudioEffectEQ10](class_audioeffecteq10#class-audioeffecteq10), [AudioEffectEQ21](class_audioeffecteq21#class-audioeffecteq21). godot Physics2DDirectBodyState Physics2DDirectBodyState ======================== **Inherits:** [Object](class_object#class-object) Direct access object to a physics body in the [Physics2DServer](class_physics2dserver#class-physics2dserver). Description ----------- Provides direct access to a physics body in the [Physics2DServer](class_physics2dserver#class-physics2dserver), allowing safe changes to physics properties. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. See [RigidBody2D.\_integrate\_forces](class_rigidbody2d#class-rigidbody2d-method-integrate-forces). Tutorials --------- * [Physics introduction](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html) * [Ray-casting](https://docs.godotengine.org/en/3.5/tutorials/physics/ray-casting.html) Properties ---------- | | | | --- | --- | | [float](class_float#class-float) | [angular\_velocity](#class-physics2ddirectbodystate-property-angular-velocity) | | [float](class_float#class-float) | [inverse\_inertia](#class-physics2ddirectbodystate-property-inverse-inertia) | | [float](class_float#class-float) | [inverse\_mass](#class-physics2ddirectbodystate-property-inverse-mass) | | [Vector2](class_vector2#class-vector2) | [linear\_velocity](#class-physics2ddirectbodystate-property-linear-velocity) | | [bool](class_bool#class-bool) | [sleeping](#class-physics2ddirectbodystate-property-sleeping) | | [float](class_float#class-float) | [step](#class-physics2ddirectbodystate-property-step) | | [float](class_float#class-float) | [total\_angular\_damp](#class-physics2ddirectbodystate-property-total-angular-damp) | | [Vector2](class_vector2#class-vector2) | [total\_gravity](#class-physics2ddirectbodystate-property-total-gravity) | | [float](class_float#class-float) | [total\_linear\_damp](#class-physics2ddirectbodystate-property-total-linear-damp) | | [Transform2D](class_transform2d#class-transform2d) | [transform](#class-physics2ddirectbodystate-property-transform) | Methods ------- | | | | --- | --- | | void | [add\_central\_force](#class-physics2ddirectbodystate-method-add-central-force) **(** [Vector2](class_vector2#class-vector2) force **)** | | void | [add\_force](#class-physics2ddirectbodystate-method-add-force) **(** [Vector2](class_vector2#class-vector2) offset, [Vector2](class_vector2#class-vector2) force **)** | | void | [add\_torque](#class-physics2ddirectbodystate-method-add-torque) **(** [float](class_float#class-float) torque **)** | | void | [apply\_central\_impulse](#class-physics2ddirectbodystate-method-apply-central-impulse) **(** [Vector2](class_vector2#class-vector2) impulse **)** | | void | [apply\_impulse](#class-physics2ddirectbodystate-method-apply-impulse) **(** [Vector2](class_vector2#class-vector2) offset, [Vector2](class_vector2#class-vector2) impulse **)** | | void | [apply\_torque\_impulse](#class-physics2ddirectbodystate-method-apply-torque-impulse) **(** [float](class_float#class-float) impulse **)** | | [RID](class_rid#class-rid) | [get\_contact\_collider](#class-physics2ddirectbodystate-method-get-contact-collider) **(** [int](class_int#class-int) contact\_idx **)** const | | [int](class_int#class-int) | [get\_contact\_collider\_id](#class-physics2ddirectbodystate-method-get-contact-collider-id) **(** [int](class_int#class-int) contact\_idx **)** const | | [Object](class_object#class-object) | [get\_contact\_collider\_object](#class-physics2ddirectbodystate-method-get-contact-collider-object) **(** [int](class_int#class-int) contact\_idx **)** const | | [Vector2](class_vector2#class-vector2) | [get\_contact\_collider\_position](#class-physics2ddirectbodystate-method-get-contact-collider-position) **(** [int](class_int#class-int) contact\_idx **)** const | | [int](class_int#class-int) | [get\_contact\_collider\_shape](#class-physics2ddirectbodystate-method-get-contact-collider-shape) **(** [int](class_int#class-int) contact\_idx **)** const | | [Variant](class_variant#class-variant) | [get\_contact\_collider\_shape\_metadata](#class-physics2ddirectbodystate-method-get-contact-collider-shape-metadata) **(** [int](class_int#class-int) contact\_idx **)** const | | [Vector2](class_vector2#class-vector2) | [get\_contact\_collider\_velocity\_at\_position](#class-physics2ddirectbodystate-method-get-contact-collider-velocity-at-position) **(** [int](class_int#class-int) contact\_idx **)** const | | [int](class_int#class-int) | [get\_contact\_count](#class-physics2ddirectbodystate-method-get-contact-count) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_contact\_local\_normal](#class-physics2ddirectbodystate-method-get-contact-local-normal) **(** [int](class_int#class-int) contact\_idx **)** const | | [Vector2](class_vector2#class-vector2) | [get\_contact\_local\_position](#class-physics2ddirectbodystate-method-get-contact-local-position) **(** [int](class_int#class-int) contact\_idx **)** const | | [int](class_int#class-int) | [get\_contact\_local\_shape](#class-physics2ddirectbodystate-method-get-contact-local-shape) **(** [int](class_int#class-int) contact\_idx **)** const | | [Physics2DDirectSpaceState](class_physics2ddirectspacestate#class-physics2ddirectspacestate) | [get\_space\_state](#class-physics2ddirectbodystate-method-get-space-state) **(** **)** | | [Vector2](class_vector2#class-vector2) | [get\_velocity\_at\_local\_position](#class-physics2ddirectbodystate-method-get-velocity-at-local-position) **(** [Vector2](class_vector2#class-vector2) local\_position **)** const | | void | [integrate\_forces](#class-physics2ddirectbodystate-method-integrate-forces) **(** **)** | Property Descriptions --------------------- ### [float](class_float#class-float) angular\_velocity | | | | --- | --- | | *Setter* | set\_angular\_velocity(value) | | *Getter* | get\_angular\_velocity() | The body's rotational velocity in *radians* per second. ### [float](class_float#class-float) inverse\_inertia | | | | --- | --- | | *Getter* | get\_inverse\_inertia() | The inverse of the inertia of the body. ### [float](class_float#class-float) inverse\_mass | | | | --- | --- | | *Getter* | get\_inverse\_mass() | The inverse of the mass of the body. ### [Vector2](class_vector2#class-vector2) linear\_velocity | | | | --- | --- | | *Setter* | set\_linear\_velocity(value) | | *Getter* | get\_linear\_velocity() | The body's linear velocity in pixels per second. ### [bool](class_bool#class-bool) sleeping | | | | --- | --- | | *Setter* | set\_sleep\_state(value) | | *Getter* | is\_sleeping() | If `true`, this body is currently sleeping (not active). ### [float](class_float#class-float) step | | | | --- | --- | | *Getter* | get\_step() | The timestep (delta) used for the simulation. ### [float](class_float#class-float) total\_angular\_damp | | | | --- | --- | | *Getter* | get\_total\_angular\_damp() | The rate at which the body stops rotating, if there are not any other forces moving it. ### [Vector2](class_vector2#class-vector2) total\_gravity | | | | --- | --- | | *Getter* | get\_total\_gravity() | The total gravity vector being currently applied to this body. ### [float](class_float#class-float) total\_linear\_damp | | | | --- | --- | | *Getter* | get\_total\_linear\_damp() | The rate at which the body stops moving, if there are not any other forces moving it. ### [Transform2D](class_transform2d#class-transform2d) transform | | | | --- | --- | | *Setter* | set\_transform(value) | | *Getter* | get\_transform() | The body's transformation matrix. Method Descriptions ------------------- ### void add\_central\_force ( [Vector2](class_vector2#class-vector2) force ) Adds a constant directional force without affecting rotation. ### void add\_force ( [Vector2](class_vector2#class-vector2) offset, [Vector2](class_vector2#class-vector2) force ) Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. ### void add\_torque ( [float](class_float#class-float) torque ) Adds a constant rotational force. ### void apply\_central\_impulse ( [Vector2](class_vector2#class-vector2) impulse ) Applies a directional impulse without affecting rotation. ### void apply\_impulse ( [Vector2](class_vector2#class-vector2) offset, [Vector2](class_vector2#class-vector2) impulse ) Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "\_force" functions otherwise). The offset uses the rotation of the global coordinate system, but is centered at the object's origin. ### void apply\_torque\_impulse ( [float](class_float#class-float) impulse ) Applies a rotational impulse to the body. ### [RID](class_rid#class-rid) get\_contact\_collider ( [int](class_int#class-int) contact\_idx ) const Returns the collider's [RID](class_rid#class-rid). ### [int](class_int#class-int) get\_contact\_collider\_id ( [int](class_int#class-int) contact\_idx ) const Returns the collider's object id. ### [Object](class_object#class-object) get\_contact\_collider\_object ( [int](class_int#class-int) contact\_idx ) const Returns the collider object. This depends on how it was created (will return a scene node if such was used to create it). ### [Vector2](class_vector2#class-vector2) get\_contact\_collider\_position ( [int](class_int#class-int) contact\_idx ) const Returns the contact position in the collider. ### [int](class_int#class-int) get\_contact\_collider\_shape ( [int](class_int#class-int) contact\_idx ) const Returns the collider's shape index. ### [Variant](class_variant#class-variant) get\_contact\_collider\_shape\_metadata ( [int](class_int#class-int) contact\_idx ) const Returns the collided shape's metadata. This metadata is different from [Object.get\_meta](class_object#class-object-method-get-meta), and is set with [Physics2DServer.shape\_set\_data](class_physics2dserver#class-physics2dserver-method-shape-set-data). ### [Vector2](class_vector2#class-vector2) get\_contact\_collider\_velocity\_at\_position ( [int](class_int#class-int) contact\_idx ) const Returns the linear velocity vector at the collider's contact point. ### [int](class_int#class-int) get\_contact\_count ( ) const Returns the number of contacts this body has with other bodies. **Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See [RigidBody2D.contact\_monitor](class_rigidbody2d#class-rigidbody2d-property-contact-monitor). ### [Vector2](class_vector2#class-vector2) get\_contact\_local\_normal ( [int](class_int#class-int) contact\_idx ) const Returns the local normal at the contact point. ### [Vector2](class_vector2#class-vector2) get\_contact\_local\_position ( [int](class_int#class-int) contact\_idx ) const Returns the local position of the contact point. ### [int](class_int#class-int) get\_contact\_local\_shape ( [int](class_int#class-int) contact\_idx ) const Returns the local shape index of the collision. ### [Physics2DDirectSpaceState](class_physics2ddirectspacestate#class-physics2ddirectspacestate) get\_space\_state ( ) Returns the current state of the space, useful for queries. ### [Vector2](class_vector2#class-vector2) get\_velocity\_at\_local\_position ( [Vector2](class_vector2#class-vector2) local\_position ) const Returns the body's velocity at the given relative position, including both translation and rotation. ### void integrate\_forces ( ) Calls the built-in force integration code. godot VisualScriptWhile VisualScriptWhile ================= **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Conditional loop. Description ----------- Loops while a condition is `true`. Execution continues out the `exit` Sequence port when the loop terminates. **Input Ports:** * Sequence: `while(cond)` * Data (bool): `cond` **Output Ports:** * Sequence: `repeat` * Sequence: `exit` godot JSONRPC JSONRPC ======= **Inherits:** [Object](class_object#class-object) A helper to handle dictionaries which look like JSONRPC documents. Description ----------- [JSON-RPC](https://www.jsonrpc.org/) is a standard which wraps a method call in a [JSON](class_json#class-json) object. The object has a particular structure and identifies which method is called, the parameters to that function, and carries an ID to keep track of responses. This class implements that standard on top of [Dictionary](class_dictionary#class-dictionary); you will have to convert between a [Dictionary](class_dictionary#class-dictionary) and [JSON](class_json#class-json) with other functions. Methods ------- | | | | --- | --- | | [Dictionary](class_dictionary#class-dictionary) | [make\_notification](#class-jsonrpc-method-make-notification) **(** [String](class_string#class-string) method, [Variant](class_variant#class-variant) params **)** | | [Dictionary](class_dictionary#class-dictionary) | [make\_request](#class-jsonrpc-method-make-request) **(** [String](class_string#class-string) method, [Variant](class_variant#class-variant) params, [Variant](class_variant#class-variant) id **)** | | [Dictionary](class_dictionary#class-dictionary) | [make\_response](#class-jsonrpc-method-make-response) **(** [Variant](class_variant#class-variant) result, [Variant](class_variant#class-variant) id **)** | | [Dictionary](class_dictionary#class-dictionary) | [make\_response\_error](#class-jsonrpc-method-make-response-error) **(** [int](class_int#class-int) code, [String](class_string#class-string) message, [Variant](class_variant#class-variant) id=null **)** const | | [Variant](class_variant#class-variant) | [process\_action](#class-jsonrpc-method-process-action) **(** [Variant](class_variant#class-variant) action, [bool](class_bool#class-bool) recurse=false **)** | | [String](class_string#class-string) | [process\_string](#class-jsonrpc-method-process-string) **(** [String](class_string#class-string) action **)** | | void | [set\_scope](#class-jsonrpc-method-set-scope) **(** [String](class_string#class-string) scope, [Object](class_object#class-object) target **)** | Enumerations ------------ enum **ErrorCode**: * **PARSE\_ERROR** = **-32700** * **INVALID\_REQUEST** = **-32600** * **METHOD\_NOT\_FOUND** = **-32601** --- A method call was requested but no function of that name existed in the JSONRPC subclass. * **INVALID\_PARAMS** = **-32602** * **INTERNAL\_ERROR** = **-32603** Method Descriptions ------------------- ### [Dictionary](class_dictionary#class-dictionary) make\_notification ( [String](class_string#class-string) method, [Variant](class_variant#class-variant) params ) Returns a dictionary in the form of a JSON-RPC notification. Notifications are one-shot messages which do not expect a response. * `method`: Name of the method being called. * `params`: An array or dictionary of parameters being passed to the method. ### [Dictionary](class_dictionary#class-dictionary) make\_request ( [String](class_string#class-string) method, [Variant](class_variant#class-variant) params, [Variant](class_variant#class-variant) id ) Returns a dictionary in the form of a JSON-RPC request. Requests are sent to a server with the expectation of a response. The ID field is used for the server to specify which exact request it is responding to. * `method`: Name of the method being called. * `params`: An array or dictionary of parameters being passed to the method. * `id`: Uniquely identifies this request. The server is expected to send a response with the same ID. ### [Dictionary](class_dictionary#class-dictionary) make\_response ( [Variant](class_variant#class-variant) result, [Variant](class_variant#class-variant) id ) When a server has received and processed a request, it is expected to send a response. If you did not want a response then you need to have sent a Notification instead. * `result`: The return value of the function which was called. * `id`: The ID of the request this response is targeted to. ### [Dictionary](class_dictionary#class-dictionary) make\_response\_error ( [int](class_int#class-int) code, [String](class_string#class-string) message, [Variant](class_variant#class-variant) id=null ) const Creates a response which indicates a previous reply has failed in some way. * `code`: The error code corresponding to what kind of error this is. See the [ErrorCode](#enum-jsonrpc-errorcode) constants. * `message`: A custom message about this error. * `id`: The request this error is a response to. ### [Variant](class_variant#class-variant) process\_action ( [Variant](class_variant#class-variant) action, [bool](class_bool#class-bool) recurse=false ) Given a Dictionary which takes the form of a JSON-RPC request: unpack the request and run it. Methods are resolved by looking at the field called "method" and looking for an equivalently named function in the JSONRPC object. If one is found that method is called. To add new supported methods extend the JSONRPC class and call [process\_action](#class-jsonrpc-method-process-action) on your subclass. `action`: The action to be run, as a Dictionary in the form of a JSON-RPC request or notification. ### [String](class_string#class-string) process\_string ( [String](class_string#class-string) action ) ### void set\_scope ( [String](class_string#class-string) scope, [Object](class_object#class-object) target )
programming_docs
godot VisualShaderNodeScalarOp VisualShaderNodeScalarOp ======================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [Operator](#enum-visualshadernodescalarop-operator) | [operator](#class-visualshadernodescalarop-property-operator) | `0` | Enumerations ------------ enum **Operator**: * **OP\_ADD** = **0** * **OP\_SUB** = **1** * **OP\_MUL** = **2** * **OP\_DIV** = **3** * **OP\_MOD** = **4** * **OP\_POW** = **5** * **OP\_MAX** = **6** * **OP\_MIN** = **7** * **OP\_ATAN2** = **8** * **OP\_STEP** = **9** Property Descriptions --------------------- ### [Operator](#enum-visualshadernodescalarop-operator) operator | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_operator(value) | | *Getter* | get\_operator() | godot StyleBoxEmpty StyleBoxEmpty ============= **Inherits:** [StyleBox](class_stylebox#class-stylebox) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Empty stylebox (does not display anything). Description ----------- Empty stylebox (really does not display anything). godot VisualShaderNodeScalarConstant VisualShaderNodeScalarConstant ============================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [constant](#class-visualshadernodescalarconstant-property-constant) | `0.0` | Property Descriptions --------------------- ### [float](class_float#class-float) constant | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_constant(value) | | *Getter* | get\_constant() | godot Joint Joint ===== **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [ConeTwistJoint](class_conetwistjoint#class-conetwistjoint), [Generic6DOFJoint](class_generic6dofjoint#class-generic6dofjoint), [HingeJoint](class_hingejoint#class-hingejoint), [PinJoint](class_pinjoint#class-pinjoint), [SliderJoint](class_sliderjoint#class-sliderjoint) Base class for all 3D joints. Description ----------- Joints are used to bind together two physics bodies. They have a solver priority and can define if the bodies of the two attached nodes should be able to collide with each other. Tutorials --------- * [3D Truck Town Demo](https://godotengine.org/asset-library/asset/524) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [collision/exclude\_nodes](#class-joint-property-collision-exclude-nodes) | `true` | | [NodePath](class_nodepath#class-nodepath) | [nodes/node\_a](#class-joint-property-nodes-node-a) | `NodePath("")` | | [NodePath](class_nodepath#class-nodepath) | [nodes/node\_b](#class-joint-property-nodes-node-b) | `NodePath("")` | | [int](class_int#class-int) | [solver/priority](#class-joint-property-solver-priority) | `1` | Property Descriptions --------------------- ### [bool](class_bool#class-bool) collision/exclude\_nodes | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_exclude\_nodes\_from\_collision(value) | | *Getter* | get\_exclude\_nodes\_from\_collision() | If `true`, the two bodies of the nodes are not able to collide with each other. ### [NodePath](class_nodepath#class-nodepath) nodes/node\_a | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_node\_a(value) | | *Getter* | get\_node\_a() | The node attached to the first side (A) of the joint. ### [NodePath](class_nodepath#class-nodepath) nodes/node\_b | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_node\_b(value) | | *Getter* | get\_node\_b() | The node attached to the second side (B) of the joint. ### [int](class_int#class-int) solver/priority | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_solver\_priority(value) | | *Getter* | get\_solver\_priority() | The priority used to define which solver is executed first for multiple joints. The lower the value, the higher the priority. godot VisualShaderNodeCompare VisualShaderNodeCompare ======================= **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A comparison function for common types within the visual shader graph. Description ----------- Compares `a` and `b` of [type](#class-visualshadernodecompare-property-type) by [function](#class-visualshadernodecompare-property-function). Returns a boolean scalar. Translates to `if` instruction in shader code. Properties ---------- | | | | | --- | --- | --- | | [Condition](#enum-visualshadernodecompare-condition) | [condition](#class-visualshadernodecompare-property-condition) | `0` | | [Function](#enum-visualshadernodecompare-function) | [function](#class-visualshadernodecompare-property-function) | `0` | | [ComparisonType](#enum-visualshadernodecompare-comparisontype) | [type](#class-visualshadernodecompare-property-type) | `0` | Enumerations ------------ enum **ComparisonType**: * **CTYPE\_SCALAR** = **0** --- A floating-point scalar. * **CTYPE\_VECTOR** = **1** --- A 3D vector type. * **CTYPE\_BOOLEAN** = **2** --- A boolean type. * **CTYPE\_TRANSFORM** = **3** --- A transform (`mat4`) type. enum **Function**: * **FUNC\_EQUAL** = **0** --- Comparison for equality (`a == b`). * **FUNC\_NOT\_EQUAL** = **1** --- Comparison for inequality (`a != b`). * **FUNC\_GREATER\_THAN** = **2** --- Comparison for greater than (`a > b`). Cannot be used if [type](#class-visualshadernodecompare-property-type) set to [CTYPE\_BOOLEAN](#class-visualshadernodecompare-constant-ctype-boolean) or [CTYPE\_TRANSFORM](#class-visualshadernodecompare-constant-ctype-transform). * **FUNC\_GREATER\_THAN\_EQUAL** = **3** --- Comparison for greater than or equal (`a >= b`). Cannot be used if [type](#class-visualshadernodecompare-property-type) set to [CTYPE\_BOOLEAN](#class-visualshadernodecompare-constant-ctype-boolean) or [CTYPE\_TRANSFORM](#class-visualshadernodecompare-constant-ctype-transform). * **FUNC\_LESS\_THAN** = **4** --- Comparison for less than (`a < b`). Cannot be used if [type](#class-visualshadernodecompare-property-type) set to [CTYPE\_BOOLEAN](#class-visualshadernodecompare-constant-ctype-boolean) or [CTYPE\_TRANSFORM](#class-visualshadernodecompare-constant-ctype-transform). * **FUNC\_LESS\_THAN\_EQUAL** = **5** --- Comparison for less than or equal (`a < b`). Cannot be used if [type](#class-visualshadernodecompare-property-type) set to [CTYPE\_BOOLEAN](#class-visualshadernodecompare-constant-ctype-boolean) or [CTYPE\_TRANSFORM](#class-visualshadernodecompare-constant-ctype-transform). enum **Condition**: * **COND\_ALL** = **0** --- The result will be true if all of component in vector satisfy the comparison condition. * **COND\_ANY** = **1** --- The result will be true if any of component in vector satisfy the comparison condition. Property Descriptions --------------------- ### [Condition](#enum-visualshadernodecompare-condition) condition | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_condition(value) | | *Getter* | get\_condition() | Extra condition which is applied if [type](#class-visualshadernodecompare-property-type) is set to [CTYPE\_VECTOR](#class-visualshadernodecompare-constant-ctype-vector). ### [Function](#enum-visualshadernodecompare-function) function | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_function(value) | | *Getter* | get\_function() | A comparison function. See [Function](#enum-visualshadernodecompare-function) for options. ### [ComparisonType](#enum-visualshadernodecompare-comparisontype) type | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_comparison\_type(value) | | *Getter* | get\_comparison\_type() | The type to be used in the comparison. See [ComparisonType](#enum-visualshadernodecompare-comparisontype) for options. godot PolygonPathFinder PolygonPathFinder ================= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Methods ------- | | | | --- | --- | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [find\_path](#class-polygonpathfinder-method-find-path) **(** [Vector2](class_vector2#class-vector2) from, [Vector2](class_vector2#class-vector2) to **)** | | [Rect2](class_rect2#class-rect2) | [get\_bounds](#class-polygonpathfinder-method-get-bounds) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_closest\_point](#class-polygonpathfinder-method-get-closest-point) **(** [Vector2](class_vector2#class-vector2) point **)** const | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [get\_intersections](#class-polygonpathfinder-method-get-intersections) **(** [Vector2](class_vector2#class-vector2) from, [Vector2](class_vector2#class-vector2) to **)** const | | [float](class_float#class-float) | [get\_point\_penalty](#class-polygonpathfinder-method-get-point-penalty) **(** [int](class_int#class-int) idx **)** const | | [bool](class_bool#class-bool) | [is\_point\_inside](#class-polygonpathfinder-method-is-point-inside) **(** [Vector2](class_vector2#class-vector2) point **)** const | | void | [set\_point\_penalty](#class-polygonpathfinder-method-set-point-penalty) **(** [int](class_int#class-int) idx, [float](class_float#class-float) penalty **)** | | void | [setup](#class-polygonpathfinder-method-setup) **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [PoolIntArray](class_poolintarray#class-poolintarray) connections **)** | Method Descriptions ------------------- ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) find\_path ( [Vector2](class_vector2#class-vector2) from, [Vector2](class_vector2#class-vector2) to ) ### [Rect2](class_rect2#class-rect2) get\_bounds ( ) const ### [Vector2](class_vector2#class-vector2) get\_closest\_point ( [Vector2](class_vector2#class-vector2) point ) const ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) get\_intersections ( [Vector2](class_vector2#class-vector2) from, [Vector2](class_vector2#class-vector2) to ) const ### [float](class_float#class-float) get\_point\_penalty ( [int](class_int#class-int) idx ) const ### [bool](class_bool#class-bool) is\_point\_inside ( [Vector2](class_vector2#class-vector2) point ) const ### void set\_point\_penalty ( [int](class_int#class-int) idx, [float](class_float#class-float) penalty ) ### void setup ( [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [PoolIntArray](class_poolintarray#class-poolintarray) connections ) godot ClassDB ClassDB ======= **Inherits:** [Object](class_object#class-object) Class information repository. Description ----------- Provides access to metadata stored for every available class. Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [can\_instance](#class-classdb-method-can-instance) **(** [String](class_string#class-string) class **)** const | | [bool](class_bool#class-bool) | [class\_exists](#class-classdb-method-class-exists) **(** [String](class_string#class-string) class **)** const | | [String](class_string#class-string) | [class\_get\_category](#class-classdb-method-class-get-category) **(** [String](class_string#class-string) class **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [class\_get\_enum\_constants](#class-classdb-method-class-get-enum-constants) **(** [String](class_string#class-string) class, [String](class_string#class-string) enum, [bool](class_bool#class-bool) no\_inheritance=false **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [class\_get\_enum\_list](#class-classdb-method-class-get-enum-list) **(** [String](class_string#class-string) class, [bool](class_bool#class-bool) no\_inheritance=false **)** const | | [int](class_int#class-int) | [class\_get\_integer\_constant](#class-classdb-method-class-get-integer-constant) **(** [String](class_string#class-string) class, [String](class_string#class-string) name **)** const | | [String](class_string#class-string) | [class\_get\_integer\_constant\_enum](#class-classdb-method-class-get-integer-constant-enum) **(** [String](class_string#class-string) class, [String](class_string#class-string) name, [bool](class_bool#class-bool) no\_inheritance=false **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [class\_get\_integer\_constant\_list](#class-classdb-method-class-get-integer-constant-list) **(** [String](class_string#class-string) class, [bool](class_bool#class-bool) no\_inheritance=false **)** const | | [Array](class_array#class-array) | [class\_get\_method\_list](#class-classdb-method-class-get-method-list) **(** [String](class_string#class-string) class, [bool](class_bool#class-bool) no\_inheritance=false **)** const | | [Variant](class_variant#class-variant) | [class\_get\_property](#class-classdb-method-class-get-property) **(** [Object](class_object#class-object) object, [String](class_string#class-string) property **)** const | | [Array](class_array#class-array) | [class\_get\_property\_list](#class-classdb-method-class-get-property-list) **(** [String](class_string#class-string) class, [bool](class_bool#class-bool) no\_inheritance=false **)** const | | [Dictionary](class_dictionary#class-dictionary) | [class\_get\_signal](#class-classdb-method-class-get-signal) **(** [String](class_string#class-string) class, [String](class_string#class-string) signal **)** const | | [Array](class_array#class-array) | [class\_get\_signal\_list](#class-classdb-method-class-get-signal-list) **(** [String](class_string#class-string) class, [bool](class_bool#class-bool) no\_inheritance=false **)** const | | [bool](class_bool#class-bool) | [class\_has\_enum](#class-classdb-method-class-has-enum) **(** [String](class_string#class-string) class, [String](class_string#class-string) name, [bool](class_bool#class-bool) no\_inheritance=false **)** const | | [bool](class_bool#class-bool) | [class\_has\_integer\_constant](#class-classdb-method-class-has-integer-constant) **(** [String](class_string#class-string) class, [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [class\_has\_method](#class-classdb-method-class-has-method) **(** [String](class_string#class-string) class, [String](class_string#class-string) method, [bool](class_bool#class-bool) no\_inheritance=false **)** const | | [bool](class_bool#class-bool) | [class\_has\_signal](#class-classdb-method-class-has-signal) **(** [String](class_string#class-string) class, [String](class_string#class-string) signal **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [class\_set\_property](#class-classdb-method-class-set-property) **(** [Object](class_object#class-object) object, [String](class_string#class-string) property, [Variant](class_variant#class-variant) value **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_class\_list](#class-classdb-method-get-class-list) **(** **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_inheriters\_from\_class](#class-classdb-method-get-inheriters-from-class) **(** [String](class_string#class-string) class **)** const | | [String](class_string#class-string) | [get\_parent\_class](#class-classdb-method-get-parent-class) **(** [String](class_string#class-string) class **)** const | | [Variant](class_variant#class-variant) | [instance](#class-classdb-method-instance) **(** [String](class_string#class-string) class **)** const | | [bool](class_bool#class-bool) | [is\_class\_enabled](#class-classdb-method-is-class-enabled) **(** [String](class_string#class-string) class **)** const | | [bool](class_bool#class-bool) | [is\_parent\_class](#class-classdb-method-is-parent-class) **(** [String](class_string#class-string) class, [String](class_string#class-string) inherits **)** const | Method Descriptions ------------------- ### [bool](class_bool#class-bool) can\_instance ( [String](class_string#class-string) class ) const Returns `true` if you can instance objects from the specified `class`, `false` in other case. ### [bool](class_bool#class-bool) class\_exists ( [String](class_string#class-string) class ) const Returns whether the specified `class` is available or not. ### [String](class_string#class-string) class\_get\_category ( [String](class_string#class-string) class ) const Returns a category associated with the class for use in documentation and the Asset Library. Debug mode required. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) class\_get\_enum\_constants ( [String](class_string#class-string) class, [String](class_string#class-string) enum, [bool](class_bool#class-bool) no\_inheritance=false ) const Returns an array with all the keys in `enum` of `class` or its ancestry. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) class\_get\_enum\_list ( [String](class_string#class-string) class, [bool](class_bool#class-bool) no\_inheritance=false ) const Returns an array with all the enums of `class` or its ancestry. ### [int](class_int#class-int) class\_get\_integer\_constant ( [String](class_string#class-string) class, [String](class_string#class-string) name ) const Returns the value of the integer constant `name` of `class` or its ancestry. Always returns 0 when the constant could not be found. ### [String](class_string#class-string) class\_get\_integer\_constant\_enum ( [String](class_string#class-string) class, [String](class_string#class-string) name, [bool](class_bool#class-bool) no\_inheritance=false ) const Returns which enum the integer constant `name` of `class` or its ancestry belongs to. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) class\_get\_integer\_constant\_list ( [String](class_string#class-string) class, [bool](class_bool#class-bool) no\_inheritance=false ) const Returns an array with the names all the integer constants of `class` or its ancestry. ### [Array](class_array#class-array) class\_get\_method\_list ( [String](class_string#class-string) class, [bool](class_bool#class-bool) no\_inheritance=false ) const Returns an array with all the methods of `class` or its ancestry if `no_inheritance` is `false`. Every element of the array is a [Dictionary](class_dictionary#class-dictionary) with the following keys: `args`, `default_args`, `flags`, `id`, `name`, `return: (class_name, hint, hint_string, name, type, usage)`. **Note:** In exported release builds the debug info is not available, so the returned dictionaries will contain only method names. ### [Variant](class_variant#class-variant) class\_get\_property ( [Object](class_object#class-object) object, [String](class_string#class-string) property ) const Returns the value of `property` of `class` or its ancestry. ### [Array](class_array#class-array) class\_get\_property\_list ( [String](class_string#class-string) class, [bool](class_bool#class-bool) no\_inheritance=false ) const Returns an array with all the properties of `class` or its ancestry if `no_inheritance` is `false`. ### [Dictionary](class_dictionary#class-dictionary) class\_get\_signal ( [String](class_string#class-string) class, [String](class_string#class-string) signal ) const Returns the `signal` data of `class` or its ancestry. The returned value is a [Dictionary](class_dictionary#class-dictionary) with the following keys: `args`, `default_args`, `flags`, `id`, `name`, `return: (class_name, hint, hint_string, name, type, usage)`. ### [Array](class_array#class-array) class\_get\_signal\_list ( [String](class_string#class-string) class, [bool](class_bool#class-bool) no\_inheritance=false ) const Returns an array with all the signals of `class` or its ancestry if `no_inheritance` is `false`. Every element of the array is a [Dictionary](class_dictionary#class-dictionary) as described in [class\_get\_signal](#class-classdb-method-class-get-signal). ### [bool](class_bool#class-bool) class\_has\_enum ( [String](class_string#class-string) class, [String](class_string#class-string) name, [bool](class_bool#class-bool) no\_inheritance=false ) const Returns whether `class` or its ancestry has an enum called `name` or not. ### [bool](class_bool#class-bool) class\_has\_integer\_constant ( [String](class_string#class-string) class, [String](class_string#class-string) name ) const Returns whether `class` or its ancestry has an integer constant called `name` or not. ### [bool](class_bool#class-bool) class\_has\_method ( [String](class_string#class-string) class, [String](class_string#class-string) method, [bool](class_bool#class-bool) no\_inheritance=false ) const Returns whether `class` (or its ancestry if `no_inheritance` is `false`) has a method called `method` or not. ### [bool](class_bool#class-bool) class\_has\_signal ( [String](class_string#class-string) class, [String](class_string#class-string) signal ) const Returns whether `class` or its ancestry has a signal called `signal` or not. ### [Error](class_%40globalscope#enum-globalscope-error) class\_set\_property ( [Object](class_object#class-object) object, [String](class_string#class-string) property, [Variant](class_variant#class-variant) value ) const Sets `property` value of `class` to `value`. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_class\_list ( ) const Returns the names of all the classes available. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_inheriters\_from\_class ( [String](class_string#class-string) class ) const Returns the names of all the classes that directly or indirectly inherit from `class`. ### [String](class_string#class-string) get\_parent\_class ( [String](class_string#class-string) class ) const Returns the parent class of `class`. ### [Variant](class_variant#class-variant) instance ( [String](class_string#class-string) class ) const Creates an instance of `class`. ### [bool](class_bool#class-bool) is\_class\_enabled ( [String](class_string#class-string) class ) const Returns whether this `class` is enabled or not. ### [bool](class_bool#class-bool) is\_parent\_class ( [String](class_string#class-string) class, [String](class_string#class-string) inherits ) const Returns whether `inherits` is an ancestor of `class` or not.
programming_docs
godot FuncRef FuncRef ======= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Reference to a function in an object. Description ----------- In GDScript, functions are not *first-class objects*. This means it is impossible to store them directly as variables, return them from another function, or pass them as arguments. However, by creating a `FuncRef` using the [@GDScript.funcref](class_%40gdscript#class-gdscript-method-funcref) function, a reference to a function in a given object can be created, passed around and called. Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [function](#class-funcref-property-function) | `""` | Methods ------- | | | | --- | --- | | [Variant](class_variant#class-variant) | [call\_func](#class-funcref-method-call-func) **(** ... **)** vararg | | [Variant](class_variant#class-variant) | [call\_funcv](#class-funcref-method-call-funcv) **(** [Array](class_array#class-array) arg\_array **)** | | [bool](class_bool#class-bool) | [is\_valid](#class-funcref-method-is-valid) **(** **)** const | | void | [set\_instance](#class-funcref-method-set-instance) **(** [Object](class_object#class-object) instance **)** | Property Descriptions --------------------- ### [String](class_string#class-string) function | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_function(value) | | *Getter* | get\_function() | The name of the referenced function. Method Descriptions ------------------- ### [Variant](class_variant#class-variant) call\_func ( ... ) vararg Calls the referenced function previously set in [function](#class-funcref-property-function) or [@GDScript.funcref](class_%40gdscript#class-gdscript-method-funcref). ### [Variant](class_variant#class-variant) call\_funcv ( [Array](class_array#class-array) arg\_array ) Calls the referenced function previously set in [function](#class-funcref-property-function) or [@GDScript.funcref](class_%40gdscript#class-gdscript-method-funcref). Contrarily to [call\_func](#class-funcref-method-call-func), this method does not support a variable number of arguments but expects all parameters to be passed via a single [Array](class_array#class-array). ### [bool](class_bool#class-bool) is\_valid ( ) const Returns whether the object still exists and has the function assigned. ### void set\_instance ( [Object](class_object#class-object) instance ) The object containing the referenced function. This object must be of a type actually inheriting from [Object](class_object#class-object), not a built-in type such as [int](class_int#class-int), [Vector2](class_vector2#class-vector2) or [Dictionary](class_dictionary#class-dictionary). godot Resource Resource ======== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [Animation](class_animation#class-animation), [AnimationNode](class_animationnode#class-animationnode), [AnimationNodeStateMachinePlayback](class_animationnodestatemachineplayback#class-animationnodestatemachineplayback), [AnimationNodeStateMachineTransition](class_animationnodestatemachinetransition#class-animationnodestatemachinetransition), [AudioBusLayout](class_audiobuslayout#class-audiobuslayout), [AudioEffect](class_audioeffect#class-audioeffect), [AudioStream](class_audiostream#class-audiostream), [BakedLightmapData](class_bakedlightmapdata#class-bakedlightmapdata), [BitMap](class_bitmap#class-bitmap), [ButtonGroup](class_buttongroup#class-buttongroup), [CryptoKey](class_cryptokey#class-cryptokey), [CubeMap](class_cubemap#class-cubemap), [Curve](class_curve#class-curve), [Curve2D](class_curve2d#class-curve2d), [Curve3D](class_curve3d#class-curve3d), [DynamicFontData](class_dynamicfontdata#class-dynamicfontdata), [EditorSettings](class_editorsettings#class-editorsettings), [EditorSpatialGizmoPlugin](class_editorspatialgizmoplugin#class-editorspatialgizmoplugin), [Environment](class_environment#class-environment), [Font](class_font#class-font), [GDNativeLibrary](class_gdnativelibrary#class-gdnativelibrary), [GIProbeData](class_giprobedata#class-giprobedata), [GLTFAccessor](class_gltfaccessor#class-gltfaccessor), [GLTFAnimation](class_gltfanimation#class-gltfanimation), [GLTFBufferView](class_gltfbufferview#class-gltfbufferview), [GLTFCamera](class_gltfcamera#class-gltfcamera), [GLTFDocument](class_gltfdocument#class-gltfdocument), [GLTFLight](class_gltflight#class-gltflight), [GLTFMesh](class_gltfmesh#class-gltfmesh), [GLTFNode](class_gltfnode#class-gltfnode), [GLTFSkeleton](class_gltfskeleton#class-gltfskeleton), [GLTFSkin](class_gltfskin#class-gltfskin), [GLTFSpecGloss](class_gltfspecgloss#class-gltfspecgloss), [GLTFState](class_gltfstate#class-gltfstate), [GLTFTexture](class_gltftexture#class-gltftexture), [Gradient](class_gradient#class-gradient), [Image](class_image#class-image), [InputEvent](class_inputevent#class-inputevent), [Material](class_material#class-material), [Mesh](class_mesh#class-mesh), [MeshLibrary](class_meshlibrary#class-meshlibrary), [MultiMesh](class_multimesh#class-multimesh), [NavigationMesh](class_navigationmesh#class-navigationmesh), [NavigationPolygon](class_navigationpolygon#class-navigationpolygon), [OccluderPolygon2D](class_occluderpolygon2d#class-occluderpolygon2d), [OccluderShape](class_occludershape#class-occludershape), [OpenSimplexNoise](class_opensimplexnoise#class-opensimplexnoise), [PackedDataContainer](class_packeddatacontainer#class-packeddatacontainer), [PackedScene](class_packedscene#class-packedscene), [PhysicsMaterial](class_physicsmaterial#class-physicsmaterial), [PolygonPathFinder](class_polygonpathfinder#class-polygonpathfinder), [RichTextEffect](class_richtexteffect#class-richtexteffect), [Script](class_script#class-script), [Shader](class_shader#class-shader), [Shape](class_shape#class-shape), [Shape2D](class_shape2d#class-shape2d), [ShortCut](class_shortcut#class-shortcut), [Skin](class_skin#class-skin), [Sky](class_sky#class-sky), [SpriteFrames](class_spriteframes#class-spriteframes), [StyleBox](class_stylebox#class-stylebox), [TextFile](class_textfile#class-textfile), [Texture](class_texture#class-texture), [TextureLayered](class_texturelayered#class-texturelayered), [Theme](class_theme#class-theme), [TileSet](class_tileset#class-tileset), [Translation](class_translation#class-translation), [VideoStream](class_videostream#class-videostream), [VisualScriptNode](class_visualscriptnode#class-visualscriptnode), [VisualShaderNode](class_visualshadernode#class-visualshadernode), [World](class_world#class-world), [World2D](class_world2d#class-world2d), [X509Certificate](class_x509certificate#class-x509certificate) Base class for all resources. Description ----------- Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from [Reference](class_reference#class-reference), resources are reference-counted and freed when no longer in use. They are also cached once loaded from disk, so that any further attempts to load a resource from a given path will return the same reference (all this in contrast to a [Node](class_node#class-node), which is not reference-counted and can be instanced from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a [Node](class_node#class-node) or another resource. **Note:** In C#, resources will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free resources that are no longer in use. This means that unused resources will linger on for a while before being removed. Tutorials --------- * [Resources](https://docs.godotengine.org/en/3.5/tutorials/scripting/resources.html) * [When and how to avoid using nodes for everything](https://docs.godotengine.org/en/3.5/tutorials/best_practices/node_alternatives.html) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [resource\_local\_to\_scene](#class-resource-property-resource-local-to-scene) | `false` | | [String](class_string#class-string) | [resource\_name](#class-resource-property-resource-name) | `""` | | [String](class_string#class-string) | [resource\_path](#class-resource-property-resource-path) | `""` | Methods ------- | | | | --- | --- | | void | [\_setup\_local\_to\_scene](#class-resource-method-setup-local-to-scene) **(** **)** virtual | | [Resource](#class-resource) | [duplicate](#class-resource-method-duplicate) **(** [bool](class_bool#class-bool) subresources=false **)** const | | void | [emit\_changed](#class-resource-method-emit-changed) **(** **)** | | [Node](class_node#class-node) | [get\_local\_scene](#class-resource-method-get-local-scene) **(** **)** const | | [RID](class_rid#class-rid) | [get\_rid](#class-resource-method-get-rid) **(** **)** const | | void | [setup\_local\_to\_scene](#id1) **(** **)** | | void | [take\_over\_path](#class-resource-method-take-over-path) **(** [String](class_string#class-string) path **)** | Signals ------- ### changed ( ) Emitted whenever the resource changes. **Note:** This signal is not emitted automatically for custom resources, which means that you need to create a setter and emit the signal yourself. Property Descriptions --------------------- ### [bool](class_bool#class-bool) resource\_local\_to\_scene | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_local\_to\_scene(value) | | *Getter* | is\_local\_to\_scene() | If `true`, the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene. ### [String](class_string#class-string) resource\_name | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_name(value) | | *Getter* | get\_name() | The name of the resource. This is an optional identifier. If [resource\_name](#class-resource-property-resource-name) is not empty, its value will be displayed to represent the current resource in the editor inspector. For built-in scripts, the [resource\_name](#class-resource-property-resource-name) will be displayed as the tab name in the script editor. ### [String](class_string#class-string) resource\_path | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_path(value) | | *Getter* | get\_path() | The path to the resource. In case it has its own file, it will return its filepath. If it's tied to the scene, it will return the scene's path, followed by the resource's index. Method Descriptions ------------------- ### void \_setup\_local\_to\_scene ( ) virtual Virtual function which can be overridden to customize the behavior value of [setup\_local\_to\_scene](#id1). ### [Resource](#class-resource) duplicate ( [bool](class_bool#class-bool) subresources=false ) const Duplicates the resource, returning a new resource with the exported members copied. **Note:** To duplicate the resource the constructor is called without arguments. This method will error when the constructor doesn't have default values. By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing `true` to the `subresources` argument which will copy the subresources. **Note:** If `subresources` is `true`, this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared. **Note:** When duplicating a resource, only `export`ed properties are copied. Other properties will be set to their default value in the new resource. ### void emit\_changed ( ) Emits the [changed](#class-resource-signal-changed) signal. If external objects which depend on this resource should be updated, this method must be called manually whenever the state of this resource has changed (such as modification of properties). The method is equivalent to: ``` emit_signal("changed") ``` **Note:** This method is called automatically for built-in resources. ### [Node](class_node#class-node) get\_local\_scene ( ) const If [resource\_local\_to\_scene](#class-resource-property-resource-local-to-scene) is enabled and the resource was loaded from a [PackedScene](class_packedscene#class-packedscene) instantiation, returns the local scene where this resource's unique copy is in use. Otherwise, returns `null`. ### [RID](class_rid#class-rid) get\_rid ( ) const Returns the RID of the resource (or an empty RID). Many resources (such as [Texture](class_texture#class-texture), [Mesh](class_mesh#class-mesh), etc) are high-level abstractions of resources stored in a server, so this function will return the original RID. ### void setup\_local\_to\_scene ( ) This method is called when a resource with [resource\_local\_to\_scene](#class-resource-property-resource-local-to-scene) enabled is loaded from a [PackedScene](class_packedscene#class-packedscene) instantiation. Its behavior can be customized by overriding [\_setup\_local\_to\_scene](#class-resource-method-setup-local-to-scene) from script. For most resources, this method performs no base logic. [ViewportTexture](class_viewporttexture#class-viewporttexture) performs custom logic to properly set the proxy texture and flags in the local viewport. ### void take\_over\_path ( [String](class_string#class-string) path ) Sets the path of the resource, potentially overriding an existing cache entry for this path. This differs from setting [resource\_path](#class-resource-property-resource-path), as the latter would error out if another resource was already cached for the given path. godot AnimationNodeBlendTree AnimationNodeBlendTree ====================== **Inherits:** [AnimationRootNode](class_animationrootnode#class-animationrootnode) **<** [AnimationNode](class_animationnode#class-animationnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) [AnimationTree](class_animationtree#class-animationtree) node resource that contains many blend type nodes. Description ----------- This node may contain a sub-tree of any other blend type nodes, such as [AnimationNodeTransition](class_animationnodetransition#class-animationnodetransition), [AnimationNodeBlend2](class_animationnodeblend2#class-animationnodeblend2), [AnimationNodeBlend3](class_animationnodeblend3#class-animationnodeblend3), [AnimationNodeOneShot](class_animationnodeoneshot#class-animationnodeoneshot), etc. This is one of the most commonly used roots. An [AnimationNodeOutput](class_animationnodeoutput#class-animationnodeoutput) node named `output` is created by default. Tutorials --------- * [Using AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html) Properties ---------- | | | | | --- | --- | --- | | [Vector2](class_vector2#class-vector2) | [graph\_offset](#class-animationnodeblendtree-property-graph-offset) | `Vector2( 0, 0 )` | Methods ------- | | | | --- | --- | | void | [add\_node](#class-animationnodeblendtree-method-add-node) **(** [String](class_string#class-string) name, [AnimationNode](class_animationnode#class-animationnode) node, [Vector2](class_vector2#class-vector2) position=Vector2( 0, 0 ) **)** | | void | [connect\_node](#class-animationnodeblendtree-method-connect-node) **(** [String](class_string#class-string) input\_node, [int](class_int#class-int) input\_index, [String](class_string#class-string) output\_node **)** | | void | [disconnect\_node](#class-animationnodeblendtree-method-disconnect-node) **(** [String](class_string#class-string) input\_node, [int](class_int#class-int) input\_index **)** | | [AnimationNode](class_animationnode#class-animationnode) | [get\_node](#class-animationnodeblendtree-method-get-node) **(** [String](class_string#class-string) name **)** const | | [Vector2](class_vector2#class-vector2) | [get\_node\_position](#class-animationnodeblendtree-method-get-node-position) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [has\_node](#class-animationnodeblendtree-method-has-node) **(** [String](class_string#class-string) name **)** const | | void | [remove\_node](#class-animationnodeblendtree-method-remove-node) **(** [String](class_string#class-string) name **)** | | void | [rename\_node](#class-animationnodeblendtree-method-rename-node) **(** [String](class_string#class-string) name, [String](class_string#class-string) new\_name **)** | | void | [set\_node\_position](#class-animationnodeblendtree-method-set-node-position) **(** [String](class_string#class-string) name, [Vector2](class_vector2#class-vector2) position **)** | Constants --------- * **CONNECTION\_OK** = **0** --- The connection was successful. * **CONNECTION\_ERROR\_NO\_INPUT** = **1** --- The input node is `null`. * **CONNECTION\_ERROR\_NO\_INPUT\_INDEX** = **2** --- The specified input port is out of range. * **CONNECTION\_ERROR\_NO\_OUTPUT** = **3** --- The output node is `null`. * **CONNECTION\_ERROR\_SAME\_NODE** = **4** --- Input and output nodes are the same. * **CONNECTION\_ERROR\_CONNECTION\_EXISTS** = **5** --- The specified connection already exists. Property Descriptions --------------------- ### [Vector2](class_vector2#class-vector2) graph\_offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_graph\_offset(value) | | *Getter* | get\_graph\_offset() | The global offset of all sub-nodes. Method Descriptions ------------------- ### void add\_node ( [String](class_string#class-string) name, [AnimationNode](class_animationnode#class-animationnode) node, [Vector2](class_vector2#class-vector2) position=Vector2( 0, 0 ) ) Adds an [AnimationNode](class_animationnode#class-animationnode) at the given `position`. The `name` is used to identify the created sub-node later. ### void connect\_node ( [String](class_string#class-string) input\_node, [int](class_int#class-int) input\_index, [String](class_string#class-string) output\_node ) Connects the output of an [AnimationNode](class_animationnode#class-animationnode) as input for another [AnimationNode](class_animationnode#class-animationnode), at the input port specified by `input_index`. ### void disconnect\_node ( [String](class_string#class-string) input\_node, [int](class_int#class-int) input\_index ) Disconnects the node connected to the specified input. ### [AnimationNode](class_animationnode#class-animationnode) get\_node ( [String](class_string#class-string) name ) const Returns the sub-node with the specified `name`. ### [Vector2](class_vector2#class-vector2) get\_node\_position ( [String](class_string#class-string) name ) const Returns the position of the sub-node with the specified `name`. ### [bool](class_bool#class-bool) has\_node ( [String](class_string#class-string) name ) const Returns `true` if a sub-node with specified `name` exists. ### void remove\_node ( [String](class_string#class-string) name ) Removes a sub-node. ### void rename\_node ( [String](class_string#class-string) name, [String](class_string#class-string) new\_name ) Changes the name of a sub-node. ### void set\_node\_position ( [String](class_string#class-string) name, [Vector2](class_vector2#class-vector2) position ) Modifies the position of a sub-node. godot CSGSphere CSGSphere ========= **Inherits:** [CSGPrimitive](class_csgprimitive#class-csgprimitive) **<** [CSGShape](class_csgshape#class-csgshape) **<** [GeometryInstance](class_geometryinstance#class-geometryinstance) **<** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) A CSG Sphere shape. Description ----------- This node allows you to create a sphere for use with the CSG system. **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a [MeshInstance](class_meshinstance#class-meshinstance) with a [PrimitiveMesh](class_primitivemesh#class-primitivemesh). Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. Tutorials --------- * [Prototyping levels with CSG](https://docs.godotengine.org/en/3.5/tutorials/3d/csg_tools.html) Properties ---------- | | | | | --- | --- | --- | | [Material](class_material#class-material) | [material](#class-csgsphere-property-material) | | | [int](class_int#class-int) | [radial\_segments](#class-csgsphere-property-radial-segments) | `12` | | [float](class_float#class-float) | [radius](#class-csgsphere-property-radius) | `1.0` | | [int](class_int#class-int) | [rings](#class-csgsphere-property-rings) | `6` | | [bool](class_bool#class-bool) | [smooth\_faces](#class-csgsphere-property-smooth-faces) | `true` | Property Descriptions --------------------- ### [Material](class_material#class-material) material | | | | --- | --- | | *Setter* | set\_material(value) | | *Getter* | get\_material() | The material used to render the sphere. ### [int](class_int#class-int) radial\_segments | | | | --- | --- | | *Default* | `12` | | *Setter* | set\_radial\_segments(value) | | *Getter* | get\_radial\_segments() | Number of vertical slices for the sphere. ### [float](class_float#class-float) radius | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_radius(value) | | *Getter* | get\_radius() | Radius of the sphere. ### [int](class_int#class-int) rings | | | | --- | --- | | *Default* | `6` | | *Setter* | set\_rings(value) | | *Getter* | get\_rings() | Number of horizontal slices for the sphere. ### [bool](class_bool#class-bool) smooth\_faces | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_smooth\_faces(value) | | *Getter* | get\_smooth\_faces() | If `true` the normals of the sphere are set to give a smooth effect making the sphere seem rounded. If `false` the sphere will have a flat shaded look.
programming_docs
godot EditorVCSInterface EditorVCSInterface ================== **Inherits:** [Object](class_object#class-object) Version Control System (VCS) interface, which reads and writes to the local VCS in use. Description ----------- Defines the API that the editor uses to extract information from the underlying VCS. The implementation of this API is included in VCS plugins, which are scripts that inherit `EditorVCSInterface` and are attached (on demand) to the singleton instance of `EditorVCSInterface`. Instead of performing the task themselves, all the virtual functions listed below are calling the internally overridden functions in the VCS plugins to provide a plug-n-play experience. A custom VCS plugin is supposed to inherit from `EditorVCSInterface` and override these virtual functions. Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [\_checkout\_branch](#class-editorvcsinterface-method-checkout-branch) **(** [String](class_string#class-string) branch\_name **)** virtual | | void | [\_commit](#class-editorvcsinterface-method-commit) **(** [String](class_string#class-string) msg **)** virtual | | void | [\_create\_branch](#class-editorvcsinterface-method-create-branch) **(** [String](class_string#class-string) branch\_name **)** virtual | | void | [\_create\_remote](#class-editorvcsinterface-method-create-remote) **(** [String](class_string#class-string) remote\_name, [String](class_string#class-string) remote\_url **)** virtual | | void | [\_discard\_file](#class-editorvcsinterface-method-discard-file) **(** [String](class_string#class-string) file\_path **)** virtual | | void | [\_fetch](#class-editorvcsinterface-method-fetch) **(** [String](class_string#class-string) remote **)** virtual | | [Array](class_array#class-array) | [\_get\_branch\_list](#class-editorvcsinterface-method-get-branch-list) **(** **)** virtual | | [String](class_string#class-string) | [\_get\_current\_branch\_name](#class-editorvcsinterface-method-get-current-branch-name) **(** **)** virtual | | [Array](class_array#class-array) | [\_get\_diff](#class-editorvcsinterface-method-get-diff) **(** [String](class_string#class-string) identifier, [int](class_int#class-int) area **)** virtual | | [Array](class_array#class-array) | [\_get\_line\_diff](#class-editorvcsinterface-method-get-line-diff) **(** [String](class_string#class-string) file\_path, [String](class_string#class-string) text **)** virtual | | [Array](class_array#class-array) | [\_get\_modified\_files\_data](#class-editorvcsinterface-method-get-modified-files-data) **(** **)** virtual | | [Array](class_array#class-array) | [\_get\_previous\_commits](#class-editorvcsinterface-method-get-previous-commits) **(** [int](class_int#class-int) max\_commits **)** virtual | | [Array](class_array#class-array) | [\_get\_remotes](#class-editorvcsinterface-method-get-remotes) **(** **)** virtual | | [String](class_string#class-string) | [\_get\_vcs\_name](#class-editorvcsinterface-method-get-vcs-name) **(** **)** virtual | | [bool](class_bool#class-bool) | [\_initialize](#class-editorvcsinterface-method-initialize) **(** [String](class_string#class-string) project\_path **)** virtual | | void | [\_pull](#class-editorvcsinterface-method-pull) **(** [String](class_string#class-string) remote **)** virtual | | void | [\_push](#class-editorvcsinterface-method-push) **(** [String](class_string#class-string) remote, [bool](class_bool#class-bool) force **)** virtual | | void | [\_remove\_branch](#class-editorvcsinterface-method-remove-branch) **(** [String](class_string#class-string) branch\_name **)** virtual | | void | [\_remove\_remote](#class-editorvcsinterface-method-remove-remote) **(** [String](class_string#class-string) remote\_name **)** virtual | | void | [\_set\_credentials](#class-editorvcsinterface-method-set-credentials) **(** [String](class_string#class-string) username, [String](class_string#class-string) password, [String](class_string#class-string) ssh\_public\_key\_path, [String](class_string#class-string) ssh\_private\_key\_path, [String](class_string#class-string) ssh\_passphrase **)** virtual | | [bool](class_bool#class-bool) | [\_shut\_down](#class-editorvcsinterface-method-shut-down) **(** **)** virtual | | void | [\_stage\_file](#class-editorvcsinterface-method-stage-file) **(** [String](class_string#class-string) file\_path **)** virtual | | void | [\_unstage\_file](#class-editorvcsinterface-method-unstage-file) **(** [String](class_string#class-string) file\_path **)** virtual | | [Dictionary](class_dictionary#class-dictionary) | [add\_diff\_hunks\_into\_diff\_file](#class-editorvcsinterface-method-add-diff-hunks-into-diff-file) **(** [Dictionary](class_dictionary#class-dictionary) diff\_file, [Array](class_array#class-array) diff\_hunks **)** | | [Dictionary](class_dictionary#class-dictionary) | [add\_line\_diffs\_into\_diff\_hunk](#class-editorvcsinterface-method-add-line-diffs-into-diff-hunk) **(** [Dictionary](class_dictionary#class-dictionary) diff\_hunk, [Array](class_array#class-array) line\_diffs **)** | | [Dictionary](class_dictionary#class-dictionary) | [create\_commit](#class-editorvcsinterface-method-create-commit) **(** [String](class_string#class-string) msg, [String](class_string#class-string) author, [String](class_string#class-string) id, [int](class_int#class-int) unix\_timestamp, [int](class_int#class-int) offset\_minutes **)** | | [Dictionary](class_dictionary#class-dictionary) | [create\_diff\_file](#class-editorvcsinterface-method-create-diff-file) **(** [String](class_string#class-string) new\_file, [String](class_string#class-string) old\_file **)** | | [Dictionary](class_dictionary#class-dictionary) | [create\_diff\_hunk](#class-editorvcsinterface-method-create-diff-hunk) **(** [int](class_int#class-int) old\_start, [int](class_int#class-int) new\_start, [int](class_int#class-int) old\_lines, [int](class_int#class-int) new\_lines **)** | | [Dictionary](class_dictionary#class-dictionary) | [create\_diff\_line](#class-editorvcsinterface-method-create-diff-line) **(** [int](class_int#class-int) new\_line\_no, [int](class_int#class-int) old\_line\_no, [String](class_string#class-string) content, [String](class_string#class-string) status **)** | | [Dictionary](class_dictionary#class-dictionary) | [create\_status\_file](#class-editorvcsinterface-method-create-status-file) **(** [String](class_string#class-string) file\_path, [ChangeType](#enum-editorvcsinterface-changetype) change\_type, [TreeArea](#enum-editorvcsinterface-treearea) area **)** | | void | [popup\_error](#class-editorvcsinterface-method-popup-error) **(** [String](class_string#class-string) msg **)** | Enumerations ------------ enum **ChangeType**: * **CHANGE\_TYPE\_NEW** = **0** --- A new file has been added. * **CHANGE\_TYPE\_MODIFIED** = **1** --- An earlier added file has been modified. * **CHANGE\_TYPE\_RENAMED** = **2** --- An earlier added file has been renamed. * **CHANGE\_TYPE\_DELETED** = **3** --- An earlier added file has been deleted. * **CHANGE\_TYPE\_TYPECHANGE** = **4** --- An earlier added file has been typechanged. * **CHANGE\_TYPE\_UNMERGED** = **5** --- A file is left unmerged. enum **TreeArea**: * **TREE\_AREA\_COMMIT** = **0** --- A commit is encountered from the commit area. * **TREE\_AREA\_STAGED** = **1** --- A file is encountered from the staged area. * **TREE\_AREA\_UNSTAGED** = **2** --- A file is encountered from the unstaged area. Method Descriptions ------------------- ### [bool](class_bool#class-bool) \_checkout\_branch ( [String](class_string#class-string) branch\_name ) virtual Checks out a `branch_name` in the VCS. ### void \_commit ( [String](class_string#class-string) msg ) virtual Commits the currently staged changes and applies the commit `msg` to the resulting commit. ### void \_create\_branch ( [String](class_string#class-string) branch\_name ) virtual Creates a new branch named `branch_name` in the VCS. ### void \_create\_remote ( [String](class_string#class-string) remote\_name, [String](class_string#class-string) remote\_url ) virtual Creates a new remote destination with name `remote_name` and points it to `remote_url`. This can be both an HTTPS remote or an SSH remote. ### void \_discard\_file ( [String](class_string#class-string) file\_path ) virtual Discards the changes made in file present at `file_path`. ### void \_fetch ( [String](class_string#class-string) remote ) virtual Fetches new changes from the remote, but doesn't write changes to the current working directory. Equivalent to `git fetch`. ### [Array](class_array#class-array) \_get\_branch\_list ( ) virtual Gets an instance of an [Array](class_array#class-array) of [String](class_string#class-string)s containing available branch names in the VCS. ### [String](class_string#class-string) \_get\_current\_branch\_name ( ) virtual Gets the current branch name defined in the VCS. ### [Array](class_array#class-array) \_get\_diff ( [String](class_string#class-string) identifier, [int](class_int#class-int) area ) virtual Returns an [Array](class_array#class-array) of [Dictionary](class_dictionary#class-dictionary) items (see [create\_diff\_file](#class-editorvcsinterface-method-create-diff-file), [create\_diff\_hunk](#class-editorvcsinterface-method-create-diff-hunk), [create\_diff\_line](#class-editorvcsinterface-method-create-diff-line), [add\_line\_diffs\_into\_diff\_hunk](#class-editorvcsinterface-method-add-line-diffs-into-diff-hunk) and [add\_diff\_hunks\_into\_diff\_file](#class-editorvcsinterface-method-add-diff-hunks-into-diff-file)), each containing information about a diff. If `identifier` is a file path, returns a file diff, and if it is a commit identifier, then returns a commit diff. ### [Array](class_array#class-array) \_get\_line\_diff ( [String](class_string#class-string) file\_path, [String](class_string#class-string) text ) virtual Returns an [Array](class_array#class-array) of [Dictionary](class_dictionary#class-dictionary) items (see [create\_diff\_hunk](#class-editorvcsinterface-method-create-diff-hunk)), each containing a line diff between a file at `file_path` and the `text` which is passed in. ### [Array](class_array#class-array) \_get\_modified\_files\_data ( ) virtual Returns an [Array](class_array#class-array) of [Dictionary](class_dictionary#class-dictionary) items (see [create\_status\_file](#class-editorvcsinterface-method-create-status-file)), each containing the status data of every modified file in the project folder. ### [Array](class_array#class-array) \_get\_previous\_commits ( [int](class_int#class-int) max\_commits ) virtual Returns an [Array](class_array#class-array) of [Dictionary](class_dictionary#class-dictionary) items (see [create\_commit](#class-editorvcsinterface-method-create-commit)), each containing the data for a past commit. ### [Array](class_array#class-array) \_get\_remotes ( ) virtual Returns an [Array](class_array#class-array) of [String](class_string#class-string)s, each containing the name of a remote configured in the VCS. ### [String](class_string#class-string) \_get\_vcs\_name ( ) virtual Returns the name of the underlying VCS provider. ### [bool](class_bool#class-bool) \_initialize ( [String](class_string#class-string) project\_path ) virtual Initializes the VCS plugin when called from the editor. Returns whether or not the plugin was successfully initialized. A VCS project is initialized at `project_path`. ### void \_pull ( [String](class_string#class-string) remote ) virtual Pulls changes from the remote. This can give rise to merge conflicts. ### void \_push ( [String](class_string#class-string) remote, [bool](class_bool#class-bool) force ) virtual Pushes changes to the `remote`. Optionally, if `force` is set to true, a force push will override the change history already present on the remote. ### void \_remove\_branch ( [String](class_string#class-string) branch\_name ) virtual Remove a branch from the local VCS. ### void \_remove\_remote ( [String](class_string#class-string) remote\_name ) virtual Remove a remote from the local VCS. ### void \_set\_credentials ( [String](class_string#class-string) username, [String](class_string#class-string) password, [String](class_string#class-string) ssh\_public\_key\_path, [String](class_string#class-string) ssh\_private\_key\_path, [String](class_string#class-string) ssh\_passphrase ) virtual Set user credentials in the underlying VCS. `username` and `password` are used only during HTTPS authentication unless not already mentioned in the remote URL. `ssh_public_key_path`, `ssh_private_key_path`, and `ssh_passphrase` are only used during SSH authentication. ### [bool](class_bool#class-bool) \_shut\_down ( ) virtual Shuts down VCS plugin instance. Called when the user either closes the editor or shuts down the VCS plugin through the editor UI. ### void \_stage\_file ( [String](class_string#class-string) file\_path ) virtual Stages the file present at `file_path` to the staged area. ### void \_unstage\_file ( [String](class_string#class-string) file\_path ) virtual Unstages the file present at `file_path` from the staged area to the unstaged area. ### [Dictionary](class_dictionary#class-dictionary) add\_diff\_hunks\_into\_diff\_file ( [Dictionary](class_dictionary#class-dictionary) diff\_file, [Array](class_array#class-array) diff\_hunks ) Helper function to add an array of `diff_hunks` into a `diff_file`. ### [Dictionary](class_dictionary#class-dictionary) add\_line\_diffs\_into\_diff\_hunk ( [Dictionary](class_dictionary#class-dictionary) diff\_hunk, [Array](class_array#class-array) line\_diffs ) Helper function to add an array of `line_diffs` into a `diff_hunk`. ### [Dictionary](class_dictionary#class-dictionary) create\_commit ( [String](class_string#class-string) msg, [String](class_string#class-string) author, [String](class_string#class-string) id, [int](class_int#class-int) unix\_timestamp, [int](class_int#class-int) offset\_minutes ) Helper function to create a commit [Dictionary](class_dictionary#class-dictionary) item. `msg` is the commit message of the commit. `author` is a single human-readable string containing all the author's details, e.g. the email and name configured in the VCS. `id` is the identifier of the commit, in whichever format your VCS may provide an identifier to commits. `unix_timestamp` is the UTC Unix timestamp of when the commit was created. `offset_minutes` is the timezone offset in minutes, recorded from the system timezone where the commit was created. ### [Dictionary](class_dictionary#class-dictionary) create\_diff\_file ( [String](class_string#class-string) new\_file, [String](class_string#class-string) old\_file ) Helper function to create a `Dictionary` for storing old and new diff file paths. ### [Dictionary](class_dictionary#class-dictionary) create\_diff\_hunk ( [int](class_int#class-int) old\_start, [int](class_int#class-int) new\_start, [int](class_int#class-int) old\_lines, [int](class_int#class-int) new\_lines ) Helper function to create a `Dictionary` for storing diff hunk data. `old_start` is the starting line number in old file. `new_start` is the starting line number in new file. `old_lines` is the number of lines in the old file. `new_lines` is the number of lines in the new file. ### [Dictionary](class_dictionary#class-dictionary) create\_diff\_line ( [int](class_int#class-int) new\_line\_no, [int](class_int#class-int) old\_line\_no, [String](class_string#class-string) content, [String](class_string#class-string) status ) Helper function to create a `Dictionary` for storing a line diff. `new_line_no` is the line number in the new file (can be `-1` if the line is deleted). `old_line_no` is the line number in the old file (can be `-1` if the line is added). `content` is the diff text. `status` is a single character string which stores the line origin. ### [Dictionary](class_dictionary#class-dictionary) create\_status\_file ( [String](class_string#class-string) file\_path, [ChangeType](#enum-editorvcsinterface-changetype) change\_type, [TreeArea](#enum-editorvcsinterface-treearea) area ) Helper function to create a `Dictionary` used by editor to read the status of a file. ### void popup\_error ( [String](class_string#class-string) msg ) Pops up an error message in the edior. godot RichTextLabel RichTextLabel ============= **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Label that displays rich text. Description ----------- Rich text can contain custom text, fonts, images and some basic formatting. The label manages these as an internal tag stack. It also adapts itself to given width/heights. **Note:** Assignments to [bbcode\_text](#class-richtextlabel-property-bbcode-text) clear the tag stack and reconstruct it from the property's contents. Any edits made to [bbcode\_text](#class-richtextlabel-property-bbcode-text) will erase previous edits made from other manual sources such as [append\_bbcode](#class-richtextlabel-method-append-bbcode) and the `push_*` / [pop](#class-richtextlabel-method-pop) methods. **Note:** RichTextLabel doesn't support entangled BBCode tags. For example, instead of using `[b]bold[i]bold italic[/b]italic[/i]`, use `[b]bold[i]bold italic[/i][/b][i]italic[/i]`. **Note:** `push_*/pop` functions won't affect BBCode. **Note:** Unlike [Label](class_label#class-label), RichTextLabel doesn't have a *property* to horizontally align text to the center. Instead, enable [bbcode\_enabled](#class-richtextlabel-property-bbcode-enabled) and surround the text in a `[center]` tag as follows: `[center]Example[/center]`. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the [fit\_content\_height](#class-richtextlabel-property-fit-content-height) property. **Note:** Unicode characters after `0xffff` (such as most emoji) are *not* supported on Windows. They will display as unknown characters instead. This will be resolved in Godot 4.0. Tutorials --------- * [BBCode in RichTextLabel](https://docs.godotengine.org/en/3.5/tutorials/ui/bbcode_in_richtextlabel.html) * [GUI Rich Text/BBcode Demo](https://godotengine.org/asset-library/asset/132) * [OS Test Demo](https://godotengine.org/asset-library/asset/677) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [bbcode\_enabled](#class-richtextlabel-property-bbcode-enabled) | `false` | | [String](class_string#class-string) | [bbcode\_text](#class-richtextlabel-property-bbcode-text) | `""` | | [Array](class_array#class-array) | [custom\_effects](#class-richtextlabel-property-custom-effects) | `[  ]` | | [bool](class_bool#class-bool) | [deselect\_on\_focus\_loss\_enabled](#class-richtextlabel-property-deselect-on-focus-loss-enabled) | `true` | | [bool](class_bool#class-bool) | [fit\_content\_height](#class-richtextlabel-property-fit-content-height) | `false` | | [bool](class_bool#class-bool) | [meta\_underlined](#class-richtextlabel-property-meta-underlined) | `true` | | [bool](class_bool#class-bool) | [override\_selected\_font\_color](#class-richtextlabel-property-override-selected-font-color) | `false` | | [float](class_float#class-float) | [percent\_visible](#class-richtextlabel-property-percent-visible) | `1.0` | | [bool](class_bool#class-bool) | rect\_clip\_content | `true` (overrides [Control](class_control#class-control-property-rect-clip-content)) | | [bool](class_bool#class-bool) | [scroll\_active](#class-richtextlabel-property-scroll-active) | `true` | | [bool](class_bool#class-bool) | [scroll\_following](#class-richtextlabel-property-scroll-following) | `false` | | [bool](class_bool#class-bool) | [selection\_enabled](#class-richtextlabel-property-selection-enabled) | `false` | | [int](class_int#class-int) | [tab\_size](#class-richtextlabel-property-tab-size) | `4` | | [String](class_string#class-string) | [text](#class-richtextlabel-property-text) | `""` | | [int](class_int#class-int) | [visible\_characters](#class-richtextlabel-property-visible-characters) | `-1` | Methods ------- | | | | --- | --- | | void | [add\_image](#class-richtextlabel-method-add-image) **(** [Texture](class_texture#class-texture) image, [int](class_int#class-int) width=0, [int](class_int#class-int) height=0, [InlineAlign](#enum-richtextlabel-inlinealign) align=2 **)** | | void | [add\_text](#class-richtextlabel-method-add-text) **(** [String](class_string#class-string) text **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [append\_bbcode](#class-richtextlabel-method-append-bbcode) **(** [String](class_string#class-string) bbcode **)** | | void | [clear](#class-richtextlabel-method-clear) **(** **)** | | void | [deselect](#class-richtextlabel-method-deselect) **(** **)** | | [int](class_int#class-int) | [get\_content\_height](#class-richtextlabel-method-get-content-height) **(** **)** const | | [int](class_int#class-int) | [get\_line\_count](#class-richtextlabel-method-get-line-count) **(** **)** const | | [String](class_string#class-string) | [get\_selected\_text](#class-richtextlabel-method-get-selected-text) **(** **)** | | [int](class_int#class-int) | [get\_total\_character\_count](#class-richtextlabel-method-get-total-character-count) **(** **)** const | | [VScrollBar](class_vscrollbar#class-vscrollbar) | [get\_v\_scroll](#class-richtextlabel-method-get-v-scroll) **(** **)** | | [int](class_int#class-int) | [get\_visible\_line\_count](#class-richtextlabel-method-get-visible-line-count) **(** **)** const | | void | [install\_effect](#class-richtextlabel-method-install-effect) **(** [Variant](class_variant#class-variant) effect **)** | | void | [newline](#class-richtextlabel-method-newline) **(** **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [parse\_bbcode](#class-richtextlabel-method-parse-bbcode) **(** [String](class_string#class-string) bbcode **)** | | [Dictionary](class_dictionary#class-dictionary) | [parse\_expressions\_for\_values](#class-richtextlabel-method-parse-expressions-for-values) **(** [PoolStringArray](class_poolstringarray#class-poolstringarray) expressions **)** | | void | [pop](#class-richtextlabel-method-pop) **(** **)** | | void | [push\_align](#class-richtextlabel-method-push-align) **(** [Align](#enum-richtextlabel-align) align **)** | | void | [push\_bold](#class-richtextlabel-method-push-bold) **(** **)** | | void | [push\_bold\_italics](#class-richtextlabel-method-push-bold-italics) **(** **)** | | void | [push\_cell](#class-richtextlabel-method-push-cell) **(** **)** | | void | [push\_color](#class-richtextlabel-method-push-color) **(** [Color](class_color#class-color) color **)** | | void | [push\_font](#class-richtextlabel-method-push-font) **(** [Font](class_font#class-font) font **)** | | void | [push\_indent](#class-richtextlabel-method-push-indent) **(** [int](class_int#class-int) level **)** | | void | [push\_italics](#class-richtextlabel-method-push-italics) **(** **)** | | void | [push\_list](#class-richtextlabel-method-push-list) **(** [ListType](#enum-richtextlabel-listtype) type **)** | | void | [push\_meta](#class-richtextlabel-method-push-meta) **(** [Variant](class_variant#class-variant) data **)** | | void | [push\_mono](#class-richtextlabel-method-push-mono) **(** **)** | | void | [push\_normal](#class-richtextlabel-method-push-normal) **(** **)** | | void | [push\_strikethrough](#class-richtextlabel-method-push-strikethrough) **(** **)** | | void | [push\_table](#class-richtextlabel-method-push-table) **(** [int](class_int#class-int) columns **)** | | void | [push\_underline](#class-richtextlabel-method-push-underline) **(** **)** | | [bool](class_bool#class-bool) | [remove\_line](#class-richtextlabel-method-remove-line) **(** [int](class_int#class-int) line **)** | | void | [scroll\_to\_line](#class-richtextlabel-method-scroll-to-line) **(** [int](class_int#class-int) line **)** | | void | [set\_table\_column\_expand](#class-richtextlabel-method-set-table-column-expand) **(** [int](class_int#class-int) column, [bool](class_bool#class-bool) expand, [int](class_int#class-int) ratio **)** | Theme Properties ---------------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [default\_color](#class-richtextlabel-theme-color-default-color) | `Color( 1, 1, 1, 1 )` | | [Color](class_color#class-color) | [font\_color\_selected](#class-richtextlabel-theme-color-font-color-selected) | `Color( 0.49, 0.49, 0.49, 1 )` | | [Color](class_color#class-color) | [font\_color\_shadow](#class-richtextlabel-theme-color-font-color-shadow) | `Color( 0, 0, 0, 0 )` | | [Color](class_color#class-color) | [selection\_color](#class-richtextlabel-theme-color-selection-color) | `Color( 0.1, 0.1, 1, 0.8 )` | | [int](class_int#class-int) | [line\_separation](#class-richtextlabel-theme-constant-line-separation) | `1` | | [int](class_int#class-int) | [shadow\_as\_outline](#class-richtextlabel-theme-constant-shadow-as-outline) | `0` | | [int](class_int#class-int) | [shadow\_offset\_x](#class-richtextlabel-theme-constant-shadow-offset-x) | `1` | | [int](class_int#class-int) | [shadow\_offset\_y](#class-richtextlabel-theme-constant-shadow-offset-y) | `1` | | [int](class_int#class-int) | [table\_hseparation](#class-richtextlabel-theme-constant-table-hseparation) | `3` | | [int](class_int#class-int) | [table\_vseparation](#class-richtextlabel-theme-constant-table-vseparation) | `3` | | [Font](class_font#class-font) | [bold\_font](#class-richtextlabel-theme-font-bold-font) | | | [Font](class_font#class-font) | [bold\_italics\_font](#class-richtextlabel-theme-font-bold-italics-font) | | | [Font](class_font#class-font) | [italics\_font](#class-richtextlabel-theme-font-italics-font) | | | [Font](class_font#class-font) | [mono\_font](#class-richtextlabel-theme-font-mono-font) | | | [Font](class_font#class-font) | [normal\_font](#class-richtextlabel-theme-font-normal-font) | | | [StyleBox](class_stylebox#class-stylebox) | [focus](#class-richtextlabel-theme-style-focus) | | | [StyleBox](class_stylebox#class-stylebox) | [normal](#class-richtextlabel-theme-style-normal) | | Signals ------- ### meta\_clicked ( [Variant](class_variant#class-variant) meta ) Triggered when the user clicks on content between meta tags. If the meta is defined in text, e.g. `[url={"data"="hi"}]hi[/url]`, then the parameter for this signal will be a [String](class_string#class-string) type. If a particular type or an object is desired, the [push\_meta](#class-richtextlabel-method-push-meta) method must be used to manually insert the data into the tag stack. ### meta\_hover\_ended ( [Variant](class_variant#class-variant) meta ) Triggers when the mouse exits a meta tag. ### meta\_hover\_started ( [Variant](class_variant#class-variant) meta ) Triggers when the mouse enters a meta tag. Enumerations ------------ enum **Align**: * **ALIGN\_LEFT** = **0** --- Makes text left aligned. * **ALIGN\_CENTER** = **1** --- Makes text centered. * **ALIGN\_RIGHT** = **2** --- Makes text right aligned. * **ALIGN\_FILL** = **3** --- Makes text fill width. enum **InlineAlign**: * **INLINE\_ALIGN\_TOP** = **0** --- Aligns top of the inline image to the top of the text. * **INLINE\_ALIGN\_CENTER** = **1** --- Aligns center of the inline image to the center of the text. * **INLINE\_ALIGN\_BASELINE** = **2** --- Aligns bottom of the inline image to the baseline of the text. * **INLINE\_ALIGN\_BOTTOM** = **3** --- Aligns bottom of the inline image to the bottom of the text. enum **ListType**: * **LIST\_NUMBERS** = **0** --- Each list item has a number marker. * **LIST\_LETTERS** = **1** --- Each list item has a letter marker. * **LIST\_DOTS** = **2** --- Each list item has a filled circle marker. enum **ItemType**: * **ITEM\_FRAME** = **0** * **ITEM\_TEXT** = **1** * **ITEM\_IMAGE** = **2** * **ITEM\_NEWLINE** = **3** * **ITEM\_FONT** = **4** * **ITEM\_COLOR** = **5** * **ITEM\_UNDERLINE** = **6** * **ITEM\_STRIKETHROUGH** = **7** * **ITEM\_ALIGN** = **8** * **ITEM\_INDENT** = **9** * **ITEM\_LIST** = **10** * **ITEM\_TABLE** = **11** * **ITEM\_FADE** = **12** * **ITEM\_SHAKE** = **13** * **ITEM\_WAVE** = **14** * **ITEM\_TORNADO** = **15** * **ITEM\_RAINBOW** = **16** * **ITEM\_CUSTOMFX** = **18** * **ITEM\_META** = **17** Property Descriptions --------------------- ### [bool](class_bool#class-bool) bbcode\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_bbcode(value) | | *Getter* | is\_using\_bbcode() | If `true`, the label uses BBCode formatting. **Note:** Trying to alter the `RichTextLabel`'s text with [add\_text](#class-richtextlabel-method-add-text) will reset this to `false`. Use instead [append\_bbcode](#class-richtextlabel-method-append-bbcode) to preserve BBCode formatting. ### [String](class_string#class-string) bbcode\_text | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_bbcode(value) | | *Getter* | get\_bbcode() | The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited. **Note:** It is unadvised to use the `+=` operator with `bbcode_text` (e.g. `bbcode_text += "some string"`) as it replaces the whole text and can cause slowdowns. It will also erase all BBCode that was added to stack using `push_*` methods. Use [append\_bbcode](#class-richtextlabel-method-append-bbcode) for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call. ### [Array](class_array#class-array) custom\_effects | | | | --- | --- | | *Default* | `[  ]` | | *Setter* | set\_effects(value) | | *Getter* | get\_effects() | The currently installed custom effects. This is an array of [RichTextEffect](class_richtexteffect#class-richtexteffect)s. To add a custom effect, it's more convenient to use [install\_effect](#class-richtextlabel-method-install-effect). ### [bool](class_bool#class-bool) deselect\_on\_focus\_loss\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_deselect\_on\_focus\_loss\_enabled(value) | | *Getter* | is\_deselect\_on\_focus\_loss\_enabled() | If `true`, the selected text will be deselected when focus is lost. ### [bool](class_bool#class-bool) fit\_content\_height | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_fit\_content\_height(value) | | *Getter* | is\_fit\_content\_height\_enabled() | If `true`, the label's height will be automatically updated to fit its content. **Note:** This property is used as a workaround to fix issues with `RichTextLabel` in [Container](class_container#class-container)s, but it's unreliable in some cases and will be removed in future versions. ### [bool](class_bool#class-bool) meta\_underlined | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_meta\_underline(value) | | *Getter* | is\_meta\_underlined() | If `true`, the label underlines meta tags such as `[url]{text}[/url]`. ### [bool](class_bool#class-bool) override\_selected\_font\_color | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_override\_selected\_font\_color(value) | | *Getter* | is\_overriding\_selected\_font\_color() | If `true`, the label uses the custom font color. ### [float](class_float#class-float) percent\_visible | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_percent\_visible(value) | | *Getter* | get\_percent\_visible() | The range of characters to display, as a [float](class_float#class-float) between 0.0 and 1.0. When assigned an out of range value, it's the same as assigning 1.0. **Note:** Setting this property updates [visible\_characters](#class-richtextlabel-property-visible-characters) based on current [get\_total\_character\_count](#class-richtextlabel-method-get-total-character-count). ### [bool](class_bool#class-bool) scroll\_active | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_scroll\_active(value) | | *Getter* | is\_scroll\_active() | If `true`, the scrollbar is visible. Setting this to `false` does not block scrolling completely. See [scroll\_to\_line](#class-richtextlabel-method-scroll-to-line). ### [bool](class_bool#class-bool) scroll\_following | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_scroll\_follow(value) | | *Getter* | is\_scroll\_following() | If `true`, the window scrolls down to display new content automatically. ### [bool](class_bool#class-bool) selection\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_selection\_enabled(value) | | *Getter* | is\_selection\_enabled() | If `true`, the label allows text selection. ### [int](class_int#class-int) tab\_size | | | | --- | --- | | *Default* | `4` | | *Setter* | set\_tab\_size(value) | | *Getter* | get\_tab\_size() | The number of spaces associated with a single tab length. Does not affect `\t` in text tags, only indent tags. ### [String](class_string#class-string) text | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_text(value) | | *Getter* | get\_text() | The raw text of the label. When set, clears the tag stack and adds a raw text tag to the top of it. Does not parse BBCodes. Does not modify [bbcode\_text](#class-richtextlabel-property-bbcode-text). ### [int](class_int#class-int) visible\_characters | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_visible\_characters(value) | | *Getter* | get\_visible\_characters() | The restricted number of characters to display in the label. If `-1`, all characters will be displayed. **Note:** Setting this property updates [percent\_visible](#class-richtextlabel-property-percent-visible) based on current [get\_total\_character\_count](#class-richtextlabel-method-get-total-character-count). Method Descriptions ------------------- ### void add\_image ( [Texture](class_texture#class-texture) image, [int](class_int#class-int) width=0, [int](class_int#class-int) height=0, [InlineAlign](#enum-richtextlabel-inlinealign) align=2 ) Adds an image's opening and closing tags to the tag stack, optionally providing a `width` and `height` to resize the image. If `width` or `height` is set to 0, the image size will be adjusted in order to keep the original aspect ratio. ### void add\_text ( [String](class_string#class-string) text ) Adds raw non-BBCode-parsed text to the tag stack. ### [Error](class_%40globalscope#enum-globalscope-error) append\_bbcode ( [String](class_string#class-string) bbcode ) Parses `bbcode` and adds tags to the tag stack as needed. **Note:** Using this method, you can't close a tag that was opened in a previous [append\_bbcode](#class-richtextlabel-method-append-bbcode) call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the [bbcode\_text](#class-richtextlabel-property-bbcode-text) instead of using [append\_bbcode](#class-richtextlabel-method-append-bbcode). **Note:** This method internals' can't possibly fail, but an error code is returned for backwards compatibility, which will always be [@GlobalScope.OK](class_%40globalscope#class-globalscope-constant-ok). ### void clear ( ) Clears the tag stack and sets [bbcode\_text](#class-richtextlabel-property-bbcode-text) to an empty string. ### void deselect ( ) Clears the current selection. ### [int](class_int#class-int) get\_content\_height ( ) const Returns the height of the content. ### [int](class_int#class-int) get\_line\_count ( ) const Returns the total number of newlines in the tag stack's text tags. Considers wrapped text as one line. ### [String](class_string#class-string) get\_selected\_text ( ) Returns the current selection text. Does not include BBCodes. ### [int](class_int#class-int) get\_total\_character\_count ( ) const Returns the total number of characters from text tags. Does not include BBCodes. ### [VScrollBar](class_vscrollbar#class-vscrollbar) get\_v\_scroll ( ) Returns the vertical scrollbar. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. ### [int](class_int#class-int) get\_visible\_line\_count ( ) const Returns the number of visible lines. ### void install\_effect ( [Variant](class_variant#class-variant) effect ) Installs a custom effect. `effect` should be a valid [RichTextEffect](class_richtexteffect#class-richtexteffect). ### void newline ( ) Adds a newline tag to the tag stack. ### [Error](class_%40globalscope#enum-globalscope-error) parse\_bbcode ( [String](class_string#class-string) bbcode ) The assignment version of [append\_bbcode](#class-richtextlabel-method-append-bbcode). Clears the tag stack and inserts the new content. **Note:** This method internals' can't possibly fail, but an error code is returned for backwards compatibility, which will always be [@GlobalScope.OK](class_%40globalscope#class-globalscope-constant-ok). ### [Dictionary](class_dictionary#class-dictionary) parse\_expressions\_for\_values ( [PoolStringArray](class_poolstringarray#class-poolstringarray) expressions ) Parses BBCode parameter `expressions` into a dictionary. ### void pop ( ) Terminates the current tag. Use after `push_*` methods to close BBCodes manually. Does not need to follow `add_*` methods. ### void push\_align ( [Align](#enum-richtextlabel-align) align ) Adds an `[align]` tag based on the given `align` value. See [Align](#enum-richtextlabel-align) for possible values. ### void push\_bold ( ) Adds a `[font]` tag with a bold font to the tag stack. This is the same as adding a `[b]` tag if not currently in a `[i]` tag. ### void push\_bold\_italics ( ) Adds a `[font]` tag with a bold italics font to the tag stack. ### void push\_cell ( ) Adds a `[cell]` tag to the tag stack. Must be inside a `[table]` tag. See [push\_table](#class-richtextlabel-method-push-table) for details. ### void push\_color ( [Color](class_color#class-color) color ) Adds a `[color]` tag to the tag stack. ### void push\_font ( [Font](class_font#class-font) font ) Adds a `[font]` tag to the tag stack. Overrides default fonts for its duration. ### void push\_indent ( [int](class_int#class-int) level ) Adds an `[indent]` tag to the tag stack. Multiplies `level` by current [tab\_size](#class-richtextlabel-property-tab-size) to determine new margin length. ### void push\_italics ( ) Adds a `[font]` tag with a italics font to the tag stack. This is the same as adding a `[i]` tag if not currently in a `[b]` tag. ### void push\_list ( [ListType](#enum-richtextlabel-listtype) type ) Adds a `[list]` tag to the tag stack. Similar to the BBCodes `[ol]` or `[ul]`, but supports more list types. Not fully implemented! ### void push\_meta ( [Variant](class_variant#class-variant) data ) Adds a `[meta]` tag to the tag stack. Similar to the BBCode `[url=something]{text}[/url]`, but supports non-[String](class_string#class-string) metadata types. ### void push\_mono ( ) Adds a `[font]` tag with a monospace font to the tag stack. ### void push\_normal ( ) Adds a `[font]` tag with a normal font to the tag stack. ### void push\_strikethrough ( ) Adds a `[s]` tag to the tag stack. ### void push\_table ( [int](class_int#class-int) columns ) Adds a `[table=columns]` tag to the tag stack. ### void push\_underline ( ) Adds a `[u]` tag to the tag stack. ### [bool](class_bool#class-bool) remove\_line ( [int](class_int#class-int) line ) Removes a line of content from the label. Returns `true` if the line exists. The `line` argument is the index of the line to remove, it can take values in the interval `[0, get_line_count() - 1]`. ### void scroll\_to\_line ( [int](class_int#class-int) line ) Scrolls the window's top line to match `line`. ### void set\_table\_column\_expand ( [int](class_int#class-int) column, [bool](class_bool#class-bool) expand, [int](class_int#class-int) ratio ) Edits the selected column's expansion options. If `expand` is `true`, the column expands in proportion to its expansion ratio versus the other columns' ratios. For example, 2 columns with ratios 3 and 4 plus 70 pixels in available width would expand 30 and 40 pixels, respectively. If `expand` is `false`, the column will not contribute to the total ratio. Theme Property Descriptions --------------------------- ### [Color](class_color#class-color) default\_color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | The default text color. ### [Color](class_color#class-color) font\_color\_selected | | | | --- | --- | | *Default* | `Color( 0.49, 0.49, 0.49, 1 )` | The color of selected text, used when [selection\_enabled](#class-richtextlabel-property-selection-enabled) is `true`. ### [Color](class_color#class-color) font\_color\_shadow | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 0 )` | The color of the font's shadow. ### [Color](class_color#class-color) selection\_color | | | | --- | --- | | *Default* | `Color( 0.1, 0.1, 1, 0.8 )` | The color of the selection box. ### [int](class_int#class-int) line\_separation | | | | --- | --- | | *Default* | `1` | The vertical space between lines. ### [int](class_int#class-int) shadow\_as\_outline | | | | --- | --- | | *Default* | `0` | Boolean value. If 1 (`true`), the shadow will be displayed around the whole text as an outline. ### [int](class_int#class-int) shadow\_offset\_x | | | | --- | --- | | *Default* | `1` | The horizontal offset of the font's shadow. ### [int](class_int#class-int) shadow\_offset\_y | | | | --- | --- | | *Default* | `1` | The vertical offset of the font's shadow. ### [int](class_int#class-int) table\_hseparation | | | | --- | --- | | *Default* | `3` | The horizontal separation of elements in a table. ### [int](class_int#class-int) table\_vseparation | | | | --- | --- | | *Default* | `3` | The vertical separation of elements in a table. ### [Font](class_font#class-font) bold\_font The font used for bold text. ### [Font](class_font#class-font) bold\_italics\_font The font used for bold italics text. ### [Font](class_font#class-font) italics\_font The font used for italics text. ### [Font](class_font#class-font) mono\_font The font used for monospace text. ### [Font](class_font#class-font) normal\_font The default text font. ### [StyleBox](class_stylebox#class-stylebox) focus The background used when the `RichTextLabel` is focused. ### [StyleBox](class_stylebox#class-stylebox) normal The normal background for the `RichTextLabel`.
programming_docs
godot VisualShaderNodeTransformUniform VisualShaderNodeTransformUniform ================================ **Inherits:** [VisualShaderNodeUniform](class_visualshadernodeuniform#class-visualshadernodeuniform) **<** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A [Transform](class_transform#class-transform) uniform for use within the visual shader graph. Description ----------- Translated to `uniform mat4` in the shader language. Properties ---------- | | | | | --- | --- | --- | | [Transform](class_transform#class-transform) | [default\_value](#class-visualshadernodetransformuniform-property-default-value) | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | | [bool](class_bool#class-bool) | [default\_value\_enabled](#class-visualshadernodetransformuniform-property-default-value-enabled) | `false` | Property Descriptions --------------------- ### [Transform](class_transform#class-transform) default\_value | | | | --- | --- | | *Default* | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | | *Setter* | set\_default\_value(value) | | *Getter* | get\_default\_value() | A default value to be assigned within the shader. ### [bool](class_bool#class-bool) default\_value\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_default\_value\_enabled(value) | | *Getter* | is\_default\_value\_enabled() | Enables usage of the [default\_value](#class-visualshadernodetransformuniform-property-default-value). godot VisualShaderNode VisualShaderNode ================ **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [VisualShaderNodeBooleanConstant](class_visualshadernodebooleanconstant#class-visualshadernodebooleanconstant), [VisualShaderNodeColorConstant](class_visualshadernodecolorconstant#class-visualshadernodecolorconstant), [VisualShaderNodeColorFunc](class_visualshadernodecolorfunc#class-visualshadernodecolorfunc), [VisualShaderNodeColorOp](class_visualshadernodecolorop#class-visualshadernodecolorop), [VisualShaderNodeCompare](class_visualshadernodecompare#class-visualshadernodecompare), [VisualShaderNodeCubeMap](class_visualshadernodecubemap#class-visualshadernodecubemap), [VisualShaderNodeCustom](class_visualshadernodecustom#class-visualshadernodecustom), [VisualShaderNodeDeterminant](class_visualshadernodedeterminant#class-visualshadernodedeterminant), [VisualShaderNodeDotProduct](class_visualshadernodedotproduct#class-visualshadernodedotproduct), [VisualShaderNodeFaceForward](class_visualshadernodefaceforward#class-visualshadernodefaceforward), [VisualShaderNodeFresnel](class_visualshadernodefresnel#class-visualshadernodefresnel), [VisualShaderNodeGroupBase](class_visualshadernodegroupbase#class-visualshadernodegroupbase), [VisualShaderNodeIf](class_visualshadernodeif#class-visualshadernodeif), [VisualShaderNodeInput](class_visualshadernodeinput#class-visualshadernodeinput), [VisualShaderNodeIs](class_visualshadernodeis#class-visualshadernodeis), [VisualShaderNodeOuterProduct](class_visualshadernodeouterproduct#class-visualshadernodeouterproduct), [VisualShaderNodeOutput](class_visualshadernodeoutput#class-visualshadernodeoutput), [VisualShaderNodeScalarClamp](class_visualshadernodescalarclamp#class-visualshadernodescalarclamp), [VisualShaderNodeScalarConstant](class_visualshadernodescalarconstant#class-visualshadernodescalarconstant), [VisualShaderNodeScalarDerivativeFunc](class_visualshadernodescalarderivativefunc#class-visualshadernodescalarderivativefunc), [VisualShaderNodeScalarFunc](class_visualshadernodescalarfunc#class-visualshadernodescalarfunc), [VisualShaderNodeScalarInterp](class_visualshadernodescalarinterp#class-visualshadernodescalarinterp), [VisualShaderNodeScalarOp](class_visualshadernodescalarop#class-visualshadernodescalarop), [VisualShaderNodeScalarSmoothStep](class_visualshadernodescalarsmoothstep#class-visualshadernodescalarsmoothstep), [VisualShaderNodeSwitch](class_visualshadernodeswitch#class-visualshadernodeswitch), [VisualShaderNodeTexture](class_visualshadernodetexture#class-visualshadernodetexture), [VisualShaderNodeTransformCompose](class_visualshadernodetransformcompose#class-visualshadernodetransformcompose), [VisualShaderNodeTransformConstant](class_visualshadernodetransformconstant#class-visualshadernodetransformconstant), [VisualShaderNodeTransformDecompose](class_visualshadernodetransformdecompose#class-visualshadernodetransformdecompose), [VisualShaderNodeTransformFunc](class_visualshadernodetransformfunc#class-visualshadernodetransformfunc), [VisualShaderNodeTransformMult](class_visualshadernodetransformmult#class-visualshadernodetransformmult), [VisualShaderNodeTransformVecMult](class_visualshadernodetransformvecmult#class-visualshadernodetransformvecmult), [VisualShaderNodeUniform](class_visualshadernodeuniform#class-visualshadernodeuniform), [VisualShaderNodeUniformRef](class_visualshadernodeuniformref#class-visualshadernodeuniformref), [VisualShaderNodeVec3Constant](class_visualshadernodevec3constant#class-visualshadernodevec3constant), [VisualShaderNodeVectorClamp](class_visualshadernodevectorclamp#class-visualshadernodevectorclamp), [VisualShaderNodeVectorCompose](class_visualshadernodevectorcompose#class-visualshadernodevectorcompose), [VisualShaderNodeVectorDecompose](class_visualshadernodevectordecompose#class-visualshadernodevectordecompose), [VisualShaderNodeVectorDerivativeFunc](class_visualshadernodevectorderivativefunc#class-visualshadernodevectorderivativefunc), [VisualShaderNodeVectorDistance](class_visualshadernodevectordistance#class-visualshadernodevectordistance), [VisualShaderNodeVectorFunc](class_visualshadernodevectorfunc#class-visualshadernodevectorfunc), [VisualShaderNodeVectorInterp](class_visualshadernodevectorinterp#class-visualshadernodevectorinterp), [VisualShaderNodeVectorLen](class_visualshadernodevectorlen#class-visualshadernodevectorlen), [VisualShaderNodeVectorOp](class_visualshadernodevectorop#class-visualshadernodevectorop), [VisualShaderNodeVectorRefract](class_visualshadernodevectorrefract#class-visualshadernodevectorrefract), [VisualShaderNodeVectorScalarMix](class_visualshadernodevectorscalarmix#class-visualshadernodevectorscalarmix), [VisualShaderNodeVectorScalarSmoothStep](class_visualshadernodevectorscalarsmoothstep#class-visualshadernodevectorscalarsmoothstep), [VisualShaderNodeVectorScalarStep](class_visualshadernodevectorscalarstep#class-visualshadernodevectorscalarstep), [VisualShaderNodeVectorSmoothStep](class_visualshadernodevectorsmoothstep#class-visualshadernodevectorsmoothstep) Base class for nodes in a visual shader graph. Description ----------- Visual shader graphs consist of various nodes. Each node in the graph is a separate object and they are represented as a rectangular boxes with title and a set of properties. Each node has also connection ports that allow to connect it to another nodes and control the flow of the shader. Tutorials --------- * [Using VisualShaders](https://docs.godotengine.org/en/3.5/tutorials/shaders/visual_shaders.html) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [output\_port\_for\_preview](#class-visualshadernode-property-output-port-for-preview) | `-1` | Methods ------- | | | | --- | --- | | [Array](class_array#class-array) | [get\_default\_input\_values](#class-visualshadernode-method-get-default-input-values) **(** **)** const | | [Variant](class_variant#class-variant) | [get\_input\_port\_default\_value](#class-visualshadernode-method-get-input-port-default-value) **(** [int](class_int#class-int) port **)** const | | void | [set\_default\_input\_values](#class-visualshadernode-method-set-default-input-values) **(** [Array](class_array#class-array) values **)** | | void | [set\_input\_port\_default\_value](#class-visualshadernode-method-set-input-port-default-value) **(** [int](class_int#class-int) port, [Variant](class_variant#class-variant) value **)** | Signals ------- ### editor\_refresh\_request ( ) Emitted when the node requests an editor refresh. Currently called only in setter of [VisualShaderNodeTexture.source](class_visualshadernodetexture#class-visualshadernodetexture-property-source), [VisualShaderNodeTexture](class_visualshadernodetexture#class-visualshadernodetexture), and [VisualShaderNodeCubeMap](class_visualshadernodecubemap#class-visualshadernodecubemap) (and their derivatives). Enumerations ------------ enum **PortType**: * **PORT\_TYPE\_SCALAR** = **0** --- Floating-point scalar. Translated to `float` type in shader code. * **PORT\_TYPE\_VECTOR** = **1** --- 3D vector of floating-point values. Translated to `vec3` type in shader code. * **PORT\_TYPE\_BOOLEAN** = **2** --- Boolean type. Translated to `bool` type in shader code. * **PORT\_TYPE\_TRANSFORM** = **3** --- Transform type. Translated to `mat4` type in shader code. * **PORT\_TYPE\_SAMPLER** = **4** --- Sampler type. Translated to reference of sampler uniform in shader code. Can only be used for input ports in non-uniform nodes. * **PORT\_TYPE\_MAX** = **5** --- Represents the size of the [PortType](#enum-visualshadernode-porttype) enum. Property Descriptions --------------------- ### [int](class_int#class-int) output\_port\_for\_preview | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_output\_port\_for\_preview(value) | | *Getter* | get\_output\_port\_for\_preview() | Sets the output port index which will be showed for preview. If set to `-1` no port will be open for preview. Method Descriptions ------------------- ### [Array](class_array#class-array) get\_default\_input\_values ( ) const Returns an [Array](class_array#class-array) containing default values for all of the input ports of the node in the form `[index0, value0, index1, value1, ...]`. ### [Variant](class_variant#class-variant) get\_input\_port\_default\_value ( [int](class_int#class-int) port ) const Returns the default value of the input `port`. ### void set\_default\_input\_values ( [Array](class_array#class-array) values ) Sets the default input ports values using an [Array](class_array#class-array) of the form `[index0, value0, index1, value1, ...]`. For example: `[0, Vector3(0, 0, 0), 1, Vector3(0, 0, 0)]`. ### void set\_input\_port\_default\_value ( [int](class_int#class-int) port, [Variant](class_variant#class-variant) value ) Sets the default value for the selected input `port`. godot Transform Transform ========= 3D transformation (3×4 matrix). Description ----------- 3×4 matrix (3 rows, 4 columns) used for 3D linear transformations. It can represent transformations such as translation, rotation, or scaling. It consists of a [basis](#class-transform-property-basis) (first 3 columns) and a [Vector3](class_vector3#class-vector3) for the [origin](#class-transform-property-origin) (last column). For more information, read the "Matrices and transforms" documentation article. Tutorials --------- * [Math tutorial index](https://docs.godotengine.org/en/3.5/tutorials/math/index.html) * [Matrices and transforms](https://docs.godotengine.org/en/3.5/tutorials/math/matrices_and_transforms.html) * [Using 3D transforms](https://docs.godotengine.org/en/3.5/tutorials/3d/using_transforms.html) * [Matrix Transform Demo](https://godotengine.org/asset-library/asset/584) * [3D Platformer Demo](https://godotengine.org/asset-library/asset/125) * [2.5D Demo](https://godotengine.org/asset-library/asset/583) Properties ---------- | | | | | --- | --- | --- | | [Basis](class_basis#class-basis) | [basis](#class-transform-property-basis) | `Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )` | | [Vector3](class_vector3#class-vector3) | [origin](#class-transform-property-origin) | `Vector3( 0, 0, 0 )` | Methods ------- | | | | --- | --- | | [Transform](#class-transform) | [Transform](#class-transform-method-transform) **(** [Vector3](class_vector3#class-vector3) x\_axis, [Vector3](class_vector3#class-vector3) y\_axis, [Vector3](class_vector3#class-vector3) z\_axis, [Vector3](class_vector3#class-vector3) origin **)** | | [Transform](#class-transform) | [Transform](#class-transform-method-transform) **(** [Basis](class_basis#class-basis) basis, [Vector3](class_vector3#class-vector3) origin **)** | | [Transform](#class-transform) | [Transform](#class-transform-method-transform) **(** [Transform2D](class_transform2d#class-transform2d) from **)** | | [Transform](#class-transform) | [Transform](#class-transform-method-transform) **(** [Quat](class_quat#class-quat) from **)** | | [Transform](#class-transform) | [Transform](#class-transform-method-transform) **(** [Basis](class_basis#class-basis) from **)** | | [Transform](#class-transform) | [affine\_inverse](#class-transform-method-affine-inverse) **(** **)** | | [Transform](#class-transform) | [interpolate\_with](#class-transform-method-interpolate-with) **(** [Transform](#class-transform) transform, [float](class_float#class-float) weight **)** | | [Transform](#class-transform) | [inverse](#class-transform-method-inverse) **(** **)** | | [bool](class_bool#class-bool) | [is\_equal\_approx](#class-transform-method-is-equal-approx) **(** [Transform](#class-transform) transform **)** | | [Transform](#class-transform) | [looking\_at](#class-transform-method-looking-at) **(** [Vector3](class_vector3#class-vector3) target, [Vector3](class_vector3#class-vector3) up **)** | | [Transform](#class-transform) | [orthonormalized](#class-transform-method-orthonormalized) **(** **)** | | [Transform](#class-transform) | [rotated](#class-transform-method-rotated) **(** [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle **)** | | [Transform](#class-transform) | [scaled](#class-transform-method-scaled) **(** [Vector3](class_vector3#class-vector3) scale **)** | | [Transform](#class-transform) | [translated](#class-transform-method-translated) **(** [Vector3](class_vector3#class-vector3) offset **)** | | [Variant](class_variant#class-variant) | [xform](#class-transform-method-xform) **(** [Variant](class_variant#class-variant) v **)** | | [Variant](class_variant#class-variant) | [xform\_inv](#class-transform-method-xform-inv) **(** [Variant](class_variant#class-variant) v **)** | Constants --------- * **IDENTITY** = **Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )** --- `Transform` with no translation, rotation or scaling applied. When applied to other data structures, [IDENTITY](#class-transform-constant-identity) performs no transformation. * **FLIP\_X** = **Transform( -1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )** --- `Transform` with mirroring applied perpendicular to the YZ plane. * **FLIP\_Y** = **Transform( 1, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0 )** --- `Transform` with mirroring applied perpendicular to the XZ plane. * **FLIP\_Z** = **Transform( 1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0 )** --- `Transform` with mirroring applied perpendicular to the XY plane. Property Descriptions --------------------- ### [Basis](class_basis#class-basis) basis | | | | --- | --- | | *Default* | `Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )` | The basis is a matrix containing 3 [Vector3](class_vector3#class-vector3) as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object. ### [Vector3](class_vector3#class-vector3) origin | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | The translation offset of the transform (column 3, the fourth column). Equivalent to array index `3`. Method Descriptions ------------------- ### [Transform](#class-transform) Transform ( [Vector3](class_vector3#class-vector3) x\_axis, [Vector3](class_vector3#class-vector3) y\_axis, [Vector3](class_vector3#class-vector3) z\_axis, [Vector3](class_vector3#class-vector3) origin ) Constructs a Transform from four [Vector3](class_vector3#class-vector3) values (matrix columns). Each axis corresponds to local basis vectors (some of which may be scaled). * [Transform](#class-transform) **Transform** **(** [Basis](class_basis#class-basis) basis, [Vector3](class_vector3#class-vector3) origin **)** Constructs a Transform from a [Basis](class_basis#class-basis) and [Vector3](class_vector3#class-vector3). * [Transform](#class-transform) **Transform** **(** [Transform2D](class_transform2d#class-transform2d) from **)** Constructs a Transform from a [Transform2D](class_transform2d#class-transform2d). * [Transform](#class-transform) **Transform** **(** [Quat](class_quat#class-quat) from **)** Constructs a Transform from a [Quat](class_quat#class-quat). The origin will be `Vector3(0, 0, 0)`. * [Transform](#class-transform) **Transform** **(** [Basis](class_basis#class-basis) from **)** Constructs the Transform from a [Basis](class_basis#class-basis). The origin will be Vector3(0, 0, 0). ### [Transform](#class-transform) affine\_inverse ( ) Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling and translation. ### [Transform](#class-transform) interpolate\_with ( [Transform](#class-transform) transform, [float](class_float#class-float) weight ) Returns a transform interpolated between this transform and another by a given `weight` (on the range of 0.0 to 1.0). ### [Transform](#class-transform) inverse ( ) Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use [affine\_inverse](#class-transform-method-affine-inverse) for transforms with scaling). ### [bool](class_bool#class-bool) is\_equal\_approx ( [Transform](#class-transform) transform ) Returns `true` if this transform and `transform` are approximately equal, by calling `is_equal_approx` on each component. ### [Transform](#class-transform) looking\_at ( [Vector3](class_vector3#class-vector3) target, [Vector3](class_vector3#class-vector3) up ) Returns a copy of the transform rotated such that its -Z axis points towards the `target` position. The transform will first be rotated around the given `up` vector, and then fully aligned to the target by a further rotation around an axis perpendicular to both the `target` and `up` vectors. Operations take place in global space. ### [Transform](#class-transform) orthonormalized ( ) Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors (scale of 1 or -1). ### [Transform](#class-transform) rotated ( [Vector3](class_vector3#class-vector3) axis, [float](class_float#class-float) angle ) Returns a copy of the transform rotated around the given `axis` by the given `angle` (in radians), using matrix multiplication. The `axis` must be a normalized vector. ### [Transform](#class-transform) scaled ( [Vector3](class_vector3#class-vector3) scale ) Returns a copy of the transform with its basis and origin scaled by the given `scale` factor, using matrix multiplication. ### [Transform](#class-transform) translated ( [Vector3](class_vector3#class-vector3) offset ) Returns a copy of the transform translated by the given `offset`, relative to the transform's basis vectors. Unlike [rotated](#class-transform-method-rotated) and [scaled](#class-transform-method-scaled), this does not use matrix multiplication. ### [Variant](class_variant#class-variant) xform ( [Variant](class_variant#class-variant) v ) Transforms the given [Vector3](class_vector3#class-vector3), [Plane](class_plane#class-plane), [AABB](class_aabb#class-aabb), or [PoolVector3Array](class_poolvector3array#class-poolvector3array) by this transform. ### [Variant](class_variant#class-variant) xform\_inv ( [Variant](class_variant#class-variant) v ) Inverse-transforms the given [Vector3](class_vector3#class-vector3), [Plane](class_plane#class-plane), [AABB](class_aabb#class-aabb), or [PoolVector3Array](class_poolvector3array#class-poolvector3array) by this transform, under the assumption that the transformation is composed of rotation and translation (no scaling). Equivalent to calling `inverse().xform(v)` on this transform. For affine transformations (e.g. with scaling) see [affine\_inverse](#class-transform-method-affine-inverse) method.
programming_docs
godot AnimationNodeBlend3 AnimationNodeBlend3 =================== **Inherits:** [AnimationNode](class_animationnode#class-animationnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Blends two of three animations linearly inside of an [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). Description ----------- A resource to add to an [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). Blends two animations together linearly out of three based on a value in the `[-1.0, 1.0]` range. This node has three inputs: * The base animation * A -blend animation to blend with when the blend amount is in the `[-1.0, 0.0]` range. * A +blend animation to blend with when the blend amount is in the `[0.0, 1.0]` range Tutorials --------- * [Using AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [sync](#class-animationnodeblend3-property-sync) | `false` | Property Descriptions --------------------- ### [bool](class_bool#class-bool) sync | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_sync(value) | | *Getter* | is\_using\_sync() | If `true`, sets the `optimization` to `false` when calling [AnimationNode.blend\_input](class_animationnode#class-animationnode-method-blend-input), forcing the blended animations to update every frame. godot GIProbeData GIProbeData =========== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Tutorials --------- * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [bias](#class-giprobedata-property-bias) | `0.4` | | [AABB](class_aabb#class-aabb) | [bounds](#class-giprobedata-property-bounds) | `AABB( 0, 0, 0, 1, 1, 1 )` | | [float](class_float#class-float) | [cell\_size](#class-giprobedata-property-cell-size) | `1.0` | | [bool](class_bool#class-bool) | [compress](#class-giprobedata-property-compress) | `false` | | [PoolIntArray](class_poolintarray#class-poolintarray) | [dynamic\_data](#class-giprobedata-property-dynamic-data) | `PoolIntArray(  )` | | [int](class_int#class-int) | [dynamic\_range](#class-giprobedata-property-dynamic-range) | `1` | | [float](class_float#class-float) | [energy](#class-giprobedata-property-energy) | `1.0` | | [bool](class_bool#class-bool) | [interior](#class-giprobedata-property-interior) | `false` | | [float](class_float#class-float) | [normal\_bias](#class-giprobedata-property-normal-bias) | `0.4` | | [float](class_float#class-float) | [propagation](#class-giprobedata-property-propagation) | `1.0` | | [Transform](class_transform#class-transform) | [to\_cell\_xform](#class-giprobedata-property-to-cell-xform) | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | Property Descriptions --------------------- ### [float](class_float#class-float) bias | | | | --- | --- | | *Default* | `0.4` | | *Setter* | set\_bias(value) | | *Getter* | get\_bias() | ### [AABB](class_aabb#class-aabb) bounds | | | | --- | --- | | *Default* | `AABB( 0, 0, 0, 1, 1, 1 )` | | *Setter* | set\_bounds(value) | | *Getter* | get\_bounds() | ### [float](class_float#class-float) cell\_size | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_cell\_size(value) | | *Getter* | get\_cell\_size() | ### [bool](class_bool#class-bool) compress | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_compress(value) | | *Getter* | is\_compressed() | ### [PoolIntArray](class_poolintarray#class-poolintarray) dynamic\_data | | | | --- | --- | | *Default* | `PoolIntArray(  )` | | *Setter* | set\_dynamic\_data(value) | | *Getter* | get\_dynamic\_data() | ### [int](class_int#class-int) dynamic\_range | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_dynamic\_range(value) | | *Getter* | get\_dynamic\_range() | ### [float](class_float#class-float) energy | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_energy(value) | | *Getter* | get\_energy() | ### [bool](class_bool#class-bool) interior | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_interior(value) | | *Getter* | is\_interior() | ### [float](class_float#class-float) normal\_bias | | | | --- | --- | | *Default* | `0.4` | | *Setter* | set\_normal\_bias(value) | | *Getter* | get\_normal\_bias() | ### [float](class_float#class-float) propagation | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_propagation(value) | | *Getter* | get\_propagation() | ### [Transform](class_transform#class-transform) to\_cell\_xform | | | | --- | --- | | *Default* | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | | *Setter* | set\_to\_cell\_xform(value) | | *Getter* | get\_to\_cell\_xform() | godot EditorInspector EditorInspector =============== **Inherits:** [ScrollContainer](class_scrollcontainer#class-scrollcontainer) **<** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) A control used to edit properties of an object. Description ----------- This is the control that implements property editing in the editor's Settings dialogs, the Inspector dock, etc. To get the `EditorInspector` used in the editor's Inspector dock, use [EditorInterface.get\_inspector](class_editorinterface#class-editorinterface-method-get-inspector). `EditorInspector` will show properties in the same order as the array returned by [Object.get\_property\_list](class_object#id2). If a property's name is path-like (i.e. if it contains forward slashes), `EditorInspector` will create nested sections for "directories" along the path. For example, if a property is named `highlighting/gdscript/node_path_color`, it will be shown as "Node Path Color" inside the "GDScript" section nested inside the "Highlighting" section. If a property has [@GlobalScope.PROPERTY\_USAGE\_GROUP](class_%40globalscope#class-globalscope-constant-property-usage-group) usage, it will group subsequent properties whose name starts with the property's hint string. The group ends when a property does not start with that hint string or when a new group starts. An empty group name effectively ends the current group. `EditorInspector` will create a top-level section for each group. For example, if a property with group usage is named `Collide With` and its hint string is `collide_with_`, a subsequent `collide_with_area` property will be shown as "Area" inside the "Collide With" section. **Note:** Unlike sections created from path-like property names, `EditorInspector` won't capitalize the name for sections created from groups. So properties with group usage usually use capitalized names instead of snake\_cased names. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | scroll\_horizontal\_enabled | `false` (overrides [ScrollContainer](class_scrollcontainer#class-scrollcontainer-property-scroll-horizontal-enabled)) | Methods ------- | | | | --- | --- | | void | [refresh](#class-editorinspector-method-refresh) **(** **)** | Signals ------- ### object\_id\_selected ( [int](class_int#class-int) id ) Emitted when the Edit button of an [Object](class_object#class-object) has been pressed in the inspector. This is mainly used in the remote scene tree inspector. ### property\_edited ( [String](class_string#class-string) property ) Emitted when a property is edited in the inspector. ### property\_keyed ( [String](class_string#class-string) property ) Emitted when a property is keyed in the inspector. Properties can be keyed by clicking the "key" icon next to a property when the Animation panel is toggled. ### property\_selected ( [String](class_string#class-string) property ) Emitted when a property is selected in the inspector. ### property\_toggled ( [String](class_string#class-string) property, [bool](class_bool#class-bool) checked ) Emitted when a boolean property is toggled in the inspector. **Note:** This signal is never emitted if the internal `autoclear` property enabled. Since this property is always enabled in the editor inspector, this signal is never emitted by the editor itself. ### resource\_selected ( [Object](class_object#class-object) res, [String](class_string#class-string) prop ) Emitted when a resource is selected in the inspector. ### restart\_requested ( ) Emitted when a property that requires a restart to be applied is edited in the inspector. This is only used in the Project Settings and Editor Settings. Method Descriptions ------------------- ### void refresh ( ) Refreshes the inspector. **Note:** To save on CPU resources, calling this method will do nothing if the time specified in `docks/property_editor/auto_refresh_interval` editor setting hasn't passed yet since this method was last called. (By default, this interval is set to 0.3 seconds.) godot VisualScriptNode VisualScriptNode ================ **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [VisualScriptBasicTypeConstant](class_visualscriptbasictypeconstant#class-visualscriptbasictypeconstant), [VisualScriptBuiltinFunc](class_visualscriptbuiltinfunc#class-visualscriptbuiltinfunc), [VisualScriptClassConstant](class_visualscriptclassconstant#class-visualscriptclassconstant), [VisualScriptComment](class_visualscriptcomment#class-visualscriptcomment), [VisualScriptCondition](class_visualscriptcondition#class-visualscriptcondition), [VisualScriptConstant](class_visualscriptconstant#class-visualscriptconstant), [VisualScriptConstructor](class_visualscriptconstructor#class-visualscriptconstructor), [VisualScriptCustomNode](class_visualscriptcustomnode#class-visualscriptcustomnode), [VisualScriptDeconstruct](class_visualscriptdeconstruct#class-visualscriptdeconstruct), [VisualScriptEmitSignal](class_visualscriptemitsignal#class-visualscriptemitsignal), [VisualScriptEngineSingleton](class_visualscriptenginesingleton#class-visualscriptenginesingleton), [VisualScriptExpression](class_visualscriptexpression#class-visualscriptexpression), [VisualScriptFunction](class_visualscriptfunction#class-visualscriptfunction), [VisualScriptFunctionCall](class_visualscriptfunctioncall#class-visualscriptfunctioncall), [VisualScriptGlobalConstant](class_visualscriptglobalconstant#class-visualscriptglobalconstant), [VisualScriptIndexGet](class_visualscriptindexget#class-visualscriptindexget), [VisualScriptIndexSet](class_visualscriptindexset#class-visualscriptindexset), [VisualScriptInputAction](class_visualscriptinputaction#class-visualscriptinputaction), [VisualScriptIterator](class_visualscriptiterator#class-visualscriptiterator), [VisualScriptLists](class_visualscriptlists#class-visualscriptlists), [VisualScriptLocalVar](class_visualscriptlocalvar#class-visualscriptlocalvar), [VisualScriptLocalVarSet](class_visualscriptlocalvarset#class-visualscriptlocalvarset), [VisualScriptMathConstant](class_visualscriptmathconstant#class-visualscriptmathconstant), [VisualScriptOperator](class_visualscriptoperator#class-visualscriptoperator), [VisualScriptPreload](class_visualscriptpreload#class-visualscriptpreload), [VisualScriptPropertyGet](class_visualscriptpropertyget#class-visualscriptpropertyget), [VisualScriptPropertySet](class_visualscriptpropertyset#class-visualscriptpropertyset), [VisualScriptResourcePath](class_visualscriptresourcepath#class-visualscriptresourcepath), [VisualScriptReturn](class_visualscriptreturn#class-visualscriptreturn), [VisualScriptSceneNode](class_visualscriptscenenode#class-visualscriptscenenode), [VisualScriptSceneTree](class_visualscriptscenetree#class-visualscriptscenetree), [VisualScriptSelect](class_visualscriptselect#class-visualscriptselect), [VisualScriptSelf](class_visualscriptself#class-visualscriptself), [VisualScriptSequence](class_visualscriptsequence#class-visualscriptsequence), [VisualScriptSubCall](class_visualscriptsubcall#class-visualscriptsubcall), [VisualScriptSwitch](class_visualscriptswitch#class-visualscriptswitch), [VisualScriptTypeCast](class_visualscripttypecast#class-visualscripttypecast), [VisualScriptVariableGet](class_visualscriptvariableget#class-visualscriptvariableget), [VisualScriptVariableSet](class_visualscriptvariableset#class-visualscriptvariableset), [VisualScriptWhile](class_visualscriptwhile#class-visualscriptwhile), [VisualScriptYield](class_visualscriptyield#class-visualscriptyield), [VisualScriptYieldSignal](class_visualscriptyieldsignal#class-visualscriptyieldsignal) A node which is part of a [VisualScript](class_visualscript#class-visualscript). Description ----------- A node which is part of a [VisualScript](class_visualscript#class-visualscript). Not to be confused with [Node](class_node#class-node), which is a part of a [SceneTree](class_scenetree#class-scenetree). Methods ------- | | | | --- | --- | | [Variant](class_variant#class-variant) | [get\_default\_input\_value](#class-visualscriptnode-method-get-default-input-value) **(** [int](class_int#class-int) port\_idx **)** const | | [VisualScript](class_visualscript#class-visualscript) | [get\_visual\_script](#class-visualscriptnode-method-get-visual-script) **(** **)** const | | void | [ports\_changed\_notify](#class-visualscriptnode-method-ports-changed-notify) **(** **)** | | void | [set\_default\_input\_value](#class-visualscriptnode-method-set-default-input-value) **(** [int](class_int#class-int) port\_idx, [Variant](class_variant#class-variant) value **)** | Signals ------- ### ports\_changed ( ) Emitted when the available input/output ports are changed. Method Descriptions ------------------- ### [Variant](class_variant#class-variant) get\_default\_input\_value ( [int](class_int#class-int) port\_idx ) const Returns the default value of a given port. The default value is used when nothing is connected to the port. ### [VisualScript](class_visualscript#class-visualscript) get\_visual\_script ( ) const Returns the [VisualScript](class_visualscript#class-visualscript) instance the node is bound to. ### void ports\_changed\_notify ( ) Notify that the node's ports have changed. Usually used in conjunction with [VisualScriptCustomNode](class_visualscriptcustomnode#class-visualscriptcustomnode) . ### void set\_default\_input\_value ( [int](class_int#class-int) port\_idx, [Variant](class_variant#class-variant) value ) Change the default value of a given port. godot GridContainer GridContainer ============= **Inherits:** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Grid container used to arrange Control-derived children in a grid like layout. Description ----------- GridContainer will arrange its Control-derived children in a grid like structure, the grid columns are specified using the [columns](#class-gridcontainer-property-columns) property and the number of rows will be equal to the number of children in the container divided by the number of columns. For example, if the container has 5 children, and 2 columns, there will be 3 rows in the container. Notice that grid layout will preserve the columns and rows for every size of the container, and that empty columns will be expanded automatically. **Note:** GridContainer only works with child nodes inheriting from Control. It won't rearrange child nodes inheriting from Node2D. Tutorials --------- * [GUI containers](https://docs.godotengine.org/en/3.5/tutorials/ui/gui_containers.html) * [OS Test Demo](https://godotengine.org/asset-library/asset/677) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [columns](#class-gridcontainer-property-columns) | `1` | | [MouseFilter](class_control#enum-control-mousefilter) | mouse\_filter | `1` (overrides [Control](class_control#class-control-property-mouse-filter)) | Theme Properties ---------------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [hseparation](#class-gridcontainer-theme-constant-hseparation) | `4` | | [int](class_int#class-int) | [vseparation](#class-gridcontainer-theme-constant-vseparation) | `4` | Property Descriptions --------------------- ### [int](class_int#class-int) columns | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_columns(value) | | *Getter* | get\_columns() | The number of columns in the `GridContainer`. If modified, `GridContainer` reorders its Control-derived children to accommodate the new layout. Theme Property Descriptions --------------------------- ### [int](class_int#class-int) hseparation | | | | --- | --- | | *Default* | `4` | The horizontal separation of children nodes. ### [int](class_int#class-int) vseparation | | | | --- | --- | | *Default* | `4` | The vertical separation of children nodes. godot AudioStreamPlayer2D AudioStreamPlayer2D =================== **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Plays positional sound in 2D space. Description ----------- Plays audio that dampens with distance from a given position. By default, audio is heard from the screen center. This can be changed by adding a [Listener2D](class_listener2d#class-listener2d) node to the scene and enabling it by calling [Listener2D.make\_current](class_listener2d#class-listener2d-method-make-current) on it. See also [AudioStreamPlayer](class_audiostreamplayer#class-audiostreamplayer) to play a sound non-positionally. **Note:** Hiding an `AudioStreamPlayer2D` node does not disable its audio output. To temporarily disable an `AudioStreamPlayer2D`'s audio output, set [volume\_db](#class-audiostreamplayer2d-property-volume-db) to a very low value like `-100` (which isn't audible to human hearing). Tutorials --------- * [Audio streams](https://docs.godotengine.org/en/3.5/tutorials/audio/audio_streams.html) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [area\_mask](#class-audiostreamplayer2d-property-area-mask) | `1` | | [float](class_float#class-float) | [attenuation](#class-audiostreamplayer2d-property-attenuation) | `1.0` | | [bool](class_bool#class-bool) | [autoplay](#class-audiostreamplayer2d-property-autoplay) | `false` | | [String](class_string#class-string) | [bus](#class-audiostreamplayer2d-property-bus) | `"Master"` | | [float](class_float#class-float) | [max\_distance](#class-audiostreamplayer2d-property-max-distance) | `2000.0` | | [float](class_float#class-float) | [pitch\_scale](#class-audiostreamplayer2d-property-pitch-scale) | `1.0` | | [bool](class_bool#class-bool) | [playing](#class-audiostreamplayer2d-property-playing) | `false` | | [AudioStream](class_audiostream#class-audiostream) | [stream](#class-audiostreamplayer2d-property-stream) | | | [bool](class_bool#class-bool) | [stream\_paused](#class-audiostreamplayer2d-property-stream-paused) | `false` | | [float](class_float#class-float) | [volume\_db](#class-audiostreamplayer2d-property-volume-db) | `0.0` | Methods ------- | | | | --- | --- | | [float](class_float#class-float) | [get\_playback\_position](#class-audiostreamplayer2d-method-get-playback-position) **(** **)** | | [AudioStreamPlayback](class_audiostreamplayback#class-audiostreamplayback) | [get\_stream\_playback](#class-audiostreamplayer2d-method-get-stream-playback) **(** **)** | | void | [play](#class-audiostreamplayer2d-method-play) **(** [float](class_float#class-float) from\_position=0.0 **)** | | void | [seek](#class-audiostreamplayer2d-method-seek) **(** [float](class_float#class-float) to\_position **)** | | void | [stop](#class-audiostreamplayer2d-method-stop) **(** **)** | Signals ------- ### finished ( ) Emitted when the audio stops playing. Property Descriptions --------------------- ### [int](class_int#class-int) area\_mask | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_area\_mask(value) | | *Getter* | get\_area\_mask() | Determines which [Area2D](class_area2d#class-area2d) layers affect the sound for reverb and audio bus effects. Areas can be used to redirect [AudioStream](class_audiostream#class-audiostream)s so that they play in a certain audio bus. An example of how you might use this is making a "water" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater. ### [float](class_float#class-float) attenuation | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_attenuation(value) | | *Getter* | get\_attenuation() | Dampens audio over distance with this as an exponent. ### [bool](class_bool#class-bool) autoplay | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_autoplay(value) | | *Getter* | is\_autoplay\_enabled() | If `true`, audio plays when added to scene tree. ### [String](class_string#class-string) bus | | | | --- | --- | | *Default* | `"Master"` | | *Setter* | set\_bus(value) | | *Getter* | get\_bus() | Bus on which this audio is playing. **Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to `"Master"`. ### [float](class_float#class-float) max\_distance | | | | --- | --- | | *Default* | `2000.0` | | *Setter* | set\_max\_distance(value) | | *Getter* | get\_max\_distance() | Maximum distance from which audio is still hearable. ### [float](class_float#class-float) pitch\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_pitch\_scale(value) | | *Getter* | get\_pitch\_scale() | The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. ### [bool](class_bool#class-bool) playing | | | | --- | --- | | *Default* | `false` | | *Getter* | is\_playing() | If `true`, audio is playing. ### [AudioStream](class_audiostream#class-audiostream) stream | | | | --- | --- | | *Setter* | set\_stream(value) | | *Getter* | get\_stream() | The [AudioStream](class_audiostream#class-audiostream) object to be played. ### [bool](class_bool#class-bool) stream\_paused | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_stream\_paused(value) | | *Getter* | get\_stream\_paused() | If `true`, the playback is paused. You can resume it by setting `stream_paused` to `false`. ### [float](class_float#class-float) volume\_db | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_volume\_db(value) | | *Getter* | get\_volume\_db() | Base volume without dampening. Method Descriptions ------------------- ### [float](class_float#class-float) get\_playback\_position ( ) Returns the position in the [AudioStream](class_audiostream#class-audiostream). ### [AudioStreamPlayback](class_audiostreamplayback#class-audiostreamplayback) get\_stream\_playback ( ) Returns the [AudioStreamPlayback](class_audiostreamplayback#class-audiostreamplayback) object associated with this `AudioStreamPlayer2D`. ### void play ( [float](class_float#class-float) from\_position=0.0 ) Plays the audio from the given position `from_position`, in seconds. ### void seek ( [float](class_float#class-float) to\_position ) Sets the position from which audio will be played, in seconds. ### void stop ( ) Stops the audio.
programming_docs
godot Position2D Position2D ========== **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Generic 2D position hint for editing. Description ----------- Generic 2D position hint for editing. It's just like a plain [Node2D](class_node2d#class-node2d), but it displays as a cross in the 2D editor at all times. You can set cross' visual size by using the gizmo in the 2D editor while the node is selected. godot FileDialog FileDialog ========== **Inherits:** [ConfirmationDialog](class_confirmationdialog#class-confirmationdialog) **<** [AcceptDialog](class_acceptdialog#class-acceptdialog) **<** [WindowDialog](class_windowdialog#class-windowdialog) **<** [Popup](class_popup#class-popup) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Dialog for selecting files or directories in the filesystem. Description ----------- FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. The FileDialog automatically sets its window title according to the [mode](#class-filedialog-property-mode). If you want to use a custom title, disable this by setting [mode\_overrides\_title](#class-filedialog-property-mode-overrides-title) to `false`. Properties ---------- | | | | | --- | --- | --- | | [Access](#enum-filedialog-access) | [access](#class-filedialog-property-access) | `0` | | [String](class_string#class-string) | [current\_dir](#class-filedialog-property-current-dir) | | | [String](class_string#class-string) | [current\_file](#class-filedialog-property-current-file) | | | [String](class_string#class-string) | [current\_path](#class-filedialog-property-current-path) | | | [bool](class_bool#class-bool) | dialog\_hide\_on\_ok | `false` (overrides [AcceptDialog](class_acceptdialog#class-acceptdialog-property-dialog-hide-on-ok)) | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [filters](#class-filedialog-property-filters) | `PoolStringArray(  )` | | [Mode](#enum-filedialog-mode) | [mode](#class-filedialog-property-mode) | `4` | | [bool](class_bool#class-bool) | [mode\_overrides\_title](#class-filedialog-property-mode-overrides-title) | `true` | | [bool](class_bool#class-bool) | [show\_hidden\_files](#class-filedialog-property-show-hidden-files) | `false` | | [String](class_string#class-string) | window\_title | `"Save a File"` (overrides [WindowDialog](class_windowdialog#class-windowdialog-property-window-title)) | Methods ------- | | | | --- | --- | | void | [add\_filter](#class-filedialog-method-add-filter) **(** [String](class_string#class-string) filter **)** | | void | [clear\_filters](#class-filedialog-method-clear-filters) **(** **)** | | void | [deselect\_items](#class-filedialog-method-deselect-items) **(** **)** | | [LineEdit](class_lineedit#class-lineedit) | [get\_line\_edit](#class-filedialog-method-get-line-edit) **(** **)** | | [VBoxContainer](class_vboxcontainer#class-vboxcontainer) | [get\_vbox](#class-filedialog-method-get-vbox) **(** **)** | | void | [invalidate](#class-filedialog-method-invalidate) **(** **)** | Theme Properties ---------------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [file\_icon\_modulate](#class-filedialog-theme-color-file-icon-modulate) | `Color( 1, 1, 1, 1 )` | | [Color](class_color#class-color) | [files\_disabled](#class-filedialog-theme-color-files-disabled) | `Color( 1, 1, 1, 0.25 )` | | [Color](class_color#class-color) | [folder\_icon\_modulate](#class-filedialog-theme-color-folder-icon-modulate) | `Color( 1, 1, 1, 1 )` | | [Texture](class_texture#class-texture) | [file](#class-filedialog-theme-icon-file) | | | [Texture](class_texture#class-texture) | [folder](#class-filedialog-theme-icon-folder) | | | [Texture](class_texture#class-texture) | [parent\_folder](#class-filedialog-theme-icon-parent-folder) | | | [Texture](class_texture#class-texture) | [reload](#class-filedialog-theme-icon-reload) | | | [Texture](class_texture#class-texture) | [toggle\_hidden](#class-filedialog-theme-icon-toggle-hidden) | | Signals ------- ### dir\_selected ( [String](class_string#class-string) dir ) Emitted when the user selects a directory. ### file\_selected ( [String](class_string#class-string) path ) Emitted when the user selects a file by double-clicking it or pressing the **OK** button. ### files\_selected ( [PoolStringArray](class_poolstringarray#class-poolstringarray) paths ) Emitted when the user selects multiple files. Enumerations ------------ enum **Mode**: * **MODE\_OPEN\_FILE** = **0** --- The dialog allows selecting one, and only one file. * **MODE\_OPEN\_FILES** = **1** --- The dialog allows selecting multiple files. * **MODE\_OPEN\_DIR** = **2** --- The dialog only allows selecting a directory, disallowing the selection of any file. * **MODE\_OPEN\_ANY** = **3** --- The dialog allows selecting one file or directory. * **MODE\_SAVE\_FILE** = **4** --- The dialog will warn when a file exists. enum **Access**: * **ACCESS\_RESOURCES** = **0** --- The dialog only allows accessing files under the [Resource](class_resource#class-resource) path (`res://`). * **ACCESS\_USERDATA** = **1** --- The dialog only allows accessing files under user data path (`user://`). * **ACCESS\_FILESYSTEM** = **2** --- The dialog allows accessing files on the whole file system. Property Descriptions --------------------- ### [Access](#enum-filedialog-access) access | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_access(value) | | *Getter* | get\_access() | The file system access scope. See enum `Access` constants. **Warning:** Currently, in sandboxed environments such as HTML5 builds or sandboxed macOS apps, FileDialog cannot access the host file system. See [godot-proposals#1123](https://github.com/godotengine/godot-proposals/issues/1123). ### [String](class_string#class-string) current\_dir | | | | --- | --- | | *Setter* | set\_current\_dir(value) | | *Getter* | get\_current\_dir() | The current working directory of the file dialog. ### [String](class_string#class-string) current\_file | | | | --- | --- | | *Setter* | set\_current\_file(value) | | *Getter* | get\_current\_file() | The currently selected file of the file dialog. ### [String](class_string#class-string) current\_path | | | | --- | --- | | *Setter* | set\_current\_path(value) | | *Getter* | get\_current\_path() | The currently selected file path of the file dialog. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) filters | | | | --- | --- | | *Default* | `PoolStringArray(  )` | | *Setter* | set\_filters(value) | | *Getter* | get\_filters() | The available file type filters. For example, this shows only `.png` and `.gd` files: `set_filters(PoolStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"]))`. Multiple file types can also be specified in a single filter. `"*.png, *.jpg, *.jpeg ; Supported Images"` will show both PNG and JPEG files when selected. ### [Mode](#enum-filedialog-mode) mode | | | | --- | --- | | *Default* | `4` | | *Setter* | set\_mode(value) | | *Getter* | get\_mode() | The dialog's open or save mode, which affects the selection behavior. See enum `Mode` constants. ### [bool](class_bool#class-bool) mode\_overrides\_title | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_mode\_overrides\_title(value) | | *Getter* | is\_mode\_overriding\_title() | If `true`, changing the `Mode` property will set the window title accordingly (e.g. setting mode to [MODE\_OPEN\_FILE](#class-filedialog-constant-mode-open-file) will change the window title to "Open a File"). ### [bool](class_bool#class-bool) show\_hidden\_files | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_show\_hidden\_files(value) | | *Getter* | is\_showing\_hidden\_files() | If `true`, the dialog will show hidden files. Method Descriptions ------------------- ### void add\_filter ( [String](class_string#class-string) filter ) Adds `filter` to the list of filters, which restricts what files can be picked. A `filter` should be of the form `"filename.extension ; Description"`, where filename and extension can be `*` to match any string. Filters starting with `.` (i.e. empty filenames) are not allowed. Example filters: `"*.png ; PNG Images"`, `"project.godot ; Godot Project"`. ### void clear\_filters ( ) Clear all the added filters in the dialog. ### void deselect\_items ( ) Clear currently selected items in the dialog. ### [LineEdit](class_lineedit#class-lineedit) get\_line\_edit ( ) Returns the LineEdit for the selected file. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. ### [VBoxContainer](class_vboxcontainer#class-vboxcontainer) get\_vbox ( ) Returns the vertical box container of the dialog, custom controls can be added to it. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. ### void invalidate ( ) Invalidate and update the current dialog content list. Theme Property Descriptions --------------------------- ### [Color](class_color#class-color) file\_icon\_modulate | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | The color modulation applied to the file icon. ### [Color](class_color#class-color) files\_disabled | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 0.25 )` | The color tint for disabled files (when the `FileDialog` is used in open folder mode). ### [Color](class_color#class-color) folder\_icon\_modulate | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | The color modulation applied to the folder icon. ### [Texture](class_texture#class-texture) file Custom icon for files. ### [Texture](class_texture#class-texture) folder Custom icon for folders. ### [Texture](class_texture#class-texture) parent\_folder Custom icon for the parent folder arrow. ### [Texture](class_texture#class-texture) reload Custom icon for the reload button. ### [Texture](class_texture#class-texture) toggle\_hidden Custom icon for the toggle hidden button. godot VisualShaderNodeBooleanConstant VisualShaderNodeBooleanConstant =============================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A boolean constant to be used within the visual shader graph. Description ----------- Has only one output port and no inputs. Translated to `bool` in the shader language. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [constant](#class-visualshadernodebooleanconstant-property-constant) | `false` | Property Descriptions --------------------- ### [bool](class_bool#class-bool) constant | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_constant(value) | | *Getter* | get\_constant() | A boolean constant which represents a state of this node. godot GradientTexture GradientTexture =============== **Inherits:** [Texture](class_texture#class-texture) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Gradient-filled texture. Description ----------- GradientTexture uses a [Gradient](class_gradient#class-gradient) to fill the texture data. The gradient will be filled from left to right using colors obtained from the gradient. This means the texture does not necessarily represent an exact copy of the gradient, but instead an interpolation of samples obtained from the gradient at fixed steps (see [width](#class-gradienttexture-property-width)). See also [GradientTexture2D](class_gradienttexture2d#class-gradienttexture2d) and [CurveTexture](class_curvetexture#class-curvetexture). Properties ---------- | | | | | --- | --- | --- | | [Gradient](class_gradient#class-gradient) | [gradient](#class-gradienttexture-property-gradient) | | | [int](class_int#class-int) | [width](#class-gradienttexture-property-width) | `2048` | Property Descriptions --------------------- ### [Gradient](class_gradient#class-gradient) gradient | | | | --- | --- | | *Setter* | set\_gradient(value) | | *Getter* | get\_gradient() | The [Gradient](class_gradient#class-gradient) that will be used to fill the texture. ### [int](class_int#class-int) width | | | | --- | --- | | *Default* | `2048` | | *Setter* | set\_width(value) | | *Getter* | get\_width() | The number of color samples that will be obtained from the [Gradient](class_gradient#class-gradient). godot PopupPanel PopupPanel ========== **Inherits:** [Popup](class_popup#class-popup) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Class for displaying popups with a panel background. Description ----------- Class for displaying popups with a panel background. In some cases it might be simpler to use than [Popup](class_popup#class-popup), since it provides a configurable background. If you are making windows, better check [WindowDialog](class_windowdialog#class-windowdialog). If any [Control](class_control#class-control) node is added as a child of this `PopupPanel`, it will be stretched to fit the panel's size (similar to how [PanelContainer](class_panelcontainer#class-panelcontainer) works). Theme Properties ---------------- | | | | --- | --- | | [StyleBox](class_stylebox#class-stylebox) | [panel](#class-popuppanel-theme-style-panel) | Theme Property Descriptions --------------------------- ### [StyleBox](class_stylebox#class-stylebox) panel The background panel style of this `PopupPanel`. godot Shape2D Shape2D ======= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [CapsuleShape2D](class_capsuleshape2d#class-capsuleshape2d), [CircleShape2D](class_circleshape2d#class-circleshape2d), [ConcavePolygonShape2D](class_concavepolygonshape2d#class-concavepolygonshape2d), [ConvexPolygonShape2D](class_convexpolygonshape2d#class-convexpolygonshape2d), [LineShape2D](class_lineshape2d#class-lineshape2d), [RayShape2D](class_rayshape2d#class-rayshape2d), [RectangleShape2D](class_rectangleshape2d#class-rectangleshape2d), [SegmentShape2D](class_segmentshape2d#class-segmentshape2d) Base class for all 2D shapes. Description ----------- Base class for all 2D shapes. All 2D shape types inherit from this. Tutorials --------- * [Physics introduction](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [custom\_solver\_bias](#class-shape2d-property-custom-solver-bias) | `0.0` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [collide](#class-shape2d-method-collide) **(** [Transform2D](class_transform2d#class-transform2d) local\_xform, [Shape2D](#class-shape2d) with\_shape, [Transform2D](class_transform2d#class-transform2d) shape\_xform **)** | | [Array](class_array#class-array) | [collide\_and\_get\_contacts](#class-shape2d-method-collide-and-get-contacts) **(** [Transform2D](class_transform2d#class-transform2d) local\_xform, [Shape2D](#class-shape2d) with\_shape, [Transform2D](class_transform2d#class-transform2d) shape\_xform **)** | | [bool](class_bool#class-bool) | [collide\_with\_motion](#class-shape2d-method-collide-with-motion) **(** [Transform2D](class_transform2d#class-transform2d) local\_xform, [Vector2](class_vector2#class-vector2) local\_motion, [Shape2D](#class-shape2d) with\_shape, [Transform2D](class_transform2d#class-transform2d) shape\_xform, [Vector2](class_vector2#class-vector2) shape\_motion **)** | | [Array](class_array#class-array) | [collide\_with\_motion\_and\_get\_contacts](#class-shape2d-method-collide-with-motion-and-get-contacts) **(** [Transform2D](class_transform2d#class-transform2d) local\_xform, [Vector2](class_vector2#class-vector2) local\_motion, [Shape2D](#class-shape2d) with\_shape, [Transform2D](class_transform2d#class-transform2d) shape\_xform, [Vector2](class_vector2#class-vector2) shape\_motion **)** | | void | [draw](#class-shape2d-method-draw) **(** [RID](class_rid#class-rid) canvas\_item, [Color](class_color#class-color) color **)** | Property Descriptions --------------------- ### [float](class_float#class-float) custom\_solver\_bias | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_custom\_solver\_bias(value) | | *Getter* | get\_custom\_solver\_bias() | The shape's custom solver bias. Defines how much bodies react to enforce contact separation when this shape is involved. When set to `0.0`, the default value of `0.3` is used. Method Descriptions ------------------- ### [bool](class_bool#class-bool) collide ( [Transform2D](class_transform2d#class-transform2d) local\_xform, [Shape2D](#class-shape2d) with\_shape, [Transform2D](class_transform2d#class-transform2d) shape\_xform ) Returns `true` if this shape is colliding with another. This method needs the transformation matrix for this shape (`local_xform`), the shape to check collisions with (`with_shape`), and the transformation matrix of that shape (`shape_xform`). ### [Array](class_array#class-array) collide\_and\_get\_contacts ( [Transform2D](class_transform2d#class-transform2d) local\_xform, [Shape2D](#class-shape2d) with\_shape, [Transform2D](class_transform2d#class-transform2d) shape\_xform ) Returns a list of contact point pairs where this shape touches another. If there are no collisions, the returned list is empty. Otherwise, the returned list contains contact points arranged in pairs, with entries alternating between points on the boundary of this shape and points on the boundary of `with_shape`. A collision pair A, B can be used to calculate the collision normal with `(B - A).normalized()`, and the collision depth with `(B - A).length()`. This information is typically used to separate shapes, particularly in collision solvers. This method needs the transformation matrix for this shape (`local_xform`), the shape to check collisions with (`with_shape`), and the transformation matrix of that shape (`shape_xform`). ### [bool](class_bool#class-bool) collide\_with\_motion ( [Transform2D](class_transform2d#class-transform2d) local\_xform, [Vector2](class_vector2#class-vector2) local\_motion, [Shape2D](#class-shape2d) with\_shape, [Transform2D](class_transform2d#class-transform2d) shape\_xform, [Vector2](class_vector2#class-vector2) shape\_motion ) Returns whether this shape would collide with another, if a given movement was applied. This method needs the transformation matrix for this shape (`local_xform`), the movement to test on this shape (`local_motion`), the shape to check collisions with (`with_shape`), the transformation matrix of that shape (`shape_xform`), and the movement to test onto the other object (`shape_motion`). ### [Array](class_array#class-array) collide\_with\_motion\_and\_get\_contacts ( [Transform2D](class_transform2d#class-transform2d) local\_xform, [Vector2](class_vector2#class-vector2) local\_motion, [Shape2D](#class-shape2d) with\_shape, [Transform2D](class_transform2d#class-transform2d) shape\_xform, [Vector2](class_vector2#class-vector2) shape\_motion ) Returns a list of contact point pairs where this shape would touch another, if a given movement was applied. If there would be no collisions, the returned list is empty. Otherwise, the returned list contains contact points arranged in pairs, with entries alternating between points on the boundary of this shape and points on the boundary of `with_shape`. A collision pair A, B can be used to calculate the collision normal with `(B - A).normalized()`, and the collision depth with `(B - A).length()`. This information is typically used to separate shapes, particularly in collision solvers. This method needs the transformation matrix for this shape (`local_xform`), the movement to test on this shape (`local_motion`), the shape to check collisions with (`with_shape`), the transformation matrix of that shape (`shape_xform`), and the movement to test onto the other object (`shape_motion`). ### void draw ( [RID](class_rid#class-rid) canvas\_item, [Color](class_color#class-color) color ) Draws a solid shape onto a [CanvasItem](class_canvasitem#class-canvasitem) with the [VisualServer](class_visualserver#class-visualserver) API filled with the specified `color`. The exact drawing method is specific for each shape and cannot be configured.
programming_docs
godot RayShape2D RayShape2D ========== **Inherits:** [Shape2D](class_shape2d#class-shape2d) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Ray shape for 2D collisions. Description ----------- Ray shape for 2D collisions. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [length](#class-rayshape2d-property-length) | `20.0` | | [bool](class_bool#class-bool) | [slips\_on\_slope](#class-rayshape2d-property-slips-on-slope) | `false` | Property Descriptions --------------------- ### [float](class_float#class-float) length | | | | --- | --- | | *Default* | `20.0` | | *Setter* | set\_length(value) | | *Getter* | get\_length() | The ray's length. ### [bool](class_bool#class-bool) slips\_on\_slope | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_slips\_on\_slope(value) | | *Getter* | get\_slips\_on\_slope() | If `true`, allow the shape to return the correct normal. godot CapsuleShape CapsuleShape ============ **Inherits:** [Shape](class_shape#class-shape) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Capsule shape for collisions. Description ----------- Capsule shape for collisions. Tutorials --------- * [3D Physics Tests Demo](https://godotengine.org/asset-library/asset/675) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [height](#class-capsuleshape-property-height) | `1.0` | | [float](class_float#class-float) | [radius](#class-capsuleshape-property-radius) | `1.0` | Property Descriptions --------------------- ### [float](class_float#class-float) height | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_height(value) | | *Getter* | get\_height() | The capsule's height. ### [float](class_float#class-float) radius | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_radius(value) | | *Getter* | get\_radius() | The capsule's radius. godot Tabs Tabs ==== **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Tabs control. Description ----------- Simple tabs control, similar to [TabContainer](class_tabcontainer#class-tabcontainer) but is only in charge of drawing tabs, not interacting with children. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [current\_tab](#class-tabs-property-current-tab) | `0` | | [bool](class_bool#class-bool) | [drag\_to\_rearrange\_enabled](#class-tabs-property-drag-to-rearrange-enabled) | `false` | | [bool](class_bool#class-bool) | [scrolling\_enabled](#class-tabs-property-scrolling-enabled) | `true` | | [TabAlign](#enum-tabs-tabalign) | [tab\_align](#class-tabs-property-tab-align) | `1` | | [CloseButtonDisplayPolicy](#enum-tabs-closebuttondisplaypolicy) | [tab\_close\_display\_policy](#class-tabs-property-tab-close-display-policy) | `0` | Methods ------- | | | | --- | --- | | void | [add\_tab](#class-tabs-method-add-tab) **(** [String](class_string#class-string) title="", [Texture](class_texture#class-texture) icon=null **)** | | void | [ensure\_tab\_visible](#class-tabs-method-ensure-tab-visible) **(** [int](class_int#class-int) idx **)** | | [bool](class_bool#class-bool) | [get\_offset\_buttons\_visible](#class-tabs-method-get-offset-buttons-visible) **(** **)** const | | [int](class_int#class-int) | [get\_previous\_tab](#class-tabs-method-get-previous-tab) **(** **)** const | | [bool](class_bool#class-bool) | [get\_select\_with\_rmb](#class-tabs-method-get-select-with-rmb) **(** **)** const | | [Texture](class_texture#class-texture) | [get\_tab\_button\_icon](#class-tabs-method-get-tab-button-icon) **(** [int](class_int#class-int) tab\_idx **)** const | | [int](class_int#class-int) | [get\_tab\_count](#class-tabs-method-get-tab-count) **(** **)** const | | [bool](class_bool#class-bool) | [get\_tab\_disabled](#class-tabs-method-get-tab-disabled) **(** [int](class_int#class-int) tab\_idx **)** const | | [Texture](class_texture#class-texture) | [get\_tab\_icon](#class-tabs-method-get-tab-icon) **(** [int](class_int#class-int) tab\_idx **)** const | | [int](class_int#class-int) | [get\_tab\_offset](#class-tabs-method-get-tab-offset) **(** **)** const | | [Rect2](class_rect2#class-rect2) | [get\_tab\_rect](#class-tabs-method-get-tab-rect) **(** [int](class_int#class-int) tab\_idx **)** const | | [String](class_string#class-string) | [get\_tab\_title](#class-tabs-method-get-tab-title) **(** [int](class_int#class-int) tab\_idx **)** const | | [int](class_int#class-int) | [get\_tabs\_rearrange\_group](#class-tabs-method-get-tabs-rearrange-group) **(** **)** const | | void | [move\_tab](#class-tabs-method-move-tab) **(** [int](class_int#class-int) from, [int](class_int#class-int) to **)** | | void | [remove\_tab](#class-tabs-method-remove-tab) **(** [int](class_int#class-int) tab\_idx **)** | | void | [set\_select\_with\_rmb](#class-tabs-method-set-select-with-rmb) **(** [bool](class_bool#class-bool) enabled **)** | | void | [set\_tab\_button\_icon](#class-tabs-method-set-tab-button-icon) **(** [int](class_int#class-int) tab\_idx, [Texture](class_texture#class-texture) icon **)** | | void | [set\_tab\_disabled](#class-tabs-method-set-tab-disabled) **(** [int](class_int#class-int) tab\_idx, [bool](class_bool#class-bool) disabled **)** | | void | [set\_tab\_icon](#class-tabs-method-set-tab-icon) **(** [int](class_int#class-int) tab\_idx, [Texture](class_texture#class-texture) icon **)** | | void | [set\_tab\_title](#class-tabs-method-set-tab-title) **(** [int](class_int#class-int) tab\_idx, [String](class_string#class-string) title **)** | | void | [set\_tabs\_rearrange\_group](#class-tabs-method-set-tabs-rearrange-group) **(** [int](class_int#class-int) group\_id **)** | Theme Properties ---------------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [font\_color\_bg](#class-tabs-theme-color-font-color-bg) | `Color( 0.69, 0.69, 0.69, 1 )` | | [Color](class_color#class-color) | [font\_color\_disabled](#class-tabs-theme-color-font-color-disabled) | `Color( 0.9, 0.9, 0.9, 0.2 )` | | [Color](class_color#class-color) | [font\_color\_fg](#class-tabs-theme-color-font-color-fg) | `Color( 0.94, 0.94, 0.94, 1 )` | | [int](class_int#class-int) | [hseparation](#class-tabs-theme-constant-hseparation) | `4` | | [int](class_int#class-int) | [label\_valign\_bg](#class-tabs-theme-constant-label-valign-bg) | `2` | | [int](class_int#class-int) | [label\_valign\_fg](#class-tabs-theme-constant-label-valign-fg) | `0` | | [int](class_int#class-int) | [top\_margin](#class-tabs-theme-constant-top-margin) | `24` | | [Font](class_font#class-font) | [font](#class-tabs-theme-font-font) | | | [Texture](class_texture#class-texture) | [close](#class-tabs-theme-icon-close) | | | [Texture](class_texture#class-texture) | [decrement](#class-tabs-theme-icon-decrement) | | | [Texture](class_texture#class-texture) | [decrement\_highlight](#class-tabs-theme-icon-decrement-highlight) | | | [Texture](class_texture#class-texture) | [increment](#class-tabs-theme-icon-increment) | | | [Texture](class_texture#class-texture) | [increment\_highlight](#class-tabs-theme-icon-increment-highlight) | | | [StyleBox](class_stylebox#class-stylebox) | [button](#class-tabs-theme-style-button) | | | [StyleBox](class_stylebox#class-stylebox) | [button\_pressed](#class-tabs-theme-style-button-pressed) | | | [StyleBox](class_stylebox#class-stylebox) | [tab\_bg](#class-tabs-theme-style-tab-bg) | | | [StyleBox](class_stylebox#class-stylebox) | [tab\_disabled](#class-tabs-theme-style-tab-disabled) | | | [StyleBox](class_stylebox#class-stylebox) | [tab\_fg](#class-tabs-theme-style-tab-fg) | | Signals ------- ### reposition\_active\_tab\_request ( [int](class_int#class-int) idx\_to ) Emitted when the active tab is rearranged via mouse drag. See [drag\_to\_rearrange\_enabled](#class-tabs-property-drag-to-rearrange-enabled). ### right\_button\_pressed ( [int](class_int#class-int) tab ) Emitted when a tab's right button is pressed. See [set\_tab\_button\_icon](#class-tabs-method-set-tab-button-icon). ### tab\_changed ( [int](class_int#class-int) tab ) Emitted when switching to another tab. ### tab\_clicked ( [int](class_int#class-int) tab ) Emitted when a tab is clicked, even if it is the current tab. ### tab\_close ( [int](class_int#class-int) tab ) Emitted when a tab is closed. ### tab\_hover ( [int](class_int#class-int) tab ) Emitted when a tab is hovered by the mouse. Enumerations ------------ enum **TabAlign**: * **ALIGN\_LEFT** = **0** --- Align the tabs to the left. * **ALIGN\_CENTER** = **1** --- Align the tabs to the center. * **ALIGN\_RIGHT** = **2** --- Align the tabs to the right. * **ALIGN\_MAX** = **3** --- Represents the size of the [TabAlign](#enum-tabs-tabalign) enum. enum **CloseButtonDisplayPolicy**: * **CLOSE\_BUTTON\_SHOW\_NEVER** = **0** --- Never show the close buttons. * **CLOSE\_BUTTON\_SHOW\_ACTIVE\_ONLY** = **1** --- Only show the close button on the currently active tab. * **CLOSE\_BUTTON\_SHOW\_ALWAYS** = **2** --- Show the close button on all tabs. * **CLOSE\_BUTTON\_MAX** = **3** --- Represents the size of the [CloseButtonDisplayPolicy](#enum-tabs-closebuttondisplaypolicy) enum. Property Descriptions --------------------- ### [int](class_int#class-int) current\_tab | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_current\_tab(value) | | *Getter* | get\_current\_tab() | Select tab at index `tab_idx`. ### [bool](class_bool#class-bool) drag\_to\_rearrange\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_drag\_to\_rearrange\_enabled(value) | | *Getter* | get\_drag\_to\_rearrange\_enabled() | If `true`, tabs can be rearranged with mouse drag. ### [bool](class_bool#class-bool) scrolling\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_scrolling\_enabled(value) | | *Getter* | get\_scrolling\_enabled() | if `true`, the mouse's scroll wheel can be used to navigate the scroll view. ### [TabAlign](#enum-tabs-tabalign) tab\_align | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_tab\_align(value) | | *Getter* | get\_tab\_align() | The alignment of all tabs. See [TabAlign](#enum-tabs-tabalign) for details. ### [CloseButtonDisplayPolicy](#enum-tabs-closebuttondisplaypolicy) tab\_close\_display\_policy | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_tab\_close\_display\_policy(value) | | *Getter* | get\_tab\_close\_display\_policy() | Sets when the close button will appear on the tabs. See [CloseButtonDisplayPolicy](#enum-tabs-closebuttondisplaypolicy) for details. Method Descriptions ------------------- ### void add\_tab ( [String](class_string#class-string) title="", [Texture](class_texture#class-texture) icon=null ) Adds a new tab. ### void ensure\_tab\_visible ( [int](class_int#class-int) idx ) Moves the scroll view to make the tab visible. ### [bool](class_bool#class-bool) get\_offset\_buttons\_visible ( ) const Returns `true` if the offset buttons (the ones that appear when there's not enough space for all tabs) are visible. ### [int](class_int#class-int) get\_previous\_tab ( ) const Returns the previously active tab index. ### [bool](class_bool#class-bool) get\_select\_with\_rmb ( ) const Returns `true` if select with right mouse button is enabled. ### [Texture](class_texture#class-texture) get\_tab\_button\_icon ( [int](class_int#class-int) tab\_idx ) const Returns the button icon from the tab at index `tab_idx`. ### [int](class_int#class-int) get\_tab\_count ( ) const Returns the number of tabs. ### [bool](class_bool#class-bool) get\_tab\_disabled ( [int](class_int#class-int) tab\_idx ) const Returns `true` if the tab at index `tab_idx` is disabled. ### [Texture](class_texture#class-texture) get\_tab\_icon ( [int](class_int#class-int) tab\_idx ) const Returns the [Texture](class_texture#class-texture) for the tab at index `tab_idx` or `null` if the tab has no [Texture](class_texture#class-texture). ### [int](class_int#class-int) get\_tab\_offset ( ) const Returns the number of hidden tabs offsetted to the left. ### [Rect2](class_rect2#class-rect2) get\_tab\_rect ( [int](class_int#class-int) tab\_idx ) const Returns tab [Rect2](class_rect2#class-rect2) with local position and size. ### [String](class_string#class-string) get\_tab\_title ( [int](class_int#class-int) tab\_idx ) const Returns the title of the tab at index `tab_idx`. ### [int](class_int#class-int) get\_tabs\_rearrange\_group ( ) const Returns the `Tabs`' rearrange group ID. ### void move\_tab ( [int](class_int#class-int) from, [int](class_int#class-int) to ) Moves a tab from `from` to `to`. ### void remove\_tab ( [int](class_int#class-int) tab\_idx ) Removes the tab at index `tab_idx`. ### void set\_select\_with\_rmb ( [bool](class_bool#class-bool) enabled ) If `true`, enables selecting a tab with the right mouse button. ### void set\_tab\_button\_icon ( [int](class_int#class-int) tab\_idx, [Texture](class_texture#class-texture) icon ) Sets the button icon from the tab at index `tab_idx`. ### void set\_tab\_disabled ( [int](class_int#class-int) tab\_idx, [bool](class_bool#class-bool) disabled ) If `disabled` is `true`, disables the tab at index `tab_idx`, making it non-interactable. ### void set\_tab\_icon ( [int](class_int#class-int) tab\_idx, [Texture](class_texture#class-texture) icon ) Sets an `icon` for the tab at index `tab_idx`. ### void set\_tab\_title ( [int](class_int#class-int) tab\_idx, [String](class_string#class-string) title ) Sets a `title` for the tab at index `tab_idx`. ### void set\_tabs\_rearrange\_group ( [int](class_int#class-int) group\_id ) Defines the rearrange group ID. Choose for each `Tabs` the same value to dragging tabs between `Tabs`. Enable drag with [drag\_to\_rearrange\_enabled](#class-tabs-property-drag-to-rearrange-enabled). Theme Property Descriptions --------------------------- ### [Color](class_color#class-color) font\_color\_bg | | | | --- | --- | | *Default* | `Color( 0.69, 0.69, 0.69, 1 )` | Font color of inactive tabs. ### [Color](class_color#class-color) font\_color\_disabled | | | | --- | --- | | *Default* | `Color( 0.9, 0.9, 0.9, 0.2 )` | Font color of disabled tabs. ### [Color](class_color#class-color) font\_color\_fg | | | | --- | --- | | *Default* | `Color( 0.94, 0.94, 0.94, 1 )` | Font color of the currently selected tab. ### [int](class_int#class-int) hseparation | | | | --- | --- | | *Default* | `4` | The horizontal separation between the tabs. ### [int](class_int#class-int) label\_valign\_bg | | | | --- | --- | | *Default* | `2` | ### [int](class_int#class-int) label\_valign\_fg | | | | --- | --- | | *Default* | `0` | ### [int](class_int#class-int) top\_margin | | | | --- | --- | | *Default* | `24` | ### [Font](class_font#class-font) font The font used to draw tab names. ### [Texture](class_texture#class-texture) close The icon for the close button (see [tab\_close\_display\_policy](#class-tabs-property-tab-close-display-policy)). ### [Texture](class_texture#class-texture) decrement Icon for the left arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the first tab is visible), it appears semi-transparent. ### [Texture](class_texture#class-texture) decrement\_highlight Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. ### [Texture](class_texture#class-texture) increment Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent. ### [Texture](class_texture#class-texture) increment\_highlight Icon for the right arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. ### [StyleBox](class_stylebox#class-stylebox) button Background of the close button when it's being hovered with the cursor. ### [StyleBox](class_stylebox#class-stylebox) button\_pressed Background of the close button when it's being pressed. ### [StyleBox](class_stylebox#class-stylebox) tab\_bg The style of an inactive tab. ### [StyleBox](class_stylebox#class-stylebox) tab\_disabled The style of a disabled tab ### [StyleBox](class_stylebox#class-stylebox) tab\_fg The style of the currently selected tab. godot RegExMatch RegExMatch ========== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Contains the results of a [RegEx](class_regex#class-regex) search. Description ----------- Contains the results of a single [RegEx](class_regex#class-regex) match returned by [RegEx.search](class_regex#class-regex-method-search) and [RegEx.search\_all](class_regex#class-regex-method-search-all). It can be used to find the position and range of the match and its capturing groups, and it can extract its substring for you. Properties ---------- | | | | | --- | --- | --- | | [Dictionary](class_dictionary#class-dictionary) | [names](#class-regexmatch-property-names) | `{}` | | [Array](class_array#class-array) | [strings](#class-regexmatch-property-strings) | `[  ]` | | [String](class_string#class-string) | [subject](#class-regexmatch-property-subject) | `""` | Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [get\_end](#class-regexmatch-method-get-end) **(** [Variant](class_variant#class-variant) name=0 **)** const | | [int](class_int#class-int) | [get\_group\_count](#class-regexmatch-method-get-group-count) **(** **)** const | | [int](class_int#class-int) | [get\_start](#class-regexmatch-method-get-start) **(** [Variant](class_variant#class-variant) name=0 **)** const | | [String](class_string#class-string) | [get\_string](#class-regexmatch-method-get-string) **(** [Variant](class_variant#class-variant) name=0 **)** const | Property Descriptions --------------------- ### [Dictionary](class_dictionary#class-dictionary) names | | | | --- | --- | | *Default* | `{}` | | *Getter* | get\_names() | A dictionary of named groups and its corresponding group number. Only groups that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. ### [Array](class_array#class-array) strings | | | | --- | --- | | *Default* | `[  ]` | | *Getter* | get\_strings() | An [Array](class_array#class-array) of the match and its capturing groups. ### [String](class_string#class-string) subject | | | | --- | --- | | *Default* | `""` | | *Getter* | get\_subject() | The source string used with the search pattern to find this matching result. Method Descriptions ------------------- ### [int](class_int#class-int) get\_end ( [Variant](class_variant#class-variant) name=0 ) const Returns the end position of the match within the source string. The end position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. Returns -1 if the group did not match or doesn't exist. ### [int](class_int#class-int) get\_group\_count ( ) const Returns the number of capturing groups. ### [int](class_int#class-int) get\_start ( [Variant](class_variant#class-variant) name=0 ) const Returns the starting position of the match within the source string. The starting position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. Returns -1 if the group did not match or doesn't exist. ### [String](class_string#class-string) get\_string ( [Variant](class_variant#class-variant) name=0 ) const Returns the substring of the match from the source string. Capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. Returns an empty string if the group did not match or doesn't exist.
programming_docs
godot ProximityGroup ProximityGroup ============== **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) General-purpose 3D proximity detection node. Description ----------- General-purpose proximity detection node. `ProximityGroup` can be used for *approximate* distance checks, which are faster than exact distance checks using [Vector3.distance\_to](class_vector3#class-vector3-method-distance-to) or [Vector3.distance\_squared\_to](class_vector3#class-vector3-method-distance-squared-to). `ProximityGroup` nodes are automatically grouped together, as long as they share the same [group\_name](#class-proximitygroup-property-group-name) and intersect with each other. By calling the [broadcast](#class-proximitygroup-method-broadcast), you can invoke a specified method with various parameters to all intersecting members. `ProximityGroup` is cuboid-shaped and consists of a cluster of [Vector3](class_vector3#class-vector3) coordinates. The coordinates are automatically calculated by calling [grid\_radius](#class-proximitygroup-property-grid-radius). To allow `ProximityGroup` to find its peers (and perform automatic grouping), you need to define its [group\_name](#class-proximitygroup-property-group-name) to a non-empty [String](class_string#class-string). As soon as this object's shape intersects with another `ProximityGroup` object' shape, and both share the same [group\_name](#class-proximitygroup-property-group-name), they will belong together for as long as they intersect. Since `ProximityGroup` doesn't rely the physics engine, you don't need to add any other node as a child (unlike [PhysicsBody](class_physicsbody#class-physicsbody)). The `ProximityGroup` uses the [SceneTree](class_scenetree#class-scenetree) groups in the background by calling the method [Node.add\_to\_group](class_node#class-node-method-add-to-group) internally. The [SceneTree](class_scenetree#class-scenetree) group names are constructed by combining the [group\_name](#class-proximitygroup-property-group-name) with its coordinates, which are calculated using the [grid\_radius](#class-proximitygroup-property-grid-radius) you defined beforehand. **Example:** A `ProximityGroup` node named `"PlanetEarth"` at position `Vector3(6, 6, 6)` with a [group\_name](#class-proximitygroup-property-group-name) set to `"planets"` and a [grid\_radius](#class-proximitygroup-property-grid-radius) of `Vector3(1, 2, 3)` will create the following [SceneTree](class_scenetree#class-scenetree) group names: ``` - "planets|5|4|3" - "planets|5|4|4" - "planets|5|4|5" - "planets|5|4|6" - "planets|5|4|7" - "planets|5|4|8" - "planets|5|4|9" - ... ``` If there is another `ProximityGroup` named `"PlanetMars"` with group name `"planets"`, and one of its coordinates is `Vector3(5, 4, 7)`, it would normally create the [SceneTree](class_scenetree#class-scenetree) group called `"planets|5|4|7"`. However, since this group name already exists, this `ProximityGroup` object will be *added* to the existing one. `"PlanetEarth"` is already in this group. As long as both nodes don't change their transform and stop intersecting (or exit the scene tree), they are grouped together. As long as this intersection exists, any call to [broadcast](#class-proximitygroup-method-broadcast) will affect *both* `ProximityGroup` nodes. There are 3 caveats to keep in mind when using `ProximityGroup`: * The larger the grid radius, the more coordinates and the more [SceneTree](class_scenetree#class-scenetree) groups are created. This can have a performance impact if too many groups are created. * If the `ProximityGroup` node is transformed in any way (or is removed from the scene tree), the groupings will have to be recalculated. This can also have a performance impact. * If your [grid\_radius](#class-proximitygroup-property-grid-radius) is smaller than `Vector3(1, 1, 1)`, it will be rounded up to `Vector3(1, 1, 1)`. Therefore, small grid radius values may lead to unwanted groupings. **Note:** `ProximityGroup` will be removed in Godot 4.0 in favor of more effective and faster [VisibilityNotifier](class_visibilitynotifier#class-visibilitynotifier) functionality. For most use cases, [Vector3.distance\_to](class_vector3#class-vector3-method-distance-to) or [Vector3.distance\_squared\_to](class_vector3#class-vector3-method-distance-squared-to) are fast enough too, especially if you call them less often using a [Timer](class_timer#class-timer) node. Properties ---------- | | | | | --- | --- | --- | | [DispatchMode](#enum-proximitygroup-dispatchmode) | [dispatch\_mode](#class-proximitygroup-property-dispatch-mode) | `0` | | [Vector3](class_vector3#class-vector3) | [grid\_radius](#class-proximitygroup-property-grid-radius) | `Vector3( 1, 1, 1 )` | | [String](class_string#class-string) | [group\_name](#class-proximitygroup-property-group-name) | `""` | Methods ------- | | | | --- | --- | | void | [broadcast](#class-proximitygroup-method-broadcast) **(** [String](class_string#class-string) method, [Variant](class_variant#class-variant) parameters **)** | Signals ------- ### broadcast ( [String](class_string#class-string) method, [Array](class_array#class-array) parameters ) Emitted when the user calls the [broadcast](#class-proximitygroup-method-broadcast) method and has set [dispatch\_mode](#class-proximitygroup-property-dispatch-mode) to [MODE\_SIGNAL](#class-proximitygroup-constant-mode-signal). The given method and its parameters are passed on to the listeners who connected to this signal of this object, as well as any `ProximityGroup` node this node is grouped together with. **Note:** This signal is *not* emitted by default, as the default [dispatch\_mode](#class-proximitygroup-property-dispatch-mode) is [MODE\_PROXY](#class-proximitygroup-constant-mode-proxy). Enumerations ------------ enum **DispatchMode**: * **MODE\_PROXY** = **0** --- This `ProximityGroup`'s parent will be target of [broadcast](#class-proximitygroup-method-broadcast). * **MODE\_SIGNAL** = **1** --- This `ProximityGroup` will emit the [broadcast](#class-proximitygroup-signal-broadcast) *signal* when calling the [broadcast](#class-proximitygroup-method-broadcast) *method*. Property Descriptions --------------------- ### [DispatchMode](#enum-proximitygroup-dispatchmode) dispatch\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_dispatch\_mode(value) | | *Getter* | get\_dispatch\_mode() | Specifies which node gets contacted on a call of method [broadcast](#class-proximitygroup-method-broadcast). ### [Vector3](class_vector3#class-vector3) grid\_radius | | | | --- | --- | | *Default* | `Vector3( 1, 1, 1 )` | | *Setter* | set\_grid\_radius(value) | | *Getter* | get\_grid\_radius() | The size of the space in 3D units. This also sets the amount of coordinates required to calculate whether two `ProximityGroup` nodes are intersecting or not. Smaller [grid\_radius](#class-proximitygroup-property-grid-radius) values can be used for more precise proximity checks at the cost of performance, since more groups will be created. ### [String](class_string#class-string) group\_name | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_group\_name(value) | | *Getter* | get\_group\_name() | Specify the common group name, to let other `ProximityGroup` nodes know, if they should be auto-grouped with this node in case they intersect with each other. For example, if you have a `ProximityGroup` node named `"Earth"` and another called `"Mars"`, with both nodes having `"planet"` as their [group\_name](#class-proximitygroup-property-group-name). Give both planets a significantly larger [grid\_radius](#class-proximitygroup-property-grid-radius) than their actual radius, position them close enough and they'll be automatically grouped. Method Descriptions ------------------- ### void broadcast ( [String](class_string#class-string) method, [Variant](class_variant#class-variant) parameters ) Calls on all intersecting `ProximityGroup` the given method and parameters. If the [dispatch\_mode](#class-proximitygroup-property-dispatch-mode) is set to [MODE\_PROXY](#class-proximitygroup-constant-mode-proxy) (the default), all calls are delegated to their respective parent [Node](class_node#class-node). godot VehicleWheel VehicleWheel ============ **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Physics object that simulates the behavior of a wheel. Description ----------- This node needs to be used as a child node of [VehicleBody](class_vehiclebody#class-vehiclebody) and simulates the behavior of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface. **Note:** This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another [PhysicsBody](class_physicsbody#class-physicsbody) class. Tutorials --------- * [3D Truck Town Demo](https://godotengine.org/asset-library/asset/524) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [brake](#class-vehiclewheel-property-brake) | `0.0` | | [float](class_float#class-float) | [damping\_compression](#class-vehiclewheel-property-damping-compression) | `0.83` | | [float](class_float#class-float) | [damping\_relaxation](#class-vehiclewheel-property-damping-relaxation) | `0.88` | | [float](class_float#class-float) | [engine\_force](#class-vehiclewheel-property-engine-force) | `0.0` | | [float](class_float#class-float) | [steering](#class-vehiclewheel-property-steering) | `0.0` | | [float](class_float#class-float) | [suspension\_max\_force](#class-vehiclewheel-property-suspension-max-force) | `6000.0` | | [float](class_float#class-float) | [suspension\_stiffness](#class-vehiclewheel-property-suspension-stiffness) | `5.88` | | [float](class_float#class-float) | [suspension\_travel](#class-vehiclewheel-property-suspension-travel) | `5.0` | | [bool](class_bool#class-bool) | [use\_as\_steering](#class-vehiclewheel-property-use-as-steering) | `false` | | [bool](class_bool#class-bool) | [use\_as\_traction](#class-vehiclewheel-property-use-as-traction) | `false` | | [float](class_float#class-float) | [wheel\_friction\_slip](#class-vehiclewheel-property-wheel-friction-slip) | `10.5` | | [float](class_float#class-float) | [wheel\_radius](#class-vehiclewheel-property-wheel-radius) | `0.5` | | [float](class_float#class-float) | [wheel\_rest\_length](#class-vehiclewheel-property-wheel-rest-length) | `0.15` | | [float](class_float#class-float) | [wheel\_roll\_influence](#class-vehiclewheel-property-wheel-roll-influence) | `0.1` | Methods ------- | | | | --- | --- | | [Spatial](class_spatial#class-spatial) | [get\_contact\_body](#class-vehiclewheel-method-get-contact-body) **(** **)** const | | [float](class_float#class-float) | [get\_rpm](#class-vehiclewheel-method-get-rpm) **(** **)** const | | [float](class_float#class-float) | [get\_skidinfo](#class-vehiclewheel-method-get-skidinfo) **(** **)** const | | [bool](class_bool#class-bool) | [is\_in\_contact](#class-vehiclewheel-method-is-in-contact) **(** **)** const | Property Descriptions --------------------- ### [float](class_float#class-float) brake | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_brake(value) | | *Getter* | get\_brake() | Slows down the wheel by applying a braking force. The wheel is only slowed down if it is in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the [RigidBody.mass](class_rigidbody#class-rigidbody-property-mass) of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking. ### [float](class_float#class-float) damping\_compression | | | | --- | --- | | *Default* | `0.83` | | *Setter* | set\_damping\_compression(value) | | *Getter* | get\_damping\_compression() | The damping applied to the spring when the spring is being compressed. This value should be between 0.0 (no damping) and 1.0. A value of 0.0 means the car will keep bouncing as the spring keeps its energy. A good value for this is around 0.3 for a normal car, 0.5 for a race car. ### [float](class_float#class-float) damping\_relaxation | | | | --- | --- | | *Default* | `0.88` | | *Setter* | set\_damping\_relaxation(value) | | *Getter* | get\_damping\_relaxation() | The damping applied to the spring when relaxing. This value should be between 0.0 (no damping) and 1.0. This value should always be slightly higher than the [damping\_compression](#class-vehiclewheel-property-damping-compression) property. For a [damping\_compression](#class-vehiclewheel-property-damping-compression) value of 0.3, try a relaxation value of 0.5. ### [float](class_float#class-float) engine\_force | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_engine\_force(value) | | *Getter* | get\_engine\_force() | Accelerates the wheel by applying an engine force. The wheel is only sped up if it is in contact with a surface. The [RigidBody.mass](class_rigidbody#class-rigidbody-property-mass) of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. **Note:** The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. A negative value will result in the wheel reversing. ### [float](class_float#class-float) steering | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_steering(value) | | *Getter* | get\_steering() | The steering angle for the wheel. Setting this to a non-zero value will result in the vehicle turning when it's moving. ### [float](class_float#class-float) suspension\_max\_force | | | | --- | --- | | *Default* | `6000.0` | | *Setter* | set\_suspension\_max\_force(value) | | *Getter* | get\_suspension\_max\_force() | The maximum force the spring can resist. This value should be higher than a quarter of the [RigidBody.mass](class_rigidbody#class-rigidbody-property-mass) of the [VehicleBody](class_vehiclebody#class-vehiclebody) or the spring will not carry the weight of the vehicle. Good results are often obtained by a value that is about 3× to 4× this number. ### [float](class_float#class-float) suspension\_stiffness | | | | --- | --- | | *Default* | `5.88` | | *Setter* | set\_suspension\_stiffness(value) | | *Getter* | get\_suspension\_stiffness() | This value defines the stiffness of the suspension. Use a value lower than 50 for an off-road car, a value between 50 and 100 for a race car and try something around 200 for something like a Formula 1 car. ### [float](class_float#class-float) suspension\_travel | | | | --- | --- | | *Default* | `5.0` | | *Setter* | set\_suspension\_travel(value) | | *Getter* | get\_suspension\_travel() | This is the distance the suspension can travel. As Godot units are equivalent to meters, keep this setting relatively low. Try a value between 0.1 and 0.3 depending on the type of car. ### [bool](class_bool#class-bool) use\_as\_steering | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_as\_steering(value) | | *Getter* | is\_used\_as\_steering() | If `true`, this wheel will be turned when the car steers. This value is used in conjunction with [VehicleBody.steering](class_vehiclebody#class-vehiclebody-property-steering) and ignored if you are using the per-wheel [steering](#class-vehiclewheel-property-steering) value instead. ### [bool](class_bool#class-bool) use\_as\_traction | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_as\_traction(value) | | *Getter* | is\_used\_as\_traction() | If `true`, this wheel transfers engine force to the ground to propel the vehicle forward. This value is used in conjunction with [VehicleBody.engine\_force](class_vehiclebody#class-vehiclebody-property-engine-force) and ignored if you are using the per-wheel [engine\_force](#class-vehiclewheel-property-engine-force) value instead. ### [float](class_float#class-float) wheel\_friction\_slip | | | | --- | --- | | *Default* | `10.5` | | *Setter* | set\_friction\_slip(value) | | *Getter* | get\_friction\_slip() | This determines how much grip this wheel has. It is combined with the friction setting of the surface the wheel is in contact with. 0.0 means no grip, 1.0 is normal grip. For a drift car setup, try setting the grip of the rear wheels slightly lower than the front wheels, or use a lower value to simulate tire wear. It's best to set this to 1.0 when starting out. ### [float](class_float#class-float) wheel\_radius | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_radius(value) | | *Getter* | get\_radius() | The radius of the wheel in meters. ### [float](class_float#class-float) wheel\_rest\_length | | | | --- | --- | | *Default* | `0.15` | | *Setter* | set\_suspension\_rest\_length(value) | | *Getter* | get\_suspension\_rest\_length() | This is the distance in meters the wheel is lowered from its origin point. Don't set this to 0.0 and move the wheel into position, instead move the origin point of your wheel (the gizmo in Godot) to the position the wheel will take when bottoming out, then use the rest length to move the wheel down to the position it should be in when the car is in rest. ### [float](class_float#class-float) wheel\_roll\_influence | | | | --- | --- | | *Default* | `0.1` | | *Setter* | set\_roll\_influence(value) | | *Getter* | get\_roll\_influence() | This value affects the roll of your vehicle. If set to 1.0 for all wheels, your vehicle will be prone to rolling over, while a value of 0.0 will resist body roll. Method Descriptions ------------------- ### [Spatial](class_spatial#class-spatial) get\_contact\_body ( ) const Returns the contacting body node if valid in the tree, as [Spatial](class_spatial#class-spatial). At the moment, [GridMap](class_gridmap#class-gridmap) is not supported so the node will be always of type [PhysicsBody](class_physicsbody#class-physicsbody). Returns `null` if the wheel is not in contact with a surface, or the contact body is not a [PhysicsBody](class_physicsbody#class-physicsbody). ### [float](class_float#class-float) get\_rpm ( ) const Returns the rotational speed of the wheel in revolutions per minute. ### [float](class_float#class-float) get\_skidinfo ( ) const Returns a value between 0.0 and 1.0 that indicates whether this wheel is skidding. 0.0 is skidding (the wheel has lost grip, e.g. icy terrain), 1.0 means not skidding (the wheel has full grip, e.g. dry asphalt road). ### [bool](class_bool#class-bool) is\_in\_contact ( ) const Returns `true` if this wheel is in contact with a surface. godot PacketPeerUDP PacketPeerUDP ============= **Inherits:** [PacketPeer](class_packetpeer#class-packetpeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) UDP packet peer. Description ----------- UDP packet peer. Can be used to send raw UDP packets as well as [Variant](class_variant#class-variant)s. Methods ------- | | | | --- | --- | | void | [close](#class-packetpeerudp-method-close) **(** **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [connect\_to\_host](#class-packetpeerudp-method-connect-to-host) **(** [String](class_string#class-string) host, [int](class_int#class-int) port **)** | | [String](class_string#class-string) | [get\_packet\_ip](#class-packetpeerudp-method-get-packet-ip) **(** **)** const | | [int](class_int#class-int) | [get\_packet\_port](#class-packetpeerudp-method-get-packet-port) **(** **)** const | | [bool](class_bool#class-bool) | [is\_connected\_to\_host](#class-packetpeerudp-method-is-connected-to-host) **(** **)** const | | [bool](class_bool#class-bool) | [is\_listening](#class-packetpeerudp-method-is-listening) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [join\_multicast\_group](#class-packetpeerudp-method-join-multicast-group) **(** [String](class_string#class-string) multicast\_address, [String](class_string#class-string) interface\_name **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [leave\_multicast\_group](#class-packetpeerudp-method-leave-multicast-group) **(** [String](class_string#class-string) multicast\_address, [String](class_string#class-string) interface\_name **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [listen](#class-packetpeerudp-method-listen) **(** [int](class_int#class-int) port, [String](class_string#class-string) bind\_address="\*", [int](class_int#class-int) recv\_buf\_size=65536 **)** | | void | [set\_broadcast\_enabled](#class-packetpeerudp-method-set-broadcast-enabled) **(** [bool](class_bool#class-bool) enabled **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [set\_dest\_address](#class-packetpeerudp-method-set-dest-address) **(** [String](class_string#class-string) host, [int](class_int#class-int) port **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [wait](#class-packetpeerudp-method-wait) **(** **)** | Method Descriptions ------------------- ### void close ( ) Closes the UDP socket the `PacketPeerUDP` is currently listening on. ### [Error](class_%40globalscope#enum-globalscope-error) connect\_to\_host ( [String](class_string#class-string) host, [int](class_int#class-int) port ) Calling this method connects this UDP peer to the given `host`/`port` pair. UDP is in reality connectionless, so this option only means that incoming packets from different addresses are automatically discarded, and that outgoing packets are always sent to the connected address (future calls to [set\_dest\_address](#class-packetpeerudp-method-set-dest-address) are not allowed). This method does not send any data to the remote peer, to do that, use [PacketPeer.put\_var](class_packetpeer#class-packetpeer-method-put-var) or [PacketPeer.put\_packet](class_packetpeer#class-packetpeer-method-put-packet) as usual. See also [UDPServer](class_udpserver#class-udpserver). **Note:** Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transferring sensitive information. ### [String](class_string#class-string) get\_packet\_ip ( ) const Returns the IP of the remote peer that sent the last packet(that was received with [PacketPeer.get\_packet](class_packetpeer#class-packetpeer-method-get-packet) or [PacketPeer.get\_var](class_packetpeer#class-packetpeer-method-get-var)). ### [int](class_int#class-int) get\_packet\_port ( ) const Returns the port of the remote peer that sent the last packet(that was received with [PacketPeer.get\_packet](class_packetpeer#class-packetpeer-method-get-packet) or [PacketPeer.get\_var](class_packetpeer#class-packetpeer-method-get-var)). ### [bool](class_bool#class-bool) is\_connected\_to\_host ( ) const Returns `true` if the UDP socket is open and has been connected to a remote address. See [connect\_to\_host](#class-packetpeerudp-method-connect-to-host). ### [bool](class_bool#class-bool) is\_listening ( ) const Returns whether this `PacketPeerUDP` is listening. ### [Error](class_%40globalscope#enum-globalscope-error) join\_multicast\_group ( [String](class_string#class-string) multicast\_address, [String](class_string#class-string) interface\_name ) Joins the multicast group specified by `multicast_address` using the interface identified by `interface_name`. You can join the same multicast group with multiple interfaces. Use [IP.get\_local\_interfaces](class_ip#class-ip-method-get-local-interfaces) to know which are available. **Note:** Some Android devices might require the `CHANGE_WIFI_MULTICAST_STATE` permission for multicast to work. ### [Error](class_%40globalscope#enum-globalscope-error) leave\_multicast\_group ( [String](class_string#class-string) multicast\_address, [String](class_string#class-string) interface\_name ) Removes the interface identified by `interface_name` from the multicast group specified by `multicast_address`. ### [Error](class_%40globalscope#enum-globalscope-error) listen ( [int](class_int#class-int) port, [String](class_string#class-string) bind\_address="\*", [int](class_int#class-int) recv\_buf\_size=65536 ) Makes this `PacketPeerUDP` listen on the `port` binding to `bind_address` with a buffer size `recv_buf_size`. If `bind_address` is set to `"*"` (default), the peer will listen on all available addresses (both IPv4 and IPv6). If `bind_address` is set to `"0.0.0.0"` (for IPv4) or `"::"` (for IPv6), the peer will listen on all available addresses matching that IP type. If `bind_address` is set to any valid address (e.g. `"192.168.1.101"`, `"::1"`, etc), the peer will only listen on the interface with that addresses (or fail if no interface with the given address exists). ### void set\_broadcast\_enabled ( [bool](class_bool#class-bool) enabled ) Enable or disable sending of broadcast packets (e.g. `set_dest_address("255.255.255.255", 4343)`. This option is disabled by default. **Note:** Some Android devices might require the `CHANGE_WIFI_MULTICAST_STATE` permission and this option to be enabled to receive broadcast packets too. ### [Error](class_%40globalscope#enum-globalscope-error) set\_dest\_address ( [String](class_string#class-string) host, [int](class_int#class-int) port ) Sets the destination address and port for sending packets and variables. A hostname will be resolved using DNS if needed. **Note:** [set\_broadcast\_enabled](#class-packetpeerudp-method-set-broadcast-enabled) must be enabled before sending packets to a broadcast address (e.g. `255.255.255.255`). ### [Error](class_%40globalscope#enum-globalscope-error) wait ( ) Waits for a packet to arrive on the listening port. See [listen](#class-packetpeerudp-method-listen). **Note:** [wait](#class-packetpeerudp-method-wait) can't be interrupted once it has been called. This can be worked around by allowing the other party to send a specific "death pill" packet like this: ``` # Server socket.set_dest_address("127.0.0.1", 789) socket.put_packet("Time to stop".to_ascii()) # Client while socket.wait() == OK: var data = socket.get_packet().get_string_from_ascii() if data == "Time to stop": return ```
programming_docs
godot TextureProgress TextureProgress =============== **Inherits:** [Range](class_range#class-range) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Texture-based progress bar. Useful for loading screens and life or stamina bars. Description ----------- TextureProgress works like [ProgressBar](class_progressbar#class-progressbar), but uses up to 3 textures instead of Godot's [Theme](class_theme#class-theme) resource. It can be used to create horizontal, vertical and radial progress bars. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [fill\_mode](#class-textureprogress-property-fill-mode) | `0` | | [MouseFilter](class_control#enum-control-mousefilter) | mouse\_filter | `1` (overrides [Control](class_control#class-control-property-mouse-filter)) | | [bool](class_bool#class-bool) | [nine\_patch\_stretch](#class-textureprogress-property-nine-patch-stretch) | `false` | | [Vector2](class_vector2#class-vector2) | [radial\_center\_offset](#class-textureprogress-property-radial-center-offset) | `Vector2( 0, 0 )` | | [float](class_float#class-float) | [radial\_fill\_degrees](#class-textureprogress-property-radial-fill-degrees) | `360.0` | | [float](class_float#class-float) | [radial\_initial\_angle](#class-textureprogress-property-radial-initial-angle) | `0.0` | | [int](class_int#class-int) | [stretch\_margin\_bottom](#class-textureprogress-property-stretch-margin-bottom) | `0` | | [int](class_int#class-int) | [stretch\_margin\_left](#class-textureprogress-property-stretch-margin-left) | `0` | | [int](class_int#class-int) | [stretch\_margin\_right](#class-textureprogress-property-stretch-margin-right) | `0` | | [int](class_int#class-int) | [stretch\_margin\_top](#class-textureprogress-property-stretch-margin-top) | `0` | | [Texture](class_texture#class-texture) | [texture\_over](#class-textureprogress-property-texture-over) | | | [Texture](class_texture#class-texture) | [texture\_progress](#class-textureprogress-property-texture-progress) | | | [Vector2](class_vector2#class-vector2) | [texture\_progress\_offset](#class-textureprogress-property-texture-progress-offset) | `Vector2( 0, 0 )` | | [Texture](class_texture#class-texture) | [texture\_under](#class-textureprogress-property-texture-under) | | | [Color](class_color#class-color) | [tint\_over](#class-textureprogress-property-tint-over) | `Color( 1, 1, 1, 1 )` | | [Color](class_color#class-color) | [tint\_progress](#class-textureprogress-property-tint-progress) | `Color( 1, 1, 1, 1 )` | | [Color](class_color#class-color) | [tint\_under](#class-textureprogress-property-tint-under) | `Color( 1, 1, 1, 1 )` | Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [get\_stretch\_margin](#class-textureprogress-method-get-stretch-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin **)** const | | void | [set\_stretch\_margin](#class-textureprogress-method-set-stretch-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin, [int](class_int#class-int) value **)** | Enumerations ------------ enum **FillMode**: * **FILL\_LEFT\_TO\_RIGHT** = **0** --- The [texture\_progress](#class-textureprogress-property-texture-progress) fills from left to right. * **FILL\_RIGHT\_TO\_LEFT** = **1** --- The [texture\_progress](#class-textureprogress-property-texture-progress) fills from right to left. * **FILL\_TOP\_TO\_BOTTOM** = **2** --- The [texture\_progress](#class-textureprogress-property-texture-progress) fills from top to bottom. * **FILL\_BOTTOM\_TO\_TOP** = **3** --- The [texture\_progress](#class-textureprogress-property-texture-progress) fills from bottom to top. * **FILL\_CLOCKWISE** = **4** --- Turns the node into a radial bar. The [texture\_progress](#class-textureprogress-property-texture-progress) fills clockwise. See [radial\_center\_offset](#class-textureprogress-property-radial-center-offset), [radial\_initial\_angle](#class-textureprogress-property-radial-initial-angle) and [radial\_fill\_degrees](#class-textureprogress-property-radial-fill-degrees) to control the way the bar fills up. * **FILL\_COUNTER\_CLOCKWISE** = **5** --- Turns the node into a radial bar. The [texture\_progress](#class-textureprogress-property-texture-progress) fills counterclockwise. See [radial\_center\_offset](#class-textureprogress-property-radial-center-offset), [radial\_initial\_angle](#class-textureprogress-property-radial-initial-angle) and [radial\_fill\_degrees](#class-textureprogress-property-radial-fill-degrees) to control the way the bar fills up. * **FILL\_BILINEAR\_LEFT\_AND\_RIGHT** = **6** --- The [texture\_progress](#class-textureprogress-property-texture-progress) fills from the center, expanding both towards the left and the right. * **FILL\_BILINEAR\_TOP\_AND\_BOTTOM** = **7** --- The [texture\_progress](#class-textureprogress-property-texture-progress) fills from the center, expanding both towards the top and the bottom. * **FILL\_CLOCKWISE\_AND\_COUNTER\_CLOCKWISE** = **8** --- Turns the node into a radial bar. The [texture\_progress](#class-textureprogress-property-texture-progress) fills radially from the center, expanding both clockwise and counterclockwise. See [radial\_center\_offset](#class-textureprogress-property-radial-center-offset), [radial\_initial\_angle](#class-textureprogress-property-radial-initial-angle) and [radial\_fill\_degrees](#class-textureprogress-property-radial-fill-degrees) to control the way the bar fills up. Property Descriptions --------------------- ### [int](class_int#class-int) fill\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_fill\_mode(value) | | *Getter* | get\_fill\_mode() | The fill direction. See [FillMode](#enum-textureprogress-fillmode) for possible values. ### [bool](class_bool#class-bool) nine\_patch\_stretch | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_nine\_patch\_stretch(value) | | *Getter* | get\_nine\_patch\_stretch() | If `true`, Godot treats the bar's textures like in [NinePatchRect](class_ninepatchrect#class-ninepatchrect). Use the `stretch_margin_*` properties like [stretch\_margin\_bottom](#class-textureprogress-property-stretch-margin-bottom) to set up the nine patch's 3×3 grid. When using a radial [fill\_mode](#class-textureprogress-property-fill-mode), this setting will enable stretching. ### [Vector2](class_vector2#class-vector2) radial\_center\_offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_radial\_center\_offset(value) | | *Getter* | get\_radial\_center\_offset() | Offsets [texture\_progress](#class-textureprogress-property-texture-progress) if [fill\_mode](#class-textureprogress-property-fill-mode) is [FILL\_CLOCKWISE](#class-textureprogress-constant-fill-clockwise) or [FILL\_COUNTER\_CLOCKWISE](#class-textureprogress-constant-fill-counter-clockwise). ### [float](class_float#class-float) radial\_fill\_degrees | | | | --- | --- | | *Default* | `360.0` | | *Setter* | set\_fill\_degrees(value) | | *Getter* | get\_fill\_degrees() | Upper limit for the fill of [texture\_progress](#class-textureprogress-property-texture-progress) if [fill\_mode](#class-textureprogress-property-fill-mode) is [FILL\_CLOCKWISE](#class-textureprogress-constant-fill-clockwise) or [FILL\_COUNTER\_CLOCKWISE](#class-textureprogress-constant-fill-counter-clockwise). When the node's `value` is equal to its `max_value`, the texture fills up to this angle. See [Range.value](class_range#class-range-property-value), [Range.max\_value](class_range#class-range-property-max-value). ### [float](class_float#class-float) radial\_initial\_angle | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_radial\_initial\_angle(value) | | *Getter* | get\_radial\_initial\_angle() | Starting angle for the fill of [texture\_progress](#class-textureprogress-property-texture-progress) if [fill\_mode](#class-textureprogress-property-fill-mode) is [FILL\_CLOCKWISE](#class-textureprogress-constant-fill-clockwise) or [FILL\_COUNTER\_CLOCKWISE](#class-textureprogress-constant-fill-counter-clockwise). When the node's `value` is equal to its `min_value`, the texture doesn't show up at all. When the `value` increases, the texture fills and tends towards [radial\_fill\_degrees](#class-textureprogress-property-radial-fill-degrees). ### [int](class_int#class-int) stretch\_margin\_bottom | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_stretch\_margin(value) | | *Getter* | get\_stretch\_margin() | The height of the 9-patch's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. ### [int](class_int#class-int) stretch\_margin\_left | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_stretch\_margin(value) | | *Getter* | get\_stretch\_margin() | The width of the 9-patch's left column. ### [int](class_int#class-int) stretch\_margin\_right | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_stretch\_margin(value) | | *Getter* | get\_stretch\_margin() | The width of the 9-patch's right column. ### [int](class_int#class-int) stretch\_margin\_top | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_stretch\_margin(value) | | *Getter* | get\_stretch\_margin() | The height of the 9-patch's top row. ### [Texture](class_texture#class-texture) texture\_over | | | | --- | --- | | *Setter* | set\_over\_texture(value) | | *Getter* | get\_over\_texture() | [Texture](class_texture#class-texture) that draws over the progress bar. Use it to add highlights or an upper-frame that hides part of [texture\_progress](#class-textureprogress-property-texture-progress). ### [Texture](class_texture#class-texture) texture\_progress | | | | --- | --- | | *Setter* | set\_progress\_texture(value) | | *Getter* | get\_progress\_texture() | [Texture](class_texture#class-texture) that clips based on the node's `value` and [fill\_mode](#class-textureprogress-property-fill-mode). As `value` increased, the texture fills up. It shows entirely when `value` reaches `max_value`. It doesn't show at all if `value` is equal to `min_value`. The `value` property comes from [Range](class_range#class-range). See [Range.value](class_range#class-range-property-value), [Range.min\_value](class_range#class-range-property-min-value), [Range.max\_value](class_range#class-range-property-max-value). ### [Vector2](class_vector2#class-vector2) texture\_progress\_offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_texture\_progress\_offset(value) | | *Getter* | get\_texture\_progress\_offset() | The offset of [texture\_progress](#class-textureprogress-property-texture-progress). Useful for [texture\_over](#class-textureprogress-property-texture-over) and [texture\_under](#class-textureprogress-property-texture-under) with fancy borders, to avoid transparent margins in your progress texture. ### [Texture](class_texture#class-texture) texture\_under | | | | --- | --- | | *Setter* | set\_under\_texture(value) | | *Getter* | get\_under\_texture() | [Texture](class_texture#class-texture) that draws under the progress bar. The bar's background. ### [Color](class_color#class-color) tint\_over | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_tint\_over(value) | | *Getter* | get\_tint\_over() | Multiplies the color of the bar's `texture_over` texture. The effect is similar to [CanvasItem.modulate](class_canvasitem#class-canvasitem-property-modulate), except it only affects this specific texture instead of the entire node. ### [Color](class_color#class-color) tint\_progress | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_tint\_progress(value) | | *Getter* | get\_tint\_progress() | Multiplies the color of the bar's `texture_progress` texture. ### [Color](class_color#class-color) tint\_under | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_tint\_under(value) | | *Getter* | get\_tint\_under() | Multiplies the color of the bar's `texture_under` texture. Method Descriptions ------------------- ### [int](class_int#class-int) get\_stretch\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin ) const ### void set\_stretch\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin, [int](class_int#class-int) value ) godot AudioEffectChorus AudioEffectChorus ================= **Inherits:** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Adds a chorus audio effect. Description ----------- Adds a chorus audio effect. The effect applies a filter with voices to duplicate the audio source and manipulate it through the filter. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [dry](#class-audioeffectchorus-property-dry) | `1.0` | | [float](class_float#class-float) | [voice/1/cutoff\_hz](#class-audioeffectchorus-property-voice-1-cutoff-hz) | `8000.0` | | [float](class_float#class-float) | [voice/1/delay\_ms](#class-audioeffectchorus-property-voice-1-delay-ms) | `15.0` | | [float](class_float#class-float) | [voice/1/depth\_ms](#class-audioeffectchorus-property-voice-1-depth-ms) | `2.0` | | [float](class_float#class-float) | [voice/1/level\_db](#class-audioeffectchorus-property-voice-1-level-db) | `0.0` | | [float](class_float#class-float) | [voice/1/pan](#class-audioeffectchorus-property-voice-1-pan) | `-0.5` | | [float](class_float#class-float) | [voice/1/rate\_hz](#class-audioeffectchorus-property-voice-1-rate-hz) | `0.8` | | [float](class_float#class-float) | [voice/2/cutoff\_hz](#class-audioeffectchorus-property-voice-2-cutoff-hz) | `8000.0` | | [float](class_float#class-float) | [voice/2/delay\_ms](#class-audioeffectchorus-property-voice-2-delay-ms) | `20.0` | | [float](class_float#class-float) | [voice/2/depth\_ms](#class-audioeffectchorus-property-voice-2-depth-ms) | `3.0` | | [float](class_float#class-float) | [voice/2/level\_db](#class-audioeffectchorus-property-voice-2-level-db) | `0.0` | | [float](class_float#class-float) | [voice/2/pan](#class-audioeffectchorus-property-voice-2-pan) | `0.5` | | [float](class_float#class-float) | [voice/2/rate\_hz](#class-audioeffectchorus-property-voice-2-rate-hz) | `1.2` | | [float](class_float#class-float) | [voice/3/cutoff\_hz](#class-audioeffectchorus-property-voice-3-cutoff-hz) | | | [float](class_float#class-float) | [voice/3/delay\_ms](#class-audioeffectchorus-property-voice-3-delay-ms) | | | [float](class_float#class-float) | [voice/3/depth\_ms](#class-audioeffectchorus-property-voice-3-depth-ms) | | | [float](class_float#class-float) | [voice/3/level\_db](#class-audioeffectchorus-property-voice-3-level-db) | | | [float](class_float#class-float) | [voice/3/pan](#class-audioeffectchorus-property-voice-3-pan) | | | [float](class_float#class-float) | [voice/3/rate\_hz](#class-audioeffectchorus-property-voice-3-rate-hz) | | | [float](class_float#class-float) | [voice/4/cutoff\_hz](#class-audioeffectchorus-property-voice-4-cutoff-hz) | | | [float](class_float#class-float) | [voice/4/delay\_ms](#class-audioeffectchorus-property-voice-4-delay-ms) | | | [float](class_float#class-float) | [voice/4/depth\_ms](#class-audioeffectchorus-property-voice-4-depth-ms) | | | [float](class_float#class-float) | [voice/4/level\_db](#class-audioeffectchorus-property-voice-4-level-db) | | | [float](class_float#class-float) | [voice/4/pan](#class-audioeffectchorus-property-voice-4-pan) | | | [float](class_float#class-float) | [voice/4/rate\_hz](#class-audioeffectchorus-property-voice-4-rate-hz) | | | [int](class_int#class-int) | [voice\_count](#class-audioeffectchorus-property-voice-count) | `2` | | [float](class_float#class-float) | [wet](#class-audioeffectchorus-property-wet) | `0.5` | Methods ------- | | | | --- | --- | | [float](class_float#class-float) | [get\_voice\_cutoff\_hz](#class-audioeffectchorus-method-get-voice-cutoff-hz) **(** [int](class_int#class-int) voice\_idx **)** const | | [float](class_float#class-float) | [get\_voice\_delay\_ms](#class-audioeffectchorus-method-get-voice-delay-ms) **(** [int](class_int#class-int) voice\_idx **)** const | | [float](class_float#class-float) | [get\_voice\_depth\_ms](#class-audioeffectchorus-method-get-voice-depth-ms) **(** [int](class_int#class-int) voice\_idx **)** const | | [float](class_float#class-float) | [get\_voice\_level\_db](#class-audioeffectchorus-method-get-voice-level-db) **(** [int](class_int#class-int) voice\_idx **)** const | | [float](class_float#class-float) | [get\_voice\_pan](#class-audioeffectchorus-method-get-voice-pan) **(** [int](class_int#class-int) voice\_idx **)** const | | [float](class_float#class-float) | [get\_voice\_rate\_hz](#class-audioeffectchorus-method-get-voice-rate-hz) **(** [int](class_int#class-int) voice\_idx **)** const | | void | [set\_voice\_cutoff\_hz](#class-audioeffectchorus-method-set-voice-cutoff-hz) **(** [int](class_int#class-int) voice\_idx, [float](class_float#class-float) cutoff\_hz **)** | | void | [set\_voice\_delay\_ms](#class-audioeffectchorus-method-set-voice-delay-ms) **(** [int](class_int#class-int) voice\_idx, [float](class_float#class-float) delay\_ms **)** | | void | [set\_voice\_depth\_ms](#class-audioeffectchorus-method-set-voice-depth-ms) **(** [int](class_int#class-int) voice\_idx, [float](class_float#class-float) depth\_ms **)** | | void | [set\_voice\_level\_db](#class-audioeffectchorus-method-set-voice-level-db) **(** [int](class_int#class-int) voice\_idx, [float](class_float#class-float) level\_db **)** | | void | [set\_voice\_pan](#class-audioeffectchorus-method-set-voice-pan) **(** [int](class_int#class-int) voice\_idx, [float](class_float#class-float) pan **)** | | void | [set\_voice\_rate\_hz](#class-audioeffectchorus-method-set-voice-rate-hz) **(** [int](class_int#class-int) voice\_idx, [float](class_float#class-float) rate\_hz **)** | Property Descriptions --------------------- ### [float](class_float#class-float) dry | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_dry(value) | | *Getter* | get\_dry() | The effect's raw signal. ### [float](class_float#class-float) voice/1/cutoff\_hz | | | | --- | --- | | *Default* | `8000.0` | | *Setter* | set\_voice\_cutoff\_hz(value) | | *Getter* | get\_voice\_cutoff\_hz() | The voice's cutoff frequency. ### [float](class_float#class-float) voice/1/delay\_ms | | | | --- | --- | | *Default* | `15.0` | | *Setter* | set\_voice\_delay\_ms(value) | | *Getter* | get\_voice\_delay\_ms() | The voice's signal delay. ### [float](class_float#class-float) voice/1/depth\_ms | | | | --- | --- | | *Default* | `2.0` | | *Setter* | set\_voice\_depth\_ms(value) | | *Getter* | get\_voice\_depth\_ms() | The voice filter's depth. ### [float](class_float#class-float) voice/1/level\_db | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_voice\_level\_db(value) | | *Getter* | get\_voice\_level\_db() | The voice's volume. ### [float](class_float#class-float) voice/1/pan | | | | --- | --- | | *Default* | `-0.5` | | *Setter* | set\_voice\_pan(value) | | *Getter* | get\_voice\_pan() | The voice's pan level. ### [float](class_float#class-float) voice/1/rate\_hz | | | | --- | --- | | *Default* | `0.8` | | *Setter* | set\_voice\_rate\_hz(value) | | *Getter* | get\_voice\_rate\_hz() | The voice's filter rate. ### [float](class_float#class-float) voice/2/cutoff\_hz | | | | --- | --- | | *Default* | `8000.0` | | *Setter* | set\_voice\_cutoff\_hz(value) | | *Getter* | get\_voice\_cutoff\_hz() | The voice's cutoff frequency. ### [float](class_float#class-float) voice/2/delay\_ms | | | | --- | --- | | *Default* | `20.0` | | *Setter* | set\_voice\_delay\_ms(value) | | *Getter* | get\_voice\_delay\_ms() | The voice's signal delay. ### [float](class_float#class-float) voice/2/depth\_ms | | | | --- | --- | | *Default* | `3.0` | | *Setter* | set\_voice\_depth\_ms(value) | | *Getter* | get\_voice\_depth\_ms() | The voice filter's depth. ### [float](class_float#class-float) voice/2/level\_db | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_voice\_level\_db(value) | | *Getter* | get\_voice\_level\_db() | The voice's volume. ### [float](class_float#class-float) voice/2/pan | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_voice\_pan(value) | | *Getter* | get\_voice\_pan() | The voice's pan level. ### [float](class_float#class-float) voice/2/rate\_hz | | | | --- | --- | | *Default* | `1.2` | | *Setter* | set\_voice\_rate\_hz(value) | | *Getter* | get\_voice\_rate\_hz() | The voice's filter rate. ### [float](class_float#class-float) voice/3/cutoff\_hz | | | | --- | --- | | *Setter* | set\_voice\_cutoff\_hz(value) | | *Getter* | get\_voice\_cutoff\_hz() | The voice's cutoff frequency. ### [float](class_float#class-float) voice/3/delay\_ms | | | | --- | --- | | *Setter* | set\_voice\_delay\_ms(value) | | *Getter* | get\_voice\_delay\_ms() | The voice's signal delay. ### [float](class_float#class-float) voice/3/depth\_ms | | | | --- | --- | | *Setter* | set\_voice\_depth\_ms(value) | | *Getter* | get\_voice\_depth\_ms() | The voice filter's depth. ### [float](class_float#class-float) voice/3/level\_db | | | | --- | --- | | *Setter* | set\_voice\_level\_db(value) | | *Getter* | get\_voice\_level\_db() | The voice's volume. ### [float](class_float#class-float) voice/3/pan | | | | --- | --- | | *Setter* | set\_voice\_pan(value) | | *Getter* | get\_voice\_pan() | The voice's pan level. ### [float](class_float#class-float) voice/3/rate\_hz | | | | --- | --- | | *Setter* | set\_voice\_rate\_hz(value) | | *Getter* | get\_voice\_rate\_hz() | The voice's filter rate. ### [float](class_float#class-float) voice/4/cutoff\_hz | | | | --- | --- | | *Setter* | set\_voice\_cutoff\_hz(value) | | *Getter* | get\_voice\_cutoff\_hz() | The voice's cutoff frequency. ### [float](class_float#class-float) voice/4/delay\_ms | | | | --- | --- | | *Setter* | set\_voice\_delay\_ms(value) | | *Getter* | get\_voice\_delay\_ms() | The voice's signal delay. ### [float](class_float#class-float) voice/4/depth\_ms | | | | --- | --- | | *Setter* | set\_voice\_depth\_ms(value) | | *Getter* | get\_voice\_depth\_ms() | The voice filter's depth. ### [float](class_float#class-float) voice/4/level\_db | | | | --- | --- | | *Setter* | set\_voice\_level\_db(value) | | *Getter* | get\_voice\_level\_db() | The voice's volume. ### [float](class_float#class-float) voice/4/pan | | | | --- | --- | | *Setter* | set\_voice\_pan(value) | | *Getter* | get\_voice\_pan() | The voice's pan level. ### [float](class_float#class-float) voice/4/rate\_hz | | | | --- | --- | | *Setter* | set\_voice\_rate\_hz(value) | | *Getter* | get\_voice\_rate\_hz() | The voice's filter rate. ### [int](class_int#class-int) voice\_count | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_voice\_count(value) | | *Getter* | get\_voice\_count() | The amount of voices in the effect. ### [float](class_float#class-float) wet | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_wet(value) | | *Getter* | get\_wet() | The effect's processed signal. Method Descriptions ------------------- ### [float](class_float#class-float) get\_voice\_cutoff\_hz ( [int](class_int#class-int) voice\_idx ) const ### [float](class_float#class-float) get\_voice\_delay\_ms ( [int](class_int#class-int) voice\_idx ) const ### [float](class_float#class-float) get\_voice\_depth\_ms ( [int](class_int#class-int) voice\_idx ) const ### [float](class_float#class-float) get\_voice\_level\_db ( [int](class_int#class-int) voice\_idx ) const ### [float](class_float#class-float) get\_voice\_pan ( [int](class_int#class-int) voice\_idx ) const ### [float](class_float#class-float) get\_voice\_rate\_hz ( [int](class_int#class-int) voice\_idx ) const ### void set\_voice\_cutoff\_hz ( [int](class_int#class-int) voice\_idx, [float](class_float#class-float) cutoff\_hz ) ### void set\_voice\_delay\_ms ( [int](class_int#class-int) voice\_idx, [float](class_float#class-float) delay\_ms ) ### void set\_voice\_depth\_ms ( [int](class_int#class-int) voice\_idx, [float](class_float#class-float) depth\_ms ) ### void set\_voice\_level\_db ( [int](class_int#class-int) voice\_idx, [float](class_float#class-float) level\_db ) ### void set\_voice\_pan ( [int](class_int#class-int) voice\_idx, [float](class_float#class-float) pan ) ### void set\_voice\_rate\_hz ( [int](class_int#class-int) voice\_idx, [float](class_float#class-float) rate\_hz )
programming_docs
godot VisibilityEnabler VisibilityEnabler ================= **Inherits:** [VisibilityNotifier](class_visibilitynotifier#class-visibilitynotifier) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Enables certain nodes only when approximately visible. Description ----------- The VisibilityEnabler will disable [RigidBody](class_rigidbody#class-rigidbody) and [AnimationPlayer](class_animationplayer#class-animationplayer) nodes when they are not visible. It will only affect other nodes within the same scene as the VisibilityEnabler itself. If you just want to receive notifications, use [VisibilityNotifier](class_visibilitynotifier#class-visibilitynotifier) instead. **Note:** VisibilityEnabler uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account (unless you are using [Portal](class_portal#class-portal)s). The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an [Area](class_area#class-area) node as a child of a [Camera](class_camera#class-camera) node and/or [Vector3.dot](class_vector3#class-vector3-method-dot). **Note:** VisibilityEnabler will not affect nodes added after scene initialization. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [freeze\_bodies](#class-visibilityenabler-property-freeze-bodies) | `true` | | [bool](class_bool#class-bool) | [pause\_animations](#class-visibilityenabler-property-pause-animations) | `true` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [is\_enabler\_enabled](#class-visibilityenabler-method-is-enabler-enabled) **(** [Enabler](#enum-visibilityenabler-enabler) enabler **)** const | | void | [set\_enabler](#class-visibilityenabler-method-set-enabler) **(** [Enabler](#enum-visibilityenabler-enabler) enabler, [bool](class_bool#class-bool) enabled **)** | Enumerations ------------ enum **Enabler**: * **ENABLER\_PAUSE\_ANIMATIONS** = **0** --- This enabler will pause [AnimationPlayer](class_animationplayer#class-animationplayer) nodes. * **ENABLER\_FREEZE\_BODIES** = **1** --- This enabler will freeze [RigidBody](class_rigidbody#class-rigidbody) nodes. * **ENABLER\_MAX** = **2** --- Represents the size of the [Enabler](#enum-visibilityenabler-enabler) enum. Property Descriptions --------------------- ### [bool](class_bool#class-bool) freeze\_bodies | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_enabler(value) | | *Getter* | is\_enabler\_enabled() | If `true`, [RigidBody](class_rigidbody#class-rigidbody) nodes will be paused. ### [bool](class_bool#class-bool) pause\_animations | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_enabler(value) | | *Getter* | is\_enabler\_enabled() | If `true`, [AnimationPlayer](class_animationplayer#class-animationplayer) nodes will be paused. Method Descriptions ------------------- ### [bool](class_bool#class-bool) is\_enabler\_enabled ( [Enabler](#enum-visibilityenabler-enabler) enabler ) const Returns whether the enabler identified by given [Enabler](#enum-visibilityenabler-enabler) constant is active. ### void set\_enabler ( [Enabler](#enum-visibilityenabler-enabler) enabler, [bool](class_bool#class-bool) enabled ) Sets active state of the enabler identified by given [Enabler](#enum-visibilityenabler-enabler) constant. godot VisualScriptConstant VisualScriptConstant ==================== **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Gets a contant's value. Description ----------- This node returns a constant's value. **Input Ports:** none **Output Ports:** * Data (variant): `get` Properties ---------- | | | | | --- | --- | --- | | [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) | [type](#class-visualscriptconstant-property-type) | `0` | | [Variant](class_variant#class-variant) | [value](#class-visualscriptconstant-property-value) | | Property Descriptions --------------------- ### [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_constant\_type(value) | | *Getter* | get\_constant\_type() | The constant's type. ### [Variant](class_variant#class-variant) value | | | | --- | --- | | *Setter* | set\_constant\_value(value) | | *Getter* | get\_constant\_value() | The constant's value. godot NavigationAgent NavigationAgent =============== **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) 3D agent used in navigation for collision avoidance. Description ----------- 3D agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO (Reciprocal Velocity Obstacles) collision avoidance. The agent needs navigation data to work correctly. By default this node will register to the default [World](class_world#class-world) navigation map. If this node is a child of a [Navigation](class_navigation#class-navigation) node it will register to the navigation map of the navigation node or the function [set\_navigation](#class-navigationagent-method-set-navigation) can be used to set the navigation node directly. `NavigationAgent` is physics safe. **Note:** After [set\_target\_location](#class-navigationagent-method-set-target-location) is used it is required to use the [get\_next\_location](#class-navigationagent-method-get-next-location) function once every physics frame to update the internal path logic of the NavigationAgent. The returned vector position from this function should be used as the next movement position for the agent's parent Node. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [agent\_height\_offset](#class-navigationagent-property-agent-height-offset) | `0.0` | | [bool](class_bool#class-bool) | [avoidance\_enabled](#class-navigationagent-property-avoidance-enabled) | `false` | | [bool](class_bool#class-bool) | [ignore\_y](#class-navigationagent-property-ignore-y) | `true` | | [int](class_int#class-int) | [max\_neighbors](#class-navigationagent-property-max-neighbors) | `10` | | [float](class_float#class-float) | [max\_speed](#class-navigationagent-property-max-speed) | `10.0` | | [int](class_int#class-int) | [navigation\_layers](#class-navigationagent-property-navigation-layers) | `1` | | [float](class_float#class-float) | [neighbor\_dist](#class-navigationagent-property-neighbor-dist) | `50.0` | | [float](class_float#class-float) | [path\_desired\_distance](#class-navigationagent-property-path-desired-distance) | `1.0` | | [float](class_float#class-float) | [path\_max\_distance](#class-navigationagent-property-path-max-distance) | `3.0` | | [float](class_float#class-float) | [radius](#class-navigationagent-property-radius) | `1.0` | | [float](class_float#class-float) | [target\_desired\_distance](#class-navigationagent-property-target-desired-distance) | `1.0` | | [float](class_float#class-float) | [time\_horizon](#class-navigationagent-property-time-horizon) | `5.0` | Methods ------- | | | | --- | --- | | [float](class_float#class-float) | [distance\_to\_target](#class-navigationagent-method-distance-to-target) **(** **)** const | | [Vector3](class_vector3#class-vector3) | [get\_final\_location](#class-navigationagent-method-get-final-location) **(** **)** | | [PoolVector3Array](class_poolvector3array#class-poolvector3array) | [get\_nav\_path](#class-navigationagent-method-get-nav-path) **(** **)** const | | [int](class_int#class-int) | [get\_nav\_path\_index](#class-navigationagent-method-get-nav-path-index) **(** **)** const | | [Node](class_node#class-node) | [get\_navigation](#class-navigationagent-method-get-navigation) **(** **)** const | | [RID](class_rid#class-rid) | [get\_navigation\_map](#class-navigationagent-method-get-navigation-map) **(** **)** const | | [Vector3](class_vector3#class-vector3) | [get\_next\_location](#class-navigationagent-method-get-next-location) **(** **)** | | [RID](class_rid#class-rid) | [get\_rid](#class-navigationagent-method-get-rid) **(** **)** const | | [Vector3](class_vector3#class-vector3) | [get\_target\_location](#class-navigationagent-method-get-target-location) **(** **)** const | | [bool](class_bool#class-bool) | [is\_navigation\_finished](#class-navigationagent-method-is-navigation-finished) **(** **)** | | [bool](class_bool#class-bool) | [is\_target\_reachable](#class-navigationagent-method-is-target-reachable) **(** **)** | | [bool](class_bool#class-bool) | [is\_target\_reached](#class-navigationagent-method-is-target-reached) **(** **)** const | | void | [set\_navigation](#class-navigationagent-method-set-navigation) **(** [Node](class_node#class-node) navigation **)** | | void | [set\_navigation\_map](#class-navigationagent-method-set-navigation-map) **(** [RID](class_rid#class-rid) navigation\_map **)** | | void | [set\_target\_location](#class-navigationagent-method-set-target-location) **(** [Vector3](class_vector3#class-vector3) location **)** | | void | [set\_velocity](#class-navigationagent-method-set-velocity) **(** [Vector3](class_vector3#class-vector3) velocity **)** | Signals ------- ### navigation\_finished ( ) Notifies when the final location is reached. ### path\_changed ( ) Notifies when the navigation path changes. This can be triggered by the navigation system or by the user changing the path. ### target\_reached ( ) Notifies when the player-defined target, set with [set\_target\_location](#class-navigationagent-method-set-target-location), is reached. ### velocity\_computed ( [Vector3](class_vector3#class-vector3) safe\_velocity ) Notifies when the collision avoidance velocity is calculated after a call to [set\_velocity](#class-navigationagent-method-set-velocity). Only emitted when [avoidance\_enabled](#class-navigationagent-property-avoidance-enabled) is true. Property Descriptions --------------------- ### [float](class_float#class-float) agent\_height\_offset | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_agent\_height\_offset(value) | | *Getter* | get\_agent\_height\_offset() | The NavigationAgent height offset is subtracted from the y-axis value of any vector path position for this NavigationAgent. The NavigationAgent height offset does not change or influence the navigation mesh or pathfinding query result. Additional navigation maps that use regions with navigation meshes that the developer baked with appropriate agent radius or height values are required to support different-sized agents. ### [bool](class_bool#class-bool) avoidance\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_avoidance\_enabled(value) | | *Getter* | get\_avoidance\_enabled() | If `true` the agent is registered for an RVO avoidance callback on the [NavigationServer](class_navigationserver#class-navigationserver). When [set\_velocity](#class-navigationagent-method-set-velocity) is used and the processing is completed a `safe_velocity` Vector3 is received with a signal connection to [velocity\_computed](#class-navigationagent-signal-velocity-computed). Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it. ### [bool](class_bool#class-bool) ignore\_y | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_ignore\_y(value) | | *Getter* | get\_ignore\_y() | Ignores collisions on the Y axis. Must be `true` to move on a horizontal plane. ### [int](class_int#class-int) max\_neighbors | | | | --- | --- | | *Default* | `10` | | *Setter* | set\_max\_neighbors(value) | | *Getter* | get\_max\_neighbors() | The maximum number of neighbors for the agent to consider. ### [float](class_float#class-float) max\_speed | | | | --- | --- | | *Default* | `10.0` | | *Setter* | set\_max\_speed(value) | | *Getter* | get\_max\_speed() | The maximum speed that an agent can move. ### [int](class_int#class-int) navigation\_layers | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_navigation\_layers(value) | | *Getter* | get\_navigation\_layers() | A bitfield determining all navigation map layers the `NavigationAgent` belongs to. On path requests the agent will ignore navmeshes without at least one matching layer. ### [float](class_float#class-float) neighbor\_dist | | | | --- | --- | | *Default* | `50.0` | | *Setter* | set\_neighbor\_dist(value) | | *Getter* | get\_neighbor\_dist() | The distance to search for other agents. ### [float](class_float#class-float) path\_desired\_distance | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_path\_desired\_distance(value) | | *Getter* | get\_path\_desired\_distance() | The distance threshold before a path point is considered to be reached. This will allow an agent to not have to hit a path point on the path exactly, but in the area. If this value is set to high the NavigationAgent will skip points on the path which can lead to leaving the navigation mesh. If this value is set to low the NavigationAgent will be stuck in a repath loop cause it will constantly overshoot or undershoot the distance to the next point on each physics frame update. ### [float](class_float#class-float) path\_max\_distance | | | | --- | --- | | *Default* | `3.0` | | *Setter* | set\_path\_max\_distance(value) | | *Getter* | get\_path\_max\_distance() | The maximum distance the agent is allowed away from the ideal path to the final location. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path. ### [float](class_float#class-float) radius | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_radius(value) | | *Getter* | get\_radius() | The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [neighbor\_dist](#class-navigationagent-property-neighbor-dist)). Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh](class_navigationmesh#class-navigationmesh) resources with a different [NavigationMesh.agent\_radius](class_navigationmesh#class-navigationmesh-property-agent-radius) property and use different navigation maps for each actor size. ### [float](class_float#class-float) target\_desired\_distance | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_target\_desired\_distance(value) | | *Getter* | get\_target\_desired\_distance() | The distance threshold before the final target point is considered to be reached. This will allow an agent to not have to hit the point of the final target exactly, but only the area. If this value is set to low the NavigationAgent will be stuck in a repath loop cause it will constantly overshoot or undershoot the distance to the final target point on each physics frame update. ### [float](class_float#class-float) time\_horizon | | | | --- | --- | | *Default* | `5.0` | | *Setter* | set\_time\_horizon(value) | | *Getter* | get\_time\_horizon() | The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but the less freedom in choosing its velocities. Must be positive. Method Descriptions ------------------- ### [float](class_float#class-float) distance\_to\_target ( ) const Returns the distance to the target location, using the agent's global position. The user must set the target location with [set\_target\_location](#class-navigationagent-method-set-target-location) in order for this to be accurate. ### [Vector3](class_vector3#class-vector3) get\_final\_location ( ) Returns the reachable final location in global coordinates. This can change if the navigation path is altered in any way. Because of this, it would be best to check this each frame. ### [PoolVector3Array](class_poolvector3array#class-poolvector3array) get\_nav\_path ( ) const Returns this agent's current path from start to finish in global coordinates. The path only updates when the target location is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended [get\_next\_location](#class-navigationagent-method-get-next-location) once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic. ### [int](class_int#class-int) get\_nav\_path\_index ( ) const Returns which index the agent is currently on in the navigation path's [PoolVector3Array](class_poolvector3array#class-poolvector3array). ### [Node](class_node#class-node) get\_navigation ( ) const Returns the [Navigation](class_navigation#class-navigation) node that the agent is using for its navigation system. ### [RID](class_rid#class-rid) get\_navigation\_map ( ) const Returns the [RID](class_rid#class-rid) of the navigation map for this NavigationAgent node. This function returns always the map set on the NavigationAgent node and not the map of the abstract agent on the NavigationServer. If the agent map is changed directly with the NavigationServer API the NavigationAgent node will not be aware of the map change. Use [set\_navigation\_map](#class-navigationagent-method-set-navigation-map) to change the navigation map for the NavigationAgent and also update the agent on the NavigationServer. ### [Vector3](class_vector3#class-vector3) get\_next\_location ( ) Returns the next location in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent. ### [RID](class_rid#class-rid) get\_rid ( ) const Returns the [RID](class_rid#class-rid) of this agent on the [NavigationServer](class_navigationserver#class-navigationserver). ### [Vector3](class_vector3#class-vector3) get\_target\_location ( ) const Returns the user-defined target location (set with [set\_target\_location](#class-navigationagent-method-set-target-location)). ### [bool](class_bool#class-bool) is\_navigation\_finished ( ) Returns `true` if the navigation path's final location has been reached. ### [bool](class_bool#class-bool) is\_target\_reachable ( ) Returns `true` if the target location is reachable. The target location is set using [set\_target\_location](#class-navigationagent-method-set-target-location). ### [bool](class_bool#class-bool) is\_target\_reached ( ) const Returns `true` if the target location is reached. The target location is set using [set\_target\_location](#class-navigationagent-method-set-target-location). It may not always be possible to reach the target location. It should always be possible to reach the final location though. See [get\_final\_location](#class-navigationagent-method-get-final-location). ### void set\_navigation ( [Node](class_node#class-node) navigation ) Sets the [Navigation](class_navigation#class-navigation) node used by the agent. Useful when you don't want to make the agent a child of a [Navigation](class_navigation#class-navigation) node. ### void set\_navigation\_map ( [RID](class_rid#class-rid) navigation\_map ) Sets the [RID](class_rid#class-rid) of the navigation map this NavigationAgent node should use and also updates the `agent` on the NavigationServer. ### void set\_target\_location ( [Vector3](class_vector3#class-vector3) location ) Sets the user desired final location. This will clear the current navigation path. ### void set\_velocity ( [Vector3](class_vector3#class-vector3) velocity ) Sends the passed in velocity to the collision avoidance algorithm. It will adjust the velocity to avoid collisions. Once the adjustment to the velocity is complete, it will emit the [velocity\_computed](#class-navigationagent-signal-velocity-computed) signal.
programming_docs
godot InputEventMouseMotion InputEventMouseMotion ===================== **Inherits:** [InputEventMouse](class_inputeventmouse#class-inputeventmouse) **<** [InputEventWithModifiers](class_inputeventwithmodifiers#class-inputeventwithmodifiers) **<** [InputEvent](class_inputevent#class-inputevent) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Input event type for mouse motion events. Description ----------- Contains mouse and pen motion information. Supports relative, absolute positions and speed. See [Node.\_input](class_node#class-node-method-input). **Note:** The behavior of this event is affected by the value of [Input.use\_accumulated\_input](class_input#class-input-property-use-accumulated-input). When set to `true` (default), mouse/pen motion events received from the OS will be merged to emit an accumulated event only once per frame rendered at most. When set to `false`, the events will be emitted as received, which means that they can be emitted multiple times per frame rendered, allowing for precise input reporting at the expense of CPU usage. **Note:** If you use InputEventMouseMotion to draw lines, consider implementing [Bresenham's line algorithm](https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm) as well to avoid visible gaps in lines if the user is moving the mouse quickly. Tutorials --------- * [Mouse and input coordinates](https://docs.godotengine.org/en/3.5/tutorials/inputs/mouse_and_input_coordinates.html) * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [pen\_inverted](#class-inputeventmousemotion-property-pen-inverted) | `false` | | [float](class_float#class-float) | [pressure](#class-inputeventmousemotion-property-pressure) | `0.0` | | [Vector2](class_vector2#class-vector2) | [relative](#class-inputeventmousemotion-property-relative) | `Vector2( 0, 0 )` | | [Vector2](class_vector2#class-vector2) | [speed](#class-inputeventmousemotion-property-speed) | `Vector2( 0, 0 )` | | [Vector2](class_vector2#class-vector2) | [tilt](#class-inputeventmousemotion-property-tilt) | `Vector2( 0, 0 )` | Property Descriptions --------------------- ### [bool](class_bool#class-bool) pen\_inverted | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_pen\_inverted(value) | | *Getter* | get\_pen\_inverted() | Returns `true` when using the eraser end of a stylus pen. **Note:** This property is implemented on Linux, macOS and Windows. ### [float](class_float#class-float) pressure | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_pressure(value) | | *Getter* | get\_pressure() | Represents the pressure the user puts on the pen. Ranges from `0.0` to `1.0`. ### [Vector2](class_vector2#class-vector2) relative | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_relative(value) | | *Getter* | get\_relative() | The mouse position relative to the previous position (position at the last frame). **Note:** Since `InputEventMouseMotion` is only emitted when the mouse moves, the last event won't have a relative position of `Vector2(0, 0)` when the user stops moving the mouse. ### [Vector2](class_vector2#class-vector2) speed | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_speed(value) | | *Getter* | get\_speed() | The mouse speed in pixels per second. ### [Vector2](class_vector2#class-vector2) tilt | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_tilt(value) | | *Getter* | get\_tilt() | Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from `-1.0` to `1.0` for both axes. godot GLTFMesh GLTFMesh ======== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Description ----------- **Note:** This class is only compiled in editor builds. Run-time glTF loading and saving is *not* available in exported projects. References to `GLTFMesh` within a script will cause an error in an exported project. Properties ---------- | | | | | --- | --- | --- | | [PoolRealArray](class_poolrealarray#class-poolrealarray) | [blend\_weights](#class-gltfmesh-property-blend-weights) | `PoolRealArray(  )` | | [Array](class_array#class-array) | [instance\_materials](#class-gltfmesh-property-instance-materials) | `[  ]` | | [ArrayMesh](class_arraymesh#class-arraymesh) | [mesh](#class-gltfmesh-property-mesh) | | Property Descriptions --------------------- ### [PoolRealArray](class_poolrealarray#class-poolrealarray) blend\_weights | | | | --- | --- | | *Default* | `PoolRealArray(  )` | | *Setter* | set\_blend\_weights(value) | | *Getter* | get\_blend\_weights() | ### [Array](class_array#class-array) instance\_materials | | | | --- | --- | | *Default* | `[  ]` | | *Setter* | set\_instance\_materials(value) | | *Getter* | get\_instance\_materials() | ### [ArrayMesh](class_arraymesh#class-arraymesh) mesh | | | | --- | --- | | *Setter* | set\_mesh(value) | | *Getter* | get\_mesh() | godot ItemList ItemList ======== **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Control that provides a list of selectable items (and/or icons) in a single column, or optionally in multiple columns. Description ----------- This control provides a selectable list of items that may be in a single (or multiple columns) with option of text, icons, or both text and icon. Tooltips are supported and may be different for every item in the list. Selectable items in the list may be selected or deselected and multiple selection may be enabled. Selection with right mouse button may also be enabled to allow use of popup context menus. Items may also be "activated" by double-clicking them or by pressing Enter. Item text only supports single-line strings, newline characters (e.g. `\n`) in the string won't produce a newline. Text wrapping is enabled in [ICON\_MODE\_TOP](#class-itemlist-constant-icon-mode-top) mode, but column's width is adjusted to fully fit its content by default. You need to set [fixed\_column\_width](#class-itemlist-property-fixed-column-width) greater than zero to wrap the text. **Incremental search:** Like [PopupMenu](class_popupmenu#class-popupmenu) and [Tree](class_tree#class-tree), `ItemList` supports searching within the list while the control is focused. Press a key that matches the first letter of an item's name to select the first item starting with the given letter. After that point, there are two ways to perform incremental search: 1) Press the same key again before the timeout duration to select the next item starting with the same letter. 2) Press letter keys that match the rest of the word before the timeout duration to match to select the item in question directly. Both of these actions will be reset to the beginning of the list if the timeout duration has passed since the last keystroke was registered. You can adjust the timeout duration by changing [ProjectSettings.gui/timers/incremental\_search\_max\_interval\_msec](class_projectsettings#class-projectsettings-property-gui-timers-incremental-search-max-interval-msec). Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [allow\_reselect](#class-itemlist-property-allow-reselect) | `false` | | [bool](class_bool#class-bool) | [allow\_rmb\_select](#class-itemlist-property-allow-rmb-select) | `false` | | [bool](class_bool#class-bool) | [auto\_height](#class-itemlist-property-auto-height) | `false` | | [int](class_int#class-int) | [fixed\_column\_width](#class-itemlist-property-fixed-column-width) | `0` | | [Vector2](class_vector2#class-vector2) | [fixed\_icon\_size](#class-itemlist-property-fixed-icon-size) | `Vector2( 0, 0 )` | | [FocusMode](class_control#enum-control-focusmode) | focus\_mode | `2` (overrides [Control](class_control#class-control-property-focus-mode)) | | [IconMode](#enum-itemlist-iconmode) | [icon\_mode](#class-itemlist-property-icon-mode) | `1` | | [float](class_float#class-float) | [icon\_scale](#class-itemlist-property-icon-scale) | `1.0` | | [int](class_int#class-int) | [max\_columns](#class-itemlist-property-max-columns) | `1` | | [int](class_int#class-int) | [max\_text\_lines](#class-itemlist-property-max-text-lines) | `1` | | [bool](class_bool#class-bool) | rect\_clip\_content | `true` (overrides [Control](class_control#class-control-property-rect-clip-content)) | | [bool](class_bool#class-bool) | [same\_column\_width](#class-itemlist-property-same-column-width) | `false` | | [SelectMode](#enum-itemlist-selectmode) | [select\_mode](#class-itemlist-property-select-mode) | `0` | Methods ------- | | | | --- | --- | | void | [add\_icon\_item](#class-itemlist-method-add-icon-item) **(** [Texture](class_texture#class-texture) icon, [bool](class_bool#class-bool) selectable=true **)** | | void | [add\_item](#class-itemlist-method-add-item) **(** [String](class_string#class-string) text, [Texture](class_texture#class-texture) icon=null, [bool](class_bool#class-bool) selectable=true **)** | | void | [clear](#class-itemlist-method-clear) **(** **)** | | void | [ensure\_current\_is\_visible](#class-itemlist-method-ensure-current-is-visible) **(** **)** | | [int](class_int#class-int) | [get\_item\_at\_position](#class-itemlist-method-get-item-at-position) **(** [Vector2](class_vector2#class-vector2) position, [bool](class_bool#class-bool) exact=false **)** const | | [int](class_int#class-int) | [get\_item\_count](#class-itemlist-method-get-item-count) **(** **)** const | | [Color](class_color#class-color) | [get\_item\_custom\_bg\_color](#class-itemlist-method-get-item-custom-bg-color) **(** [int](class_int#class-int) idx **)** const | | [Color](class_color#class-color) | [get\_item\_custom\_fg\_color](#class-itemlist-method-get-item-custom-fg-color) **(** [int](class_int#class-int) idx **)** const | | [Texture](class_texture#class-texture) | [get\_item\_icon](#class-itemlist-method-get-item-icon) **(** [int](class_int#class-int) idx **)** const | | [Color](class_color#class-color) | [get\_item\_icon\_modulate](#class-itemlist-method-get-item-icon-modulate) **(** [int](class_int#class-int) idx **)** const | | [Rect2](class_rect2#class-rect2) | [get\_item\_icon\_region](#class-itemlist-method-get-item-icon-region) **(** [int](class_int#class-int) idx **)** const | | [Variant](class_variant#class-variant) | [get\_item\_metadata](#class-itemlist-method-get-item-metadata) **(** [int](class_int#class-int) idx **)** const | | [String](class_string#class-string) | [get\_item\_text](#class-itemlist-method-get-item-text) **(** [int](class_int#class-int) idx **)** const | | [String](class_string#class-string) | [get\_item\_tooltip](#class-itemlist-method-get-item-tooltip) **(** [int](class_int#class-int) idx **)** const | | [PoolIntArray](class_poolintarray#class-poolintarray) | [get\_selected\_items](#class-itemlist-method-get-selected-items) **(** **)** | | [VScrollBar](class_vscrollbar#class-vscrollbar) | [get\_v\_scroll](#class-itemlist-method-get-v-scroll) **(** **)** | | [bool](class_bool#class-bool) | [is\_anything\_selected](#class-itemlist-method-is-anything-selected) **(** **)** | | [bool](class_bool#class-bool) | [is\_item\_disabled](#class-itemlist-method-is-item-disabled) **(** [int](class_int#class-int) idx **)** const | | [bool](class_bool#class-bool) | [is\_item\_icon\_transposed](#class-itemlist-method-is-item-icon-transposed) **(** [int](class_int#class-int) idx **)** const | | [bool](class_bool#class-bool) | [is\_item\_selectable](#class-itemlist-method-is-item-selectable) **(** [int](class_int#class-int) idx **)** const | | [bool](class_bool#class-bool) | [is\_item\_tooltip\_enabled](#class-itemlist-method-is-item-tooltip-enabled) **(** [int](class_int#class-int) idx **)** const | | [bool](class_bool#class-bool) | [is\_selected](#class-itemlist-method-is-selected) **(** [int](class_int#class-int) idx **)** const | | void | [move\_item](#class-itemlist-method-move-item) **(** [int](class_int#class-int) from\_idx, [int](class_int#class-int) to\_idx **)** | | void | [remove\_item](#class-itemlist-method-remove-item) **(** [int](class_int#class-int) idx **)** | | void | [select](#class-itemlist-method-select) **(** [int](class_int#class-int) idx, [bool](class_bool#class-bool) single=true **)** | | void | [set\_item\_custom\_bg\_color](#class-itemlist-method-set-item-custom-bg-color) **(** [int](class_int#class-int) idx, [Color](class_color#class-color) custom\_bg\_color **)** | | void | [set\_item\_custom\_fg\_color](#class-itemlist-method-set-item-custom-fg-color) **(** [int](class_int#class-int) idx, [Color](class_color#class-color) custom\_fg\_color **)** | | void | [set\_item\_disabled](#class-itemlist-method-set-item-disabled) **(** [int](class_int#class-int) idx, [bool](class_bool#class-bool) disabled **)** | | void | [set\_item\_icon](#class-itemlist-method-set-item-icon) **(** [int](class_int#class-int) idx, [Texture](class_texture#class-texture) icon **)** | | void | [set\_item\_icon\_modulate](#class-itemlist-method-set-item-icon-modulate) **(** [int](class_int#class-int) idx, [Color](class_color#class-color) modulate **)** | | void | [set\_item\_icon\_region](#class-itemlist-method-set-item-icon-region) **(** [int](class_int#class-int) idx, [Rect2](class_rect2#class-rect2) rect **)** | | void | [set\_item\_icon\_transposed](#class-itemlist-method-set-item-icon-transposed) **(** [int](class_int#class-int) idx, [bool](class_bool#class-bool) transposed **)** | | void | [set\_item\_metadata](#class-itemlist-method-set-item-metadata) **(** [int](class_int#class-int) idx, [Variant](class_variant#class-variant) metadata **)** | | void | [set\_item\_selectable](#class-itemlist-method-set-item-selectable) **(** [int](class_int#class-int) idx, [bool](class_bool#class-bool) selectable **)** | | void | [set\_item\_text](#class-itemlist-method-set-item-text) **(** [int](class_int#class-int) idx, [String](class_string#class-string) text **)** | | void | [set\_item\_tooltip](#class-itemlist-method-set-item-tooltip) **(** [int](class_int#class-int) idx, [String](class_string#class-string) tooltip **)** | | void | [set\_item\_tooltip\_enabled](#class-itemlist-method-set-item-tooltip-enabled) **(** [int](class_int#class-int) idx, [bool](class_bool#class-bool) enable **)** | | void | [sort\_items\_by\_text](#class-itemlist-method-sort-items-by-text) **(** **)** | | void | [unselect](#class-itemlist-method-unselect) **(** [int](class_int#class-int) idx **)** | | void | [unselect\_all](#class-itemlist-method-unselect-all) **(** **)** | Theme Properties ---------------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [font\_color](#class-itemlist-theme-color-font-color) | `Color( 0.63, 0.63, 0.63, 1 )` | | [Color](class_color#class-color) | [font\_color\_selected](#class-itemlist-theme-color-font-color-selected) | `Color( 1, 1, 1, 1 )` | | [Color](class_color#class-color) | [guide\_color](#class-itemlist-theme-color-guide-color) | `Color( 0, 0, 0, 0.1 )` | | [int](class_int#class-int) | [hseparation](#class-itemlist-theme-constant-hseparation) | `4` | | [int](class_int#class-int) | [icon\_margin](#class-itemlist-theme-constant-icon-margin) | `4` | | [int](class_int#class-int) | [line\_separation](#class-itemlist-theme-constant-line-separation) | `2` | | [int](class_int#class-int) | [vseparation](#class-itemlist-theme-constant-vseparation) | `2` | | [Font](class_font#class-font) | [font](#class-itemlist-theme-font-font) | | | [StyleBox](class_stylebox#class-stylebox) | [bg](#class-itemlist-theme-style-bg) | | | [StyleBox](class_stylebox#class-stylebox) | [bg\_focus](#class-itemlist-theme-style-bg-focus) | | | [StyleBox](class_stylebox#class-stylebox) | [cursor](#class-itemlist-theme-style-cursor) | | | [StyleBox](class_stylebox#class-stylebox) | [cursor\_unfocused](#class-itemlist-theme-style-cursor-unfocused) | | | [StyleBox](class_stylebox#class-stylebox) | [selected](#class-itemlist-theme-style-selected) | | | [StyleBox](class_stylebox#class-stylebox) | [selected\_focus](#class-itemlist-theme-style-selected-focus) | | Signals ------- ### item\_activated ( [int](class_int#class-int) index ) Triggered when specified list item is activated via double-clicking or by pressing Enter. ### item\_rmb\_selected ( [int](class_int#class-int) index, [Vector2](class_vector2#class-vector2) at\_position ) Triggered when specified list item has been selected via right mouse clicking. The click position is also provided to allow appropriate popup of context menus at the correct location. [allow\_rmb\_select](#class-itemlist-property-allow-rmb-select) must be enabled. ### item\_selected ( [int](class_int#class-int) index ) Triggered when specified item has been selected. [allow\_reselect](#class-itemlist-property-allow-reselect) must be enabled to reselect an item. ### multi\_selected ( [int](class_int#class-int) index, [bool](class_bool#class-bool) selected ) Triggered when a multiple selection is altered on a list allowing multiple selection. ### nothing\_selected ( ) Triggered when a left mouse click is issued within the rect of the list but on empty space. ### rmb\_clicked ( [Vector2](class_vector2#class-vector2) at\_position ) Triggered when a right mouse click is issued within the rect of the list but on empty space. [allow\_rmb\_select](#class-itemlist-property-allow-rmb-select) must be enabled. Enumerations ------------ enum **IconMode**: * **ICON\_MODE\_TOP** = **0** --- Icon is drawn above the text. * **ICON\_MODE\_LEFT** = **1** --- Icon is drawn to the left of the text. enum **SelectMode**: * **SELECT\_SINGLE** = **0** --- Only allow selecting a single item. * **SELECT\_MULTI** = **1** --- Allows selecting multiple items by holding Ctrl or Shift. Property Descriptions --------------------- ### [bool](class_bool#class-bool) allow\_reselect | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_allow\_reselect(value) | | *Getter* | get\_allow\_reselect() | If `true`, the currently selected item can be selected again. ### [bool](class_bool#class-bool) allow\_rmb\_select | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_allow\_rmb\_select(value) | | *Getter* | get\_allow\_rmb\_select() | If `true`, right mouse button click can select items. ### [bool](class_bool#class-bool) auto\_height | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_auto\_height(value) | | *Getter* | has\_auto\_height() | If `true`, the control will automatically resize the height to fit its content. ### [int](class_int#class-int) fixed\_column\_width | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_fixed\_column\_width(value) | | *Getter* | get\_fixed\_column\_width() | The width all columns will be adjusted to. A value of zero disables the adjustment, each item will have a width equal to the width of its content and the columns will have an uneven width. ### [Vector2](class_vector2#class-vector2) fixed\_icon\_size | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_fixed\_icon\_size(value) | | *Getter* | get\_fixed\_icon\_size() | The size all icons will be adjusted to. If either X or Y component is not greater than zero, icon size won't be affected. ### [IconMode](#enum-itemlist-iconmode) icon\_mode | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_icon\_mode(value) | | *Getter* | get\_icon\_mode() | The icon position, whether above or to the left of the text. See the [IconMode](#enum-itemlist-iconmode) constants. ### [float](class_float#class-float) icon\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_icon\_scale(value) | | *Getter* | get\_icon\_scale() | The scale of icon applied after [fixed\_icon\_size](#class-itemlist-property-fixed-icon-size) and transposing takes effect. ### [int](class_int#class-int) max\_columns | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_max\_columns(value) | | *Getter* | get\_max\_columns() | Maximum columns the list will have. If greater than zero, the content will be split among the specified columns. A value of zero means unlimited columns, i.e. all items will be put in the same row. ### [int](class_int#class-int) max\_text\_lines | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_max\_text\_lines(value) | | *Getter* | get\_max\_text\_lines() | Maximum lines of text allowed in each item. Space will be reserved even when there is not enough lines of text to display. **Note:** This property takes effect only when [icon\_mode](#class-itemlist-property-icon-mode) is [ICON\_MODE\_TOP](#class-itemlist-constant-icon-mode-top). To make the text wrap, [fixed\_column\_width](#class-itemlist-property-fixed-column-width) should be greater than zero. ### [bool](class_bool#class-bool) same\_column\_width | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_same\_column\_width(value) | | *Getter* | is\_same\_column\_width() | Whether all columns will have the same width. If `true`, the width is equal to the largest column width of all columns. ### [SelectMode](#enum-itemlist-selectmode) select\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_select\_mode(value) | | *Getter* | get\_select\_mode() | Allows single or multiple item selection. See the [SelectMode](#enum-itemlist-selectmode) constants. Method Descriptions ------------------- ### void add\_icon\_item ( [Texture](class_texture#class-texture) icon, [bool](class_bool#class-bool) selectable=true ) Adds an item to the item list with no text, only an icon. ### void add\_item ( [String](class_string#class-string) text, [Texture](class_texture#class-texture) icon=null, [bool](class_bool#class-bool) selectable=true ) Adds an item to the item list with specified text. Specify an `icon`, or use `null` as the `icon` for a list item with no icon. If selectable is `true`, the list item will be selectable. ### void clear ( ) Removes all items from the list. ### void ensure\_current\_is\_visible ( ) Ensure current selection is visible, adjusting the scroll position as necessary. ### [int](class_int#class-int) get\_item\_at\_position ( [Vector2](class_vector2#class-vector2) position, [bool](class_bool#class-bool) exact=false ) const Returns the item index at the given `position`. When there is no item at that point, -1 will be returned if `exact` is `true`, and the closest item index will be returned otherwise. ### [int](class_int#class-int) get\_item\_count ( ) const Returns the number of items currently in the list. ### [Color](class_color#class-color) get\_item\_custom\_bg\_color ( [int](class_int#class-int) idx ) const Returns the custom background color of the item specified by `idx` index. ### [Color](class_color#class-color) get\_item\_custom\_fg\_color ( [int](class_int#class-int) idx ) const Returns the custom foreground color of the item specified by `idx` index. ### [Texture](class_texture#class-texture) get\_item\_icon ( [int](class_int#class-int) idx ) const Returns the icon associated with the specified index. ### [Color](class_color#class-color) get\_item\_icon\_modulate ( [int](class_int#class-int) idx ) const Returns a [Color](class_color#class-color) modulating item's icon at the specified index. ### [Rect2](class_rect2#class-rect2) get\_item\_icon\_region ( [int](class_int#class-int) idx ) const Returns the region of item's icon used. The whole icon will be used if the region has no area. ### [Variant](class_variant#class-variant) get\_item\_metadata ( [int](class_int#class-int) idx ) const Returns the metadata value of the specified index. ### [String](class_string#class-string) get\_item\_text ( [int](class_int#class-int) idx ) const Returns the text associated with the specified index. ### [String](class_string#class-string) get\_item\_tooltip ( [int](class_int#class-int) idx ) const Returns the tooltip hint associated with the specified index. ### [PoolIntArray](class_poolintarray#class-poolintarray) get\_selected\_items ( ) Returns an array with the indexes of the selected items. ### [VScrollBar](class_vscrollbar#class-vscrollbar) get\_v\_scroll ( ) Returns the vertical scrollbar. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. ### [bool](class_bool#class-bool) is\_anything\_selected ( ) Returns `true` if one or more items are selected. ### [bool](class_bool#class-bool) is\_item\_disabled ( [int](class_int#class-int) idx ) const Returns `true` if the item at the specified index is disabled. ### [bool](class_bool#class-bool) is\_item\_icon\_transposed ( [int](class_int#class-int) idx ) const Returns `true` if the item icon will be drawn transposed, i.e. the X and Y axes are swapped. ### [bool](class_bool#class-bool) is\_item\_selectable ( [int](class_int#class-int) idx ) const Returns `true` if the item at the specified index is selectable. ### [bool](class_bool#class-bool) is\_item\_tooltip\_enabled ( [int](class_int#class-int) idx ) const Returns `true` if the tooltip is enabled for specified item index. ### [bool](class_bool#class-bool) is\_selected ( [int](class_int#class-int) idx ) const Returns `true` if the item at the specified index is currently selected. ### void move\_item ( [int](class_int#class-int) from\_idx, [int](class_int#class-int) to\_idx ) Moves item from index `from_idx` to `to_idx`. ### void remove\_item ( [int](class_int#class-int) idx ) Removes the item specified by `idx` index from the list. ### void select ( [int](class_int#class-int) idx, [bool](class_bool#class-bool) single=true ) Select the item at the specified index. **Note:** This method does not trigger the item selection signal. ### void set\_item\_custom\_bg\_color ( [int](class_int#class-int) idx, [Color](class_color#class-color) custom\_bg\_color ) Sets the background color of the item specified by `idx` index to the specified [Color](class_color#class-color). ### void set\_item\_custom\_fg\_color ( [int](class_int#class-int) idx, [Color](class_color#class-color) custom\_fg\_color ) Sets the foreground color of the item specified by `idx` index to the specified [Color](class_color#class-color). ### void set\_item\_disabled ( [int](class_int#class-int) idx, [bool](class_bool#class-bool) disabled ) Disables (or enables) the item at the specified index. Disabled items cannot be selected and do not trigger activation signals (when double-clicking or pressing Enter). ### void set\_item\_icon ( [int](class_int#class-int) idx, [Texture](class_texture#class-texture) icon ) Sets (or replaces) the icon's [Texture](class_texture#class-texture) associated with the specified index. ### void set\_item\_icon\_modulate ( [int](class_int#class-int) idx, [Color](class_color#class-color) modulate ) Sets a modulating [Color](class_color#class-color) of the item associated with the specified index. ### void set\_item\_icon\_region ( [int](class_int#class-int) idx, [Rect2](class_rect2#class-rect2) rect ) Sets the region of item's icon used. The whole icon will be used if the region has no area. ### void set\_item\_icon\_transposed ( [int](class_int#class-int) idx, [bool](class_bool#class-bool) transposed ) Sets whether the item icon will be drawn transposed. ### void set\_item\_metadata ( [int](class_int#class-int) idx, [Variant](class_variant#class-variant) metadata ) Sets a value (of any type) to be stored with the item associated with the specified index. ### void set\_item\_selectable ( [int](class_int#class-int) idx, [bool](class_bool#class-bool) selectable ) Allows or disallows selection of the item associated with the specified index. ### void set\_item\_text ( [int](class_int#class-int) idx, [String](class_string#class-string) text ) Sets text of the item associated with the specified index. ### void set\_item\_tooltip ( [int](class_int#class-int) idx, [String](class_string#class-string) tooltip ) Sets the tooltip hint for the item associated with the specified index. ### void set\_item\_tooltip\_enabled ( [int](class_int#class-int) idx, [bool](class_bool#class-bool) enable ) Sets whether the tooltip hint is enabled for specified item index. ### void sort\_items\_by\_text ( ) Sorts items in the list by their text. ### void unselect ( [int](class_int#class-int) idx ) Ensures the item associated with the specified index is not selected. ### void unselect\_all ( ) Ensures there are no items selected. Theme Property Descriptions --------------------------- ### [Color](class_color#class-color) font\_color | | | | --- | --- | | *Default* | `Color( 0.63, 0.63, 0.63, 1 )` | Default text [Color](class_color#class-color) of the item. ### [Color](class_color#class-color) font\_color\_selected | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | Text [Color](class_color#class-color) used when the item is selected. ### [Color](class_color#class-color) guide\_color | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 0.1 )` | [Color](class_color#class-color) of the guideline. The guideline is a line drawn between each row of items. ### [int](class_int#class-int) hseparation | | | | --- | --- | | *Default* | `4` | The horizontal spacing between items. ### [int](class_int#class-int) icon\_margin | | | | --- | --- | | *Default* | `4` | The spacing between item's icon and text. ### [int](class_int#class-int) line\_separation | | | | --- | --- | | *Default* | `2` | The vertical spacing between each line of text. ### [int](class_int#class-int) vseparation | | | | --- | --- | | *Default* | `2` | The vertical spacing between items. ### [Font](class_font#class-font) font [Font](class_font#class-font) of the item's text. ### [StyleBox](class_stylebox#class-stylebox) bg Default [StyleBox](class_stylebox#class-stylebox) for the `ItemList`, i.e. used when the control is not being focused. ### [StyleBox](class_stylebox#class-stylebox) bg\_focus [StyleBox](class_stylebox#class-stylebox) used when the `ItemList` is being focused. ### [StyleBox](class_stylebox#class-stylebox) cursor [StyleBox](class_stylebox#class-stylebox) used for the cursor, when the `ItemList` is being focused. ### [StyleBox](class_stylebox#class-stylebox) cursor\_unfocused [StyleBox](class_stylebox#class-stylebox) used for the cursor, when the `ItemList` is not being focused. ### [StyleBox](class_stylebox#class-stylebox) selected [StyleBox](class_stylebox#class-stylebox) for the selected items, used when the `ItemList` is not being focused. ### [StyleBox](class_stylebox#class-stylebox) selected\_focus [StyleBox](class_stylebox#class-stylebox) for the selected items, used when the `ItemList` is being focused.
programming_docs
godot EditorScriptPicker EditorScriptPicker ================== **Inherits:** [EditorResourcePicker](class_editorresourcepicker#class-editorresourcepicker) **<** [HBoxContainer](class_hboxcontainer#class-hboxcontainer) **<** [BoxContainer](class_boxcontainer#class-boxcontainer) **<** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Godot editor's control for selecting the `script` property of a [Node](class_node#class-node). Description ----------- Similar to [EditorResourcePicker](class_editorresourcepicker#class-editorresourcepicker) this [Control](class_control#class-control) node is used in the editor's Inspector dock, but only to edit the `script` property of a [Node](class_node#class-node). Default options for creating new resources of all possible subtypes are replaced with dedicated buttons that open the "Attach Node Script" dialog. Can be used with [EditorInspectorPlugin](class_editorinspectorplugin#class-editorinspectorplugin) to recreate the same behavior. **Note:** You must set the [script\_owner](#class-editorscriptpicker-property-script-owner) for the custom context menu items to work. Properties ---------- | | | | --- | --- | | [Node](class_node#class-node) | [script\_owner](#class-editorscriptpicker-property-script-owner) | Property Descriptions --------------------- ### [Node](class_node#class-node) script\_owner | | | | --- | --- | | *Setter* | set\_script\_owner(value) | | *Getter* | get\_script\_owner() | The owner [Node](class_node#class-node) of the script property that holds the edited resource. godot VisualScriptPreload VisualScriptPreload =================== **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Creates a new [Resource](class_resource#class-resource) or loads one from the filesystem. Description ----------- Creates a new [Resource](class_resource#class-resource) or loads one from the filesystem. **Input Ports:** none **Output Ports:** * Data (object): `res` Properties ---------- | | | | --- | --- | | [Resource](class_resource#class-resource) | [resource](#class-visualscriptpreload-property-resource) | Property Descriptions --------------------- ### [Resource](class_resource#class-resource) resource | | | | --- | --- | | *Setter* | set\_preload(value) | | *Getter* | get\_preload() | The [Resource](class_resource#class-resource) to load. godot JSON JSON ==== **Inherits:** [Object](class_object#class-object) Helper class for parsing JSON data. Description ----------- Helper class for parsing JSON data. For usage example and other important hints, see [JSONParseResult](class_jsonparseresult#class-jsonparseresult). Methods ------- | | | | --- | --- | | [JSONParseResult](class_jsonparseresult#class-jsonparseresult) | [parse](#class-json-method-parse) **(** [String](class_string#class-string) json **)** | | [String](class_string#class-string) | [print](#class-json-method-print) **(** [Variant](class_variant#class-variant) value, [String](class_string#class-string) indent="", [bool](class_bool#class-bool) sort\_keys=false **)** | Method Descriptions ------------------- ### [JSONParseResult](class_jsonparseresult#class-jsonparseresult) parse ( [String](class_string#class-string) json ) Parses a JSON-encoded string and returns a [JSONParseResult](class_jsonparseresult#class-jsonparseresult) containing the result. ### [String](class_string#class-string) print ( [Variant](class_variant#class-variant) value, [String](class_string#class-string) indent="", [bool](class_bool#class-bool) sort\_keys=false ) Converts a [Variant](class_variant#class-variant) var to JSON text and returns the result. Useful for serializing data to store or send over the network. **Note:** The JSON specification does not define integer or float types, but only a *number* type. Therefore, converting a Variant to JSON text will convert all numerical values to [float](class_float#class-float) types. The `indent` parameter controls if and how something is indented, the string used for this parameter will be used where there should be an indent in the output, even spaces like `"   "` will work. `\t` and `\n` can also be used for a tab indent, or to make a newline for each indent respectively. **Example output:** ``` ## JSON.print(my_dictionary) {"name":"my_dictionary","version":"1.0.0","entities":[{"name":"entity_0","value":"value_0"},{"name":"entity_1","value":"value_1"}]} ## JSON.print(my_dictionary, "\t") { "name": "my_dictionary", "version": "1.0.0", "entities": [ { "name": "entity_0", "value": "value_0" }, { "name": "entity_1", "value": "value_1" } ] } ## JSON.print(my_dictionary, "...") { ..."name": "my_dictionary", ..."version": "1.0.0", ..."entities": [ ......{ ........."name": "entity_0", ........."value": "value_0" ......}, ......{ ........."name": "entity_1", ........."value": "value_1" ......} ...] } ``` godot EditorScenePostImport EditorScenePostImport ===================== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Post-processes scenes after import. Description ----------- Imported scenes can be automatically modified right after import by setting their **Custom Script** Import property to a `tool` script that inherits from this class. The [post\_import](#class-editorscenepostimport-method-post-import) callback receives the imported scene's root node and returns the modified version of the scene. Usage example: ``` tool # Needed so it runs in editor extends EditorScenePostImport # This sample changes all node names # Called right after the scene is imported and gets the root node func post_import(scene): # Change all node names to "modified_[oldnodename]" iterate(scene) return scene # Remember to return the imported scene func iterate(node): if node != null: node.name = "modified_" + node.name for child in node.get_children(): iterate(child) ``` Tutorials --------- * [#custom-script](https://docs.godotengine.org/en/3.5/tutorials/assets_pipeline/importing_scenes.html#custom-script) in [Importing 3D scenes](https://docs.godotengine.org/en/3.5/tutorials/assets_pipeline/importing_scenes.html) Methods ------- | | | | --- | --- | | [String](class_string#class-string) | [get\_source\_file](#class-editorscenepostimport-method-get-source-file) **(** **)** const | | [String](class_string#class-string) | [get\_source\_folder](#class-editorscenepostimport-method-get-source-folder) **(** **)** const | | [Object](class_object#class-object) | [post\_import](#class-editorscenepostimport-method-post-import) **(** [Object](class_object#class-object) scene **)** virtual | Method Descriptions ------------------- ### [String](class_string#class-string) get\_source\_file ( ) const Returns the source file path which got imported (e.g. `res://scene.dae`). ### [String](class_string#class-string) get\_source\_folder ( ) const Returns the resource folder the imported scene file is located in. ### [Object](class_object#class-object) post\_import ( [Object](class_object#class-object) scene ) virtual Called after the scene was imported. This method must return the modified version of the scene. godot VisualScriptFunctionState VisualScriptFunctionState ========================= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A Visual Script node representing a function state. Description ----------- `VisualScriptFunctionState` is returned from [VisualScriptYield](class_visualscriptyield#class-visualscriptyield) and can be used to resume a paused function call. Methods ------- | | | | --- | --- | | void | [connect\_to\_signal](#class-visualscriptfunctionstate-method-connect-to-signal) **(** [Object](class_object#class-object) obj, [String](class_string#class-string) signals, [Array](class_array#class-array) args **)** | | [bool](class_bool#class-bool) | [is\_valid](#class-visualscriptfunctionstate-method-is-valid) **(** **)** const | | [Variant](class_variant#class-variant) | [resume](#class-visualscriptfunctionstate-method-resume) **(** [Array](class_array#class-array) args=null **)** | Method Descriptions ------------------- ### void connect\_to\_signal ( [Object](class_object#class-object) obj, [String](class_string#class-string) signals, [Array](class_array#class-array) args ) Connects this `VisualScriptFunctionState` to a signal in the given object to automatically resume when it's emitted. ### [bool](class_bool#class-bool) is\_valid ( ) const Returns whether the function state is valid. ### [Variant](class_variant#class-variant) resume ( [Array](class_array#class-array) args=null ) Resumes the function to run from the point it was yielded. godot SegmentShape2D SegmentShape2D ============== **Inherits:** [Shape2D](class_shape2d#class-shape2d) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Segment shape for 2D collisions. Description ----------- Segment shape for 2D collisions. Consists of two points, `a` and `b`. Properties ---------- | | | | | --- | --- | --- | | [Vector2](class_vector2#class-vector2) | [a](#class-segmentshape2d-property-a) | `Vector2( 0, 0 )` | | [Vector2](class_vector2#class-vector2) | [b](#class-segmentshape2d-property-b) | `Vector2( 0, 10 )` | Property Descriptions --------------------- ### [Vector2](class_vector2#class-vector2) a | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_a(value) | | *Getter* | get\_a() | The segment's first point position. ### [Vector2](class_vector2#class-vector2) b | | | | --- | --- | | *Default* | `Vector2( 0, 10 )` | | *Setter* | set\_b(value) | | *Getter* | get\_b() | The segment's second point position. godot PrimitiveMesh PrimitiveMesh ============= **Inherits:** [Mesh](class_mesh#class-mesh) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [CapsuleMesh](class_capsulemesh#class-capsulemesh), [CubeMesh](class_cubemesh#class-cubemesh), [CylinderMesh](class_cylindermesh#class-cylindermesh), [PlaneMesh](class_planemesh#class-planemesh), [PointMesh](class_pointmesh#class-pointmesh), [PrismMesh](class_prismmesh#class-prismmesh), [QuadMesh](class_quadmesh#class-quadmesh), [SphereMesh](class_spheremesh#class-spheremesh), [TextMesh](class_textmesh#class-textmesh) Base class for all primitive meshes. Handles applying a [Material](class_material#class-material) to a primitive mesh. Description ----------- Base class for all primitive meshes. Handles applying a [Material](class_material#class-material) to a primitive mesh. Examples include [CapsuleMesh](class_capsulemesh#class-capsulemesh), [CubeMesh](class_cubemesh#class-cubemesh), [CylinderMesh](class_cylindermesh#class-cylindermesh), [PlaneMesh](class_planemesh#class-planemesh), [PrismMesh](class_prismmesh#class-prismmesh), [QuadMesh](class_quadmesh#class-quadmesh), and [SphereMesh](class_spheremesh#class-spheremesh). Properties ---------- | | | | | --- | --- | --- | | [AABB](class_aabb#class-aabb) | [custom\_aabb](#class-primitivemesh-property-custom-aabb) | `AABB( 0, 0, 0, 0, 0, 0 )` | | [bool](class_bool#class-bool) | [flip\_faces](#class-primitivemesh-property-flip-faces) | `false` | | [Material](class_material#class-material) | [material](#class-primitivemesh-property-material) | | Methods ------- | | | | --- | --- | | [Array](class_array#class-array) | [get\_mesh\_arrays](#class-primitivemesh-method-get-mesh-arrays) **(** **)** const | Property Descriptions --------------------- ### [AABB](class_aabb#class-aabb) custom\_aabb | | | | --- | --- | | *Default* | `AABB( 0, 0, 0, 0, 0, 0 )` | | *Setter* | set\_custom\_aabb(value) | | *Getter* | get\_custom\_aabb() | Overrides the [AABB](class_aabb#class-aabb) with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. ### [bool](class_bool#class-bool) flip\_faces | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flip\_faces(value) | | *Getter* | get\_flip\_faces() | If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. This gives the same result as using [SpatialMaterial.CULL\_BACK](class_spatialmaterial#class-spatialmaterial-constant-cull-back) in [SpatialMaterial.params\_cull\_mode](class_spatialmaterial#class-spatialmaterial-property-params-cull-mode). ### [Material](class_material#class-material) material | | | | --- | --- | | *Setter* | set\_material(value) | | *Getter* | get\_material() | The current [Material](class_material#class-material) of the primitive mesh. Method Descriptions ------------------- ### [Array](class_array#class-array) get\_mesh\_arrays ( ) const Returns mesh arrays used to constitute surface of [Mesh](class_mesh#class-mesh). The result can be passed to [ArrayMesh.add\_surface\_from\_arrays](class_arraymesh#class-arraymesh-method-add-surface-from-arrays) to create a new surface. For example: ``` var c := CylinderMesh.new() var arr_mesh := ArrayMesh.new() arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, c.get_mesh_arrays()) ``` godot SpotLight SpotLight ========= **Inherits:** [Light](class_light#class-light) **<** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) A spotlight, such as a reflector spotlight or a lantern. Description ----------- A Spotlight is a type of [Light](class_light#class-light) node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance. This attenuation can be configured by changing the energy, radius and attenuation parameters of [Light](class_light#class-light). **Note:** By default, only 32 SpotLights may affect a single mesh *resource* at once. Consider splitting your level into several meshes to decrease the likelihood that more than 32 lights will affect the same mesh resource. Splitting the level mesh will also improve frustum culling effectiveness, leading to greater performance. If you need to use more lights per mesh, you can increase [ProjectSettings.rendering/limits/rendering/max\_lights\_per\_object](class_projectsettings#class-projectsettings-property-rendering-limits-rendering-max-lights-per-object) at the cost of shader compilation times. Tutorials --------- * [3D lights and shadows](https://docs.godotengine.org/en/3.5/tutorials/3d/lights_and_shadows.html) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [spot\_angle](#class-spotlight-property-spot-angle) | `45.0` | | [float](class_float#class-float) | [spot\_angle\_attenuation](#class-spotlight-property-spot-angle-attenuation) | `1.0` | | [float](class_float#class-float) | [spot\_attenuation](#class-spotlight-property-spot-attenuation) | `1.0` | | [float](class_float#class-float) | [spot\_range](#class-spotlight-property-spot-range) | `5.0` | Property Descriptions --------------------- ### [float](class_float#class-float) spot\_angle | | | | --- | --- | | *Default* | `45.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The spotlight's angle in degrees. ### [float](class_float#class-float) spot\_angle\_attenuation | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The spotlight's angular attenuation curve. ### [float](class_float#class-float) spot\_attenuation | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The spotlight's light energy attenuation curve. ### [float](class_float#class-float) spot\_range | | | | --- | --- | | *Default* | `5.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The maximal range that can be reached by the spotlight. Note that the effectively lit area may appear to be smaller depending on the [spot\_attenuation](#class-spotlight-property-spot-attenuation) in use. No matter the [spot\_attenuation](#class-spotlight-property-spot-attenuation) in use, the light will never reach anything outside this range. godot VisualShaderNodeTransformMult VisualShaderNodeTransformMult ============================= **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Multiplies [Transform](class_transform#class-transform) by [Transform](class_transform#class-transform) within the visual shader graph. Description ----------- A multiplication operation on two transforms (4x4 matrices), with support for different multiplication operators. Properties ---------- | | | | | --- | --- | --- | | [Operator](#enum-visualshadernodetransformmult-operator) | [operator](#class-visualshadernodetransformmult-property-operator) | `0` | Enumerations ------------ enum **Operator**: * **OP\_AxB** = **0** --- Multiplies transform `a` by the transform `b`. * **OP\_BxA** = **1** --- Multiplies transform `b` by the transform `a`. * **OP\_AxB\_COMP** = **2** --- Performs a component-wise multiplication of transform `a` by the transform `b`. * **OP\_BxA\_COMP** = **3** --- Performs a component-wise multiplication of transform `b` by the transform `a`. Property Descriptions --------------------- ### [Operator](#enum-visualshadernodetransformmult-operator) operator | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_operator(value) | | *Getter* | get\_operator() | The multiplication type to be performed on the transforms. See [Operator](#enum-visualshadernodetransformmult-operator) for options. godot TreeItem TreeItem ======== **Inherits:** [Object](class_object#class-object) Control for a single item inside a [Tree](class_tree#class-tree). Description ----------- Control for a single item inside a [Tree](class_tree#class-tree). May have child `TreeItem`s and be styled as well as contain buttons. You can remove a `TreeItem` by using [Object.free](class_object#class-object-method-free). Properties ---------- | | | | --- | --- | | [bool](class_bool#class-bool) | [collapsed](#class-treeitem-property-collapsed) | | [int](class_int#class-int) | [custom\_minimum\_height](#class-treeitem-property-custom-minimum-height) | | [bool](class_bool#class-bool) | [disable\_folding](#class-treeitem-property-disable-folding) | Methods ------- | | | | --- | --- | | void | [add\_button](#class-treeitem-method-add-button) **(** [int](class_int#class-int) column, [Texture](class_texture#class-texture) button, [int](class_int#class-int) id=-1, [bool](class_bool#class-bool) disabled=false, [String](class_string#class-string) tooltip="" **)** | | [Variant](class_variant#class-variant) | [call\_recursive](#class-treeitem-method-call-recursive) **(** [String](class_string#class-string) method, ... **)** vararg | | void | [clear\_custom\_bg\_color](#class-treeitem-method-clear-custom-bg-color) **(** [int](class_int#class-int) column **)** | | void | [clear\_custom\_color](#class-treeitem-method-clear-custom-color) **(** [int](class_int#class-int) column **)** | | void | [deselect](#class-treeitem-method-deselect) **(** [int](class_int#class-int) column **)** | | void | [erase\_button](#class-treeitem-method-erase-button) **(** [int](class_int#class-int) column, [int](class_int#class-int) button\_idx **)** | | [Texture](class_texture#class-texture) | [get\_button](#class-treeitem-method-get-button) **(** [int](class_int#class-int) column, [int](class_int#class-int) button\_idx **)** const | | [int](class_int#class-int) | [get\_button\_by\_id](#class-treeitem-method-get-button-by-id) **(** [int](class_int#class-int) column, [int](class_int#class-int) id **)** const | | [int](class_int#class-int) | [get\_button\_count](#class-treeitem-method-get-button-count) **(** [int](class_int#class-int) column **)** const | | [int](class_int#class-int) | [get\_button\_id](#class-treeitem-method-get-button-id) **(** [int](class_int#class-int) column, [int](class_int#class-int) button\_idx **)** const | | [String](class_string#class-string) | [get\_button\_tooltip](#class-treeitem-method-get-button-tooltip) **(** [int](class_int#class-int) column, [int](class_int#class-int) button\_idx **)** const | | [TreeCellMode](#enum-treeitem-treecellmode) | [get\_cell\_mode](#class-treeitem-method-get-cell-mode) **(** [int](class_int#class-int) column **)** const | | [TreeItem](#class-treeitem) | [get\_children](#class-treeitem-method-get-children) **(** **)** | | [Color](class_color#class-color) | [get\_custom\_bg\_color](#class-treeitem-method-get-custom-bg-color) **(** [int](class_int#class-int) column **)** const | | [Color](class_color#class-color) | [get\_custom\_color](#class-treeitem-method-get-custom-color) **(** [int](class_int#class-int) column **)** const | | [bool](class_bool#class-bool) | [get\_expand\_right](#class-treeitem-method-get-expand-right) **(** [int](class_int#class-int) column **)** const | | [Texture](class_texture#class-texture) | [get\_icon](#class-treeitem-method-get-icon) **(** [int](class_int#class-int) column **)** const | | [int](class_int#class-int) | [get\_icon\_max\_width](#class-treeitem-method-get-icon-max-width) **(** [int](class_int#class-int) column **)** const | | [Color](class_color#class-color) | [get\_icon\_modulate](#class-treeitem-method-get-icon-modulate) **(** [int](class_int#class-int) column **)** const | | [Rect2](class_rect2#class-rect2) | [get\_icon\_region](#class-treeitem-method-get-icon-region) **(** [int](class_int#class-int) column **)** const | | [Variant](class_variant#class-variant) | [get\_metadata](#class-treeitem-method-get-metadata) **(** [int](class_int#class-int) column **)** const | | [TreeItem](#class-treeitem) | [get\_next](#class-treeitem-method-get-next) **(** **)** | | [TreeItem](#class-treeitem) | [get\_next\_visible](#class-treeitem-method-get-next-visible) **(** [bool](class_bool#class-bool) wrap=false **)** | | [TreeItem](#class-treeitem) | [get\_parent](#class-treeitem-method-get-parent) **(** **)** | | [TreeItem](#class-treeitem) | [get\_prev](#class-treeitem-method-get-prev) **(** **)** | | [TreeItem](#class-treeitem) | [get\_prev\_visible](#class-treeitem-method-get-prev-visible) **(** [bool](class_bool#class-bool) wrap=false **)** | | [float](class_float#class-float) | [get\_range](#class-treeitem-method-get-range) **(** [int](class_int#class-int) column **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_range\_config](#class-treeitem-method-get-range-config) **(** [int](class_int#class-int) column **)** | | [String](class_string#class-string) | [get\_suffix](#class-treeitem-method-get-suffix) **(** [int](class_int#class-int) column **)** const | | [String](class_string#class-string) | [get\_text](#class-treeitem-method-get-text) **(** [int](class_int#class-int) column **)** const | | [TextAlign](#enum-treeitem-textalign) | [get\_text\_align](#class-treeitem-method-get-text-align) **(** [int](class_int#class-int) column **)** const | | [String](class_string#class-string) | [get\_tooltip](#class-treeitem-method-get-tooltip) **(** [int](class_int#class-int) column **)** const | | [bool](class_bool#class-bool) | [is\_button\_disabled](#class-treeitem-method-is-button-disabled) **(** [int](class_int#class-int) column, [int](class_int#class-int) button\_idx **)** const | | [bool](class_bool#class-bool) | [is\_checked](#class-treeitem-method-is-checked) **(** [int](class_int#class-int) column **)** const | | [bool](class_bool#class-bool) | [is\_custom\_set\_as\_button](#class-treeitem-method-is-custom-set-as-button) **(** [int](class_int#class-int) column **)** const | | [bool](class_bool#class-bool) | [is\_editable](#class-treeitem-method-is-editable) **(** [int](class_int#class-int) column **)** | | [bool](class_bool#class-bool) | [is\_selectable](#class-treeitem-method-is-selectable) **(** [int](class_int#class-int) column **)** const | | [bool](class_bool#class-bool) | [is\_selected](#class-treeitem-method-is-selected) **(** [int](class_int#class-int) column **)** | | void | [move\_to\_bottom](#class-treeitem-method-move-to-bottom) **(** **)** | | void | [move\_to\_top](#class-treeitem-method-move-to-top) **(** **)** | | void | [remove\_child](#class-treeitem-method-remove-child) **(** [Object](class_object#class-object) child **)** | | void | [select](#class-treeitem-method-select) **(** [int](class_int#class-int) column **)** | | void | [set\_button](#class-treeitem-method-set-button) **(** [int](class_int#class-int) column, [int](class_int#class-int) button\_idx, [Texture](class_texture#class-texture) button **)** | | void | [set\_button\_disabled](#class-treeitem-method-set-button-disabled) **(** [int](class_int#class-int) column, [int](class_int#class-int) button\_idx, [bool](class_bool#class-bool) disabled **)** | | void | [set\_cell\_mode](#class-treeitem-method-set-cell-mode) **(** [int](class_int#class-int) column, [TreeCellMode](#enum-treeitem-treecellmode) mode **)** | | void | [set\_checked](#class-treeitem-method-set-checked) **(** [int](class_int#class-int) column, [bool](class_bool#class-bool) checked **)** | | void | [set\_custom\_as\_button](#class-treeitem-method-set-custom-as-button) **(** [int](class_int#class-int) column, [bool](class_bool#class-bool) enable **)** | | void | [set\_custom\_bg\_color](#class-treeitem-method-set-custom-bg-color) **(** [int](class_int#class-int) column, [Color](class_color#class-color) color, [bool](class_bool#class-bool) just\_outline=false **)** | | void | [set\_custom\_color](#class-treeitem-method-set-custom-color) **(** [int](class_int#class-int) column, [Color](class_color#class-color) color **)** | | void | [set\_custom\_draw](#class-treeitem-method-set-custom-draw) **(** [int](class_int#class-int) column, [Object](class_object#class-object) object, [String](class_string#class-string) callback **)** | | void | [set\_editable](#class-treeitem-method-set-editable) **(** [int](class_int#class-int) column, [bool](class_bool#class-bool) enabled **)** | | void | [set\_expand\_right](#class-treeitem-method-set-expand-right) **(** [int](class_int#class-int) column, [bool](class_bool#class-bool) enable **)** | | void | [set\_icon](#class-treeitem-method-set-icon) **(** [int](class_int#class-int) column, [Texture](class_texture#class-texture) texture **)** | | void | [set\_icon\_max\_width](#class-treeitem-method-set-icon-max-width) **(** [int](class_int#class-int) column, [int](class_int#class-int) width **)** | | void | [set\_icon\_modulate](#class-treeitem-method-set-icon-modulate) **(** [int](class_int#class-int) column, [Color](class_color#class-color) modulate **)** | | void | [set\_icon\_region](#class-treeitem-method-set-icon-region) **(** [int](class_int#class-int) column, [Rect2](class_rect2#class-rect2) region **)** | | void | [set\_metadata](#class-treeitem-method-set-metadata) **(** [int](class_int#class-int) column, [Variant](class_variant#class-variant) meta **)** | | void | [set\_range](#class-treeitem-method-set-range) **(** [int](class_int#class-int) column, [float](class_float#class-float) value **)** | | void | [set\_range\_config](#class-treeitem-method-set-range-config) **(** [int](class_int#class-int) column, [float](class_float#class-float) min, [float](class_float#class-float) max, [float](class_float#class-float) step, [bool](class_bool#class-bool) expr=false **)** | | void | [set\_selectable](#class-treeitem-method-set-selectable) **(** [int](class_int#class-int) column, [bool](class_bool#class-bool) selectable **)** | | void | [set\_suffix](#class-treeitem-method-set-suffix) **(** [int](class_int#class-int) column, [String](class_string#class-string) text **)** | | void | [set\_text](#class-treeitem-method-set-text) **(** [int](class_int#class-int) column, [String](class_string#class-string) text **)** | | void | [set\_text\_align](#class-treeitem-method-set-text-align) **(** [int](class_int#class-int) column, [TextAlign](#enum-treeitem-textalign) text\_align **)** | | void | [set\_tooltip](#class-treeitem-method-set-tooltip) **(** [int](class_int#class-int) column, [String](class_string#class-string) tooltip **)** | Enumerations ------------ enum **TreeCellMode**: * **CELL\_MODE\_STRING** = **0** --- Cell contains a string. * **CELL\_MODE\_CHECK** = **1** --- Cell contains a checkbox. * **CELL\_MODE\_RANGE** = **2** --- Cell contains a range. * **CELL\_MODE\_ICON** = **3** --- Cell contains an icon. * **CELL\_MODE\_CUSTOM** = **4** enum **TextAlign**: * **ALIGN\_LEFT** = **0** --- Align text to the left. See `set_text_align()`. * **ALIGN\_CENTER** = **1** --- Center text. See `set_text_align()`. * **ALIGN\_RIGHT** = **2** --- Align text to the right. See `set_text_align()`. Property Descriptions --------------------- ### [bool](class_bool#class-bool) collapsed | | | | --- | --- | | *Setter* | set\_collapsed(value) | | *Getter* | is\_collapsed() | If `true`, the TreeItem is collapsed. ### [int](class_int#class-int) custom\_minimum\_height | | | | --- | --- | | *Setter* | set\_custom\_minimum\_height(value) | | *Getter* | get\_custom\_minimum\_height() | The custom minimum height. ### [bool](class_bool#class-bool) disable\_folding | | | | --- | --- | | *Setter* | set\_disable\_folding(value) | | *Getter* | is\_folding\_disabled() | If `true`, folding is disabled for this TreeItem. Method Descriptions ------------------- ### void add\_button ( [int](class_int#class-int) column, [Texture](class_texture#class-texture) button, [int](class_int#class-int) id=-1, [bool](class_bool#class-bool) disabled=false, [String](class_string#class-string) tooltip="" ) Adds a button with [Texture](class_texture#class-texture) `button` at column `column`. The `id` is used to identify the button. If not specified, the next available index is used, which may be retrieved by calling [get\_button\_count](#class-treeitem-method-get-button-count) immediately before this method. Optionally, the button can be `disabled` and have a `tooltip`. ### [Variant](class_variant#class-variant) call\_recursive ( [String](class_string#class-string) method, ... ) vararg Calls the `method` on the actual TreeItem and its children recursively. Pass parameters as a comma separated list. ### void clear\_custom\_bg\_color ( [int](class_int#class-int) column ) Resets the background color for the given column to default. ### void clear\_custom\_color ( [int](class_int#class-int) column ) Resets the color for the given column to default. ### void deselect ( [int](class_int#class-int) column ) Deselects the given column. ### void erase\_button ( [int](class_int#class-int) column, [int](class_int#class-int) button\_idx ) Removes the button at index `button_idx` in column `column`. ### [Texture](class_texture#class-texture) get\_button ( [int](class_int#class-int) column, [int](class_int#class-int) button\_idx ) const Returns the [Texture](class_texture#class-texture) of the button at index `button_idx` in column `column`. ### [int](class_int#class-int) get\_button\_by\_id ( [int](class_int#class-int) column, [int](class_int#class-int) id ) const Returns the button index if there is a button with id `id` in column `column`, otherwise returns -1. ### [int](class_int#class-int) get\_button\_count ( [int](class_int#class-int) column ) const Returns the number of buttons in column `column`. ### [int](class_int#class-int) get\_button\_id ( [int](class_int#class-int) column, [int](class_int#class-int) button\_idx ) const Returns the id for the button at index `button_idx` in column `column`. ### [String](class_string#class-string) get\_button\_tooltip ( [int](class_int#class-int) column, [int](class_int#class-int) button\_idx ) const Returns the tooltip string for the button at index `button_idx` in column `column`. ### [TreeCellMode](#enum-treeitem-treecellmode) get\_cell\_mode ( [int](class_int#class-int) column ) const Returns the column's cell mode. ### [TreeItem](#class-treeitem) get\_children ( ) Returns the TreeItem's first child item or a null object if there is none. ### [Color](class_color#class-color) get\_custom\_bg\_color ( [int](class_int#class-int) column ) const Returns the custom background color of column `column`. ### [Color](class_color#class-color) get\_custom\_color ( [int](class_int#class-int) column ) const Returns the custom color of column `column`. ### [bool](class_bool#class-bool) get\_expand\_right ( [int](class_int#class-int) column ) const Returns `true` if `expand_right` is set. ### [Texture](class_texture#class-texture) get\_icon ( [int](class_int#class-int) column ) const Returns the given column's icon [Texture](class_texture#class-texture). Error if no icon is set. ### [int](class_int#class-int) get\_icon\_max\_width ( [int](class_int#class-int) column ) const Returns the column's icon's maximum width. ### [Color](class_color#class-color) get\_icon\_modulate ( [int](class_int#class-int) column ) const Returns the [Color](class_color#class-color) modulating the column's icon. ### [Rect2](class_rect2#class-rect2) get\_icon\_region ( [int](class_int#class-int) column ) const Returns the icon [Texture](class_texture#class-texture) region as [Rect2](class_rect2#class-rect2). ### [Variant](class_variant#class-variant) get\_metadata ( [int](class_int#class-int) column ) const Returns the metadata value that was set for the given column using [set\_metadata](#class-treeitem-method-set-metadata). ### [TreeItem](#class-treeitem) get\_next ( ) Returns the next sibling TreeItem in the tree or a null object if there is none. ### [TreeItem](#class-treeitem) get\_next\_visible ( [bool](class_bool#class-bool) wrap=false ) Returns the next visible sibling TreeItem in the tree or a null object if there is none. If `wrap` is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns `null`. ### [TreeItem](#class-treeitem) get\_parent ( ) Returns the parent TreeItem or a null object if there is none. ### [TreeItem](#class-treeitem) get\_prev ( ) Returns the previous sibling TreeItem in the tree or a null object if there is none. ### [TreeItem](#class-treeitem) get\_prev\_visible ( [bool](class_bool#class-bool) wrap=false ) Returns the previous visible sibling TreeItem in the tree or a null object if there is none. If `wrap` is enabled, the method will wrap around to the last visible element in the tree when called on the first visible element, otherwise it returns `null`. ### [float](class_float#class-float) get\_range ( [int](class_int#class-int) column ) const Returns the value of a [CELL\_MODE\_RANGE](#class-treeitem-constant-cell-mode-range) column. ### [Dictionary](class_dictionary#class-dictionary) get\_range\_config ( [int](class_int#class-int) column ) Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr". ### [String](class_string#class-string) get\_suffix ( [int](class_int#class-int) column ) const Gets the suffix string shown after the column value. ### [String](class_string#class-string) get\_text ( [int](class_int#class-int) column ) const Returns the given column's text. ### [TextAlign](#enum-treeitem-textalign) get\_text\_align ( [int](class_int#class-int) column ) const Returns the given column's text alignment. ### [String](class_string#class-string) get\_tooltip ( [int](class_int#class-int) column ) const Returns the given column's tooltip. ### [bool](class_bool#class-bool) is\_button\_disabled ( [int](class_int#class-int) column, [int](class_int#class-int) button\_idx ) const Returns `true` if the button at index `button_idx` for the given column is disabled. ### [bool](class_bool#class-bool) is\_checked ( [int](class_int#class-int) column ) const Returns `true` if the given column is checked. ### [bool](class_bool#class-bool) is\_custom\_set\_as\_button ( [int](class_int#class-int) column ) const ### [bool](class_bool#class-bool) is\_editable ( [int](class_int#class-int) column ) Returns `true` if column `column` is editable. ### [bool](class_bool#class-bool) is\_selectable ( [int](class_int#class-int) column ) const Returns `true` if column `column` is selectable. ### [bool](class_bool#class-bool) is\_selected ( [int](class_int#class-int) column ) Returns `true` if column `column` is selected. ### void move\_to\_bottom ( ) Moves this TreeItem to the bottom in the [Tree](class_tree#class-tree) hierarchy. ### void move\_to\_top ( ) Moves this TreeItem to the top in the [Tree](class_tree#class-tree) hierarchy. ### void remove\_child ( [Object](class_object#class-object) child ) Removes the given child `TreeItem` and all its children from the [Tree](class_tree#class-tree). Note that it doesn't free the item from memory, so it can be reused later. To completely remove a `TreeItem` use [Object.free](class_object#class-object-method-free). ### void select ( [int](class_int#class-int) column ) Selects the column `column`. ### void set\_button ( [int](class_int#class-int) column, [int](class_int#class-int) button\_idx, [Texture](class_texture#class-texture) button ) Sets the given column's button [Texture](class_texture#class-texture) at index `button_idx` to `button`. ### void set\_button\_disabled ( [int](class_int#class-int) column, [int](class_int#class-int) button\_idx, [bool](class_bool#class-bool) disabled ) If `true`, disables the button at index `button_idx` in column `column`. ### void set\_cell\_mode ( [int](class_int#class-int) column, [TreeCellMode](#enum-treeitem-treecellmode) mode ) Sets the given column's cell mode to `mode`. See [TreeCellMode](#enum-treeitem-treecellmode) constants. ### void set\_checked ( [int](class_int#class-int) column, [bool](class_bool#class-bool) checked ) If `true`, the column `column` is checked. ### void set\_custom\_as\_button ( [int](class_int#class-int) column, [bool](class_bool#class-bool) enable ) ### void set\_custom\_bg\_color ( [int](class_int#class-int) column, [Color](class_color#class-color) color, [bool](class_bool#class-bool) just\_outline=false ) Sets the given column's custom background color and whether to just use it as an outline. ### void set\_custom\_color ( [int](class_int#class-int) column, [Color](class_color#class-color) color ) Sets the given column's custom color. ### void set\_custom\_draw ( [int](class_int#class-int) column, [Object](class_object#class-object) object, [String](class_string#class-string) callback ) Sets the given column's custom draw callback to `callback` method on `object`. The `callback` should accept two arguments: the `TreeItem` that is drawn and its position and size as a [Rect2](class_rect2#class-rect2). ### void set\_editable ( [int](class_int#class-int) column, [bool](class_bool#class-bool) enabled ) If `true`, column `column` is editable. ### void set\_expand\_right ( [int](class_int#class-int) column, [bool](class_bool#class-bool) enable ) If `true`, column `column` is expanded to the right. ### void set\_icon ( [int](class_int#class-int) column, [Texture](class_texture#class-texture) texture ) Sets the given column's icon [Texture](class_texture#class-texture). ### void set\_icon\_max\_width ( [int](class_int#class-int) column, [int](class_int#class-int) width ) Sets the given column's icon's maximum width. ### void set\_icon\_modulate ( [int](class_int#class-int) column, [Color](class_color#class-color) modulate ) Modulates the given column's icon with `modulate`. ### void set\_icon\_region ( [int](class_int#class-int) column, [Rect2](class_rect2#class-rect2) region ) Sets the given column's icon's texture region. ### void set\_metadata ( [int](class_int#class-int) column, [Variant](class_variant#class-variant) meta ) Sets the metadata value for the given column, which can be retrieved later using [get\_metadata](#class-treeitem-method-get-metadata). This can be used, for example, to store a reference to the original data. ### void set\_range ( [int](class_int#class-int) column, [float](class_float#class-float) value ) Sets the value of a [CELL\_MODE\_RANGE](#class-treeitem-constant-cell-mode-range) column. ### void set\_range\_config ( [int](class_int#class-int) column, [float](class_float#class-float) min, [float](class_float#class-float) max, [float](class_float#class-float) step, [bool](class_bool#class-bool) expr=false ) Sets the range of accepted values for a column. The column must be in the [CELL\_MODE\_RANGE](#class-treeitem-constant-cell-mode-range) mode. If `expr` is `true`, the edit mode slider will use an exponential scale as with [Range.exp\_edit](class_range#class-range-property-exp-edit). ### void set\_selectable ( [int](class_int#class-int) column, [bool](class_bool#class-bool) selectable ) If `true`, the given column is selectable. ### void set\_suffix ( [int](class_int#class-int) column, [String](class_string#class-string) text ) Sets a string to be shown after a column's value (for example, a unit abbreviation). ### void set\_text ( [int](class_int#class-int) column, [String](class_string#class-string) text ) Sets the given column's text value. ### void set\_text\_align ( [int](class_int#class-int) column, [TextAlign](#enum-treeitem-textalign) text\_align ) Sets the given column's text alignment. See [TextAlign](#enum-treeitem-textalign) for possible values. ### void set\_tooltip ( [int](class_int#class-int) column, [String](class_string#class-string) tooltip ) Sets the given column's tooltip text.
programming_docs
godot Label3D Label3D ======= **Inherits:** [GeometryInstance](class_geometryinstance#class-geometryinstance) **<** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Displays plain text in a 3D world. Description ----------- Label3D displays plain text in a 3D world. It gives you control over the horizontal and vertical alignment. Properties ---------- | | | | | --- | --- | --- | | [AlphaCutMode](#enum-label3d-alphacutmode) | [alpha\_cut](#class-label3d-property-alpha-cut) | `0` | | [float](class_float#class-float) | [alpha\_scissor\_threshold](#class-label3d-property-alpha-scissor-threshold) | `0.5` | | [bool](class_bool#class-bool) | [autowrap](#class-label3d-property-autowrap) | `false` | | [BillboardMode](class_spatialmaterial#enum-spatialmaterial-billboardmode) | [billboard](#class-label3d-property-billboard) | `0` | | [bool](class_bool#class-bool) | [double\_sided](#class-label3d-property-double-sided) | `true` | | [bool](class_bool#class-bool) | [fixed\_size](#class-label3d-property-fixed-size) | `false` | | [Font](class_font#class-font) | [font](#class-label3d-property-font) | | | [Align](#enum-label3d-align) | [horizontal\_alignment](#class-label3d-property-horizontal-alignment) | `1` | | [float](class_float#class-float) | [line\_spacing](#class-label3d-property-line-spacing) | `0.0` | | [Color](class_color#class-color) | [modulate](#class-label3d-property-modulate) | `Color( 1, 1, 1, 1 )` | | [bool](class_bool#class-bool) | [no\_depth\_test](#class-label3d-property-no-depth-test) | `false` | | [Vector2](class_vector2#class-vector2) | [offset](#class-label3d-property-offset) | `Vector2( 0, 0 )` | | [Color](class_color#class-color) | [outline\_modulate](#class-label3d-property-outline-modulate) | `Color( 0, 0, 0, 1 )` | | [int](class_int#class-int) | [outline\_render\_priority](#class-label3d-property-outline-render-priority) | `-1` | | [float](class_float#class-float) | [pixel\_size](#class-label3d-property-pixel-size) | `0.01` | | [int](class_int#class-int) | [render\_priority](#class-label3d-property-render-priority) | `0` | | [bool](class_bool#class-bool) | [shaded](#class-label3d-property-shaded) | `false` | | [String](class_string#class-string) | [text](#class-label3d-property-text) | `""` | | [bool](class_bool#class-bool) | [uppercase](#class-label3d-property-uppercase) | `false` | | [VAlign](#enum-label3d-valign) | [vertical\_alignment](#class-label3d-property-vertical-alignment) | `1` | | [float](class_float#class-float) | [width](#class-label3d-property-width) | `500.0` | Methods ------- | | | | --- | --- | | [TriangleMesh](class_trianglemesh#class-trianglemesh) | [generate\_triangle\_mesh](#class-label3d-method-generate-triangle-mesh) **(** **)** const | | [bool](class_bool#class-bool) | [get\_draw\_flag](#class-label3d-method-get-draw-flag) **(** [DrawFlags](#enum-label3d-drawflags) flag **)** const | | void | [set\_draw\_flag](#class-label3d-method-set-draw-flag) **(** [DrawFlags](#enum-label3d-drawflags) flag, [bool](class_bool#class-bool) enabled **)** | Enumerations ------------ enum **DrawFlags**: * **FLAG\_SHADED** = **0** --- If set, lights in the environment affect the label. * **FLAG\_DOUBLE\_SIDED** = **1** --- If set, text can be seen from the back as well. If not, the text is invisible when looking at it from behind. * **FLAG\_DISABLE\_DEPTH\_TEST** = **2** --- Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it. * **FLAG\_FIXED\_SIZE** = **3** --- Label is scaled by depth so that it always appears the same size on screen. * **FLAG\_MAX** = **4** --- Represents the size of the [DrawFlags](#enum-label3d-drawflags) enum. enum **AlphaCutMode**: * **ALPHA\_CUT\_DISABLED** = **0** --- This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping. * **ALPHA\_CUT\_DISCARD** = **1** --- This mode only allows fully transparent or fully opaque pixels. This mode is also known as *alpha testing* or *1-bit transparency*. **Note:** This mode might have issues with anti-aliased fonts and outlines, try adjusting [alpha\_scissor\_threshold](#class-label3d-property-alpha-scissor-threshold) or using SDF font. **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline. * **ALPHA\_CUT\_OPAQUE\_PREPASS** = **2** --- This mode draws fully opaque pixels in the depth prepass. This is slower than [ALPHA\_CUT\_DISABLED](#class-label3d-constant-alpha-cut-disabled) or [ALPHA\_CUT\_DISCARD](#class-label3d-constant-alpha-cut-discard), but it allows displaying translucent areas and smooth edges while using proper sorting. **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline. enum **Align**: * **ALIGN\_LEFT** = **0** --- Align rows to the left (default). * **ALIGN\_CENTER** = **1** --- Align rows centered. * **ALIGN\_RIGHT** = **2** --- Align rows to the right. * **ALIGN\_FILL** = **3** --- Expand row whitespaces to fit the width. enum **VAlign**: * **VALIGN\_TOP** = **0** --- Align the whole text to the top. * **VALIGN\_CENTER** = **1** --- Align the whole text to the center. * **VALIGN\_BOTTOM** = **2** --- Align the whole text to the bottom. * **VALIGN\_FILL** = **3** --- Align the whole text by spreading the rows. Property Descriptions --------------------- ### [AlphaCutMode](#enum-label3d-alphacutmode) alpha\_cut | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_alpha\_cut\_mode(value) | | *Getter* | get\_alpha\_cut\_mode() | The alpha cutting mode to use for the sprite. See [AlphaCutMode](#enum-label3d-alphacutmode) for possible values. ### [float](class_float#class-float) alpha\_scissor\_threshold | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_alpha\_scissor\_threshold(value) | | *Getter* | get\_alpha\_scissor\_threshold() | Threshold at which the alpha scissor will discard values. ### [bool](class_bool#class-bool) autowrap | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_autowrap(value) | | *Getter* | get\_autowrap() | If `true`, wraps the text to the [width](#class-label3d-property-width). ### [BillboardMode](class_spatialmaterial#enum-spatialmaterial-billboardmode) billboard | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_billboard\_mode(value) | | *Getter* | get\_billboard\_mode() | The billboard mode to use for the label. See [BillboardMode](class_spatialmaterial#enum-spatialmaterial-billboardmode) for possible values. ### [bool](class_bool#class-bool) double\_sided | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_draw\_flag(value) | | *Getter* | get\_draw\_flag() | If `true`, text can be seen from the back as well, if `false`, it is invisible when looking at it from behind. ### [bool](class_bool#class-bool) fixed\_size | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_draw\_flag(value) | | *Getter* | get\_draw\_flag() | If `true`, the label is rendered at the same size regardless of distance. ### [Font](class_font#class-font) font | | | | --- | --- | | *Setter* | set\_font(value) | | *Getter* | get\_font() | [Font](class_font#class-font) used for the `Label3D`'s text. ### [Align](#enum-label3d-align) horizontal\_alignment | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_horizontal\_alignment(value) | | *Getter* | get\_horizontal\_alignment() | Controls the text's horizontal alignment. Supports left, center, right. Set it to one of the [Align](#enum-label3d-align) constants. ### [float](class_float#class-float) line\_spacing | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_line\_spacing(value) | | *Getter* | get\_line\_spacing() | Vertical space between lines in multiline `Label3D`. ### [Color](class_color#class-color) modulate | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_modulate(value) | | *Getter* | get\_modulate() | Text [Color](class_color#class-color) of the `Label3D`. ### [bool](class_bool#class-bool) no\_depth\_test | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_draw\_flag(value) | | *Getter* | get\_draw\_flag() | If `true`, depth testing is disabled and the object will be drawn in render order. ### [Vector2](class_vector2#class-vector2) offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_offset(value) | | *Getter* | get\_offset() | The text drawing offset (in pixels). ### [Color](class_color#class-color) outline\_modulate | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 1 )` | | *Setter* | set\_outline\_modulate(value) | | *Getter* | get\_outline\_modulate() | The tint of [Font](class_font#class-font)'s outline. ### [int](class_int#class-int) outline\_render\_priority | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_outline\_render\_priority(value) | | *Getter* | get\_outline\_render\_priority() | Sets the render priority for the text outline. Higher priority objects will be sorted in front of lower priority objects. **Note:** This only applies if [alpha\_cut](#class-label3d-property-alpha-cut) is set to [ALPHA\_CUT\_DISABLED](#class-label3d-constant-alpha-cut-disabled) (default value). **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). ### [float](class_float#class-float) pixel\_size | | | | --- | --- | | *Default* | `0.01` | | *Setter* | set\_pixel\_size(value) | | *Getter* | get\_pixel\_size() | The size of one pixel's width on the label to scale it in 3D. ### [int](class_int#class-int) render\_priority | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_render\_priority(value) | | *Getter* | get\_render\_priority() | Sets the render priority for the text. Higher priority objects will be sorted in front of lower priority objects. **Note:** This only applies if [alpha\_cut](#class-label3d-property-alpha-cut) is set to [ALPHA\_CUT\_DISABLED](#class-label3d-constant-alpha-cut-disabled) (default value). **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). ### [bool](class_bool#class-bool) shaded | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_draw\_flag(value) | | *Getter* | get\_draw\_flag() | If `true`, the [Light](class_light#class-light) in the [Environment](class_environment#class-environment) has effects on the label. ### [String](class_string#class-string) text | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_text(value) | | *Getter* | get\_text() | The text to display on screen. ### [bool](class_bool#class-bool) uppercase | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_uppercase(value) | | *Getter* | is\_uppercase() | If `true`, all the text displays as UPPERCASE. ### [VAlign](#enum-label3d-valign) vertical\_alignment | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_vertical\_alignment(value) | | *Getter* | get\_vertical\_alignment() | Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the [VAlign](#enum-label3d-valign) constants. ### [float](class_float#class-float) width | | | | --- | --- | | *Default* | `500.0` | | *Setter* | set\_width(value) | | *Getter* | get\_width() | Text width (in pixels), used for autowrap and fill alignment. Method Descriptions ------------------- ### [TriangleMesh](class_trianglemesh#class-trianglemesh) generate\_triangle\_mesh ( ) const Returns a [TriangleMesh](class_trianglemesh#class-trianglemesh) with the label's vertices following its current configuration (such as its [pixel\_size](#class-label3d-property-pixel-size)). ### [bool](class_bool#class-bool) get\_draw\_flag ( [DrawFlags](#enum-label3d-drawflags) flag ) const Returns the value of the specified flag. ### void set\_draw\_flag ( [DrawFlags](#enum-label3d-drawflags) flag, [bool](class_bool#class-bool) enabled ) If `true`, the specified flag will be enabled. See [DrawFlags](#enum-label3d-drawflags) for a list of flags. godot CSGCylinder CSGCylinder =========== **Inherits:** [CSGPrimitive](class_csgprimitive#class-csgprimitive) **<** [CSGShape](class_csgshape#class-csgshape) **<** [GeometryInstance](class_geometryinstance#class-geometryinstance) **<** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) A CSG Cylinder shape. Description ----------- This node allows you to create a cylinder (or cone) for use with the CSG system. **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a [MeshInstance](class_meshinstance#class-meshinstance) with a [PrimitiveMesh](class_primitivemesh#class-primitivemesh). Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. Tutorials --------- * [Prototyping levels with CSG](https://docs.godotengine.org/en/3.5/tutorials/3d/csg_tools.html) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [cone](#class-csgcylinder-property-cone) | `false` | | [float](class_float#class-float) | [height](#class-csgcylinder-property-height) | `1.0` | | [Material](class_material#class-material) | [material](#class-csgcylinder-property-material) | | | [float](class_float#class-float) | [radius](#class-csgcylinder-property-radius) | `1.0` | | [int](class_int#class-int) | [sides](#class-csgcylinder-property-sides) | `8` | | [bool](class_bool#class-bool) | [smooth\_faces](#class-csgcylinder-property-smooth-faces) | `true` | Property Descriptions --------------------- ### [bool](class_bool#class-bool) cone | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_cone(value) | | *Getter* | is\_cone() | If `true` a cone is created, the [radius](#class-csgcylinder-property-radius) will only apply to one side. ### [float](class_float#class-float) height | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_height(value) | | *Getter* | get\_height() | The height of the cylinder. ### [Material](class_material#class-material) material | | | | --- | --- | | *Setter* | set\_material(value) | | *Getter* | get\_material() | The material used to render the cylinder. ### [float](class_float#class-float) radius | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_radius(value) | | *Getter* | get\_radius() | The radius of the cylinder. ### [int](class_int#class-int) sides | | | | --- | --- | | *Default* | `8` | | *Setter* | set\_sides(value) | | *Getter* | get\_sides() | The number of sides of the cylinder, the higher this number the more detail there will be in the cylinder. ### [bool](class_bool#class-bool) smooth\_faces | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_smooth\_faces(value) | | *Getter* | get\_smooth\_faces() | If `true` the normals of the cylinder are set to give a smooth effect making the cylinder seem rounded. If `false` the cylinder will have a flat shaded look. godot VisualShaderNodeGroupBase VisualShaderNodeGroupBase ========================= **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [VisualShaderNodeExpression](class_visualshadernodeexpression#class-visualshadernodeexpression) Base class for a family of nodes with variable amount of input and output ports within the visual shader graph. Description ----------- Currently, has no direct usage, use the derived classes instead. Properties ---------- | | | | | --- | --- | --- | | [Vector2](class_vector2#class-vector2) | [size](#class-visualshadernodegroupbase-property-size) | `Vector2( 0, 0 )` | Methods ------- | | | | --- | --- | | void | [add\_input\_port](#class-visualshadernodegroupbase-method-add-input-port) **(** [int](class_int#class-int) id, [int](class_int#class-int) type, [String](class_string#class-string) name **)** | | void | [add\_output\_port](#class-visualshadernodegroupbase-method-add-output-port) **(** [int](class_int#class-int) id, [int](class_int#class-int) type, [String](class_string#class-string) name **)** | | void | [clear\_input\_ports](#class-visualshadernodegroupbase-method-clear-input-ports) **(** **)** | | void | [clear\_output\_ports](#class-visualshadernodegroupbase-method-clear-output-ports) **(** **)** | | [int](class_int#class-int) | [get\_free\_input\_port\_id](#class-visualshadernodegroupbase-method-get-free-input-port-id) **(** **)** const | | [int](class_int#class-int) | [get\_free\_output\_port\_id](#class-visualshadernodegroupbase-method-get-free-output-port-id) **(** **)** const | | [int](class_int#class-int) | [get\_input\_port\_count](#class-visualshadernodegroupbase-method-get-input-port-count) **(** **)** const | | [String](class_string#class-string) | [get\_inputs](#class-visualshadernodegroupbase-method-get-inputs) **(** **)** const | | [int](class_int#class-int) | [get\_output\_port\_count](#class-visualshadernodegroupbase-method-get-output-port-count) **(** **)** const | | [String](class_string#class-string) | [get\_outputs](#class-visualshadernodegroupbase-method-get-outputs) **(** **)** const | | [bool](class_bool#class-bool) | [has\_input\_port](#class-visualshadernodegroupbase-method-has-input-port) **(** [int](class_int#class-int) id **)** const | | [bool](class_bool#class-bool) | [has\_output\_port](#class-visualshadernodegroupbase-method-has-output-port) **(** [int](class_int#class-int) id **)** const | | [bool](class_bool#class-bool) | [is\_valid\_port\_name](#class-visualshadernodegroupbase-method-is-valid-port-name) **(** [String](class_string#class-string) name **)** const | | void | [remove\_input\_port](#class-visualshadernodegroupbase-method-remove-input-port) **(** [int](class_int#class-int) id **)** | | void | [remove\_output\_port](#class-visualshadernodegroupbase-method-remove-output-port) **(** [int](class_int#class-int) id **)** | | void | [set\_input\_port\_name](#class-visualshadernodegroupbase-method-set-input-port-name) **(** [int](class_int#class-int) id, [String](class_string#class-string) name **)** | | void | [set\_input\_port\_type](#class-visualshadernodegroupbase-method-set-input-port-type) **(** [int](class_int#class-int) id, [int](class_int#class-int) type **)** | | void | [set\_inputs](#class-visualshadernodegroupbase-method-set-inputs) **(** [String](class_string#class-string) inputs **)** | | void | [set\_output\_port\_name](#class-visualshadernodegroupbase-method-set-output-port-name) **(** [int](class_int#class-int) id, [String](class_string#class-string) name **)** | | void | [set\_output\_port\_type](#class-visualshadernodegroupbase-method-set-output-port-type) **(** [int](class_int#class-int) id, [int](class_int#class-int) type **)** | | void | [set\_outputs](#class-visualshadernodegroupbase-method-set-outputs) **(** [String](class_string#class-string) outputs **)** | Property Descriptions --------------------- ### [Vector2](class_vector2#class-vector2) size | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_size(value) | | *Getter* | get\_size() | The size of the node in the visual shader graph. Method Descriptions ------------------- ### void add\_input\_port ( [int](class_int#class-int) id, [int](class_int#class-int) type, [String](class_string#class-string) name ) Adds an input port with the specified `type` (see [PortType](class_visualshadernode#enum-visualshadernode-porttype)) and `name`. ### void add\_output\_port ( [int](class_int#class-int) id, [int](class_int#class-int) type, [String](class_string#class-string) name ) Adds an output port with the specified `type` (see [PortType](class_visualshadernode#enum-visualshadernode-porttype)) and `name`. ### void clear\_input\_ports ( ) Removes all previously specified input ports. ### void clear\_output\_ports ( ) Removes all previously specified output ports. ### [int](class_int#class-int) get\_free\_input\_port\_id ( ) const Returns a free input port ID which can be used in [add\_input\_port](#class-visualshadernodegroupbase-method-add-input-port). ### [int](class_int#class-int) get\_free\_output\_port\_id ( ) const Returns a free output port ID which can be used in [add\_output\_port](#class-visualshadernodegroupbase-method-add-output-port). ### [int](class_int#class-int) get\_input\_port\_count ( ) const Returns the number of input ports in use. Alternative for [get\_free\_input\_port\_id](#class-visualshadernodegroupbase-method-get-free-input-port-id). ### [String](class_string#class-string) get\_inputs ( ) const Returns a [String](class_string#class-string) description of the input ports as a colon-separated list using the format `id,type,name;` (see [add\_input\_port](#class-visualshadernodegroupbase-method-add-input-port)). ### [int](class_int#class-int) get\_output\_port\_count ( ) const Returns the number of output ports in use. Alternative for [get\_free\_output\_port\_id](#class-visualshadernodegroupbase-method-get-free-output-port-id). ### [String](class_string#class-string) get\_outputs ( ) const Returns a [String](class_string#class-string) description of the output ports as a colon-separated list using the format `id,type,name;` (see [add\_output\_port](#class-visualshadernodegroupbase-method-add-output-port)). ### [bool](class_bool#class-bool) has\_input\_port ( [int](class_int#class-int) id ) const Returns `true` if the specified input port exists. ### [bool](class_bool#class-bool) has\_output\_port ( [int](class_int#class-int) id ) const Returns `true` if the specified output port exists. ### [bool](class_bool#class-bool) is\_valid\_port\_name ( [String](class_string#class-string) name ) const Returns `true` if the specified port name does not override an existed port name and is valid within the shader. ### void remove\_input\_port ( [int](class_int#class-int) id ) Removes the specified input port. ### void remove\_output\_port ( [int](class_int#class-int) id ) Removes the specified output port. ### void set\_input\_port\_name ( [int](class_int#class-int) id, [String](class_string#class-string) name ) Renames the specified input port. ### void set\_input\_port\_type ( [int](class_int#class-int) id, [int](class_int#class-int) type ) Sets the specified input port's type (see [PortType](class_visualshadernode#enum-visualshadernode-porttype)). ### void set\_inputs ( [String](class_string#class-string) inputs ) Defines all input ports using a [String](class_string#class-string) formatted as a colon-separated list: `id,type,name;` (see [add\_input\_port](#class-visualshadernodegroupbase-method-add-input-port)). ### void set\_output\_port\_name ( [int](class_int#class-int) id, [String](class_string#class-string) name ) Renames the specified output port. ### void set\_output\_port\_type ( [int](class_int#class-int) id, [int](class_int#class-int) type ) Sets the specified output port's type (see [PortType](class_visualshadernode#enum-visualshadernode-porttype)). ### void set\_outputs ( [String](class_string#class-string) outputs ) Defines all output ports using a [String](class_string#class-string) formatted as a colon-separated list: `id,type,name;` (see [add\_output\_port](#class-visualshadernodegroupbase-method-add-output-port)).
programming_docs
godot VisualScriptSceneNode VisualScriptSceneNode ===================== **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Node reference. Description ----------- A direct reference to a node. **Input Ports:** none **Output Ports:** * Data: `node` (obj) Properties ---------- | | | | | --- | --- | --- | | [NodePath](class_nodepath#class-nodepath) | [node\_path](#class-visualscriptscenenode-property-node-path) | `NodePath(".")` | Property Descriptions --------------------- ### [NodePath](class_nodepath#class-nodepath) node\_path | | | | --- | --- | | *Default* | `NodePath(".")` | | *Setter* | set\_node\_path(value) | | *Getter* | get\_node\_path() | The node's path in the scene tree. godot Physics2DShapeQueryParameters Physics2DShapeQueryParameters ============================= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Parameters to be sent to a 2D shape physics query. Description ----------- This class contains the shape and other parameters for 2D intersection/collision queries. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [collide\_with\_areas](#class-physics2dshapequeryparameters-property-collide-with-areas) | `false` | | [bool](class_bool#class-bool) | [collide\_with\_bodies](#class-physics2dshapequeryparameters-property-collide-with-bodies) | `true` | | [int](class_int#class-int) | [collision\_layer](#class-physics2dshapequeryparameters-property-collision-layer) | `2147483647` | | [Array](class_array#class-array) | [exclude](#class-physics2dshapequeryparameters-property-exclude) | `[  ]` | | [float](class_float#class-float) | [margin](#class-physics2dshapequeryparameters-property-margin) | `0.0` | | [Vector2](class_vector2#class-vector2) | [motion](#class-physics2dshapequeryparameters-property-motion) | `Vector2( 0, 0 )` | | [RID](class_rid#class-rid) | [shape\_rid](#class-physics2dshapequeryparameters-property-shape-rid) | | | [Transform2D](class_transform2d#class-transform2d) | [transform](#class-physics2dshapequeryparameters-property-transform) | `Transform2D( 1, 0, 0, 1, 0, 0 )` | Methods ------- | | | | --- | --- | | void | [set\_shape](#class-physics2dshapequeryparameters-method-set-shape) **(** [Resource](class_resource#class-resource) shape **)** | Property Descriptions --------------------- ### [bool](class_bool#class-bool) collide\_with\_areas | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_collide\_with\_areas(value) | | *Getter* | is\_collide\_with\_areas\_enabled() | If `true`, the query will take [Area2D](class_area2d#class-area2d)s into account. ### [bool](class_bool#class-bool) collide\_with\_bodies | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_collide\_with\_bodies(value) | | *Getter* | is\_collide\_with\_bodies\_enabled() | If `true`, the query will take [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d)s into account. ### [int](class_int#class-int) collision\_layer | | | | --- | --- | | *Default* | `2147483647` | | *Setter* | set\_collision\_layer(value) | | *Getter* | get\_collision\_layer() | The physics layer(s) the query will take into account (as a bitmask). See [Collision layers and masks](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. ### [Array](class_array#class-array) exclude | | | | --- | --- | | *Default* | `[  ]` | | *Setter* | set\_exclude(value) | | *Getter* | get\_exclude() | The list of objects or object [RID](class_rid#class-rid)s that will be excluded from collisions. ### [float](class_float#class-float) margin | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_margin(value) | | *Getter* | get\_margin() | The collision margin for the shape. ### [Vector2](class_vector2#class-vector2) motion | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_motion(value) | | *Getter* | get\_motion() | The motion of the shape being queried for. ### [RID](class_rid#class-rid) shape\_rid | | | | --- | --- | | *Setter* | set\_shape\_rid(value) | | *Getter* | get\_shape\_rid() | The queried shape's [RID](class_rid#class-rid). See also [set\_shape](#class-physics2dshapequeryparameters-method-set-shape). ### [Transform2D](class_transform2d#class-transform2d) transform | | | | --- | --- | | *Default* | `Transform2D( 1, 0, 0, 1, 0, 0 )` | | *Setter* | set\_transform(value) | | *Getter* | get\_transform() | The queried shape's transform matrix. Method Descriptions ------------------- ### void set\_shape ( [Resource](class_resource#class-resource) shape ) Sets the [Shape2D](class_shape2d#class-shape2d) that will be used for collision/intersection queries. godot @GlobalScope @GlobalScope ============ Global scope constants and variables. Description ----------- Global scope constants and variables. This is all that resides in the globals, constants regarding error codes, scancodes, property hints, etc. Singletons are also documented here, since they can be accessed from anywhere. Properties ---------- | | | | --- | --- | | [ARVRServer](class_arvrserver#class-arvrserver) | [ARVRServer](#class-globalscope-property-arvrserver) | | [AudioServer](class_audioserver#class-audioserver) | [AudioServer](#class-globalscope-property-audioserver) | | [CameraServer](class_cameraserver#class-cameraserver) | [CameraServer](#class-globalscope-property-cameraserver) | | [ClassDB](class_classdb#class-classdb) | [ClassDB](#class-globalscope-property-classdb) | | [Engine](class_engine#class-engine) | [Engine](#class-globalscope-property-engine) | | [Geometry](class_geometry#class-geometry) | [Geometry](#class-globalscope-property-geometry) | | [IP](class_ip#class-ip) | [IP](#class-globalscope-property-ip) | | [Input](class_input#class-input) | [Input](#class-globalscope-property-input) | | [InputMap](class_inputmap#class-inputmap) | [InputMap](#class-globalscope-property-inputmap) | | [JSON](class_json#class-json) | [JSON](#class-globalscope-property-json) | | [JavaClassWrapper](class_javaclasswrapper#class-javaclasswrapper) | [JavaClassWrapper](#class-globalscope-property-javaclasswrapper) | | [JavaScript](class_javascript#class-javascript) | [JavaScript](#class-globalscope-property-javascript) | | [Marshalls](class_marshalls#class-marshalls) | [Marshalls](#class-globalscope-property-marshalls) | | [Navigation2DServer](class_navigation2dserver#class-navigation2dserver) | [Navigation2DServer](#class-globalscope-property-navigation2dserver) | | [NavigationMeshGenerator](class_navigationmeshgenerator#class-navigationmeshgenerator) | [NavigationMeshGenerator](#class-globalscope-property-navigationmeshgenerator) | | [NavigationServer](class_navigationserver#class-navigationserver) | [NavigationServer](#class-globalscope-property-navigationserver) | | [OS](class_os#class-os) | [OS](#class-globalscope-property-os) | | [Performance](class_performance#class-performance) | [Performance](#class-globalscope-property-performance) | | [Physics2DServer](class_physics2dserver#class-physics2dserver) | [Physics2DServer](#class-globalscope-property-physics2dserver) | | [PhysicsServer](class_physicsserver#class-physicsserver) | [PhysicsServer](#class-globalscope-property-physicsserver) | | [ProjectSettings](class_projectsettings#class-projectsettings) | [ProjectSettings](#class-globalscope-property-projectsettings) | | [ResourceLoader](class_resourceloader#class-resourceloader) | [ResourceLoader](#class-globalscope-property-resourceloader) | | [ResourceSaver](class_resourcesaver#class-resourcesaver) | [ResourceSaver](#class-globalscope-property-resourcesaver) | | [Time](class_time#class-time) | [Time](#class-globalscope-property-time) | | [TranslationServer](class_translationserver#class-translationserver) | [TranslationServer](#class-globalscope-property-translationserver) | | [VisualScriptEditor](class_visualscripteditor#class-visualscripteditor) | [VisualScriptEditor](#class-globalscope-property-visualscripteditor) | | [VisualServer](class_visualserver#class-visualserver) | [VisualServer](#class-globalscope-property-visualserver) | Enumerations ------------ enum **Margin**: * **MARGIN\_LEFT** = **0** --- Left margin, usually used for [Control](class_control#class-control) or [StyleBox](class_stylebox#class-stylebox)-derived classes. * **MARGIN\_TOP** = **1** --- Top margin, usually used for [Control](class_control#class-control) or [StyleBox](class_stylebox#class-stylebox)-derived classes. * **MARGIN\_RIGHT** = **2** --- Right margin, usually used for [Control](class_control#class-control) or [StyleBox](class_stylebox#class-stylebox)-derived classes. * **MARGIN\_BOTTOM** = **3** --- Bottom margin, usually used for [Control](class_control#class-control) or [StyleBox](class_stylebox#class-stylebox)-derived classes. enum **Corner**: * **CORNER\_TOP\_LEFT** = **0** --- Top-left corner. * **CORNER\_TOP\_RIGHT** = **1** --- Top-right corner. * **CORNER\_BOTTOM\_RIGHT** = **2** --- Bottom-right corner. * **CORNER\_BOTTOM\_LEFT** = **3** --- Bottom-left corner. enum **Orientation**: * **VERTICAL** = **1** --- General vertical alignment, usually used for [Separator](class_separator#class-separator), [ScrollBar](class_scrollbar#class-scrollbar), [Slider](class_slider#class-slider), etc. * **HORIZONTAL** = **0** --- General horizontal alignment, usually used for [Separator](class_separator#class-separator), [ScrollBar](class_scrollbar#class-scrollbar), [Slider](class_slider#class-slider), etc. enum **HAlign**: * **HALIGN\_LEFT** = **0** --- Horizontal left alignment, usually for text-derived classes. * **HALIGN\_CENTER** = **1** --- Horizontal center alignment, usually for text-derived classes. * **HALIGN\_RIGHT** = **2** --- Horizontal right alignment, usually for text-derived classes. enum **VAlign**: * **VALIGN\_TOP** = **0** --- Vertical top alignment, usually for text-derived classes. * **VALIGN\_CENTER** = **1** --- Vertical center alignment, usually for text-derived classes. * **VALIGN\_BOTTOM** = **2** --- Vertical bottom alignment, usually for text-derived classes. enum **KeyList**: * **KEY\_ESCAPE** = **16777217** --- Escape key. * **KEY\_TAB** = **16777218** --- Tab key. * **KEY\_BACKTAB** = **16777219** --- Shift+Tab key. * **KEY\_BACKSPACE** = **16777220** --- Backspace key. * **KEY\_ENTER** = **16777221** --- Return key (on the main keyboard). * **KEY\_KP\_ENTER** = **16777222** --- Enter key on the numeric keypad. * **KEY\_INSERT** = **16777223** --- Insert key. * **KEY\_DELETE** = **16777224** --- Delete key. * **KEY\_PAUSE** = **16777225** --- Pause key. * **KEY\_PRINT** = **16777226** --- Print Screen key. * **KEY\_SYSREQ** = **16777227** --- System Request key. * **KEY\_CLEAR** = **16777228** --- Clear key. * **KEY\_HOME** = **16777229** --- Home key. * **KEY\_END** = **16777230** --- End key. * **KEY\_LEFT** = **16777231** --- Left arrow key. * **KEY\_UP** = **16777232** --- Up arrow key. * **KEY\_RIGHT** = **16777233** --- Right arrow key. * **KEY\_DOWN** = **16777234** --- Down arrow key. * **KEY\_PAGEUP** = **16777235** --- Page Up key. * **KEY\_PAGEDOWN** = **16777236** --- Page Down key. * **KEY\_SHIFT** = **16777237** --- Shift key. * **KEY\_CONTROL** = **16777238** --- Control key. * **KEY\_META** = **16777239** --- Meta key. * **KEY\_ALT** = **16777240** --- Alt key. * **KEY\_CAPSLOCK** = **16777241** --- Caps Lock key. * **KEY\_NUMLOCK** = **16777242** --- Num Lock key. * **KEY\_SCROLLLOCK** = **16777243** --- Scroll Lock key. * **KEY\_F1** = **16777244** --- F1 key. * **KEY\_F2** = **16777245** --- F2 key. * **KEY\_F3** = **16777246** --- F3 key. * **KEY\_F4** = **16777247** --- F4 key. * **KEY\_F5** = **16777248** --- F5 key. * **KEY\_F6** = **16777249** --- F6 key. * **KEY\_F7** = **16777250** --- F7 key. * **KEY\_F8** = **16777251** --- F8 key. * **KEY\_F9** = **16777252** --- F9 key. * **KEY\_F10** = **16777253** --- F10 key. * **KEY\_F11** = **16777254** --- F11 key. * **KEY\_F12** = **16777255** --- F12 key. * **KEY\_F13** = **16777256** --- F13 key. * **KEY\_F14** = **16777257** --- F14 key. * **KEY\_F15** = **16777258** --- F15 key. * **KEY\_F16** = **16777259** --- F16 key. * **KEY\_KP\_MULTIPLY** = **16777345** --- Multiply (\*) key on the numeric keypad. * **KEY\_KP\_DIVIDE** = **16777346** --- Divide (/) key on the numeric keypad. * **KEY\_KP\_SUBTRACT** = **16777347** --- Subtract (-) key on the numeric keypad. * **KEY\_KP\_PERIOD** = **16777348** --- Period (.) key on the numeric keypad. * **KEY\_KP\_ADD** = **16777349** --- Add (+) key on the numeric keypad. * **KEY\_KP\_0** = **16777350** --- Number 0 on the numeric keypad. * **KEY\_KP\_1** = **16777351** --- Number 1 on the numeric keypad. * **KEY\_KP\_2** = **16777352** --- Number 2 on the numeric keypad. * **KEY\_KP\_3** = **16777353** --- Number 3 on the numeric keypad. * **KEY\_KP\_4** = **16777354** --- Number 4 on the numeric keypad. * **KEY\_KP\_5** = **16777355** --- Number 5 on the numeric keypad. * **KEY\_KP\_6** = **16777356** --- Number 6 on the numeric keypad. * **KEY\_KP\_7** = **16777357** --- Number 7 on the numeric keypad. * **KEY\_KP\_8** = **16777358** --- Number 8 on the numeric keypad. * **KEY\_KP\_9** = **16777359** --- Number 9 on the numeric keypad. * **KEY\_SUPER\_L** = **16777260** --- Left Super key (Windows key). * **KEY\_SUPER\_R** = **16777261** --- Right Super key (Windows key). * **KEY\_MENU** = **16777262** --- Context menu key. * **KEY\_HYPER\_L** = **16777263** --- Left Hyper key. * **KEY\_HYPER\_R** = **16777264** --- Right Hyper key. * **KEY\_HELP** = **16777265** --- Help key. * **KEY\_DIRECTION\_L** = **16777266** --- Left Direction key. * **KEY\_DIRECTION\_R** = **16777267** --- Right Direction key. * **KEY\_BACK** = **16777280** --- Media back key. Not to be confused with the Back button on an Android device. * **KEY\_FORWARD** = **16777281** --- Media forward key. * **KEY\_STOP** = **16777282** --- Media stop key. * **KEY\_REFRESH** = **16777283** --- Media refresh key. * **KEY\_VOLUMEDOWN** = **16777284** --- Volume down key. * **KEY\_VOLUMEMUTE** = **16777285** --- Mute volume key. * **KEY\_VOLUMEUP** = **16777286** --- Volume up key. * **KEY\_BASSBOOST** = **16777287** --- Bass Boost key. * **KEY\_BASSUP** = **16777288** --- Bass up key. * **KEY\_BASSDOWN** = **16777289** --- Bass down key. * **KEY\_TREBLEUP** = **16777290** --- Treble up key. * **KEY\_TREBLEDOWN** = **16777291** --- Treble down key. * **KEY\_MEDIAPLAY** = **16777292** --- Media play key. * **KEY\_MEDIASTOP** = **16777293** --- Media stop key. * **KEY\_MEDIAPREVIOUS** = **16777294** --- Previous song key. * **KEY\_MEDIANEXT** = **16777295** --- Next song key. * **KEY\_MEDIARECORD** = **16777296** --- Media record key. * **KEY\_HOMEPAGE** = **16777297** --- Home page key. * **KEY\_FAVORITES** = **16777298** --- Favorites key. * **KEY\_SEARCH** = **16777299** --- Search key. * **KEY\_STANDBY** = **16777300** --- Standby key. * **KEY\_OPENURL** = **16777301** --- Open URL / Launch Browser key. * **KEY\_LAUNCHMAIL** = **16777302** --- Launch Mail key. * **KEY\_LAUNCHMEDIA** = **16777303** --- Launch Media key. * **KEY\_LAUNCH0** = **16777304** --- Launch Shortcut 0 key. * **KEY\_LAUNCH1** = **16777305** --- Launch Shortcut 1 key. * **KEY\_LAUNCH2** = **16777306** --- Launch Shortcut 2 key. * **KEY\_LAUNCH3** = **16777307** --- Launch Shortcut 3 key. * **KEY\_LAUNCH4** = **16777308** --- Launch Shortcut 4 key. * **KEY\_LAUNCH5** = **16777309** --- Launch Shortcut 5 key. * **KEY\_LAUNCH6** = **16777310** --- Launch Shortcut 6 key. * **KEY\_LAUNCH7** = **16777311** --- Launch Shortcut 7 key. * **KEY\_LAUNCH8** = **16777312** --- Launch Shortcut 8 key. * **KEY\_LAUNCH9** = **16777313** --- Launch Shortcut 9 key. * **KEY\_LAUNCHA** = **16777314** --- Launch Shortcut A key. * **KEY\_LAUNCHB** = **16777315** --- Launch Shortcut B key. * **KEY\_LAUNCHC** = **16777316** --- Launch Shortcut C key. * **KEY\_LAUNCHD** = **16777317** --- Launch Shortcut D key. * **KEY\_LAUNCHE** = **16777318** --- Launch Shortcut E key. * **KEY\_LAUNCHF** = **16777319** --- Launch Shortcut F key. * **KEY\_UNKNOWN** = **33554431** --- Unknown key. * **KEY\_SPACE** = **32** --- Space key. * **KEY\_EXCLAM** = **33** --- ! key. * **KEY\_QUOTEDBL** = **34** --- " key. * **KEY\_NUMBERSIGN** = **35** --- # key. * **KEY\_DOLLAR** = **36** --- $ key. * **KEY\_PERCENT** = **37** --- % key. * **KEY\_AMPERSAND** = **38** --- & key. * **KEY\_APOSTROPHE** = **39** --- ' key. * **KEY\_PARENLEFT** = **40** --- ( key. * **KEY\_PARENRIGHT** = **41** --- ) key. * **KEY\_ASTERISK** = **42** --- \* key. * **KEY\_PLUS** = **43** --- + key. * **KEY\_COMMA** = **44** --- , key. * **KEY\_MINUS** = **45** --- - key. * **KEY\_PERIOD** = **46** --- . key. * **KEY\_SLASH** = **47** --- / key. * **KEY\_0** = **48** --- Number 0. * **KEY\_1** = **49** --- Number 1. * **KEY\_2** = **50** --- Number 2. * **KEY\_3** = **51** --- Number 3. * **KEY\_4** = **52** --- Number 4. * **KEY\_5** = **53** --- Number 5. * **KEY\_6** = **54** --- Number 6. * **KEY\_7** = **55** --- Number 7. * **KEY\_8** = **56** --- Number 8. * **KEY\_9** = **57** --- Number 9. * **KEY\_COLON** = **58** --- : key. * **KEY\_SEMICOLON** = **59** --- ; key. * **KEY\_LESS** = **60** --- < key. * **KEY\_EQUAL** = **61** --- = key. * **KEY\_GREATER** = **62** --- > key. * **KEY\_QUESTION** = **63** --- ? key. * **KEY\_AT** = **64** --- @ key. * **KEY\_A** = **65** --- A key. * **KEY\_B** = **66** --- B key. * **KEY\_C** = **67** --- C key. * **KEY\_D** = **68** --- D key. * **KEY\_E** = **69** --- E key. * **KEY\_F** = **70** --- F key. * **KEY\_G** = **71** --- G key. * **KEY\_H** = **72** --- H key. * **KEY\_I** = **73** --- I key. * **KEY\_J** = **74** --- J key. * **KEY\_K** = **75** --- K key. * **KEY\_L** = **76** --- L key. * **KEY\_M** = **77** --- M key. * **KEY\_N** = **78** --- N key. * **KEY\_O** = **79** --- O key. * **KEY\_P** = **80** --- P key. * **KEY\_Q** = **81** --- Q key. * **KEY\_R** = **82** --- R key. * **KEY\_S** = **83** --- S key. * **KEY\_T** = **84** --- T key. * **KEY\_U** = **85** --- U key. * **KEY\_V** = **86** --- V key. * **KEY\_W** = **87** --- W key. * **KEY\_X** = **88** --- X key. * **KEY\_Y** = **89** --- Y key. * **KEY\_Z** = **90** --- Z key. * **KEY\_BRACKETLEFT** = **91** --- [ key. * **KEY\_BACKSLASH** = **92** --- \ key. * **KEY\_BRACKETRIGHT** = **93** --- ] key. * **KEY\_ASCIICIRCUM** = **94** --- ^ key. * **KEY\_UNDERSCORE** = **95** --- \_ key. * **KEY\_QUOTELEFT** = **96** --- ` key. * **KEY\_BRACELEFT** = **123** --- { key. * **KEY\_BAR** = **124** --- | key. * **KEY\_BRACERIGHT** = **125** --- } key. * **KEY\_ASCIITILDE** = **126** --- ~ key. * **KEY\_NOBREAKSPACE** = **160** --- Non-breakable space key. * **KEY\_EXCLAMDOWN** = **161** --- ¡ key. * **KEY\_CENT** = **162** --- ¢ key. * **KEY\_STERLING** = **163** --- £ key. * **KEY\_CURRENCY** = **164** --- ¤ key. * **KEY\_YEN** = **165** --- ¥ key. * **KEY\_BROKENBAR** = **166** --- ¦ key. * **KEY\_SECTION** = **167** --- § key. * **KEY\_DIAERESIS** = **168** --- ¨ key. * **KEY\_COPYRIGHT** = **169** --- © key. * **KEY\_ORDFEMININE** = **170** --- ª key. * **KEY\_GUILLEMOTLEFT** = **171** --- « key. * **KEY\_NOTSIGN** = **172** --- ¬ key. * **KEY\_HYPHEN** = **173** --- Soft hyphen key. * **KEY\_REGISTERED** = **174** --- ® key. * **KEY\_MACRON** = **175** --- ¯ key. * **KEY\_DEGREE** = **176** --- ° key. * **KEY\_PLUSMINUS** = **177** --- ± key. * **KEY\_TWOSUPERIOR** = **178** --- ² key. * **KEY\_THREESUPERIOR** = **179** --- ³ key. * **KEY\_ACUTE** = **180** --- ´ key. * **KEY\_MU** = **181** --- µ key. * **KEY\_PARAGRAPH** = **182** --- ¶ key. * **KEY\_PERIODCENTERED** = **183** --- · key. * **KEY\_CEDILLA** = **184** --- ¸ key. * **KEY\_ONESUPERIOR** = **185** --- ¹ key. * **KEY\_MASCULINE** = **186** --- º key. * **KEY\_GUILLEMOTRIGHT** = **187** --- » key. * **KEY\_ONEQUARTER** = **188** --- ¼ key. * **KEY\_ONEHALF** = **189** --- ½ key. * **KEY\_THREEQUARTERS** = **190** --- ¾ key. * **KEY\_QUESTIONDOWN** = **191** --- ¿ key. * **KEY\_AGRAVE** = **192** --- À key. * **KEY\_AACUTE** = **193** --- Á key. * **KEY\_ACIRCUMFLEX** = **194** --- Â key. * **KEY\_ATILDE** = **195** --- Ã key. * **KEY\_ADIAERESIS** = **196** --- Ä key. * **KEY\_ARING** = **197** --- Å key. * **KEY\_AE** = **198** --- Æ key. * **KEY\_CCEDILLA** = **199** --- Ç key. * **KEY\_EGRAVE** = **200** --- È key. * **KEY\_EACUTE** = **201** --- É key. * **KEY\_ECIRCUMFLEX** = **202** --- Ê key. * **KEY\_EDIAERESIS** = **203** --- Ë key. * **KEY\_IGRAVE** = **204** --- Ì key. * **KEY\_IACUTE** = **205** --- Í key. * **KEY\_ICIRCUMFLEX** = **206** --- Î key. * **KEY\_IDIAERESIS** = **207** --- Ï key. * **KEY\_ETH** = **208** --- Ð key. * **KEY\_NTILDE** = **209** --- Ñ key. * **KEY\_OGRAVE** = **210** --- Ò key. * **KEY\_OACUTE** = **211** --- Ó key. * **KEY\_OCIRCUMFLEX** = **212** --- Ô key. * **KEY\_OTILDE** = **213** --- Õ key. * **KEY\_ODIAERESIS** = **214** --- Ö key. * **KEY\_MULTIPLY** = **215** --- × key. * **KEY\_OOBLIQUE** = **216** --- Ø key. * **KEY\_UGRAVE** = **217** --- Ù key. * **KEY\_UACUTE** = **218** --- Ú key. * **KEY\_UCIRCUMFLEX** = **219** --- Û key. * **KEY\_UDIAERESIS** = **220** --- Ü key. * **KEY\_YACUTE** = **221** --- Ý key. * **KEY\_THORN** = **222** --- Þ key. * **KEY\_SSHARP** = **223** --- ß key. * **KEY\_DIVISION** = **247** --- ÷ key. * **KEY\_YDIAERESIS** = **255** --- ÿ key. enum **KeyModifierMask**: * **KEY\_CODE\_MASK** = **33554431** --- Key Code mask. * **KEY\_MODIFIER\_MASK** = **-16777216** --- Modifier key mask. * **KEY\_MASK\_SHIFT** = **33554432** --- Shift key mask. * **KEY\_MASK\_ALT** = **67108864** --- Alt key mask. * **KEY\_MASK\_META** = **134217728** --- Meta key mask. * **KEY\_MASK\_CTRL** = **268435456** --- Ctrl key mask. * **KEY\_MASK\_CMD** = **platform-dependent** --- Command key mask. On macOS, this is equivalent to [KEY\_MASK\_META](#class-globalscope-constant-key-mask-meta). On other platforms, this is equivalent to [KEY\_MASK\_CTRL](#class-globalscope-constant-key-mask-ctrl). This mask should be preferred to [KEY\_MASK\_META](#class-globalscope-constant-key-mask-meta) or [KEY\_MASK\_CTRL](#class-globalscope-constant-key-mask-ctrl) for system shortcuts as it handles all platforms correctly. * **KEY\_MASK\_KPAD** = **536870912** --- Keypad key mask. * **KEY\_MASK\_GROUP\_SWITCH** = **1073741824** --- Group Switch key mask. enum **ButtonList**: * **BUTTON\_LEFT** = **1** --- Left mouse button. * **BUTTON\_RIGHT** = **2** --- Right mouse button. * **BUTTON\_MIDDLE** = **3** --- Middle mouse button. * **BUTTON\_XBUTTON1** = **8** --- Extra mouse button 1 (only present on some mice). * **BUTTON\_XBUTTON2** = **9** --- Extra mouse button 2 (only present on some mice). * **BUTTON\_WHEEL\_UP** = **4** --- Mouse wheel up. * **BUTTON\_WHEEL\_DOWN** = **5** --- Mouse wheel down. * **BUTTON\_WHEEL\_LEFT** = **6** --- Mouse wheel left button (only present on some mice). * **BUTTON\_WHEEL\_RIGHT** = **7** --- Mouse wheel right button (only present on some mice). * **BUTTON\_MASK\_LEFT** = **1** --- Left mouse button mask. * **BUTTON\_MASK\_RIGHT** = **2** --- Right mouse button mask. * **BUTTON\_MASK\_MIDDLE** = **4** --- Middle mouse button mask. * **BUTTON\_MASK\_XBUTTON1** = **128** --- Extra mouse button 1 mask. * **BUTTON\_MASK\_XBUTTON2** = **256** --- Extra mouse button 2 mask. enum **JoystickList**: * **JOY\_INVALID\_OPTION** = **-1** --- Invalid button or axis. * **JOY\_BUTTON\_0** = **0** --- Gamepad button 0. * **JOY\_BUTTON\_1** = **1** --- Gamepad button 1. * **JOY\_BUTTON\_2** = **2** --- Gamepad button 2. * **JOY\_BUTTON\_3** = **3** --- Gamepad button 3. * **JOY\_BUTTON\_4** = **4** --- Gamepad button 4. * **JOY\_BUTTON\_5** = **5** --- Gamepad button 5. * **JOY\_BUTTON\_6** = **6** --- Gamepad button 6. * **JOY\_BUTTON\_7** = **7** --- Gamepad button 7. * **JOY\_BUTTON\_8** = **8** --- Gamepad button 8. * **JOY\_BUTTON\_9** = **9** --- Gamepad button 9. * **JOY\_BUTTON\_10** = **10** --- Gamepad button 10. * **JOY\_BUTTON\_11** = **11** --- Gamepad button 11. * **JOY\_BUTTON\_12** = **12** --- Gamepad button 12. * **JOY\_BUTTON\_13** = **13** --- Gamepad button 13. * **JOY\_BUTTON\_14** = **14** --- Gamepad button 14. * **JOY\_BUTTON\_15** = **15** --- Gamepad button 15. * **JOY\_BUTTON\_16** = **16** --- Gamepad button 16. * **JOY\_BUTTON\_17** = **17** --- Gamepad button 17. * **JOY\_BUTTON\_18** = **18** --- Gamepad button 18. * **JOY\_BUTTON\_19** = **19** --- Gamepad button 19. * **JOY\_BUTTON\_20** = **20** --- Gamepad button 20. * **JOY\_BUTTON\_21** = **21** --- Gamepad button 21. * **JOY\_BUTTON\_22** = **22** --- Gamepad button 22. * **JOY\_BUTTON\_MAX** = **128** --- The maximum number of game controller buttons supported by the engine. The actual limit may be lower on specific platforms: + Android: Up to 36 buttons. + Linux: Up to 80 buttons. + Windows and macOS: Up to 128 buttons. * **JOY\_SONY\_CIRCLE** = **1** --- DualShock circle button. * **JOY\_SONY\_X** = **0** --- DualShock X button. * **JOY\_SONY\_SQUARE** = **2** --- DualShock square button. * **JOY\_SONY\_TRIANGLE** = **3** --- DualShock triangle button. * **JOY\_XBOX\_B** = **1** --- Xbox controller B button. * **JOY\_XBOX\_A** = **0** --- Xbox controller A button. * **JOY\_XBOX\_X** = **2** --- Xbox controller X button. * **JOY\_XBOX\_Y** = **3** --- Xbox controller Y button. * **JOY\_DS\_A** = **1** --- Nintendo controller A button. * **JOY\_DS\_B** = **0** --- Nintendo controller B button. * **JOY\_DS\_X** = **3** --- Nintendo controller X button. * **JOY\_DS\_Y** = **2** --- Nintendo controller Y button. * **JOY\_VR\_GRIP** = **2** --- Grip (side) buttons on a VR controller. * **JOY\_VR\_PAD** = **14** --- Push down on the touchpad or main joystick on a VR controller. * **JOY\_VR\_TRIGGER** = **15** --- Trigger on a VR controller. * **JOY\_OCULUS\_AX** = **7** --- A button on the right Oculus Touch controller, X button on the left controller (also when used in OpenVR). * **JOY\_OCULUS\_BY** = **1** --- B button on the right Oculus Touch controller, Y button on the left controller (also when used in OpenVR). * **JOY\_OCULUS\_MENU** = **3** --- Menu button on either Oculus Touch controller. * **JOY\_OPENVR\_MENU** = **1** --- Menu button in OpenVR (Except when Oculus Touch controllers are used). * **JOY\_SELECT** = **10** --- Gamepad button Select. * **JOY\_START** = **11** --- Gamepad button Start. * **JOY\_DPAD\_UP** = **12** --- Gamepad DPad up. * **JOY\_DPAD\_DOWN** = **13** --- Gamepad DPad down. * **JOY\_DPAD\_LEFT** = **14** --- Gamepad DPad left. * **JOY\_DPAD\_RIGHT** = **15** --- Gamepad DPad right. * **JOY\_GUIDE** = **16** --- Gamepad SDL guide button. * **JOY\_MISC1** = **17** --- Gamepad SDL miscellaneous button. * **JOY\_PADDLE1** = **18** --- Gamepad SDL paddle 1 button. * **JOY\_PADDLE2** = **19** --- Gamepad SDL paddle 2 button. * **JOY\_PADDLE3** = **20** --- Gamepad SDL paddle 3 button. * **JOY\_PADDLE4** = **21** --- Gamepad SDL paddle 4 button. * **JOY\_TOUCHPAD** = **22** --- Gamepad SDL touchpad button. * **JOY\_L** = **4** --- Gamepad left Shoulder button. * **JOY\_L2** = **6** --- Gamepad left trigger. * **JOY\_L3** = **8** --- Gamepad left stick click. * **JOY\_R** = **5** --- Gamepad right Shoulder button. * **JOY\_R2** = **7** --- Gamepad right trigger. * **JOY\_R3** = **9** --- Gamepad right stick click. * **JOY\_AXIS\_0** = **0** --- Gamepad left stick horizontal axis. * **JOY\_AXIS\_1** = **1** --- Gamepad left stick vertical axis. * **JOY\_AXIS\_2** = **2** --- Gamepad right stick horizontal axis. * **JOY\_AXIS\_3** = **3** --- Gamepad right stick vertical axis. * **JOY\_AXIS\_4** = **4** --- Generic gamepad axis 4. * **JOY\_AXIS\_5** = **5** --- Generic gamepad axis 5. * **JOY\_AXIS\_6** = **6** --- Gamepad left trigger analog axis. * **JOY\_AXIS\_7** = **7** --- Gamepad right trigger analog axis. * **JOY\_AXIS\_8** = **8** --- Generic gamepad axis 8. * **JOY\_AXIS\_9** = **9** --- Generic gamepad axis 9. * **JOY\_AXIS\_MAX** = **10** --- Represents the maximum number of joystick axes supported. * **JOY\_ANALOG\_LX** = **0** --- Gamepad left stick horizontal axis. * **JOY\_ANALOG\_LY** = **1** --- Gamepad left stick vertical axis. * **JOY\_ANALOG\_RX** = **2** --- Gamepad right stick horizontal axis. * **JOY\_ANALOG\_RY** = **3** --- Gamepad right stick vertical axis. * **JOY\_ANALOG\_L2** = **6** --- Gamepad left analog trigger. * **JOY\_ANALOG\_R2** = **7** --- Gamepad right analog trigger. * **JOY\_VR\_ANALOG\_TRIGGER** = **2** --- VR Controller analog trigger. * **JOY\_VR\_ANALOG\_GRIP** = **4** --- VR Controller analog grip (side buttons). * **JOY\_OPENVR\_TOUCHPADX** = **0** --- OpenVR touchpad X axis (Joystick axis on Oculus Touch and Windows MR controllers). * **JOY\_OPENVR\_TOUCHPADY** = **1** --- OpenVR touchpad Y axis (Joystick axis on Oculus Touch and Windows MR controllers). enum **MidiMessageList**: * **MIDI\_MESSAGE\_NOTE\_OFF** = **8** --- MIDI note OFF message. See the documentation of [InputEventMIDI](class_inputeventmidi#class-inputeventmidi) for information of how to use MIDI inputs. * **MIDI\_MESSAGE\_NOTE\_ON** = **9** --- MIDI note ON message. See the documentation of [InputEventMIDI](class_inputeventmidi#class-inputeventmidi) for information of how to use MIDI inputs. * **MIDI\_MESSAGE\_AFTERTOUCH** = **10** --- MIDI aftertouch message. This message is most often sent by pressing down on the key after it "bottoms out". * **MIDI\_MESSAGE\_CONTROL\_CHANGE** = **11** --- MIDI control change message. This message is sent when a controller value changes. Controllers include devices such as pedals and levers. * **MIDI\_MESSAGE\_PROGRAM\_CHANGE** = **12** --- MIDI program change message. This message sent when the program patch number changes. * **MIDI\_MESSAGE\_CHANNEL\_PRESSURE** = **13** --- MIDI channel pressure message. This message is most often sent by pressing down on the key after it "bottoms out". This message is different from polyphonic after-touch as it indicates the highest pressure across all keys. * **MIDI\_MESSAGE\_PITCH\_BEND** = **14** --- MIDI pitch bend message. This message is sent to indicate a change in the pitch bender (wheel or lever, typically). * **MIDI\_MESSAGE\_SYSTEM\_EXCLUSIVE** = **240** --- MIDI system exclusive message. This has behavior exclusive to the device you're receiving input from. Getting this data is not implemented in Godot. * **MIDI\_MESSAGE\_QUARTER\_FRAME** = **241** --- MIDI quarter frame message. Contains timing information that is used to synchronize MIDI devices. Getting this data is not implemented in Godot. * **MIDI\_MESSAGE\_SONG\_POSITION\_POINTER** = **242** --- MIDI song position pointer message. Gives the number of 16th notes since the start of the song. Getting this data is not implemented in Godot. * **MIDI\_MESSAGE\_SONG\_SELECT** = **243** --- MIDI song select message. Specifies which sequence or song is to be played. Getting this data is not implemented in Godot. * **MIDI\_MESSAGE\_TUNE\_REQUEST** = **246** --- MIDI tune request message. Upon receiving a tune request, all analog synthesizers should tune their oscillators. * **MIDI\_MESSAGE\_TIMING\_CLOCK** = **248** --- MIDI timing clock message. Sent 24 times per quarter note when synchronization is required. * **MIDI\_MESSAGE\_START** = **250** --- MIDI start message. Start the current sequence playing. This message will be followed with Timing Clocks. * **MIDI\_MESSAGE\_CONTINUE** = **251** --- MIDI continue message. Continue at the point the sequence was stopped. * **MIDI\_MESSAGE\_STOP** = **252** --- MIDI stop message. Stop the current sequence. * **MIDI\_MESSAGE\_ACTIVE\_SENSING** = **254** --- MIDI active sensing message. This message is intended to be sent repeatedly to tell the receiver that a connection is alive. * **MIDI\_MESSAGE\_SYSTEM\_RESET** = **255** --- MIDI system reset message. Reset all receivers in the system to power-up status. It should not be sent on power-up itself. enum **Error**: * **OK** = **0** --- Methods that return [Error](#enum-globalscope-error) return [OK](#class-globalscope-constant-ok) when no error occurred. Note that many functions don't return an error code but will print error messages to standard output. Since [OK](#class-globalscope-constant-ok) has value 0, and all other failure codes are positive integers, it can also be used in boolean checks, e.g.: ``` var err = method_that_returns_error() if err != OK: print("Failure!") # Or, equivalent: if err: print("Still failing!") ``` * **FAILED** = **1** --- Generic error. * **ERR\_UNAVAILABLE** = **2** --- Unavailable error. * **ERR\_UNCONFIGURED** = **3** --- Unconfigured error. * **ERR\_UNAUTHORIZED** = **4** --- Unauthorized error. * **ERR\_PARAMETER\_RANGE\_ERROR** = **5** --- Parameter range error. * **ERR\_OUT\_OF\_MEMORY** = **6** --- Out of memory (OOM) error. * **ERR\_FILE\_NOT\_FOUND** = **7** --- File: Not found error. * **ERR\_FILE\_BAD\_DRIVE** = **8** --- File: Bad drive error. * **ERR\_FILE\_BAD\_PATH** = **9** --- File: Bad path error. * **ERR\_FILE\_NO\_PERMISSION** = **10** --- File: No permission error. * **ERR\_FILE\_ALREADY\_IN\_USE** = **11** --- File: Already in use error. * **ERR\_FILE\_CANT\_OPEN** = **12** --- File: Can't open error. * **ERR\_FILE\_CANT\_WRITE** = **13** --- File: Can't write error. * **ERR\_FILE\_CANT\_READ** = **14** --- File: Can't read error. * **ERR\_FILE\_UNRECOGNIZED** = **15** --- File: Unrecognized error. * **ERR\_FILE\_CORRUPT** = **16** --- File: Corrupt error. * **ERR\_FILE\_MISSING\_DEPENDENCIES** = **17** --- File: Missing dependencies error. * **ERR\_FILE\_EOF** = **18** --- File: End of file (EOF) error. * **ERR\_CANT\_OPEN** = **19** --- Can't open error. * **ERR\_CANT\_CREATE** = **20** --- Can't create error. * **ERR\_QUERY\_FAILED** = **21** --- Query failed error. * **ERR\_ALREADY\_IN\_USE** = **22** --- Already in use error. * **ERR\_LOCKED** = **23** --- Locked error. * **ERR\_TIMEOUT** = **24** --- Timeout error. * **ERR\_CANT\_CONNECT** = **25** --- Can't connect error. * **ERR\_CANT\_RESOLVE** = **26** --- Can't resolve error. * **ERR\_CONNECTION\_ERROR** = **27** --- Connection error. * **ERR\_CANT\_ACQUIRE\_RESOURCE** = **28** --- Can't acquire resource error. * **ERR\_CANT\_FORK** = **29** --- Can't fork process error. * **ERR\_INVALID\_DATA** = **30** --- Invalid data error. * **ERR\_INVALID\_PARAMETER** = **31** --- Invalid parameter error. * **ERR\_ALREADY\_EXISTS** = **32** --- Already exists error. * **ERR\_DOES\_NOT\_EXIST** = **33** --- Does not exist error. * **ERR\_DATABASE\_CANT\_READ** = **34** --- Database: Read error. * **ERR\_DATABASE\_CANT\_WRITE** = **35** --- Database: Write error. * **ERR\_COMPILATION\_FAILED** = **36** --- Compilation failed error. * **ERR\_METHOD\_NOT\_FOUND** = **37** --- Method not found error. * **ERR\_LINK\_FAILED** = **38** --- Linking failed error. * **ERR\_SCRIPT\_FAILED** = **39** --- Script failed error. * **ERR\_CYCLIC\_LINK** = **40** --- Cycling link (import cycle) error. * **ERR\_INVALID\_DECLARATION** = **41** --- Invalid declaration error. * **ERR\_DUPLICATE\_SYMBOL** = **42** --- Duplicate symbol error. * **ERR\_PARSE\_ERROR** = **43** --- Parse error. * **ERR\_BUSY** = **44** --- Busy error. * **ERR\_SKIP** = **45** --- Skip error. * **ERR\_HELP** = **46** --- Help error. * **ERR\_BUG** = **47** --- Bug error. * **ERR\_PRINTER\_ON\_FIRE** = **48** --- Printer on fire error. (This is an easter egg, no engine methods return this error code.) enum **PropertyHint**: * **PROPERTY\_HINT\_NONE** = **0** --- No hint for the edited property. * **PROPERTY\_HINT\_RANGE** = **1** --- Hints that an integer or float property should be within a range specified via the hint string `"min,max"` or `"min,max,step"`. The hint string can optionally include `"or_greater"` and/or `"or_lesser"` to allow manual input going respectively above the max or below the min values. Example: `"-360,360,1,or_greater,or_lesser"`. * **PROPERTY\_HINT\_EXP\_RANGE** = **2** --- Hints that a float property should be within an exponential range specified via the hint string `"min,max"` or `"min,max,step"`. The hint string can optionally include `"or_greater"` and/or `"or_lesser"` to allow manual input going respectively above the max or below the min values. Example: `"0.01,100,0.01,or_greater"`. * **PROPERTY\_HINT\_ENUM** = **3** --- Hints that an integer, float or string property is an enumerated value to pick in a list specified via a hint string. The hint string is a comma separated list of names such as `"Hello,Something,Else"`. For integer and float properties, the first name in the list has value 0, the next 1, and so on. Explicit values can also be specified by appending `:integer` to the name, e.g. `"Zero,One,Three:3,Four,Six:6"`. * **PROPERTY\_HINT\_ENUM\_SUGGESTION** = **39** --- Hints that a string property can be an enumerated value to pick in a list specified via a hint string such as `"Hello,Something,Else"`. Unlike [PROPERTY\_HINT\_ENUM](#class-globalscope-constant-property-hint-enum) a property with this hint still accepts arbitrary values and can be empty. The list of values serves to suggest possible values. * **PROPERTY\_HINT\_EXP\_EASING** = **4** --- Hints that a float property should be edited via an exponential easing function. The hint string can include `"attenuation"` to flip the curve horizontally and/or `"inout"` to also include in/out easing. * **PROPERTY\_HINT\_LENGTH** = **5** --- Deprecated hint, unused. * **PROPERTY\_HINT\_KEY\_ACCEL** = **7** --- Deprecated hint, unused. * **PROPERTY\_HINT\_FLAGS** = **8** --- Hints that an integer property is a bitmask with named bit flags. For example, to allow toggling bits 0, 1, 2 and 4, the hint could be something like `"Bit0,Bit1,Bit2,,Bit4"`. * **PROPERTY\_HINT\_LAYERS\_2D\_RENDER** = **9** --- Hints that an integer property is a bitmask using the optionally named 2D render layers. * **PROPERTY\_HINT\_LAYERS\_2D\_PHYSICS** = **10** --- Hints that an integer property is a bitmask using the optionally named 2D physics layers. * **PROPERTY\_HINT\_LAYERS\_2D\_NAVIGATION** = **11** --- Hints that an integer property is a bitmask using the optionally named 2D navigation layers. * **PROPERTY\_HINT\_LAYERS\_3D\_RENDER** = **12** --- Hints that an integer property is a bitmask using the optionally named 3D render layers. * **PROPERTY\_HINT\_LAYERS\_3D\_PHYSICS** = **13** --- Hints that an integer property is a bitmask using the optionally named 3D physics layers. * **PROPERTY\_HINT\_LAYERS\_3D\_NAVIGATION** = **14** --- Hints that an integer property is a bitmask using the optionally named 3D navigation layers. * **PROPERTY\_HINT\_FILE** = **15** --- Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like `"*.png,*.jpg"`. * **PROPERTY\_HINT\_DIR** = **16** --- Hints that a string property is a path to a directory. Editing it will show a file dialog for picking the path. * **PROPERTY\_HINT\_GLOBAL\_FILE** = **17** --- Hints that a string property is an absolute path to a file outside the project folder. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like `"*.png,*.jpg"`. * **PROPERTY\_HINT\_GLOBAL\_DIR** = **18** --- Hints that a string property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path. * **PROPERTY\_HINT\_RESOURCE\_TYPE** = **19** --- Hints that a property is an instance of a [Resource](class_resource#class-resource)-derived type, optionally specified via the hint string (e.g. `"Texture"`). Editing it will show a popup menu of valid resource types to instantiate. * **PROPERTY\_HINT\_MULTILINE\_TEXT** = **20** --- Hints that a string property is text with line breaks. Editing it will show a text input field where line breaks can be typed. * **PROPERTY\_HINT\_PLACEHOLDER\_TEXT** = **21** --- Hints that a string property should have a placeholder text visible on its input field, whenever the property is empty. The hint string is the placeholder text to use. * **PROPERTY\_HINT\_COLOR\_NO\_ALPHA** = **22** --- Hints that a color property should be edited without changing its alpha component, i.e. only R, G and B channels are edited. * **PROPERTY\_HINT\_IMAGE\_COMPRESS\_LOSSY** = **23** --- Hints that an image is compressed using lossy compression. * **PROPERTY\_HINT\_IMAGE\_COMPRESS\_LOSSLESS** = **24** --- Hints that an image is compressed using lossless compression. enum **PropertyUsageFlags**: * **PROPERTY\_USAGE\_STORAGE** = **1** --- The property is serialized and saved in the scene file (default). * **PROPERTY\_USAGE\_EDITOR** = **2** --- The property is shown in the editor inspector (default). * **PROPERTY\_USAGE\_NETWORK** = **4** --- Deprecated usage flag, unused. * **PROPERTY\_USAGE\_EDITOR\_HELPER** = **8** --- Deprecated usage flag, unused. * **PROPERTY\_USAGE\_CHECKABLE** = **16** --- The property can be checked in the editor inspector. * **PROPERTY\_USAGE\_CHECKED** = **32** --- The property is checked in the editor inspector. * **PROPERTY\_USAGE\_INTERNATIONALIZED** = **64** --- The property is a translatable string. * **PROPERTY\_USAGE\_GROUP** = **128** --- Used to group properties together in the editor. See [EditorInspector](class_editorinspector#class-editorinspector). * **PROPERTY\_USAGE\_CATEGORY** = **256** --- Used to categorize properties together in the editor. * **PROPERTY\_USAGE\_NO\_INSTANCE\_STATE** = **2048** --- The property does not save its state in [PackedScene](class_packedscene#class-packedscene). * **PROPERTY\_USAGE\_RESTART\_IF\_CHANGED** = **4096** --- Editing the property prompts the user for restarting the editor. * **PROPERTY\_USAGE\_SCRIPT\_VARIABLE** = **8192** --- The property is a script variable which should be serialized and saved in the scene file. * **PROPERTY\_USAGE\_DEFAULT** = **7** --- Default usage (storage, editor and network). * **PROPERTY\_USAGE\_DEFAULT\_INTL** = **71** --- Default usage for translatable strings (storage, editor, network and internationalized). * **PROPERTY\_USAGE\_NOEDITOR** = **5** --- Default usage but without showing the property in the editor (storage, network). enum **MethodFlags**: * **METHOD\_FLAG\_NORMAL** = **1** --- Flag for a normal method. * **METHOD\_FLAG\_EDITOR** = **2** --- Flag for an editor method. * **METHOD\_FLAG\_NOSCRIPT** = **4** --- Deprecated method flag, unused. * **METHOD\_FLAG\_CONST** = **8** --- Flag for a constant method. * **METHOD\_FLAG\_REVERSE** = **16** --- Deprecated method flag, unused. * **METHOD\_FLAG\_VIRTUAL** = **32** --- Flag for a virtual method. * **METHOD\_FLAG\_FROM\_SCRIPT** = **64** --- Deprecated method flag, unused. * **METHOD\_FLAG\_VARARG** = **128** * **METHOD\_FLAGS\_DEFAULT** = **1** --- Default method flags. enum **Variant.Type**: * **TYPE\_NIL** = **0** --- Variable is `null`. * **TYPE\_BOOL** = **1** --- Variable is of type [bool](class_bool#class-bool). * **TYPE\_INT** = **2** --- Variable is of type [int](class_int#class-int). * **TYPE\_REAL** = **3** --- Variable is of type [float](class_float#class-float) (real). * **TYPE\_STRING** = **4** --- Variable is of type [String](class_string#class-string). * **TYPE\_VECTOR2** = **5** --- Variable is of type [Vector2](class_vector2#class-vector2). * **TYPE\_RECT2** = **6** --- Variable is of type [Rect2](class_rect2#class-rect2). * **TYPE\_VECTOR3** = **7** --- Variable is of type [Vector3](class_vector3#class-vector3). * **TYPE\_TRANSFORM2D** = **8** --- Variable is of type [Transform2D](class_transform2d#class-transform2d). * **TYPE\_PLANE** = **9** --- Variable is of type [Plane](class_plane#class-plane). * **TYPE\_QUAT** = **10** --- Variable is of type [Quat](class_quat#class-quat). * **TYPE\_AABB** = **11** --- Variable is of type [AABB](class_aabb#class-aabb). * **TYPE\_BASIS** = **12** --- Variable is of type [Basis](class_basis#class-basis). * **TYPE\_TRANSFORM** = **13** --- Variable is of type [Transform](class_transform#class-transform). * **TYPE\_COLOR** = **14** --- Variable is of type [Color](class_color#class-color). * **TYPE\_NODE\_PATH** = **15** --- Variable is of type [NodePath](class_nodepath#class-nodepath). * **TYPE\_RID** = **16** --- Variable is of type [RID](class_rid#class-rid). * **TYPE\_OBJECT** = **17** --- Variable is of type [Object](class_object#class-object). * **TYPE\_DICTIONARY** = **18** --- Variable is of type [Dictionary](class_dictionary#class-dictionary). * **TYPE\_ARRAY** = **19** --- Variable is of type [Array](class_array#class-array). * **TYPE\_RAW\_ARRAY** = **20** --- Variable is of type [PoolByteArray](class_poolbytearray#class-poolbytearray). * **TYPE\_INT\_ARRAY** = **21** --- Variable is of type [PoolIntArray](class_poolintarray#class-poolintarray). * **TYPE\_REAL\_ARRAY** = **22** --- Variable is of type [PoolRealArray](class_poolrealarray#class-poolrealarray). * **TYPE\_STRING\_ARRAY** = **23** --- Variable is of type [PoolStringArray](class_poolstringarray#class-poolstringarray). * **TYPE\_VECTOR2\_ARRAY** = **24** --- Variable is of type [PoolVector2Array](class_poolvector2array#class-poolvector2array). * **TYPE\_VECTOR3\_ARRAY** = **25** --- Variable is of type [PoolVector3Array](class_poolvector3array#class-poolvector3array). * **TYPE\_COLOR\_ARRAY** = **26** --- Variable is of type [PoolColorArray](class_poolcolorarray#class-poolcolorarray). * **TYPE\_MAX** = **27** --- Represents the size of the [Variant.Type](#enum-globalscope-variant-type) enum. enum **Variant.Operator**: * **OP\_EQUAL** = **0** --- Equality operator (`==`). * **OP\_NOT\_EQUAL** = **1** --- Inequality operator (`!=`). * **OP\_LESS** = **2** --- Less than operator (`<`). * **OP\_LESS\_EQUAL** = **3** --- Less than or equal operator (`<=`). * **OP\_GREATER** = **4** --- Greater than operator (`>`). * **OP\_GREATER\_EQUAL** = **5** --- Greater than or equal operator (`>=`). * **OP\_ADD** = **6** --- Addition operator (`+`). * **OP\_SUBTRACT** = **7** --- Subtraction operator (`-`). * **OP\_MULTIPLY** = **8** --- Multiplication operator (`*`). * **OP\_DIVIDE** = **9** --- Division operator (`/`). * **OP\_NEGATE** = **10** --- Unary negation operator (`-`). * **OP\_POSITIVE** = **11** --- Unary plus operator (`+`). * **OP\_MODULE** = **12** --- Remainder/modulo operator (`%`). * **OP\_STRING\_CONCAT** = **13** --- String concatenation operator (`+`). * **OP\_SHIFT\_LEFT** = **14** --- Left shift operator (`<<`). * **OP\_SHIFT\_RIGHT** = **15** --- Right shift operator (`>>`). * **OP\_BIT\_AND** = **16** --- Bitwise AND operator (`&`). * **OP\_BIT\_OR** = **17** --- Bitwise OR operator (`|`). * **OP\_BIT\_XOR** = **18** --- Bitwise XOR operator (`^`). * **OP\_BIT\_NEGATE** = **19** --- Bitwise NOT operator (`~`). * **OP\_AND** = **20** --- Logical AND operator (`and` or `&&`). * **OP\_OR** = **21** --- Logical OR operator (`or` or `||`). * **OP\_XOR** = **22** --- Logical XOR operator (not implemented in GDScript). * **OP\_NOT** = **23** --- Logical NOT operator (`not` or `!`). * **OP\_IN** = **24** --- Logical IN operator (`in`). * **OP\_MAX** = **25** --- Represents the size of the [Variant.Operator](#enum-globalscope-variant-operator) enum. Constants --------- ### SPKEY = 16777216 --- Scancodes with this bit applied are non-printable. Property Descriptions --------------------- ### [ARVRServer](class_arvrserver#class-arvrserver) ARVRServer The [ARVRServer](class_arvrserver#class-arvrserver) singleton. ### [AudioServer](class_audioserver#class-audioserver) AudioServer The [AudioServer](class_audioserver#class-audioserver) singleton. ### [CameraServer](class_cameraserver#class-cameraserver) CameraServer The [CameraServer](class_cameraserver#class-cameraserver) singleton. ### [ClassDB](class_classdb#class-classdb) ClassDB The [ClassDB](class_classdb#class-classdb) singleton. ### [Engine](class_engine#class-engine) Engine The [Engine](class_engine#class-engine) singleton. ### [Geometry](class_geometry#class-geometry) Geometry The [Geometry](class_geometry#class-geometry) singleton. ### [IP](class_ip#class-ip) IP The [IP](class_ip#class-ip) singleton. ### [Input](class_input#class-input) Input The [Input](class_input#class-input) singleton. ### [InputMap](class_inputmap#class-inputmap) InputMap The [InputMap](class_inputmap#class-inputmap) singleton. ### [JSON](class_json#class-json) JSON The [JSON](class_json#class-json) singleton. ### [JavaClassWrapper](class_javaclasswrapper#class-javaclasswrapper) JavaClassWrapper The [JavaClassWrapper](class_javaclasswrapper#class-javaclasswrapper) singleton. **Note:** Only implemented on Android. ### [JavaScript](class_javascript#class-javascript) JavaScript The [JavaScript](class_javascript#class-javascript) singleton. **Note:** Only implemented on HTML5. ### [Marshalls](class_marshalls#class-marshalls) Marshalls The [Marshalls](class_marshalls#class-marshalls) singleton. ### [Navigation2DServer](class_navigation2dserver#class-navigation2dserver) Navigation2DServer The [Navigation2DServer](class_navigation2dserver#class-navigation2dserver) singleton. ### [NavigationMeshGenerator](class_navigationmeshgenerator#class-navigationmeshgenerator) NavigationMeshGenerator The [NavigationMeshGenerator](class_navigationmeshgenerator#class-navigationmeshgenerator) singleton. ### [NavigationServer](class_navigationserver#class-navigationserver) NavigationServer The [NavigationServer](class_navigationserver#class-navigationserver) singleton. ### [OS](class_os#class-os) OS The [OS](class_os#class-os) singleton. ### [Performance](class_performance#class-performance) Performance The [Performance](class_performance#class-performance) singleton. ### [Physics2DServer](class_physics2dserver#class-physics2dserver) Physics2DServer The [Physics2DServer](class_physics2dserver#class-physics2dserver) singleton. ### [PhysicsServer](class_physicsserver#class-physicsserver) PhysicsServer The [PhysicsServer](class_physicsserver#class-physicsserver) singleton. ### [ProjectSettings](class_projectsettings#class-projectsettings) ProjectSettings The [ProjectSettings](class_projectsettings#class-projectsettings) singleton. ### [ResourceLoader](class_resourceloader#class-resourceloader) ResourceLoader The [ResourceLoader](class_resourceloader#class-resourceloader) singleton. ### [ResourceSaver](class_resourcesaver#class-resourcesaver) ResourceSaver The [ResourceSaver](class_resourcesaver#class-resourcesaver) singleton. ### [Time](class_time#class-time) Time The [Time](class_time#class-time) singleton. ### [TranslationServer](class_translationserver#class-translationserver) TranslationServer The [TranslationServer](class_translationserver#class-translationserver) singleton. ### [VisualScriptEditor](class_visualscripteditor#class-visualscripteditor) VisualScriptEditor The [VisualScriptEditor](class_visualscripteditor#class-visualscripteditor) singleton. ### [VisualServer](class_visualserver#class-visualserver) VisualServer The [VisualServer](class_visualserver#class-visualserver) singleton.
programming_docs
godot VisualShaderNodeSwitch VisualShaderNodeSwitch ====================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [VisualShaderNodeScalarSwitch](class_visualshadernodescalarswitch#class-visualshadernodescalarswitch) A boolean/vector function for use within the visual shader graph. Description ----------- Returns an associated vector if the provided boolean value is `true` or `false`. godot AudioEffectHighShelfFilter AudioEffectHighShelfFilter ========================== **Inherits:** [AudioEffectFilter](class_audioeffectfilter#class-audioeffectfilter) **<** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Reduces all frequencies above the [AudioEffectFilter.cutoff\_hz](class_audioeffectfilter#class-audioeffectfilter-property-cutoff-hz). Tutorials --------- * [Audio buses](https://docs.godotengine.org/en/3.5/tutorials/audio/audio_buses.html) godot VisualScriptIndexSet VisualScriptIndexSet ==================== **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A Visual Script node for setting a value in an array or a dictionary. Description ----------- `VisualScriptIndexSet` will set the value stored in an array or a dictionary under the given index to the provided new value. godot StreamPeerGDNative StreamPeerGDNative ================== **Inherits:** [StreamPeer](class_streampeer#class-streampeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) godot GraphEdit GraphEdit ========= **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) GraphEdit is an area capable of showing various GraphNodes. It manages connection events between them. Description ----------- GraphEdit manages the showing of GraphNodes it contains, as well as connections and disconnections between them. Signals are sent for each of these two events. Disconnection between GraphNode slots is disabled by default. It is greatly advised to enable low-processor usage mode (see [OS.low\_processor\_usage\_mode](class_os#class-os-property-low-processor-usage-mode)) when using GraphEdits. Properties ---------- | | | | | --- | --- | --- | | [FocusMode](class_control#enum-control-focusmode) | focus\_mode | `2` (overrides [Control](class_control#class-control-property-focus-mode)) | | [bool](class_bool#class-bool) | [minimap\_enabled](#class-graphedit-property-minimap-enabled) | `true` | | [float](class_float#class-float) | [minimap\_opacity](#class-graphedit-property-minimap-opacity) | `0.65` | | [Vector2](class_vector2#class-vector2) | [minimap\_size](#class-graphedit-property-minimap-size) | `Vector2( 240, 160 )` | | [bool](class_bool#class-bool) | rect\_clip\_content | `true` (overrides [Control](class_control#class-control-property-rect-clip-content)) | | [bool](class_bool#class-bool) | [right\_disconnects](#class-graphedit-property-right-disconnects) | `false` | | [Vector2](class_vector2#class-vector2) | [scroll\_offset](#class-graphedit-property-scroll-offset) | `Vector2( 0, 0 )` | | [bool](class_bool#class-bool) | [show\_zoom\_label](#class-graphedit-property-show-zoom-label) | `false` | | [int](class_int#class-int) | [snap\_distance](#class-graphedit-property-snap-distance) | `20` | | [bool](class_bool#class-bool) | [use\_snap](#class-graphedit-property-use-snap) | `true` | | [float](class_float#class-float) | [zoom](#class-graphedit-property-zoom) | `1.0` | | [float](class_float#class-float) | [zoom\_max](#class-graphedit-property-zoom-max) | `2.0736` | | [float](class_float#class-float) | [zoom\_min](#class-graphedit-property-zoom-min) | `0.232568` | | [float](class_float#class-float) | [zoom\_step](#class-graphedit-property-zoom-step) | `1.2` | Methods ------- | | | | --- | --- | | void | [add\_valid\_connection\_type](#class-graphedit-method-add-valid-connection-type) **(** [int](class_int#class-int) from\_type, [int](class_int#class-int) to\_type **)** | | void | [add\_valid\_left\_disconnect\_type](#class-graphedit-method-add-valid-left-disconnect-type) **(** [int](class_int#class-int) type **)** | | void | [add\_valid\_right\_disconnect\_type](#class-graphedit-method-add-valid-right-disconnect-type) **(** [int](class_int#class-int) type **)** | | void | [clear\_connections](#class-graphedit-method-clear-connections) **(** **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [connect\_node](#class-graphedit-method-connect-node) **(** [String](class_string#class-string) from, [int](class_int#class-int) from\_port, [String](class_string#class-string) to, [int](class_int#class-int) to\_port **)** | | void | [disconnect\_node](#class-graphedit-method-disconnect-node) **(** [String](class_string#class-string) from, [int](class_int#class-int) from\_port, [String](class_string#class-string) to, [int](class_int#class-int) to\_port **)** | | [Array](class_array#class-array) | [get\_connection\_list](#class-graphedit-method-get-connection-list) **(** **)** const | | [HBoxContainer](class_hboxcontainer#class-hboxcontainer) | [get\_zoom\_hbox](#class-graphedit-method-get-zoom-hbox) **(** **)** | | [bool](class_bool#class-bool) | [is\_node\_connected](#class-graphedit-method-is-node-connected) **(** [String](class_string#class-string) from, [int](class_int#class-int) from\_port, [String](class_string#class-string) to, [int](class_int#class-int) to\_port **)** | | [bool](class_bool#class-bool) | [is\_valid\_connection\_type](#class-graphedit-method-is-valid-connection-type) **(** [int](class_int#class-int) from\_type, [int](class_int#class-int) to\_type **)** const | | void | [remove\_valid\_connection\_type](#class-graphedit-method-remove-valid-connection-type) **(** [int](class_int#class-int) from\_type, [int](class_int#class-int) to\_type **)** | | void | [remove\_valid\_left\_disconnect\_type](#class-graphedit-method-remove-valid-left-disconnect-type) **(** [int](class_int#class-int) type **)** | | void | [remove\_valid\_right\_disconnect\_type](#class-graphedit-method-remove-valid-right-disconnect-type) **(** [int](class_int#class-int) type **)** | | void | [set\_connection\_activity](#class-graphedit-method-set-connection-activity) **(** [String](class_string#class-string) from, [int](class_int#class-int) from\_port, [String](class_string#class-string) to, [int](class_int#class-int) to\_port, [float](class_float#class-float) amount **)** | | void | [set\_selected](#class-graphedit-method-set-selected) **(** [Node](class_node#class-node) node **)** | Theme Properties ---------------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [activity](#class-graphedit-theme-color-activity) | `Color( 1, 1, 1, 1 )` | | [Color](class_color#class-color) | [grid\_major](#class-graphedit-theme-color-grid-major) | `Color( 1, 1, 1, 0.2 )` | | [Color](class_color#class-color) | [grid\_minor](#class-graphedit-theme-color-grid-minor) | `Color( 1, 1, 1, 0.05 )` | | [Color](class_color#class-color) | [selection\_fill](#class-graphedit-theme-color-selection-fill) | `Color( 1, 1, 1, 0.3 )` | | [Color](class_color#class-color) | [selection\_stroke](#class-graphedit-theme-color-selection-stroke) | `Color( 1, 1, 1, 0.8 )` | | [int](class_int#class-int) | [bezier\_len\_neg](#class-graphedit-theme-constant-bezier-len-neg) | `160` | | [int](class_int#class-int) | [bezier\_len\_pos](#class-graphedit-theme-constant-bezier-len-pos) | `80` | | [int](class_int#class-int) | [port\_grab\_distance\_horizontal](#class-graphedit-theme-constant-port-grab-distance-horizontal) | `24` | | [int](class_int#class-int) | [port\_grab\_distance\_vertical](#class-graphedit-theme-constant-port-grab-distance-vertical) | `26` | | [Texture](class_texture#class-texture) | [minimap](#class-graphedit-theme-icon-minimap) | | | [Texture](class_texture#class-texture) | [minus](#class-graphedit-theme-icon-minus) | | | [Texture](class_texture#class-texture) | [more](#class-graphedit-theme-icon-more) | | | [Texture](class_texture#class-texture) | [reset](#class-graphedit-theme-icon-reset) | | | [Texture](class_texture#class-texture) | [snap](#class-graphedit-theme-icon-snap) | | | [StyleBox](class_stylebox#class-stylebox) | [bg](#class-graphedit-theme-style-bg) | | Signals ------- ### \_begin\_node\_move ( ) Emitted at the beginning of a GraphNode movement. ### \_end\_node\_move ( ) Emitted at the end of a GraphNode movement. ### connection\_from\_empty ( [String](class_string#class-string) to, [int](class_int#class-int) to\_slot, [Vector2](class_vector2#class-vector2) release\_position ) Emitted when user dragging connection from input port into empty space of the graph. ### connection\_request ( [String](class_string#class-string) from, [int](class_int#class-int) from\_slot, [String](class_string#class-string) to, [int](class_int#class-int) to\_slot ) Emitted to the GraphEdit when the connection between the `from_slot` slot of the `from` GraphNode and the `to_slot` slot of the `to` GraphNode is attempted to be created. ### connection\_to\_empty ( [String](class_string#class-string) from, [int](class_int#class-int) from\_slot, [Vector2](class_vector2#class-vector2) release\_position ) Emitted when user dragging connection from output port into empty space of the graph. ### copy\_nodes\_request ( ) Emitted when the user presses `Ctrl + C`. ### delete\_nodes\_request ( [Array](class_array#class-array) nodes ) Emitted when a GraphNode is attempted to be removed from the GraphEdit. Provides a list of node names to be removed (all selected nodes, excluding nodes without closing button). ### disconnection\_request ( [String](class_string#class-string) from, [int](class_int#class-int) from\_slot, [String](class_string#class-string) to, [int](class_int#class-int) to\_slot ) Emitted to the GraphEdit when the connection between `from_slot` slot of `from` GraphNode and `to_slot` slot of `to` GraphNode is attempted to be removed. ### duplicate\_nodes\_request ( ) Emitted when a GraphNode is attempted to be duplicated in the GraphEdit. ### node\_selected ( [Node](class_node#class-node) node ) Emitted when a GraphNode is selected. ### node\_unselected ( [Node](class_node#class-node) node ) ### paste\_nodes\_request ( ) Emitted when the user presses `Ctrl + V`. ### popup\_request ( [Vector2](class_vector2#class-vector2) position ) Emitted when a popup is requested. Happens on right-clicking in the GraphEdit. `position` is the position of the mouse pointer when the signal is sent. ### scroll\_offset\_changed ( [Vector2](class_vector2#class-vector2) ofs ) Emitted when the scroll offset is changed by the user. It will not be emitted when changed in code. Property Descriptions --------------------- ### [bool](class_bool#class-bool) minimap\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_minimap\_enabled(value) | | *Getter* | is\_minimap\_enabled() | If `true`, the minimap is visible. ### [float](class_float#class-float) minimap\_opacity | | | | --- | --- | | *Default* | `0.65` | | *Setter* | set\_minimap\_opacity(value) | | *Getter* | get\_minimap\_opacity() | The opacity of the minimap rectangle. ### [Vector2](class_vector2#class-vector2) minimap\_size | | | | --- | --- | | *Default* | `Vector2( 240, 160 )` | | *Setter* | set\_minimap\_size(value) | | *Getter* | get\_minimap\_size() | The size of the minimap rectangle. The map itself is based on the size of the grid area and is scaled to fit this rectangle. ### [bool](class_bool#class-bool) right\_disconnects | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_right\_disconnects(value) | | *Getter* | is\_right\_disconnects\_enabled() | If `true`, enables disconnection of existing connections in the GraphEdit by dragging the right end. ### [Vector2](class_vector2#class-vector2) scroll\_offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_scroll\_ofs(value) | | *Getter* | get\_scroll\_ofs() | The scroll offset. ### [bool](class_bool#class-bool) show\_zoom\_label | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_show\_zoom\_label(value) | | *Getter* | is\_showing\_zoom\_label() | If `true`, makes a label with the current zoom level visible. The zoom value is displayed in percents. ### [int](class_int#class-int) snap\_distance | | | | --- | --- | | *Default* | `20` | | *Setter* | set\_snap(value) | | *Getter* | get\_snap() | The snapping distance in pixels. ### [bool](class_bool#class-bool) use\_snap | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_use\_snap(value) | | *Getter* | is\_using\_snap() | If `true`, enables snapping. ### [float](class_float#class-float) zoom | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_zoom(value) | | *Getter* | get\_zoom() | The current zoom value. ### [float](class_float#class-float) zoom\_max | | | | --- | --- | | *Default* | `2.0736` | | *Setter* | set\_zoom\_max(value) | | *Getter* | get\_zoom\_max() | The upper zoom limit. ### [float](class_float#class-float) zoom\_min | | | | --- | --- | | *Default* | `0.232568` | | *Setter* | set\_zoom\_min(value) | | *Getter* | get\_zoom\_min() | The lower zoom limit. ### [float](class_float#class-float) zoom\_step | | | | --- | --- | | *Default* | `1.2` | | *Setter* | set\_zoom\_step(value) | | *Getter* | get\_zoom\_step() | The step of each zoom level. Method Descriptions ------------------- ### void add\_valid\_connection\_type ( [int](class_int#class-int) from\_type, [int](class_int#class-int) to\_type ) Makes possible the connection between two different slot types. The type is defined with the [GraphNode.set\_slot](class_graphnode#class-graphnode-method-set-slot) method. ### void add\_valid\_left\_disconnect\_type ( [int](class_int#class-int) type ) Makes possible to disconnect nodes when dragging from the slot at the left if it has the specified type. ### void add\_valid\_right\_disconnect\_type ( [int](class_int#class-int) type ) Makes possible to disconnect nodes when dragging from the slot at the right if it has the specified type. ### void clear\_connections ( ) Removes all connections between nodes. ### [Error](class_%40globalscope#enum-globalscope-error) connect\_node ( [String](class_string#class-string) from, [int](class_int#class-int) from\_port, [String](class_string#class-string) to, [int](class_int#class-int) to\_port ) Create a connection between the `from_port` slot of the `from` GraphNode and the `to_port` slot of the `to` GraphNode. If the connection already exists, no connection is created. ### void disconnect\_node ( [String](class_string#class-string) from, [int](class_int#class-int) from\_port, [String](class_string#class-string) to, [int](class_int#class-int) to\_port ) Removes the connection between the `from_port` slot of the `from` GraphNode and the `to_port` slot of the `to` GraphNode. If the connection does not exist, no connection is removed. ### [Array](class_array#class-array) get\_connection\_list ( ) const Returns an Array containing the list of connections. A connection consists in a structure of the form `{ from_port: 0, from: "GraphNode name 0", to_port: 1, to: "GraphNode name 1" }`. ### [HBoxContainer](class_hboxcontainer#class-hboxcontainer) get\_zoom\_hbox ( ) Gets the [HBoxContainer](class_hboxcontainer#class-hboxcontainer) that contains the zooming and grid snap controls in the top left of the graph. You can use this method to reposition the toolbar or to add your own custom controls to it. **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property. ### [bool](class_bool#class-bool) is\_node\_connected ( [String](class_string#class-string) from, [int](class_int#class-int) from\_port, [String](class_string#class-string) to, [int](class_int#class-int) to\_port ) Returns `true` if the `from_port` slot of the `from` GraphNode is connected to the `to_port` slot of the `to` GraphNode. ### [bool](class_bool#class-bool) is\_valid\_connection\_type ( [int](class_int#class-int) from\_type, [int](class_int#class-int) to\_type ) const Returns whether it's possible to connect slots of the specified types. ### void remove\_valid\_connection\_type ( [int](class_int#class-int) from\_type, [int](class_int#class-int) to\_type ) Makes it not possible to connect between two different slot types. The type is defined with the [GraphNode.set\_slot](class_graphnode#class-graphnode-method-set-slot) method. ### void remove\_valid\_left\_disconnect\_type ( [int](class_int#class-int) type ) Removes the possibility to disconnect nodes when dragging from the slot at the left if it has the specified type. ### void remove\_valid\_right\_disconnect\_type ( [int](class_int#class-int) type ) Removes the possibility to disconnect nodes when dragging from the slot at the right if it has the specified type. ### void set\_connection\_activity ( [String](class_string#class-string) from, [int](class_int#class-int) from\_port, [String](class_string#class-string) to, [int](class_int#class-int) to\_port, [float](class_float#class-float) amount ) Sets the coloration of the connection between `from`'s `from_port` and `to`'s `to_port` with the color provided in the `activity` theme property. ### void set\_selected ( [Node](class_node#class-node) node ) Sets the specified `node` as the one selected. Theme Property Descriptions --------------------------- ### [Color](class_color#class-color) activity | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | ### [Color](class_color#class-color) grid\_major | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 0.2 )` | Color of major grid lines. ### [Color](class_color#class-color) grid\_minor | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 0.05 )` | Color of minor grid lines. ### [Color](class_color#class-color) selection\_fill | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 0.3 )` | The fill color of the selection rectangle. ### [Color](class_color#class-color) selection\_stroke | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 0.8 )` | The outline color of the selection rectangle. ### [int](class_int#class-int) bezier\_len\_neg | | | | --- | --- | | *Default* | `160` | ### [int](class_int#class-int) bezier\_len\_pos | | | | --- | --- | | *Default* | `80` | ### [int](class_int#class-int) port\_grab\_distance\_horizontal | | | | --- | --- | | *Default* | `24` | The horizontal range within which a port can be grabbed (on both sides). ### [int](class_int#class-int) port\_grab\_distance\_vertical | | | | --- | --- | | *Default* | `26` | The vertical range within which a port can be grabbed (on both sides). ### [Texture](class_texture#class-texture) minimap ### [Texture](class_texture#class-texture) minus The icon for the zoom out button. ### [Texture](class_texture#class-texture) more The icon for the zoom in button. ### [Texture](class_texture#class-texture) reset The icon for the zoom reset button. ### [Texture](class_texture#class-texture) snap The icon for the snap toggle button. ### [StyleBox](class_stylebox#class-stylebox) bg The background drawn under the grid.
programming_docs
godot UDPServer UDPServer ========= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Helper class to implement a UDP server. Description ----------- A simple server that opens a UDP socket and returns connected [PacketPeerUDP](class_packetpeerudp#class-packetpeerudp) upon receiving new packets. See also [PacketPeerUDP.connect\_to\_host](class_packetpeerudp#class-packetpeerudp-method-connect-to-host). After starting the server ([listen](#class-udpserver-method-listen)), you will need to [poll](#class-udpserver-method-poll) it at regular intervals (e.g. inside [Node.\_process](class_node#class-node-method-process)) for it to process new packets, delivering them to the appropriate [PacketPeerUDP](class_packetpeerudp#class-packetpeerudp), and taking new connections. Below a small example of how it can be used: ``` # server.gd extends Node var server := UDPServer.new() var peers = [] func _ready(): server.listen(4242) func _process(delta): server.poll() # Important! if server.is_connection_available(): var peer : PacketPeerUDP = server.take_connection() var pkt = peer.get_packet() print("Accepted peer: %s:%s" % [peer.get_packet_ip(), peer.get_packet_port()]) print("Received data: %s" % [pkt.get_string_from_utf8()]) # Reply so it knows we received the message. peer.put_packet(pkt) # Keep a reference so we can keep contacting the remote peer. peers.append(peer) for i in range(0, peers.size()): pass # Do something with the connected peers. ``` ``` # client.gd extends Node var udp := PacketPeerUDP.new() var connected = false func _ready(): udp.connect_to_host("127.0.0.1", 4242) func _process(delta): if !connected: # Try to contact server udp.put_packet("The answer is... 42!".to_utf8()) if udp.get_available_packet_count() > 0: print("Connected: %s" % udp.get_packet().get_string_from_utf8()) connected = true ``` Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [max\_pending\_connections](#class-udpserver-property-max-pending-connections) | `16` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [is\_connection\_available](#class-udpserver-method-is-connection-available) **(** **)** const | | [bool](class_bool#class-bool) | [is\_listening](#class-udpserver-method-is-listening) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [listen](#class-udpserver-method-listen) **(** [int](class_int#class-int) port, [String](class_string#class-string) bind\_address="\*" **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [poll](#class-udpserver-method-poll) **(** **)** | | void | [stop](#class-udpserver-method-stop) **(** **)** | | [PacketPeerUDP](class_packetpeerudp#class-packetpeerudp) | [take\_connection](#class-udpserver-method-take-connection) **(** **)** | Property Descriptions --------------------- ### [int](class_int#class-int) max\_pending\_connections | | | | --- | --- | | *Default* | `16` | | *Setter* | set\_max\_pending\_connections(value) | | *Getter* | get\_max\_pending\_connections() | Define the maximum number of pending connections, during [poll](#class-udpserver-method-poll), any new pending connection exceeding that value will be automatically dropped. Setting this value to `0` effectively prevents any new pending connection to be accepted (e.g. when all your players have connected). Method Descriptions ------------------- ### [bool](class_bool#class-bool) is\_connection\_available ( ) const Returns `true` if a packet with a new address/port combination was received on the socket. ### [bool](class_bool#class-bool) is\_listening ( ) const Returns `true` if the socket is open and listening on a port. ### [Error](class_%40globalscope#enum-globalscope-error) listen ( [int](class_int#class-int) port, [String](class_string#class-string) bind\_address="\*" ) Starts the server by opening a UDP socket listening on the given port. You can optionally specify a `bind_address` to only listen for packets sent to that address. See also [PacketPeerUDP.listen](class_packetpeerudp#class-packetpeerudp-method-listen). ### [Error](class_%40globalscope#enum-globalscope-error) poll ( ) Call this method at regular intervals (e.g. inside [Node.\_process](class_node#class-node-method-process)) to process new packets. And packet from known address/port pair will be delivered to the appropriate [PacketPeerUDP](class_packetpeerudp#class-packetpeerudp), any packet received from an unknown address/port pair will be added as a pending connection (see [is\_connection\_available](#class-udpserver-method-is-connection-available), [take\_connection](#class-udpserver-method-take-connection)). The maximum number of pending connection is defined via [max\_pending\_connections](#class-udpserver-property-max-pending-connections). ### void stop ( ) Stops the server, closing the UDP socket if open. Will close all connected [PacketPeerUDP](class_packetpeerudp#class-packetpeerudp) accepted via [take\_connection](#class-udpserver-method-take-connection) (remote peers will not be notified). ### [PacketPeerUDP](class_packetpeerudp#class-packetpeerudp) take\_connection ( ) Returns the first pending connection (connected to the appropriate address/port). Will return `null` if no new connection is available. See also [is\_connection\_available](#class-udpserver-method-is-connection-available), [PacketPeerUDP.connect\_to\_host](class_packetpeerudp#class-packetpeerudp-method-connect-to-host). godot LargeTexture LargeTexture ============ **Inherits:** [Texture](class_texture#class-texture) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) *Deprecated.* A [Texture](class_texture#class-texture) capable of storing many smaller textures with offsets. Description ----------- *Deprecated (will be removed in Godot 4.0).* A [Texture](class_texture#class-texture) capable of storing many smaller textures with offsets. You can dynamically add pieces ([Texture](class_texture#class-texture)s) to this `LargeTexture` using different offsets. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | flags | `0` (overrides [Texture](class_texture#class-texture-property-flags)) | Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [add\_piece](#class-largetexture-method-add-piece) **(** [Vector2](class_vector2#class-vector2) ofs, [Texture](class_texture#class-texture) texture **)** | | void | [clear](#class-largetexture-method-clear) **(** **)** | | [int](class_int#class-int) | [get\_piece\_count](#class-largetexture-method-get-piece-count) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_piece\_offset](#class-largetexture-method-get-piece-offset) **(** [int](class_int#class-int) idx **)** const | | [Texture](class_texture#class-texture) | [get\_piece\_texture](#class-largetexture-method-get-piece-texture) **(** [int](class_int#class-int) idx **)** const | | void | [set\_piece\_offset](#class-largetexture-method-set-piece-offset) **(** [int](class_int#class-int) idx, [Vector2](class_vector2#class-vector2) ofs **)** | | void | [set\_piece\_texture](#class-largetexture-method-set-piece-texture) **(** [int](class_int#class-int) idx, [Texture](class_texture#class-texture) texture **)** | | void | [set\_size](#class-largetexture-method-set-size) **(** [Vector2](class_vector2#class-vector2) size **)** | Method Descriptions ------------------- ### [int](class_int#class-int) add\_piece ( [Vector2](class_vector2#class-vector2) ofs, [Texture](class_texture#class-texture) texture ) Adds `texture` to this `LargeTexture`, starting on offset `ofs`. ### void clear ( ) Clears the `LargeTexture`. ### [int](class_int#class-int) get\_piece\_count ( ) const Returns the number of pieces currently in this `LargeTexture`. ### [Vector2](class_vector2#class-vector2) get\_piece\_offset ( [int](class_int#class-int) idx ) const Returns the offset of the piece with the index `idx`. ### [Texture](class_texture#class-texture) get\_piece\_texture ( [int](class_int#class-int) idx ) const Returns the [Texture](class_texture#class-texture) of the piece with the index `idx`. ### void set\_piece\_offset ( [int](class_int#class-int) idx, [Vector2](class_vector2#class-vector2) ofs ) Sets the offset of the piece with the index `idx` to `ofs`. ### void set\_piece\_texture ( [int](class_int#class-int) idx, [Texture](class_texture#class-texture) texture ) Sets the [Texture](class_texture#class-texture) of the piece with index `idx` to `texture`. ### void set\_size ( [Vector2](class_vector2#class-vector2) size ) Sets the size of this `LargeTexture`. godot OS OS == **Inherits:** [Object](class_object#class-object) Operating System functions. Description ----------- Operating System functions. OS wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, date and time, timers, environment variables, execution of binaries, command line, etc. Tutorials --------- * [OS Test Demo](https://godotengine.org/asset-library/asset/677) Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [clipboard](#class-os-property-clipboard) | `""` | | [int](class_int#class-int) | [current\_screen](#class-os-property-current-screen) | `0` | | [bool](class_bool#class-bool) | [delta\_smoothing](#class-os-property-delta-smoothing) | `true` | | [int](class_int#class-int) | [exit\_code](#class-os-property-exit-code) | `0` | | [bool](class_bool#class-bool) | [keep\_screen\_on](#class-os-property-keep-screen-on) | `true` | | [bool](class_bool#class-bool) | [low\_processor\_usage\_mode](#class-os-property-low-processor-usage-mode) | `false` | | [int](class_int#class-int) | [low\_processor\_usage\_mode\_sleep\_usec](#class-os-property-low-processor-usage-mode-sleep-usec) | `6900` | | [Vector2](class_vector2#class-vector2) | [max\_window\_size](#class-os-property-max-window-size) | `Vector2( 0, 0 )` | | [Vector2](class_vector2#class-vector2) | [min\_window\_size](#class-os-property-min-window-size) | `Vector2( 0, 0 )` | | [ScreenOrientation](#enum-os-screenorientation) | [screen\_orientation](#class-os-property-screen-orientation) | `0` | | [String](class_string#class-string) | [tablet\_driver](#class-os-property-tablet-driver) | `""` | | [bool](class_bool#class-bool) | [vsync\_enabled](#class-os-property-vsync-enabled) | `true` | | [bool](class_bool#class-bool) | [vsync\_via\_compositor](#class-os-property-vsync-via-compositor) | `false` | | [bool](class_bool#class-bool) | [window\_borderless](#class-os-property-window-borderless) | `false` | | [bool](class_bool#class-bool) | [window\_fullscreen](#class-os-property-window-fullscreen) | `false` | | [bool](class_bool#class-bool) | [window\_maximized](#class-os-property-window-maximized) | `false` | | [bool](class_bool#class-bool) | [window\_minimized](#class-os-property-window-minimized) | `false` | | [bool](class_bool#class-bool) | [window\_per\_pixel\_transparency\_enabled](#class-os-property-window-per-pixel-transparency-enabled) | `false` | | [Vector2](class_vector2#class-vector2) | [window\_position](#class-os-property-window-position) | `Vector2( 0, 0 )` | | [bool](class_bool#class-bool) | [window\_resizable](#class-os-property-window-resizable) | `true` | | [Vector2](class_vector2#class-vector2) | [window\_size](#class-os-property-window-size) | `Vector2( 0, 0 )` | Methods ------- | | | | --- | --- | | void | [alert](#class-os-method-alert) **(** [String](class_string#class-string) text, [String](class_string#class-string) title="Alert!" **)** | | [bool](class_bool#class-bool) | [can\_draw](#class-os-method-can-draw) **(** **)** const | | [bool](class_bool#class-bool) | [can\_use\_threads](#class-os-method-can-use-threads) **(** **)** const | | void | [center\_window](#class-os-method-center-window) **(** **)** | | void | [close\_midi\_inputs](#class-os-method-close-midi-inputs) **(** **)** | | void | [crash](#class-os-method-crash) **(** [String](class_string#class-string) message **)** | | void | [delay\_msec](#class-os-method-delay-msec) **(** [int](class_int#class-int) msec **)** const | | void | [delay\_usec](#class-os-method-delay-usec) **(** [int](class_int#class-int) usec **)** const | | void | [dump\_memory\_to\_file](#class-os-method-dump-memory-to-file) **(** [String](class_string#class-string) file **)** | | void | [dump\_resources\_to\_file](#class-os-method-dump-resources-to-file) **(** [String](class_string#class-string) file **)** | | [int](class_int#class-int) | [execute](#class-os-method-execute) **(** [String](class_string#class-string) path, [PoolStringArray](class_poolstringarray#class-poolstringarray) arguments, [bool](class_bool#class-bool) blocking=true, [Array](class_array#class-array) output=[ ], [bool](class_bool#class-bool) read\_stderr=false, [bool](class_bool#class-bool) open\_console=false **)** | | [int](class_int#class-int) | [find\_scancode\_from\_string](#class-os-method-find-scancode-from-string) **(** [String](class_string#class-string) string **)** const | | [int](class_int#class-int) | [get\_audio\_driver\_count](#class-os-method-get-audio-driver-count) **(** **)** const | | [String](class_string#class-string) | [get\_audio\_driver\_name](#class-os-method-get-audio-driver-name) **(** [int](class_int#class-int) driver **)** const | | [String](class_string#class-string) | [get\_cache\_dir](#class-os-method-get-cache-dir) **(** **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_cmdline\_args](#class-os-method-get-cmdline-args) **(** **)** | | [String](class_string#class-string) | [get\_config\_dir](#class-os-method-get-config-dir) **(** **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_connected\_midi\_inputs](#class-os-method-get-connected-midi-inputs) **(** **)** | | [VideoDriver](#enum-os-videodriver) | [get\_current\_video\_driver](#class-os-method-get-current-video-driver) **(** **)** const | | [String](class_string#class-string) | [get\_data\_dir](#class-os-method-get-data-dir) **(** **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_date](#class-os-method-get-date) **(** [bool](class_bool#class-bool) utc=false **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_datetime](#class-os-method-get-datetime) **(** [bool](class_bool#class-bool) utc=false **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_datetime\_from\_unix\_time](#class-os-method-get-datetime-from-unix-time) **(** [int](class_int#class-int) unix\_time\_val **)** const | | [Array](class_array#class-array) | [get\_display\_cutouts](#class-os-method-get-display-cutouts) **(** **)** const | | [int](class_int#class-int) | [get\_dynamic\_memory\_usage](#class-os-method-get-dynamic-memory-usage) **(** **)** const | | [String](class_string#class-string) | [get\_environment](#class-os-method-get-environment) **(** [String](class_string#class-string) variable **)** const | | [String](class_string#class-string) | [get\_executable\_path](#class-os-method-get-executable-path) **(** **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_granted\_permissions](#class-os-method-get-granted-permissions) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_ime\_selection](#class-os-method-get-ime-selection) **(** **)** const | | [String](class_string#class-string) | [get\_ime\_text](#class-os-method-get-ime-text) **(** **)** const | | [String](class_string#class-string) | [get\_latin\_keyboard\_variant](#class-os-method-get-latin-keyboard-variant) **(** **)** const | | [String](class_string#class-string) | [get\_locale](#class-os-method-get-locale) **(** **)** const | | [String](class_string#class-string) | [get\_locale\_language](#class-os-method-get-locale-language) **(** **)** const | | [int](class_int#class-int) | [get\_main\_thread\_id](#class-os-method-get-main-thread-id) **(** **)** const | | [String](class_string#class-string) | [get\_model\_name](#class-os-method-get-model-name) **(** **)** const | | [String](class_string#class-string) | [get\_name](#class-os-method-get-name) **(** **)** const | | [int](class_int#class-int) | [get\_native\_handle](#class-os-method-get-native-handle) **(** [HandleType](#enum-os-handletype) handle\_type **)** | | [int](class_int#class-int) | [get\_power\_percent\_left](#class-os-method-get-power-percent-left) **(** **)** | | [int](class_int#class-int) | [get\_power\_seconds\_left](#class-os-method-get-power-seconds-left) **(** **)** | | [PowerState](#enum-os-powerstate) | [get\_power\_state](#class-os-method-get-power-state) **(** **)** | | [int](class_int#class-int) | [get\_process\_id](#class-os-method-get-process-id) **(** **)** const | | [int](class_int#class-int) | [get\_processor\_count](#class-os-method-get-processor-count) **(** **)** const | | [String](class_string#class-string) | [get\_processor\_name](#class-os-method-get-processor-name) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_real\_window\_size](#class-os-method-get-real-window-size) **(** **)** const | | [String](class_string#class-string) | [get\_scancode\_string](#class-os-method-get-scancode-string) **(** [int](class_int#class-int) code **)** const | | [int](class_int#class-int) | [get\_screen\_count](#class-os-method-get-screen-count) **(** **)** const | | [int](class_int#class-int) | [get\_screen\_dpi](#class-os-method-get-screen-dpi) **(** [int](class_int#class-int) screen=-1 **)** const | | [float](class_float#class-float) | [get\_screen\_max\_scale](#class-os-method-get-screen-max-scale) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_screen\_position](#class-os-method-get-screen-position) **(** [int](class_int#class-int) screen=-1 **)** const | | [float](class_float#class-float) | [get\_screen\_refresh\_rate](#class-os-method-get-screen-refresh-rate) **(** [int](class_int#class-int) screen=-1 **)** const | | [float](class_float#class-float) | [get\_screen\_scale](#class-os-method-get-screen-scale) **(** [int](class_int#class-int) screen=-1 **)** const | | [Vector2](class_vector2#class-vector2) | [get\_screen\_size](#class-os-method-get-screen-size) **(** [int](class_int#class-int) screen=-1 **)** const | | [int](class_int#class-int) | [get\_splash\_tick\_msec](#class-os-method-get-splash-tick-msec) **(** **)** const | | [int](class_int#class-int) | [get\_static\_memory\_peak\_usage](#class-os-method-get-static-memory-peak-usage) **(** **)** const | | [int](class_int#class-int) | [get\_static\_memory\_usage](#class-os-method-get-static-memory-usage) **(** **)** const | | [String](class_string#class-string) | [get\_system\_dir](#class-os-method-get-system-dir) **(** [SystemDir](#enum-os-systemdir) dir, [bool](class_bool#class-bool) shared\_storage=true **)** const | | [int](class_int#class-int) | [get\_system\_time\_msecs](#class-os-method-get-system-time-msecs) **(** **)** const | | [int](class_int#class-int) | [get\_system\_time\_secs](#class-os-method-get-system-time-secs) **(** **)** const | | [int](class_int#class-int) | [get\_tablet\_driver\_count](#class-os-method-get-tablet-driver-count) **(** **)** const | | [String](class_string#class-string) | [get\_tablet\_driver\_name](#class-os-method-get-tablet-driver-name) **(** [int](class_int#class-int) idx **)** const | | [int](class_int#class-int) | [get\_thread\_caller\_id](#class-os-method-get-thread-caller-id) **(** **)** const | | [int](class_int#class-int) | [get\_ticks\_msec](#class-os-method-get-ticks-msec) **(** **)** const | | [int](class_int#class-int) | [get\_ticks\_usec](#class-os-method-get-ticks-usec) **(** **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_time](#class-os-method-get-time) **(** [bool](class_bool#class-bool) utc=false **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_time\_zone\_info](#class-os-method-get-time-zone-info) **(** **)** const | | [String](class_string#class-string) | [get\_unique\_id](#class-os-method-get-unique-id) **(** **)** const | | [int](class_int#class-int) | [get\_unix\_time](#class-os-method-get-unix-time) **(** **)** const | | [int](class_int#class-int) | [get\_unix\_time\_from\_datetime](#class-os-method-get-unix-time-from-datetime) **(** [Dictionary](class_dictionary#class-dictionary) datetime **)** const | | [String](class_string#class-string) | [get\_user\_data\_dir](#class-os-method-get-user-data-dir) **(** **)** const | | [int](class_int#class-int) | [get\_video\_driver\_count](#class-os-method-get-video-driver-count) **(** **)** const | | [String](class_string#class-string) | [get\_video\_driver\_name](#class-os-method-get-video-driver-name) **(** [VideoDriver](#enum-os-videodriver) driver **)** const | | [int](class_int#class-int) | [get\_virtual\_keyboard\_height](#class-os-method-get-virtual-keyboard-height) **(** **)** | | [Rect2](class_rect2#class-rect2) | [get\_window\_safe\_area](#class-os-method-get-window-safe-area) **(** **)** const | | void | [global\_menu\_add\_item](#class-os-method-global-menu-add-item) **(** [String](class_string#class-string) menu, [String](class_string#class-string) label, [Variant](class_variant#class-variant) id, [Variant](class_variant#class-variant) meta **)** | | void | [global\_menu\_add\_separator](#class-os-method-global-menu-add-separator) **(** [String](class_string#class-string) menu **)** | | void | [global\_menu\_clear](#class-os-method-global-menu-clear) **(** [String](class_string#class-string) menu **)** | | void | [global\_menu\_remove\_item](#class-os-method-global-menu-remove-item) **(** [String](class_string#class-string) menu, [int](class_int#class-int) idx **)** | | [bool](class_bool#class-bool) | [has\_clipboard](#class-os-method-has-clipboard) **(** **)** const | | [bool](class_bool#class-bool) | [has\_environment](#class-os-method-has-environment) **(** [String](class_string#class-string) variable **)** const | | [bool](class_bool#class-bool) | [has\_feature](#class-os-method-has-feature) **(** [String](class_string#class-string) tag\_name **)** const | | [bool](class_bool#class-bool) | [has\_touchscreen\_ui\_hint](#class-os-method-has-touchscreen-ui-hint) **(** **)** const | | [bool](class_bool#class-bool) | [has\_virtual\_keyboard](#class-os-method-has-virtual-keyboard) **(** **)** const | | void | [hide\_virtual\_keyboard](#class-os-method-hide-virtual-keyboard) **(** **)** | | [bool](class_bool#class-bool) | [is\_debug\_build](#class-os-method-is-debug-build) **(** **)** const | | [bool](class_bool#class-bool) | [is\_ok\_left\_and\_cancel\_right](#class-os-method-is-ok-left-and-cancel-right) **(** **)** const | | [bool](class_bool#class-bool) | [is\_process\_running](#class-os-method-is-process-running) **(** [int](class_int#class-int) pid **)** const | | [bool](class_bool#class-bool) | [is\_scancode\_unicode](#class-os-method-is-scancode-unicode) **(** [int](class_int#class-int) code **)** const | | [bool](class_bool#class-bool) | [is\_stdout\_verbose](#class-os-method-is-stdout-verbose) **(** **)** const | | [bool](class_bool#class-bool) | [is\_userfs\_persistent](#class-os-method-is-userfs-persistent) **(** **)** const | | [bool](class_bool#class-bool) | [is\_window\_always\_on\_top](#class-os-method-is-window-always-on-top) **(** **)** const | | [bool](class_bool#class-bool) | [is\_window\_focused](#class-os-method-is-window-focused) **(** **)** const | | [int](class_int#class-int) | [keyboard\_get\_current\_layout](#class-os-method-keyboard-get-current-layout) **(** **)** const | | [int](class_int#class-int) | [keyboard\_get\_layout\_count](#class-os-method-keyboard-get-layout-count) **(** **)** const | | [String](class_string#class-string) | [keyboard\_get\_layout\_language](#class-os-method-keyboard-get-layout-language) **(** [int](class_int#class-int) index **)** const | | [String](class_string#class-string) | [keyboard\_get\_layout\_name](#class-os-method-keyboard-get-layout-name) **(** [int](class_int#class-int) index **)** const | | [int](class_int#class-int) | [keyboard\_get\_scancode\_from\_physical](#class-os-method-keyboard-get-scancode-from-physical) **(** [int](class_int#class-int) scancode **)** const | | void | [keyboard\_set\_current\_layout](#class-os-method-keyboard-set-current-layout) **(** [int](class_int#class-int) index **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [kill](#class-os-method-kill) **(** [int](class_int#class-int) pid **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [move\_to\_trash](#class-os-method-move-to-trash) **(** [String](class_string#class-string) path **)** const | | void | [move\_window\_to\_foreground](#class-os-method-move-window-to-foreground) **(** **)** | | [bool](class_bool#class-bool) | [native\_video\_is\_playing](#class-os-method-native-video-is-playing) **(** **)** | | void | [native\_video\_pause](#class-os-method-native-video-pause) **(** **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [native\_video\_play](#class-os-method-native-video-play) **(** [String](class_string#class-string) path, [float](class_float#class-float) volume, [String](class_string#class-string) audio\_track, [String](class_string#class-string) subtitle\_track **)** | | void | [native\_video\_stop](#class-os-method-native-video-stop) **(** **)** | | void | [native\_video\_unpause](#class-os-method-native-video-unpause) **(** **)** | | void | [open\_midi\_inputs](#class-os-method-open-midi-inputs) **(** **)** | | void | [print\_all\_resources](#class-os-method-print-all-resources) **(** [String](class_string#class-string) tofile="" **)** | | void | [print\_all\_textures\_by\_size](#class-os-method-print-all-textures-by-size) **(** **)** | | void | [print\_resources\_by\_type](#class-os-method-print-resources-by-type) **(** [PoolStringArray](class_poolstringarray#class-poolstringarray) types **)** | | void | [print\_resources\_in\_use](#class-os-method-print-resources-in-use) **(** [bool](class_bool#class-bool) short=false **)** | | void | [request\_attention](#class-os-method-request-attention) **(** **)** | | [bool](class_bool#class-bool) | [request\_permission](#class-os-method-request-permission) **(** [String](class_string#class-string) name **)** | | [bool](class_bool#class-bool) | [request\_permissions](#class-os-method-request-permissions) **(** **)** | | [bool](class_bool#class-bool) | [set\_environment](#class-os-method-set-environment) **(** [String](class_string#class-string) variable, [String](class_string#class-string) value **)** const | | void | [set\_icon](#class-os-method-set-icon) **(** [Image](class_image#class-image) icon **)** | | void | [set\_ime\_active](#class-os-method-set-ime-active) **(** [bool](class_bool#class-bool) active **)** | | void | [set\_ime\_position](#class-os-method-set-ime-position) **(** [Vector2](class_vector2#class-vector2) position **)** | | void | [set\_native\_icon](#class-os-method-set-native-icon) **(** [String](class_string#class-string) filename **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [set\_thread\_name](#class-os-method-set-thread-name) **(** [String](class_string#class-string) name **)** | | void | [set\_use\_file\_access\_save\_and\_swap](#class-os-method-set-use-file-access-save-and-swap) **(** [bool](class_bool#class-bool) enabled **)** | | void | [set\_window\_always\_on\_top](#class-os-method-set-window-always-on-top) **(** [bool](class_bool#class-bool) enabled **)** | | void | [set\_window\_mouse\_passthrough](#class-os-method-set-window-mouse-passthrough) **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) region **)** | | void | [set\_window\_title](#class-os-method-set-window-title) **(** [String](class_string#class-string) title **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [shell\_open](#class-os-method-shell-open) **(** [String](class_string#class-string) uri **)** | | void | [show\_virtual\_keyboard](#class-os-method-show-virtual-keyboard) **(** [String](class_string#class-string) existing\_text="", [bool](class_bool#class-bool) multiline=false **)** | Enumerations ------------ enum **VideoDriver**: * **VIDEO\_DRIVER\_GLES2** = **1** --- The GLES2 rendering backend. It uses OpenGL ES 2.0 on mobile devices, OpenGL 2.1 on desktop platforms and WebGL 1.0 on the web. * **VIDEO\_DRIVER\_GLES3** = **0** --- The GLES3 rendering backend. It uses OpenGL ES 3.0 on mobile devices, OpenGL 3.3 on desktop platforms and WebGL 2.0 on the web. enum **Weekday**: * **DAY\_SUNDAY** = **0** --- Sunday. * **DAY\_MONDAY** = **1** --- Monday. * **DAY\_TUESDAY** = **2** --- Tuesday. * **DAY\_WEDNESDAY** = **3** --- Wednesday. * **DAY\_THURSDAY** = **4** --- Thursday. * **DAY\_FRIDAY** = **5** --- Friday. * **DAY\_SATURDAY** = **6** --- Saturday. enum **Month**: * **MONTH\_JANUARY** = **1** --- January. * **MONTH\_FEBRUARY** = **2** --- February. * **MONTH\_MARCH** = **3** --- March. * **MONTH\_APRIL** = **4** --- April. * **MONTH\_MAY** = **5** --- May. * **MONTH\_JUNE** = **6** --- June. * **MONTH\_JULY** = **7** --- July. * **MONTH\_AUGUST** = **8** --- August. * **MONTH\_SEPTEMBER** = **9** --- September. * **MONTH\_OCTOBER** = **10** --- October. * **MONTH\_NOVEMBER** = **11** --- November. * **MONTH\_DECEMBER** = **12** --- December. enum **HandleType**: * **APPLICATION\_HANDLE** = **0** --- Application handle: + Windows: `HINSTANCE` of the application + MacOS: `NSApplication*` of the application (not yet implemented) + Android: `JNIEnv*` of the application (not yet implemented) * **DISPLAY\_HANDLE** = **1** --- Display handle: + Linux: `X11::Display*` for the display * **WINDOW\_HANDLE** = **2** --- Window handle: + Windows: `HWND` of the main window + Linux: `X11::Window*` of the main window + MacOS: `NSWindow*` of the main window (not yet implemented) + Android: `jObject` the main android activity (not yet implemented) * **WINDOW\_VIEW** = **3** --- Window view: + Windows: `HDC` of the main window drawing context + MacOS: `NSView*` of the main windows view (not yet implemented) * **OPENGL\_CONTEXT** = **4** --- OpenGL Context: + Windows: `HGLRC` + Linux: `X11::GLXContext` + MacOS: `NSOpenGLContext*` (not yet implemented) enum **ScreenOrientation**: * **SCREEN\_ORIENTATION\_LANDSCAPE** = **0** --- Landscape screen orientation. * **SCREEN\_ORIENTATION\_PORTRAIT** = **1** --- Portrait screen orientation. * **SCREEN\_ORIENTATION\_REVERSE\_LANDSCAPE** = **2** --- Reverse landscape screen orientation. * **SCREEN\_ORIENTATION\_REVERSE\_PORTRAIT** = **3** --- Reverse portrait screen orientation. * **SCREEN\_ORIENTATION\_SENSOR\_LANDSCAPE** = **4** --- Uses landscape or reverse landscape based on the hardware sensor. * **SCREEN\_ORIENTATION\_SENSOR\_PORTRAIT** = **5** --- Uses portrait or reverse portrait based on the hardware sensor. * **SCREEN\_ORIENTATION\_SENSOR** = **6** --- Uses most suitable orientation based on the hardware sensor. enum **SystemDir**: * **SYSTEM\_DIR\_DESKTOP** = **0** --- Desktop directory path. * **SYSTEM\_DIR\_DCIM** = **1** --- DCIM (Digital Camera Images) directory path. * **SYSTEM\_DIR\_DOCUMENTS** = **2** --- Documents directory path. * **SYSTEM\_DIR\_DOWNLOADS** = **3** --- Downloads directory path. * **SYSTEM\_DIR\_MOVIES** = **4** --- Movies directory path. * **SYSTEM\_DIR\_MUSIC** = **5** --- Music directory path. * **SYSTEM\_DIR\_PICTURES** = **6** --- Pictures directory path. * **SYSTEM\_DIR\_RINGTONES** = **7** --- Ringtones directory path. enum **PowerState**: * **POWERSTATE\_UNKNOWN** = **0** --- Unknown powerstate. * **POWERSTATE\_ON\_BATTERY** = **1** --- Unplugged, running on battery. * **POWERSTATE\_NO\_BATTERY** = **2** --- Plugged in, no battery available. * **POWERSTATE\_CHARGING** = **3** --- Plugged in, battery charging. * **POWERSTATE\_CHARGED** = **4** --- Plugged in, battery fully charged. Property Descriptions --------------------- ### [String](class_string#class-string) clipboard | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_clipboard(value) | | *Getter* | get\_clipboard() | The clipboard from the host OS. Might be unavailable on some platforms. ### [int](class_int#class-int) current\_screen | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_current\_screen(value) | | *Getter* | get\_current\_screen() | The current screen index (starting from 0). ### [bool](class_bool#class-bool) delta\_smoothing | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_delta\_smoothing(value) | | *Getter* | is\_delta\_smoothing\_enabled() | If `true`, the engine filters the time delta measured between each frame, and attempts to compensate for random variation. This will only operate on systems where V-Sync is active. ### [int](class_int#class-int) exit\_code | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_exit\_code(value) | | *Getter* | get\_exit\_code() | The exit code passed to the OS when the main loop exits. By convention, an exit code of `0` indicates success whereas a non-zero exit code indicates an error. For portability reasons, the exit code should be set between 0 and 125 (inclusive). **Note:** This value will be ignored if using [SceneTree.quit](class_scenetree#class-scenetree-method-quit) with an `exit_code` argument passed. ### [bool](class_bool#class-bool) keep\_screen\_on | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_keep\_screen\_on(value) | | *Getter* | is\_keep\_screen\_on() | If `true`, the engine tries to keep the screen on while the game is running. Useful on mobile. ### [bool](class_bool#class-bool) low\_processor\_usage\_mode | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_low\_processor\_usage\_mode(value) | | *Getter* | is\_in\_low\_processor\_usage\_mode() | If `true`, the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile. ### [int](class_int#class-int) low\_processor\_usage\_mode\_sleep\_usec | | | | --- | --- | | *Default* | `6900` | | *Setter* | set\_low\_processor\_usage\_mode\_sleep\_usec(value) | | *Getter* | get\_low\_processor\_usage\_mode\_sleep\_usec() | The amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage. ### [Vector2](class_vector2#class-vector2) max\_window\_size | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_max\_window\_size(value) | | *Getter* | get\_max\_window\_size() | The maximum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to `(0, 0)` to reset to the system default value. ### [Vector2](class_vector2#class-vector2) min\_window\_size | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_min\_window\_size(value) | | *Getter* | get\_min\_window\_size() | The minimum size of the window in pixels (without counting window manager decorations). Does not affect fullscreen mode. Set to `(0, 0)` to reset to the system's default value. **Note:** By default, the project window has a minimum size of `Vector2(64, 64)`. This prevents issues that can arise when the window is resized to a near-zero size. ### [ScreenOrientation](#enum-os-screenorientation) screen\_orientation | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_screen\_orientation(value) | | *Getter* | get\_screen\_orientation() | The current screen orientation. ### [String](class_string#class-string) tablet\_driver | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_current\_tablet\_driver(value) | | *Getter* | get\_current\_tablet\_driver() | The current tablet driver in use. ### [bool](class_bool#class-bool) vsync\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_use\_vsync(value) | | *Getter* | is\_vsync\_enabled() | If `true`, vertical synchronization (Vsync) is enabled. ### [bool](class_bool#class-bool) vsync\_via\_compositor | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_vsync\_via\_compositor(value) | | *Getter* | is\_vsync\_via\_compositor\_enabled() | If `true` and `vsync_enabled` is true, the operating system's window compositor will be used for vsync when the compositor is enabled and the game is in windowed mode. **Note:** This option is experimental and meant to alleviate stutter experienced by some users. However, some users have experienced a Vsync framerate halving (e.g. from 60 FPS to 30 FPS) when using it. **Note:** This property is only implemented on Windows. ### [bool](class_bool#class-bool) window\_borderless | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_borderless\_window(value) | | *Getter* | get\_borderless\_window() | If `true`, removes the window frame. **Note:** Setting `window_borderless` to `false` disables per-pixel transparency. ### [bool](class_bool#class-bool) window\_fullscreen | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_window\_fullscreen(value) | | *Getter* | is\_window\_fullscreen() | If `true`, the window is fullscreen. ### [bool](class_bool#class-bool) window\_maximized | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_window\_maximized(value) | | *Getter* | is\_window\_maximized() | If `true`, the window is maximized. ### [bool](class_bool#class-bool) window\_minimized | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_window\_minimized(value) | | *Getter* | is\_window\_minimized() | If `true`, the window is minimized. ### [bool](class_bool#class-bool) window\_per\_pixel\_transparency\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_window\_per\_pixel\_transparency\_enabled(value) | | *Getter* | get\_window\_per\_pixel\_transparency\_enabled() | If `true`, the window background is transparent and the window frame is removed. Use `get_tree().get_root().set_transparent_background(true)` to disable main viewport background rendering. **Note:** This property has no effect if [ProjectSettings.display/window/per\_pixel\_transparency/allowed](class_projectsettings#class-projectsettings-property-display-window-per-pixel-transparency-allowed) setting is disabled. **Note:** This property is implemented on HTML5, Linux, macOS, Windows, and Android. It can't be changed at runtime for Android. Use [ProjectSettings.display/window/per\_pixel\_transparency/enabled](class_projectsettings#class-projectsettings-property-display-window-per-pixel-transparency-enabled) to set it at startup instead. ### [Vector2](class_vector2#class-vector2) window\_position | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_window\_position(value) | | *Getter* | get\_window\_position() | The window position relative to the screen, the origin is the top left corner, +Y axis goes to the bottom and +X axis goes to the right. ### [bool](class_bool#class-bool) window\_resizable | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_window\_resizable(value) | | *Getter* | is\_window\_resizable() | If `true`, the window is resizable by the user. ### [Vector2](class_vector2#class-vector2) window\_size | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_window\_size(value) | | *Getter* | get\_window\_size() | The size of the window (without counting window manager decorations). Method Descriptions ------------------- ### void alert ( [String](class_string#class-string) text, [String](class_string#class-string) title="Alert!" ) Displays a modal dialog box using the host OS' facilities. Execution is blocked until the dialog is closed. ### [bool](class_bool#class-bool) can\_draw ( ) const Returns `true` if the host OS allows drawing. ### [bool](class_bool#class-bool) can\_use\_threads ( ) const Returns `true` if the current host platform is using multiple threads. ### void center\_window ( ) Centers the window on the screen if in windowed mode. ### void close\_midi\_inputs ( ) Shuts down system MIDI driver. **Note:** This method is implemented on Linux, macOS and Windows. ### void crash ( [String](class_string#class-string) message ) Crashes the engine (or the editor if called within a `tool` script). This should *only* be used for testing the system's crash handler, not for any other purpose. For general error reporting, use (in order of preference) [@GDScript.assert](class_%40gdscript#class-gdscript-method-assert), [@GDScript.push\_error](class_%40gdscript#class-gdscript-method-push-error) or [alert](#class-os-method-alert). See also [kill](#class-os-method-kill). ### void delay\_msec ( [int](class_int#class-int) msec ) const Delays execution of the current thread by `msec` milliseconds. `msec` must be greater than or equal to `0`. Otherwise, [delay\_msec](#class-os-method-delay-msec) will do nothing and will print an error message. **Note:** [delay\_msec](#class-os-method-delay-msec) is a *blocking* way to delay code execution. To delay code execution in a non-blocking way, see [SceneTree.create\_timer](class_scenetree#class-scenetree-method-create-timer). Yielding with [SceneTree.create\_timer](class_scenetree#class-scenetree-method-create-timer) will delay the execution of code placed below the `yield` without affecting the rest of the project (or editor, for [EditorPlugin](class_editorplugin#class-editorplugin)s and [EditorScript](class_editorscript#class-editorscript)s). **Note:** When [delay\_msec](#class-os-method-delay-msec) is called on the main thread, it will freeze the project and will prevent it from redrawing and registering input until the delay has passed. When using [delay\_msec](#class-os-method-delay-msec) as part of an [EditorPlugin](class_editorplugin#class-editorplugin) or [EditorScript](class_editorscript#class-editorscript), it will freeze the editor but won't freeze the project if it is currently running (since the project is an independent child process). ### void delay\_usec ( [int](class_int#class-int) usec ) const Delays execution of the current thread by `usec` microseconds. `usec` must be greater than or equal to `0`. Otherwise, [delay\_usec](#class-os-method-delay-usec) will do nothing and will print an error message. **Note:** [delay\_usec](#class-os-method-delay-usec) is a *blocking* way to delay code execution. To delay code execution in a non-blocking way, see [SceneTree.create\_timer](class_scenetree#class-scenetree-method-create-timer). Yielding with [SceneTree.create\_timer](class_scenetree#class-scenetree-method-create-timer) will delay the execution of code placed below the `yield` without affecting the rest of the project (or editor, for [EditorPlugin](class_editorplugin#class-editorplugin)s and [EditorScript](class_editorscript#class-editorscript)s). **Note:** When [delay\_usec](#class-os-method-delay-usec) is called on the main thread, it will freeze the project and will prevent it from redrawing and registering input until the delay has passed. When using [delay\_usec](#class-os-method-delay-usec) as part of an [EditorPlugin](class_editorplugin#class-editorplugin) or [EditorScript](class_editorscript#class-editorscript), it will freeze the editor but won't freeze the project if it is currently running (since the project is an independent child process). ### void dump\_memory\_to\_file ( [String](class_string#class-string) file ) Dumps the memory allocation ringlist to a file (only works in debug). Entry format per line: "Address - Size - Description". ### void dump\_resources\_to\_file ( [String](class_string#class-string) file ) Dumps all used resources to file (only works in debug). Entry format per line: "Resource Type : Resource Location". At the end of the file is a statistic of all used Resource Types. ### [int](class_int#class-int) execute ( [String](class_string#class-string) path, [PoolStringArray](class_poolstringarray#class-poolstringarray) arguments, [bool](class_bool#class-bool) blocking=true, [Array](class_array#class-array) output=[ ], [bool](class_bool#class-bool) read\_stderr=false, [bool](class_bool#class-bool) open\_console=false ) Execute the file at the given path with the arguments passed as an array of strings. Platform path resolution will take place. The resolved file must exist and be executable. The arguments are used in the given order and separated by a space, so `OS.execute("ping", ["-w", "3", "godotengine.org"], false)` will resolve to `ping -w 3 godotengine.org` in the system's shell. This method has slightly different behavior based on whether the `blocking` mode is enabled. If `blocking` is `true`, the Godot thread will pause its execution while waiting for the process to terminate. The shell output of the process will be written to the `output` array as a single string. When the process terminates, the Godot thread will resume execution. If `blocking` is `false`, the Godot thread will continue while the new process runs. It is not possible to retrieve the shell output in non-blocking mode, so `output` will be empty. On Windows, if `open_console` is `true` and process is console app, new terminal window will be opened, it's ignored on other platforms. The return value also depends on the blocking mode. When blocking, the method will return an exit code of the process. When non-blocking, the method returns a process ID, which you can use to monitor the process (and potentially terminate it with [kill](#class-os-method-kill)). If the process forking (non-blocking) or opening (blocking) fails, the method will return `-1` or another exit code. Example of blocking mode and retrieving the shell output: ``` var output = [] var exit_code = OS.execute("ls", ["-l", "/tmp"], true, output) ``` Example of non-blocking mode, running another instance of the project and storing its process ID: ``` var pid = OS.execute(OS.get_executable_path(), [], false) ``` If you wish to access a shell built-in or perform a composite command, a platform-specific shell can be invoked. For example: ``` OS.execute("CMD.exe", ["/C", "cd %TEMP% && dir"], true, output) ``` **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows. **Note:** To execute a Windows command interpreter built-in command, specify `cmd.exe` in `path`, `/c` as the first argument, and the desired command as the second argument. **Note:** To execute a PowerShell built-in command, specify `powershell.exe` in `path`, `-Command` as the first argument, and the desired command as the second argument. **Note:** To execute a Unix shell built-in command, specify shell executable name in `path`, `-c` as the first argument, and the desired command as the second argument. ### [int](class_int#class-int) find\_scancode\_from\_string ( [String](class_string#class-string) string ) const Returns the scancode of the given string (e.g. "Escape"). ### [int](class_int#class-int) get\_audio\_driver\_count ( ) const Returns the total number of available audio drivers. ### [String](class_string#class-string) get\_audio\_driver\_name ( [int](class_int#class-int) driver ) const Returns the audio driver name for the given index. ### [String](class_string#class-string) get\_cache\_dir ( ) const Returns the *global* cache data directory according to the operating system's standards. On desktop platforms, this path can be overridden by setting the `XDG_CACHE_HOME` environment variable before starting the project. See [File paths in Godot projects](https://docs.godotengine.org/en/3.5/tutorials/io/data_paths.html) in the documentation for more information. See also [get\_config\_dir](#class-os-method-get-config-dir) and [get\_data\_dir](#class-os-method-get-data-dir). Not to be confused with [get\_user\_data\_dir](#class-os-method-get-user-data-dir), which returns the *project-specific* user data path. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_cmdline\_args ( ) Returns the command-line arguments passed to the engine. Command-line arguments can be written in any form, including both `--key value` and `--key=value` forms so they can be properly parsed, as long as custom command-line arguments do not conflict with engine arguments. You can also incorporate environment variables using the [get\_environment](#class-os-method-get-environment) method. You can set [ProjectSettings.editor/main\_run\_args](class_projectsettings#class-projectsettings-property-editor-main-run-args) to define command-line arguments to be passed by the editor when running the project. Here's a minimal example on how to parse command-line arguments into a dictionary using the `--key=value` form for arguments: ``` var arguments = {} for argument in OS.get_cmdline_args(): if argument.find("=") > -1: var key_value = argument.split("=") arguments[key_value[0].lstrip("--")] = key_value[1] else: # Options without an argument will be present in the dictionary, # with the value set to an empty string. arguments[argument.lstrip("--")] = "" ``` ### [String](class_string#class-string) get\_config\_dir ( ) const Returns the *global* user configuration directory according to the operating system's standards. On desktop platforms, this path can be overridden by setting the `XDG_CONFIG_HOME` environment variable before starting the project. See [File paths in Godot projects](https://docs.godotengine.org/en/3.5/tutorials/io/data_paths.html) in the documentation for more information. See also [get\_cache\_dir](#class-os-method-get-cache-dir) and [get\_data\_dir](#class-os-method-get-data-dir). Not to be confused with [get\_user\_data\_dir](#class-os-method-get-user-data-dir), which returns the *project-specific* user data path. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_connected\_midi\_inputs ( ) Returns an array of MIDI device names. The returned array will be empty if the system MIDI driver has not previously been initialised with [open\_midi\_inputs](#class-os-method-open-midi-inputs). **Note:** This method is implemented on Linux, macOS and Windows. ### [VideoDriver](#enum-os-videodriver) get\_current\_video\_driver ( ) const Returns the currently used video driver, using one of the values from [VideoDriver](#enum-os-videodriver). ### [String](class_string#class-string) get\_data\_dir ( ) const Returns the *global* user data directory according to the operating system's standards. On desktop platforms, this path can be overridden by setting the `XDG_DATA_HOME` environment variable before starting the project. See [File paths in Godot projects](https://docs.godotengine.org/en/3.5/tutorials/io/data_paths.html) in the documentation for more information. See also [get\_cache\_dir](#class-os-method-get-cache-dir) and [get\_config\_dir](#class-os-method-get-config-dir). Not to be confused with [get\_user\_data\_dir](#class-os-method-get-user-data-dir), which returns the *project-specific* user data path. ### [Dictionary](class_dictionary#class-dictionary) get\_date ( [bool](class_bool#class-bool) utc=false ) const Deprecated, use [Time.get\_date\_dict\_from\_system](class_time#class-time-method-get-date-dict-from-system) instead. Returns current date as a dictionary of keys: `year`, `month`, `day`, `weekday`, `dst` (Daylight Savings Time). ### [Dictionary](class_dictionary#class-dictionary) get\_datetime ( [bool](class_bool#class-bool) utc=false ) const Deprecated, use [Time.get\_datetime\_dict\_from\_system](class_time#class-time-method-get-datetime-dict-from-system) instead. Returns current datetime as a dictionary of keys: `year`, `month`, `day`, `weekday`, `dst` (Daylight Savings Time), `hour`, `minute`, `second`. ### [Dictionary](class_dictionary#class-dictionary) get\_datetime\_from\_unix\_time ( [int](class_int#class-int) unix\_time\_val ) const Deprecated, use [Time.get\_datetime\_dict\_from\_unix\_time](class_time#class-time-method-get-datetime-dict-from-unix-time) instead. Gets a dictionary of time values corresponding to the given UNIX epoch time (in seconds). The returned Dictionary's values will be the same as [get\_datetime](#class-os-method-get-datetime), with the exception of Daylight Savings Time as it cannot be determined from the epoch. ### [Array](class_array#class-array) get\_display\_cutouts ( ) const Returns an [Array](class_array#class-array) of [Rect2](class_rect2#class-rect2), each of which is the bounding rectangle for a display cutout or notch. These are non-functional areas on edge-to-edge screens used by cameras and sensors. Returns an empty array if the device does not have cutouts. See also [get\_window\_safe\_area](#class-os-method-get-window-safe-area). **Note:** Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches. ### [int](class_int#class-int) get\_dynamic\_memory\_usage ( ) const Returns the total amount of dynamic memory used (only works in debug). ### [String](class_string#class-string) get\_environment ( [String](class_string#class-string) variable ) const Returns the value of an environment variable. Returns an empty string if the environment variable doesn't exist. **Note:** Double-check the casing of `variable`. Environment variable names are case-sensitive on all platforms except Windows. ### [String](class_string#class-string) get\_executable\_path ( ) const Returns the path to the current engine executable. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_granted\_permissions ( ) const With this function, you can get the list of dangerous permissions that have been granted to the Android application. **Note:** This method is implemented on Android. ### [Vector2](class_vector2#class-vector2) get\_ime\_selection ( ) const Returns the IME cursor position (the currently-edited portion of the string) relative to the characters in the composition string. [MainLoop.NOTIFICATION\_OS\_IME\_UPDATE](class_mainloop#class-mainloop-constant-notification-os-ime-update) is sent to the application to notify it of changes to the IME cursor position. **Note:** This method is implemented on macOS. ### [String](class_string#class-string) get\_ime\_text ( ) const Returns the IME intermediate composition string. [MainLoop.NOTIFICATION\_OS\_IME\_UPDATE](class_mainloop#class-mainloop-constant-notification-os-ime-update) is sent to the application to notify it of changes to the IME composition string. **Note:** This method is implemented on macOS. ### [String](class_string#class-string) get\_latin\_keyboard\_variant ( ) const Returns the current latin keyboard variant as a String. Possible return values are: `"QWERTY"`, `"AZERTY"`, `"QZERTY"`, `"DVORAK"`, `"NEO"`, `"COLEMAK"` or `"ERROR"`. **Note:** This method is implemented on Linux, macOS and Windows. Returns `"QWERTY"` on unsupported platforms. ### [String](class_string#class-string) get\_locale ( ) const Returns the host OS locale as a string of the form `language_Script_COUNTRY_VARIANT@extra`. If you want only the language code and not the fully specified locale from the OS, you can use [get\_locale\_language](#class-os-method-get-locale-language). `language` - 2 or 3-letter [language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), in lower case. `Script` - optional, 4-letter [script code](https://en.wikipedia.org/wiki/ISO_15924), in title case. `COUNTRY` - optional, 2 or 3-letter [country code](https://en.wikipedia.org/wiki/ISO_3166-1), in upper case. `VARIANT` - optional, language variant, region and sort order. Variant can have any number of underscored keywords. `extra` - optional, semicolon separated list of additional key words. Currency, calendar, sort order and numbering system information. ### [String](class_string#class-string) get\_locale\_language ( ) const Returns the host OS locale's 2 or 3-letter [language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) as a string which should be consistent on all platforms. This is equivalent to extracting the `language` part of the [get\_locale](#class-os-method-get-locale) string. This can be used to narrow down fully specified locale strings to only the "common" language code, when you don't need the additional information about country code or variants. For example, for a French Canadian user with `fr_CA` locale, this would return `fr`. ### [int](class_int#class-int) get\_main\_thread\_id ( ) const Returns the ID of the main thread. See [get\_thread\_caller\_id](#class-os-method-get-thread-caller-id). **Note:** Thread IDs are not deterministic and may be reused across application restarts. ### [String](class_string#class-string) get\_model\_name ( ) const Returns the model name of the current device. **Note:** This method is implemented on Android and iOS. Returns `"GenericDevice"` on unsupported platforms. ### [String](class_string#class-string) get\_name ( ) const Returns the name of the host OS. Possible values are: `"Android"`, `"iOS"`, `"HTML5"`, `"OSX"`, `"Server"`, `"Windows"`, `"UWP"`, `"X11"`. ### [int](class_int#class-int) get\_native\_handle ( [HandleType](#enum-os-handletype) handle\_type ) Returns internal structure pointers for use in GDNative plugins. **Note:** This method is implemented on Linux and Windows (other OSs will soon be supported). ### [int](class_int#class-int) get\_power\_percent\_left ( ) Returns the amount of battery left in the device as a percentage. Returns `-1` if power state is unknown. **Note:** This method is implemented on Linux, macOS and Windows. ### [int](class_int#class-int) get\_power\_seconds\_left ( ) Returns an estimate of the time left in seconds before the device runs out of battery. Returns `-1` if power state is unknown. **Note:** This method is implemented on Linux, macOS and Windows. ### [PowerState](#enum-os-powerstate) get\_power\_state ( ) Returns the current state of the device regarding battery and power. See [PowerState](#enum-os-powerstate) constants. **Note:** This method is implemented on Linux, macOS and Windows. ### [int](class_int#class-int) get\_process\_id ( ) const Returns the project's process ID. **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows. ### [int](class_int#class-int) get\_processor\_count ( ) const Returns the number of *logical* CPU cores available on the host machine. On CPUs with HyperThreading enabled, this number will be greater than the number of *physical* CPU cores. ### [String](class_string#class-string) get\_processor\_name ( ) const Returns the name of the CPU model on the host machine (e.g. "Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz"). **Note:** This method is only implemented on Windows, macOS, Linux and iOS. On Android, HTML5 and UWP, [get\_processor\_name](#class-os-method-get-processor-name) returns an empty string. ### [Vector2](class_vector2#class-vector2) get\_real\_window\_size ( ) const Returns the window size including decorations like window borders. ### [String](class_string#class-string) get\_scancode\_string ( [int](class_int#class-int) code ) const Returns the given scancode as a string (e.g. Return values: `"Escape"`, `"Shift+Escape"`). See also [InputEventKey.scancode](class_inputeventkey#class-inputeventkey-property-scancode) and [InputEventKey.get\_scancode\_with\_modifiers](class_inputeventkey#class-inputeventkey-method-get-scancode-with-modifiers). ### [int](class_int#class-int) get\_screen\_count ( ) const Returns the number of displays attached to the host machine. ### [int](class_int#class-int) get\_screen\_dpi ( [int](class_int#class-int) screen=-1 ) const Returns the dots per inch density of the specified screen. If `screen` is `-1` (the default value), the current screen will be used. **Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used. **Note:** On Android devices, the actual screen densities are grouped into six generalized densities: ``` ldpi - 120 dpi mdpi - 160 dpi hdpi - 240 dpi xhdpi - 320 dpi xxhdpi - 480 dpi xxxhdpi - 640 dpi ``` **Note:** This method is implemented on Android, Linux, macOS and Windows. Returns `72` on unsupported platforms. ### [float](class_float#class-float) get\_screen\_max\_scale ( ) const Return the greatest scale factor of all screens. **Note:** On macOS returned value is `2.0` if there is at least one hiDPI (Retina) screen in the system, and `1.0` in all other cases. **Note:** This method is implemented on macOS. ### [Vector2](class_vector2#class-vector2) get\_screen\_position ( [int](class_int#class-int) screen=-1 ) const Returns the position of the specified screen by index. If `screen` is `-1` (the default value), the current screen will be used. ### [float](class_float#class-float) get\_screen\_refresh\_rate ( [int](class_int#class-int) screen=-1 ) const Returns the current refresh rate of the specified screen. If `screen` is `-1` (the default value), the current screen will be used. **Note:** Returns `-1.0` if Godot fails to find the refresh rate for the specified screen. On HTML5, [get\_screen\_refresh\_rate](#class-os-method-get-screen-refresh-rate) will always return `-1.0` as there is no way to retrieve the refresh rate on that platform. To fallback to a default refresh rate if the method fails, try: ``` var refresh_rate = OS.get_screen_refresh_rate() if refresh_rate < 0: refresh_rate = 60.0 ``` ### [float](class_float#class-float) get\_screen\_scale ( [int](class_int#class-int) screen=-1 ) const Return the scale factor of the specified screen by index. If `screen` is `-1` (the default value), the current screen will be used. **Note:** On macOS returned value is `2.0` for hiDPI (Retina) screen, and `1.0` for all other cases. **Note:** This method is implemented on macOS. ### [Vector2](class_vector2#class-vector2) get\_screen\_size ( [int](class_int#class-int) screen=-1 ) const Returns the dimensions in pixels of the specified screen. If `screen` is `-1` (the default value), the current screen will be used. ### [int](class_int#class-int) get\_splash\_tick\_msec ( ) const Returns the amount of time in milliseconds it took for the boot logo to appear. ### [int](class_int#class-int) get\_static\_memory\_peak\_usage ( ) const Returns the maximum amount of static memory used (only works in debug). ### [int](class_int#class-int) get\_static\_memory\_usage ( ) const Returns the amount of static memory being used by the program in bytes (only works in debug). ### [String](class_string#class-string) get\_system\_dir ( [SystemDir](#enum-os-systemdir) dir, [bool](class_bool#class-bool) shared\_storage=true ) const Returns the actual path to commonly used folders across different platforms. Available locations are specified in [SystemDir](#enum-os-systemdir). **Note:** This method is implemented on Android, Linux, macOS and Windows. **Note:** Shared storage is implemented on Android and allows to differentiate between app specific and shared directories. Shared directories have additional restrictions on Android. ### [int](class_int#class-int) get\_system\_time\_msecs ( ) const Returns the epoch time of the operating system in milliseconds. ### [int](class_int#class-int) get\_system\_time\_secs ( ) const Returns the epoch time of the operating system in seconds. ### [int](class_int#class-int) get\_tablet\_driver\_count ( ) const Returns the total number of available tablet drivers. **Note:** This method is implemented on Windows. ### [String](class_string#class-string) get\_tablet\_driver\_name ( [int](class_int#class-int) idx ) const Returns the tablet driver name for the given index. **Note:** This method is implemented on Windows. ### [int](class_int#class-int) get\_thread\_caller\_id ( ) const Returns the ID of the current thread. This can be used in logs to ease debugging of multi-threaded applications. **Note:** Thread IDs are not deterministic and may be reused across application restarts. ### [int](class_int#class-int) get\_ticks\_msec ( ) const Deprecated, use [Time.get\_ticks\_msec](class_time#class-time-method-get-ticks-msec) instead. Returns the amount of time passed in milliseconds since the engine started. ### [int](class_int#class-int) get\_ticks\_usec ( ) const Deprecated, use [Time.get\_ticks\_usec](class_time#class-time-method-get-ticks-usec) instead. Returns the amount of time passed in microseconds since the engine started. ### [Dictionary](class_dictionary#class-dictionary) get\_time ( [bool](class_bool#class-bool) utc=false ) const Deprecated, use [Time.get\_time\_dict\_from\_system](class_time#class-time-method-get-time-dict-from-system) instead. Returns current time as a dictionary of keys: hour, minute, second. ### [Dictionary](class_dictionary#class-dictionary) get\_time\_zone\_info ( ) const Returns the current time zone as a dictionary with the keys: bias and name. ### [String](class_string#class-string) get\_unique\_id ( ) const Returns a string that is unique to the device. **Note:** This string may change without notice if the user reinstalls/upgrades their operating system or changes their hardware. This means it should generally not be used to encrypt persistent data as the data saved before an unexpected ID change would become inaccessible. The returned string may also be falsified using external programs, so do not rely on the string returned by [get\_unique\_id](#class-os-method-get-unique-id) for security purposes. **Note:** Returns an empty string on HTML5 and UWP, as this method isn't implemented on those platforms yet. ### [int](class_int#class-int) get\_unix\_time ( ) const Returns the current UNIX epoch timestamp in seconds. **Important:** This is the system clock that the user can manually set. **Never use** this method for precise time calculation since its results are also subject to automatic adjustments by the operating system. **Always use** [get\_ticks\_usec](#class-os-method-get-ticks-usec) or [get\_ticks\_msec](#class-os-method-get-ticks-msec) for precise time calculation instead, since they are guaranteed to be monotonic (i.e. never decrease). **Note:** To get a floating point timestamp with sub-second precision, use [Time.get\_unix\_time\_from\_system](class_time#class-time-method-get-unix-time-from-system). ### [int](class_int#class-int) get\_unix\_time\_from\_datetime ( [Dictionary](class_dictionary#class-dictionary) datetime ) const Gets an epoch time value from a dictionary of time values. `datetime` must be populated with the following keys: `year`, `month`, `day`, `hour`, `minute`, `second`. If the dictionary is empty `0` is returned. If some keys are omitted, they default to the equivalent values for the UNIX epoch timestamp 0 (1970-01-01 at 00:00:00 UTC). You can pass the output from [get\_datetime\_from\_unix\_time](#class-os-method-get-datetime-from-unix-time) directly into this function. Daylight Savings Time (`dst`), if present, is ignored. ### [String](class_string#class-string) get\_user\_data\_dir ( ) const Returns the absolute directory path where user data is written (`user://`). On Linux, this is `~/.local/share/godot/app_userdata/[project_name]`, or `~/.local/share/[custom_name]` if `use_custom_user_dir` is set. On macOS, this is `~/Library/Application Support/Godot/app_userdata/[project_name]`, or `~/Library/Application Support/[custom_name]` if `use_custom_user_dir` is set. On Windows, this is `%APPDATA%\Godot\app_userdata\[project_name]`, or `%APPDATA%\[custom_name]` if `use_custom_user_dir` is set. `%APPDATA%` expands to `%USERPROFILE%\AppData\Roaming`. If the project name is empty, `user://` falls back to `res://`. Not to be confused with [get\_data\_dir](#class-os-method-get-data-dir), which returns the *global* (non-project-specific) user data directory. ### [int](class_int#class-int) get\_video\_driver\_count ( ) const Returns the number of video drivers supported on the current platform. ### [String](class_string#class-string) get\_video\_driver\_name ( [VideoDriver](#enum-os-videodriver) driver ) const Returns the name of the video driver matching the given `driver` index. This index is a value from [VideoDriver](#enum-os-videodriver), and you can use [get\_current\_video\_driver](#class-os-method-get-current-video-driver) to get the current backend's index. ### [int](class_int#class-int) get\_virtual\_keyboard\_height ( ) Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden. ### [Rect2](class_rect2#class-rect2) get\_window\_safe\_area ( ) const Returns unobscured area of the window where interactive controls should be rendered. ### void global\_menu\_add\_item ( [String](class_string#class-string) menu, [String](class_string#class-string) label, [Variant](class_variant#class-variant) id, [Variant](class_variant#class-variant) meta ) Add a new item with text "label" to global menu. Use "\_dock" menu to add item to the macOS dock icon menu. **Note:** This method is implemented on macOS. ### void global\_menu\_add\_separator ( [String](class_string#class-string) menu ) Add a separator between items. Separators also occupy an index. **Note:** This method is implemented on macOS. ### void global\_menu\_clear ( [String](class_string#class-string) menu ) Clear the global menu, in effect removing all items. **Note:** This method is implemented on macOS. ### void global\_menu\_remove\_item ( [String](class_string#class-string) menu, [int](class_int#class-int) idx ) Removes the item at index "idx" from the global menu. Note that the indexes of items after the removed item are going to be shifted by one. **Note:** This method is implemented on macOS. ### [bool](class_bool#class-bool) has\_clipboard ( ) const Returns `true` if there is content on the clipboard. ### [bool](class_bool#class-bool) has\_environment ( [String](class_string#class-string) variable ) const Returns `true` if the environment variable with the name `variable` exists. **Note:** Double-check the casing of `variable`. Environment variable names are case-sensitive on all platforms except Windows. ### [bool](class_bool#class-bool) has\_feature ( [String](class_string#class-string) tag\_name ) const Returns `true` if the feature for the given feature tag is supported in the currently running instance, depending on the platform, build etc. Can be used to check whether you're currently running a debug build, on a certain platform or arch, etc. Refer to the [Feature Tags](https://docs.godotengine.org/en/3.5/tutorials/export/feature_tags.html) documentation for more details. **Note:** Tag names are case-sensitive. ### [bool](class_bool#class-bool) has\_touchscreen\_ui\_hint ( ) const Returns `true` if the device has a touchscreen or emulates one. ### [bool](class_bool#class-bool) has\_virtual\_keyboard ( ) const Returns `true` if the platform has a virtual keyboard, `false` otherwise. ### void hide\_virtual\_keyboard ( ) Hides the virtual keyboard if it is shown, does nothing otherwise. ### [bool](class_bool#class-bool) is\_debug\_build ( ) const Returns `true` if the Godot binary used to run the project is a *debug* export template, or when running in the editor. Returns `false` if the Godot binary used to run the project is a *release* export template. To check whether the Godot binary used to run the project is an export template (debug or release), use `OS.has_feature("standalone")` instead. ### [bool](class_bool#class-bool) is\_ok\_left\_and\_cancel\_right ( ) const Returns `true` if the **OK** button should appear on the left and **Cancel** on the right. ### [bool](class_bool#class-bool) is\_process\_running ( [int](class_int#class-int) pid ) const Returns `true` if the child process ID (`pid`) is still running or `false` if it has terminated. Must be a valid ID generated from [execute](#class-os-method-execute). **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows. ### [bool](class_bool#class-bool) is\_scancode\_unicode ( [int](class_int#class-int) code ) const Returns `true` if the input scancode corresponds to a Unicode character. ### [bool](class_bool#class-bool) is\_stdout\_verbose ( ) const Returns `true` if the engine was executed with `-v` (verbose stdout). ### [bool](class_bool#class-bool) is\_userfs\_persistent ( ) const If `true`, the `user://` file system is persistent, so that its state is the same after a player quits and starts the game again. Relevant to the HTML5 platform, where this persistence may be unavailable. ### [bool](class_bool#class-bool) is\_window\_always\_on\_top ( ) const Returns `true` if the window should always be on top of other windows. ### [bool](class_bool#class-bool) is\_window\_focused ( ) const Returns `true` if the window is currently focused. **Note:** Only implemented on desktop platforms. On other platforms, it will always return `true`. ### [int](class_int#class-int) keyboard\_get\_current\_layout ( ) const Returns active keyboard layout index. **Note:** This method is implemented on Linux, macOS and Windows. ### [int](class_int#class-int) keyboard\_get\_layout\_count ( ) const Returns the number of keyboard layouts. **Note:** This method is implemented on Linux, macOS and Windows. ### [String](class_string#class-string) keyboard\_get\_layout\_language ( [int](class_int#class-int) index ) const Returns the ISO-639/BCP-47 language code of the keyboard layout at position `index`. **Note:** This method is implemented on Linux, macOS and Windows. ### [String](class_string#class-string) keyboard\_get\_layout\_name ( [int](class_int#class-int) index ) const Returns the localized name of the keyboard layout at position `index`. **Note:** This method is implemented on Linux, macOS and Windows. ### [int](class_int#class-int) keyboard\_get\_scancode\_from\_physical ( [int](class_int#class-int) scancode ) const Converts a physical (US QWERTY) `scancode` to one in the active keyboard layout. **Note:** This method is implemented on Linux, macOS and Windows. ### void keyboard\_set\_current\_layout ( [int](class_int#class-int) index ) Sets active keyboard layout. **Note:** This method is implemented on Linux, macOS and Windows. ### [Error](class_%40globalscope#enum-globalscope-error) kill ( [int](class_int#class-int) pid ) Kill (terminate) the process identified by the given process ID (`pid`), e.g. the one returned by [execute](#class-os-method-execute) in non-blocking mode. See also [crash](#class-os-method-crash). **Note:** This method can also be used to kill processes that were not spawned by the game. **Note:** This method is implemented on Android, iOS, Linux, macOS and Windows. ### [Error](class_%40globalscope#enum-globalscope-error) move\_to\_trash ( [String](class_string#class-string) path ) const Moves the file or directory to the system's recycle bin. See also [Directory.remove](class_directory#class-directory-method-remove). The method takes only global paths, so you may need to use [ProjectSettings.globalize\_path](class_projectsettings#class-projectsettings-method-globalize-path). Do not use it for files in `res://` as it will not work in exported project. **Note:** If the user has disabled the recycle bin on their system, the file will be permanently deleted instead. ``` var file_to_remove = "user://slot1.sav" OS.move_to_trash(ProjectSettings.globalize_path(file_to_remove)) ``` ### void move\_window\_to\_foreground ( ) Moves the window to the front. **Note:** This method is implemented on Linux, macOS and Windows. ### [bool](class_bool#class-bool) native\_video\_is\_playing ( ) Returns `true` if native video is playing. **Note:** This method is only implemented on iOS. ### void native\_video\_pause ( ) Pauses native video playback. **Note:** This method is only implemented on iOS. ### [Error](class_%40globalscope#enum-globalscope-error) native\_video\_play ( [String](class_string#class-string) path, [float](class_float#class-float) volume, [String](class_string#class-string) audio\_track, [String](class_string#class-string) subtitle\_track ) Plays native video from the specified path, at the given volume and with audio and subtitle tracks. **Note:** This method is only implemented on iOS. ### void native\_video\_stop ( ) Stops native video playback. **Note:** This method is implemented on iOS. ### void native\_video\_unpause ( ) Resumes native video playback. **Note:** This method is implemented on iOS. ### void open\_midi\_inputs ( ) Initialises the singleton for the system MIDI driver. **Note:** This method is implemented on Linux, macOS and Windows. ### void print\_all\_resources ( [String](class_string#class-string) tofile="" ) Shows all resources in the game. Optionally, the list can be written to a file by specifying a file path in `tofile`. ### void print\_all\_textures\_by\_size ( ) Shows the list of loaded textures sorted by size in memory. ### void print\_resources\_by\_type ( [PoolStringArray](class_poolstringarray#class-poolstringarray) types ) Shows the number of resources loaded by the game of the given types. ### void print\_resources\_in\_use ( [bool](class_bool#class-bool) short=false ) Shows all resources currently used by the game. ### void request\_attention ( ) Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX. **Note:** This method is implemented on Linux, macOS and Windows. ### [bool](class_bool#class-bool) request\_permission ( [String](class_string#class-string) name ) At the moment this function is only used by `AudioDriverOpenSL` to request permission for `RECORD_AUDIO` on Android. ### [bool](class_bool#class-bool) request\_permissions ( ) With this function, you can request dangerous permissions since normal permissions are automatically granted at install time in Android applications. **Note:** This method is implemented on Android. ### [bool](class_bool#class-bool) set\_environment ( [String](class_string#class-string) variable, [String](class_string#class-string) value ) const Sets the value of the environment variable `variable` to `value`. The environment variable will be set for the Godot process and any process executed with [execute](#class-os-method-execute) after running [set\_environment](#class-os-method-set-environment). The environment variable will *not* persist to processes run after the Godot process was terminated. **Note:** Double-check the casing of `variable`. Environment variable names are case-sensitive on all platforms except Windows. ### void set\_icon ( [Image](class_image#class-image) icon ) Sets the game's icon using an [Image](class_image#class-image) resource. The same image is used for window caption, taskbar/dock and window selection dialog. Image is scaled as needed. **Note:** This method is implemented on HTML5, Linux, macOS and Windows. ### void set\_ime\_active ( [bool](class_bool#class-bool) active ) Sets whether IME input mode should be enabled. If active IME handles key events before the application and creates an composition string and suggestion list. Application can retrieve the composition status by using [get\_ime\_selection](#class-os-method-get-ime-selection) and [get\_ime\_text](#class-os-method-get-ime-text) functions. Completed composition string is committed when input is finished. **Note:** This method is implemented on Linux, macOS and Windows. ### void set\_ime\_position ( [Vector2](class_vector2#class-vector2) position ) Sets position of IME suggestion list popup (in window coordinates). **Note:** This method is implemented on Linux, macOS and Windows. ### void set\_native\_icon ( [String](class_string#class-string) filename ) Sets the game's icon using a multi-size platform-specific icon file (`*.ico` on Windows and `*.icns` on macOS). Appropriate size sub-icons are used for window caption, taskbar/dock and window selection dialog. **Note:** This method is implemented on macOS and Windows. ### [Error](class_%40globalscope#enum-globalscope-error) set\_thread\_name ( [String](class_string#class-string) name ) Sets the name of the current thread. ### void set\_use\_file\_access\_save\_and\_swap ( [bool](class_bool#class-bool) enabled ) Enables backup saves if `enabled` is `true`. ### void set\_window\_always\_on\_top ( [bool](class_bool#class-bool) enabled ) Sets whether the window should always be on top. **Note:** This method is implemented on Linux, macOS and Windows. ### void set\_window\_mouse\_passthrough ( [PoolVector2Array](class_poolvector2array#class-poolvector2array) region ) Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through. Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior). ``` # Set region, using Path2D node. OS.set_window_mouse_passthrough($Path2D.curve.get_baked_points()) # Set region, using Polygon2D node. OS.set_window_mouse_passthrough($Polygon2D.polygon) # Reset region to default. OS.set_window_mouse_passthrough([]) ``` **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is. **Note:** This method is implemented on Linux, macOS and Windows. ### void set\_window\_title ( [String](class_string#class-string) title ) Sets the window title to the specified string. **Note:** This should be used sporadically. Don't set this every frame, as that will negatively affect performance on some window managers. **Note:** This method is implemented on HTML5, Linux, macOS and Windows. ### [Error](class_%40globalscope#enum-globalscope-error) shell\_open ( [String](class_string#class-string) uri ) Requests the OS to open a resource with the most appropriate program. For example: * `OS.shell_open("C:\\Users\name\Downloads")` on Windows opens the file explorer at the user's Downloads folder. * `OS.shell_open("https://godotengine.org")` opens the default web browser on the official Godot website. * `OS.shell_open("mailto:[email protected]")` opens the default email client with the "To" field set to `[email protected]`. See [RFC 2368 - The [code]mailto[/code] URL scheme](https://datatracker.ietf.org/doc/html/rfc2368) for a list of fields that can be added. Use [ProjectSettings.globalize\_path](class_projectsettings#class-projectsettings-method-globalize-path) to convert a `res://` or `user://` path into a system path for use with this method. **Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS and Windows. ### void show\_virtual\_keyboard ( [String](class_string#class-string) existing\_text="", [bool](class_bool#class-bool) multiline=false ) Shows the virtual keyboard if the platform has one. The `existing_text` parameter is useful for implementing your own [LineEdit](class_lineedit#class-lineedit) or [TextEdit](class_textedit#class-textedit), as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions). The `multiline` parameter needs to be set to `true` to be able to enter multiple lines of text, as in [TextEdit](class_textedit#class-textedit). **Note:** This method is implemented on Android, iOS and UWP.
programming_docs
godot Viewport Viewport ======== **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) Creates a sub-view into the screen. Description ----------- A Viewport creates a different view into the screen, or a sub-view inside another viewport. Children 2D Nodes will display on it, and children Camera 3D nodes will render on it too. Optionally, a viewport can have its own 2D or 3D world, so they don't share what they draw with other viewports. If a viewport is a child of a [ViewportContainer](class_viewportcontainer#class-viewportcontainer), it will automatically take up its size, otherwise it must be set manually. Viewports can also choose to be audio listeners, so they generate positional audio depending on a 2D or 3D camera child of it. Also, viewports can be assigned to different screens in case the devices have multiple screens. Finally, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw. **Note:** By default, a newly created Viewport in Godot 3.x will appear to be upside down. Enabling [render\_target\_v\_flip](#class-viewport-property-render-target-v-flip) will display the Viewport with the correct orientation. Tutorials --------- * [Viewport and canvas transforms](https://docs.godotengine.org/en/3.5/tutorials/2d/2d_transforms.html) * [Viewports tutorial index](https://docs.godotengine.org/en/3.5/tutorials/rendering/index.html) * [GUI in 3D Demo](https://godotengine.org/asset-library/asset/127) * [3D in 2D Demo](https://godotengine.org/asset-library/asset/128) * [2D in 3D Demo](https://godotengine.org/asset-library/asset/129) * [Screen Capture Demo](https://godotengine.org/asset-library/asset/130) * [Dynamic Split Screen Demo](https://godotengine.org/asset-library/asset/541) * [3D Viewport Scaling Demo](https://godotengine.org/asset-library/asset/586) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [arvr](#class-viewport-property-arvr) | `false` | | [bool](class_bool#class-bool) | [audio\_listener\_enable\_2d](#class-viewport-property-audio-listener-enable-2d) | `false` | | [bool](class_bool#class-bool) | [audio\_listener\_enable\_3d](#class-viewport-property-audio-listener-enable-3d) | `false` | | [Transform2D](class_transform2d#class-transform2d) | [canvas\_transform](#class-viewport-property-canvas-transform) | | | [bool](class_bool#class-bool) | [debanding](#class-viewport-property-debanding) | `false` | | [DebugDraw](#enum-viewport-debugdraw) | [debug\_draw](#class-viewport-property-debug-draw) | `0` | | [bool](class_bool#class-bool) | [disable\_3d](#class-viewport-property-disable-3d) | `false` | | [bool](class_bool#class-bool) | [fxaa](#class-viewport-property-fxaa) | `false` | | [Transform2D](class_transform2d#class-transform2d) | [global\_canvas\_transform](#class-viewport-property-global-canvas-transform) | | | [bool](class_bool#class-bool) | [gui\_disable\_input](#class-viewport-property-gui-disable-input) | `false` | | [bool](class_bool#class-bool) | [gui\_snap\_controls\_to\_pixels](#class-viewport-property-gui-snap-controls-to-pixels) | `true` | | [bool](class_bool#class-bool) | [handle\_input\_locally](#class-viewport-property-handle-input-locally) | `true` | | [bool](class_bool#class-bool) | [hdr](#class-viewport-property-hdr) | `true` | | [bool](class_bool#class-bool) | [keep\_3d\_linear](#class-viewport-property-keep-3d-linear) | `false` | | [MSAA](#enum-viewport-msaa) | [msaa](#class-viewport-property-msaa) | `0` | | [bool](class_bool#class-bool) | [own\_world](#class-viewport-property-own-world) | `false` | | [bool](class_bool#class-bool) | [physics\_object\_picking](#class-viewport-property-physics-object-picking) | `false` | | [bool](class_bool#class-bool) | [render\_direct\_to\_screen](#class-viewport-property-render-direct-to-screen) | `false` | | [ClearMode](#enum-viewport-clearmode) | [render\_target\_clear\_mode](#class-viewport-property-render-target-clear-mode) | `0` | | [UpdateMode](#enum-viewport-updatemode) | [render\_target\_update\_mode](#class-viewport-property-render-target-update-mode) | `2` | | [bool](class_bool#class-bool) | [render\_target\_v\_flip](#class-viewport-property-render-target-v-flip) | `false` | | [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) | [shadow\_atlas\_quad\_0](#class-viewport-property-shadow-atlas-quad-0) | `2` | | [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) | [shadow\_atlas\_quad\_1](#class-viewport-property-shadow-atlas-quad-1) | `2` | | [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) | [shadow\_atlas\_quad\_2](#class-viewport-property-shadow-atlas-quad-2) | `3` | | [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) | [shadow\_atlas\_quad\_3](#class-viewport-property-shadow-atlas-quad-3) | `4` | | [int](class_int#class-int) | [shadow\_atlas\_size](#class-viewport-property-shadow-atlas-size) | `0` | | [float](class_float#class-float) | [sharpen\_intensity](#class-viewport-property-sharpen-intensity) | `0.0` | | [Vector2](class_vector2#class-vector2) | [size](#class-viewport-property-size) | `Vector2( 0, 0 )` | | [bool](class_bool#class-bool) | [size\_override\_stretch](#class-viewport-property-size-override-stretch) | `false` | | [bool](class_bool#class-bool) | [transparent\_bg](#class-viewport-property-transparent-bg) | `false` | | [Usage](#enum-viewport-usage) | [usage](#class-viewport-property-usage) | `2` | | [bool](class_bool#class-bool) | [use\_32\_bpc\_depth](#class-viewport-property-use-32-bpc-depth) | `false` | | [World](class_world#class-world) | [world](#class-viewport-property-world) | | | [World2D](class_world2d#class-world2d) | [world\_2d](#class-viewport-property-world-2d) | | Methods ------- | | | | --- | --- | | [World](class_world#class-world) | [find\_world](#class-viewport-method-find-world) **(** **)** const | | [World2D](class_world2d#class-world2d) | [find\_world\_2d](#class-viewport-method-find-world-2d) **(** **)** const | | [Camera](class_camera#class-camera) | [get\_camera](#class-viewport-method-get-camera) **(** **)** const | | [Transform2D](class_transform2d#class-transform2d) | [get\_final\_transform](#class-viewport-method-get-final-transform) **(** **)** const | | [Control](class_control#class-control) | [get\_modal\_stack\_top](#class-viewport-method-get-modal-stack-top) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_mouse\_position](#class-viewport-method-get-mouse-position) **(** **)** const | | [int](class_int#class-int) | [get\_render\_info](#class-viewport-method-get-render-info) **(** [RenderInfo](#enum-viewport-renderinfo) info **)** | | [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) | [get\_shadow\_atlas\_quadrant\_subdiv](#class-viewport-method-get-shadow-atlas-quadrant-subdiv) **(** [int](class_int#class-int) quadrant **)** const | | [Vector2](class_vector2#class-vector2) | [get\_size\_override](#class-viewport-method-get-size-override) **(** **)** const | | [ViewportTexture](class_viewporttexture#class-viewporttexture) | [get\_texture](#class-viewport-method-get-texture) **(** **)** const | | [RID](class_rid#class-rid) | [get\_viewport\_rid](#class-viewport-method-get-viewport-rid) **(** **)** const | | [Rect2](class_rect2#class-rect2) | [get\_visible\_rect](#class-viewport-method-get-visible-rect) **(** **)** const | | [Variant](class_variant#class-variant) | [gui\_get\_drag\_data](#class-viewport-method-gui-get-drag-data) **(** **)** const | | [bool](class_bool#class-bool) | [gui\_has\_modal\_stack](#class-viewport-method-gui-has-modal-stack) **(** **)** const | | [bool](class_bool#class-bool) | [gui\_is\_drag\_successful](#class-viewport-method-gui-is-drag-successful) **(** **)** const | | [bool](class_bool#class-bool) | [gui\_is\_dragging](#class-viewport-method-gui-is-dragging) **(** **)** const | | void | [input](#class-viewport-method-input) **(** [InputEvent](class_inputevent#class-inputevent) local\_event **)** | | [bool](class_bool#class-bool) | [is\_input\_handled](#class-viewport-method-is-input-handled) **(** **)** const | | [bool](class_bool#class-bool) | [is\_size\_override\_enabled](#class-viewport-method-is-size-override-enabled) **(** **)** const | | void | [set\_attach\_to\_screen\_rect](#class-viewport-method-set-attach-to-screen-rect) **(** [Rect2](class_rect2#class-rect2) rect **)** | | void | [set\_input\_as\_handled](#class-viewport-method-set-input-as-handled) **(** **)** | | void | [set\_shadow\_atlas\_quadrant\_subdiv](#class-viewport-method-set-shadow-atlas-quadrant-subdiv) **(** [int](class_int#class-int) quadrant, [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) subdiv **)** | | void | [set\_size\_override](#class-viewport-method-set-size-override) **(** [bool](class_bool#class-bool) enable, [Vector2](class_vector2#class-vector2) size=Vector2( -1, -1 ), [Vector2](class_vector2#class-vector2) margin=Vector2( 0, 0 ) **)** | | void | [unhandled\_input](#class-viewport-method-unhandled-input) **(** [InputEvent](class_inputevent#class-inputevent) local\_event **)** | | void | [update\_worlds](#class-viewport-method-update-worlds) **(** **)** | | void | [warp\_mouse](#class-viewport-method-warp-mouse) **(** [Vector2](class_vector2#class-vector2) to\_position **)** | Signals ------- ### gui\_focus\_changed ( [Control](class_control#class-control) node ) Emitted when a Control node grabs keyboard focus. ### size\_changed ( ) Emitted when the size of the viewport is changed, whether by [set\_size\_override](#class-viewport-method-set-size-override), resize of window, or some other means. Enumerations ------------ enum **UpdateMode**: * **UPDATE\_DISABLED** = **0** --- Do not update the render target. * **UPDATE\_ONCE** = **1** --- Update the render target once, then switch to [UPDATE\_DISABLED](#class-viewport-constant-update-disabled). * **UPDATE\_WHEN\_VISIBLE** = **2** --- Update the render target only when it is visible. This is the default value. * **UPDATE\_ALWAYS** = **3** --- Always update the render target. enum **ShadowAtlasQuadrantSubdiv**: * **SHADOW\_ATLAS\_QUADRANT\_SUBDIV\_DISABLED** = **0** --- This quadrant will not be used. * **SHADOW\_ATLAS\_QUADRANT\_SUBDIV\_1** = **1** --- This quadrant will only be used by one shadow map. * **SHADOW\_ATLAS\_QUADRANT\_SUBDIV\_4** = **2** --- This quadrant will be split in 4 and used by up to 4 shadow maps. * **SHADOW\_ATLAS\_QUADRANT\_SUBDIV\_16** = **3** --- This quadrant will be split 16 ways and used by up to 16 shadow maps. * **SHADOW\_ATLAS\_QUADRANT\_SUBDIV\_64** = **4** --- This quadrant will be split 64 ways and used by up to 64 shadow maps. * **SHADOW\_ATLAS\_QUADRANT\_SUBDIV\_256** = **5** --- This quadrant will be split 256 ways and used by up to 256 shadow maps. Unless the [shadow\_atlas\_size](#class-viewport-property-shadow-atlas-size) is very high, the shadows in this quadrant will be very low resolution. * **SHADOW\_ATLAS\_QUADRANT\_SUBDIV\_1024** = **6** --- This quadrant will be split 1024 ways and used by up to 1024 shadow maps. Unless the [shadow\_atlas\_size](#class-viewport-property-shadow-atlas-size) is very high, the shadows in this quadrant will be very low resolution. * **SHADOW\_ATLAS\_QUADRANT\_SUBDIV\_MAX** = **7** --- Represents the size of the [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) enum. enum **RenderInfo**: * **RENDER\_INFO\_OBJECTS\_IN\_FRAME** = **0** --- Amount of objects in frame. * **RENDER\_INFO\_VERTICES\_IN\_FRAME** = **1** --- Amount of vertices in frame. * **RENDER\_INFO\_MATERIAL\_CHANGES\_IN\_FRAME** = **2** --- Amount of material changes in frame. * **RENDER\_INFO\_SHADER\_CHANGES\_IN\_FRAME** = **3** --- Amount of shader changes in frame. * **RENDER\_INFO\_SURFACE\_CHANGES\_IN\_FRAME** = **4** --- Amount of surface changes in frame. * **RENDER\_INFO\_DRAW\_CALLS\_IN\_FRAME** = **5** --- Amount of draw calls in frame. * **RENDER\_INFO\_2D\_ITEMS\_IN\_FRAME** = **6** --- Amount of items or joined items in frame. * **RENDER\_INFO\_2D\_DRAW\_CALLS\_IN\_FRAME** = **7** --- Amount of draw calls in frame. * **RENDER\_INFO\_MAX** = **8** --- Represents the size of the [RenderInfo](#enum-viewport-renderinfo) enum. enum **DebugDraw**: * **DEBUG\_DRAW\_DISABLED** = **0** --- Objects are displayed normally. * **DEBUG\_DRAW\_UNSHADED** = **1** --- Objects are displayed without light information. * **DEBUG\_DRAW\_OVERDRAW** = **2** --- Objected are displayed semi-transparent with additive blending so you can see where they intersect. * **DEBUG\_DRAW\_WIREFRAME** = **3** --- Objects are displayed in wireframe style. enum **MSAA**: * **MSAA\_DISABLED** = **0** --- Multisample anti-aliasing mode disabled. This is the default value. * **MSAA\_2X** = **1** --- Use 2x Multisample Antialiasing. * **MSAA\_4X** = **2** --- Use 4x Multisample Antialiasing. * **MSAA\_8X** = **3** --- Use 8x Multisample Antialiasing. Likely unsupported on low-end and older hardware. * **MSAA\_16X** = **4** --- Use 16x Multisample Antialiasing. Likely unsupported on medium and low-end hardware. enum **Usage**: * **USAGE\_2D** = **0** --- Allocates all buffers needed for drawing 2D scenes. This takes less VRAM than the 3D usage modes. Note that 3D rendering effects such as glow and HDR are not available when using this mode. * **USAGE\_2D\_NO\_SAMPLING** = **1** --- Allocates buffers needed for 2D scenes without allocating a buffer for screen copy. Accordingly, you cannot read from the screen. Of the [Usage](#enum-viewport-usage) types, this requires the least VRAM. Note that 3D rendering effects such as glow and HDR are not available when using this mode. * **USAGE\_3D** = **2** --- Allocates full buffers for drawing 3D scenes and all 3D effects including buffers needed for 2D scenes and effects. * **USAGE\_3D\_NO\_EFFECTS** = **3** --- Allocates buffers needed for drawing 3D scenes. But does not allocate buffers needed for reading from the screen and post-processing effects. Saves some VRAM. enum **ClearMode**: * **CLEAR\_MODE\_ALWAYS** = **0** --- Always clear the render target before drawing. * **CLEAR\_MODE\_NEVER** = **1** --- Never clear the render target. * **CLEAR\_MODE\_ONLY\_NEXT\_FRAME** = **2** --- Clear the render target next frame, then switch to [CLEAR\_MODE\_NEVER](#class-viewport-constant-clear-mode-never). Property Descriptions --------------------- ### [bool](class_bool#class-bool) arvr | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_arvr(value) | | *Getter* | use\_arvr() | If `true`, the viewport will be used in AR/VR process. ### [bool](class_bool#class-bool) audio\_listener\_enable\_2d | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_as\_audio\_listener\_2d(value) | | *Getter* | is\_audio\_listener\_2d() | If `true`, the viewport will process 2D audio streams. ### [bool](class_bool#class-bool) audio\_listener\_enable\_3d | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_as\_audio\_listener(value) | | *Getter* | is\_audio\_listener() | If `true`, the viewport will process 3D audio streams. ### [Transform2D](class_transform2d#class-transform2d) canvas\_transform | | | | --- | --- | | *Setter* | set\_canvas\_transform(value) | | *Getter* | get\_canvas\_transform() | The canvas transform of the viewport, useful for changing the on-screen positions of all child [CanvasItem](class_canvasitem#class-canvasitem)s. This is relative to the global canvas transform of the viewport. ### [bool](class_bool#class-bool) debanding | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_debanding(value) | | *Getter* | get\_use\_debanding() | If `true`, uses a fast post-processing filter to make banding significantly less visible. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger. **Note:** Only available on the GLES3 backend. [hdr](#class-viewport-property-hdr) must also be `true` for debanding to be effective. ### [DebugDraw](#enum-viewport-debugdraw) debug\_draw | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_debug\_draw(value) | | *Getter* | get\_debug\_draw() | The overlay mode for test rendered geometry in debug purposes. ### [bool](class_bool#class-bool) disable\_3d | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_disable\_3d(value) | | *Getter* | is\_3d\_disabled() | If `true`, the viewport will disable 3D rendering. For actual disabling use `usage`. ### [bool](class_bool#class-bool) fxaa | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_fxaa(value) | | *Getter* | get\_use\_fxaa() | Enables fast approximate antialiasing. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. Some of the lost sharpness can be recovered by enabling contrast-adaptive sharpening (see [sharpen\_intensity](#class-viewport-property-sharpen-intensity)). ### [Transform2D](class_transform2d#class-transform2d) global\_canvas\_transform | | | | --- | --- | | *Setter* | set\_global\_canvas\_transform(value) | | *Getter* | get\_global\_canvas\_transform() | The global canvas transform of the viewport. The canvas transform is relative to this. ### [bool](class_bool#class-bool) gui\_disable\_input | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_disable\_input(value) | | *Getter* | is\_input\_disabled() | If `true`, the viewport will not receive input events. ### [bool](class_bool#class-bool) gui\_snap\_controls\_to\_pixels | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_snap\_controls\_to\_pixels(value) | | *Getter* | is\_snap\_controls\_to\_pixels\_enabled() | If `true`, the GUI controls on the viewport will lay pixel perfectly. ### [bool](class_bool#class-bool) handle\_input\_locally | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_handle\_input\_locally(value) | | *Getter* | is\_handling\_input\_locally() | ### [bool](class_bool#class-bool) hdr | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_hdr(value) | | *Getter* | get\_hdr() | If `true`, the viewport rendering will receive benefits from High Dynamic Range algorithm. High Dynamic Range allows the viewport to receive values that are outside the 0-1 range. In Godot, HDR uses half floating-point precision (16-bit) by default. To use full floating-point precision (32-bit), enable [use\_32\_bpc\_depth](#class-viewport-property-use-32-bpc-depth). **Note:** Requires [usage](#class-viewport-property-usage) to be set to [USAGE\_3D](#class-viewport-constant-usage-3d) or [USAGE\_3D\_NO\_EFFECTS](#class-viewport-constant-usage-3d-no-effects), since HDR is not supported for 2D. **Note:** Only available on the GLES3 backend. ### [bool](class_bool#class-bool) keep\_3d\_linear | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_keep\_3d\_linear(value) | | *Getter* | get\_keep\_3d\_linear() | If `true`, the result after 3D rendering will not have a linear to sRGB color conversion applied. This is important when the viewport is used as a render target where the result is used as a texture on a 3D object rendered in another viewport. It is also important if the viewport is used to create data that is not color based (noise, heightmaps, pickmaps, etc.). Do not enable this when the viewport is used as a texture on a 2D object or if the viewport is your final output. For the GLES2 driver this will convert the sRGB output to linear, this should only be used for VR plugins that require input in linear color space! ### [MSAA](#enum-viewport-msaa) msaa | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_msaa(value) | | *Getter* | get\_msaa() | The multisample anti-aliasing mode. A higher number results in smoother edges at the cost of significantly worse performance. A value of 4 is best unless targeting very high-end systems. ### [bool](class_bool#class-bool) own\_world | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_own\_world(value) | | *Getter* | is\_using\_own\_world() | If `true`, the viewport will use a unique copy of the [World](class_world#class-world) defined in [world](#class-viewport-property-world). ### [bool](class_bool#class-bool) physics\_object\_picking | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_physics\_object\_picking(value) | | *Getter* | get\_physics\_object\_picking() | If `true`, the objects rendered by viewport become subjects of mouse picking process. ### [bool](class_bool#class-bool) render\_direct\_to\_screen | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_render\_direct\_to\_screen(value) | | *Getter* | is\_using\_render\_direct\_to\_screen() | If `true`, renders the Viewport directly to the screen instead of to the root viewport. Only available in GLES2. This is a low-level optimization and should not be used in most cases. If used, reading from the Viewport or from `SCREEN_TEXTURE` becomes unavailable. For more information see [VisualServer.viewport\_set\_render\_direct\_to\_screen](class_visualserver#class-visualserver-method-viewport-set-render-direct-to-screen). ### [ClearMode](#enum-viewport-clearmode) render\_target\_clear\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_clear\_mode(value) | | *Getter* | get\_clear\_mode() | The clear mode when viewport used as a render target. **Note:** This property is intended for 2D usage. ### [UpdateMode](#enum-viewport-updatemode) render\_target\_update\_mode | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_update\_mode(value) | | *Getter* | get\_update\_mode() | The update mode when viewport used as a render target. ### [bool](class_bool#class-bool) render\_target\_v\_flip | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_vflip(value) | | *Getter* | get\_vflip() | If `true`, the result of rendering will be flipped vertically. Since Viewports in Godot 3.x render upside-down, it's recommended to set this to `true` in most situations. ### [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) shadow\_atlas\_quad\_0 | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_shadow\_atlas\_quadrant\_subdiv(value) | | *Getter* | get\_shadow\_atlas\_quadrant\_subdiv() | The subdivision amount of the first quadrant on the shadow atlas. ### [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) shadow\_atlas\_quad\_1 | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_shadow\_atlas\_quadrant\_subdiv(value) | | *Getter* | get\_shadow\_atlas\_quadrant\_subdiv() | The subdivision amount of the second quadrant on the shadow atlas. ### [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) shadow\_atlas\_quad\_2 | | | | --- | --- | | *Default* | `3` | | *Setter* | set\_shadow\_atlas\_quadrant\_subdiv(value) | | *Getter* | get\_shadow\_atlas\_quadrant\_subdiv() | The subdivision amount of the third quadrant on the shadow atlas. ### [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) shadow\_atlas\_quad\_3 | | | | --- | --- | | *Default* | `4` | | *Setter* | set\_shadow\_atlas\_quadrant\_subdiv(value) | | *Getter* | get\_shadow\_atlas\_quadrant\_subdiv() | The subdivision amount of the fourth quadrant on the shadow atlas. ### [int](class_int#class-int) shadow\_atlas\_size | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_shadow\_atlas\_size(value) | | *Getter* | get\_shadow\_atlas\_size() | The shadow atlas' resolution (used for omni and spot lights). The value will be rounded up to the nearest power of 2. **Note:** If this is set to `0`, both point *and* directional shadows won't be visible. Since user-created viewports default to a value of `0`, this value must be set above `0` manually (typically at least `256`). ### [float](class_float#class-float) sharpen\_intensity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_sharpen\_intensity(value) | | *Getter* | get\_sharpen\_intensity() | If set to a value greater than `0.0`, contrast-adaptive sharpening will be applied to the 3D viewport. This has a low performance cost and can be used to recover some of the sharpness lost from using FXAA. Values around `0.5` generally give the best results. See also [fxaa](#class-viewport-property-fxaa). ### [Vector2](class_vector2#class-vector2) size | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_size(value) | | *Getter* | get\_size() | The width and height of viewport. Must be set to a value greater than or equal to 2 pixels on both dimensions. Otherwise, nothing will be displayed. ### [bool](class_bool#class-bool) size\_override\_stretch | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_size\_override\_stretch(value) | | *Getter* | is\_size\_override\_stretch\_enabled() | If `true`, the size override affects stretch as well. ### [bool](class_bool#class-bool) transparent\_bg | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_transparent\_background(value) | | *Getter* | has\_transparent\_background() | If `true`, the viewport should render its background as transparent. ### [Usage](#enum-viewport-usage) usage | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_usage(value) | | *Getter* | get\_usage() | The rendering mode of viewport. **Note:** If set to [USAGE\_2D](#class-viewport-constant-usage-2d) or [USAGE\_2D\_NO\_SAMPLING](#class-viewport-constant-usage-2d-no-sampling), [hdr](#class-viewport-property-hdr) will have no effect when enabled since HDR is not supported for 2D. ### [bool](class_bool#class-bool) use\_32\_bpc\_depth | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_32\_bpc\_depth(value) | | *Getter* | get\_use\_32\_bpc\_depth() | If `true`, allocates the viewport's framebuffer with full floating-point precision (32-bit) instead of half floating-point precision (16-bit). Only effective when [hdr](#class-viewport-property-hdr) is also enabled. **Note:** Enabling this setting does not improve rendering quality. Using full floating-point precision is slower, and is generally only needed for advanced shaders that require a high level of precision. To reduce banding, enable [debanding](#class-viewport-property-debanding) instead. **Note:** Only available on the GLES3 backend. ### [World](class_world#class-world) world | | | | --- | --- | | *Setter* | set\_world(value) | | *Getter* | get\_world() | The custom [World](class_world#class-world) which can be used as 3D environment source. ### [World2D](class_world2d#class-world2d) world\_2d | | | | --- | --- | | *Setter* | set\_world\_2d(value) | | *Getter* | get\_world\_2d() | The custom [World2D](class_world2d#class-world2d) which can be used as 2D environment source. Method Descriptions ------------------- ### [World](class_world#class-world) find\_world ( ) const Returns the first valid [World](class_world#class-world) for this viewport, searching the [world](#class-viewport-property-world) property of itself and any Viewport ancestor. ### [World2D](class_world2d#class-world2d) find\_world\_2d ( ) const Returns the first valid [World2D](class_world2d#class-world2d) for this viewport, searching the [world\_2d](#class-viewport-property-world-2d) property of itself and any Viewport ancestor. ### [Camera](class_camera#class-camera) get\_camera ( ) const Returns the active 3D camera. ### [Transform2D](class_transform2d#class-transform2d) get\_final\_transform ( ) const Returns the total transform of the viewport. ### [Control](class_control#class-control) get\_modal\_stack\_top ( ) const Returns the topmost modal in the stack. ### [Vector2](class_vector2#class-vector2) get\_mouse\_position ( ) const Returns the mouse's position in this `Viewport` using the coordinate system of this `Viewport`. ### [int](class_int#class-int) get\_render\_info ( [RenderInfo](#enum-viewport-renderinfo) info ) Returns information about the viewport from the rendering pipeline. ### [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) get\_shadow\_atlas\_quadrant\_subdiv ( [int](class_int#class-int) quadrant ) const Returns the [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) of the specified quadrant. ### [Vector2](class_vector2#class-vector2) get\_size\_override ( ) const Returns the size override set with [set\_size\_override](#class-viewport-method-set-size-override). ### [ViewportTexture](class_viewporttexture#class-viewporttexture) get\_texture ( ) const Returns the viewport's texture. **Note:** Due to the way OpenGL works, the resulting [ViewportTexture](class_viewporttexture#class-viewporttexture) is flipped vertically. You can use [Image.flip\_y](class_image#class-image-method-flip-y) on the result of [Texture.get\_data](class_texture#class-texture-method-get-data) to flip it back, for example: ``` var img = get_viewport().get_texture().get_data() img.flip_y() ``` ### [RID](class_rid#class-rid) get\_viewport\_rid ( ) const Returns the viewport's RID from the [VisualServer](class_visualserver#class-visualserver). ### [Rect2](class_rect2#class-rect2) get\_visible\_rect ( ) const Returns the visible rectangle in global screen coordinates. ### [Variant](class_variant#class-variant) gui\_get\_drag\_data ( ) const Returns the drag data from the GUI, that was previously returned by [Control.get\_drag\_data](class_control#class-control-method-get-drag-data). ### [bool](class_bool#class-bool) gui\_has\_modal\_stack ( ) const Returns `true` if there are visible modals on-screen. ### [bool](class_bool#class-bool) gui\_is\_drag\_successful ( ) const Returns `true` if the drag operation is successful. ### [bool](class_bool#class-bool) gui\_is\_dragging ( ) const Returns `true` if the viewport is currently performing a drag operation. Alternative to [Node.NOTIFICATION\_DRAG\_BEGIN](class_node#class-node-constant-notification-drag-begin) and [Node.NOTIFICATION\_DRAG\_END](class_node#class-node-constant-notification-drag-end) when you prefer polling the value. ### void input ( [InputEvent](class_inputevent#class-inputevent) local\_event ) ### [bool](class_bool#class-bool) is\_input\_handled ( ) const ### [bool](class_bool#class-bool) is\_size\_override\_enabled ( ) const Returns `true` if the size override is enabled. See [set\_size\_override](#class-viewport-method-set-size-override). ### void set\_attach\_to\_screen\_rect ( [Rect2](class_rect2#class-rect2) rect ) Attaches this `Viewport` to the root `Viewport` with the specified rectangle. This bypasses the need for another node to display this `Viewport` but makes you responsible for updating the position of this `Viewport` manually. ### void set\_input\_as\_handled ( ) Stops the input from propagating further down the [SceneTree](class_scenetree#class-scenetree). ### void set\_shadow\_atlas\_quadrant\_subdiv ( [int](class_int#class-int) quadrant, [ShadowAtlasQuadrantSubdiv](#enum-viewport-shadowatlasquadrantsubdiv) subdiv ) Sets the number of subdivisions to use in the specified quadrant. A higher number of subdivisions allows you to have more shadows in the scene at once, but reduces the quality of the shadows. A good practice is to have quadrants with a varying number of subdivisions and to have as few subdivisions as possible. ### void set\_size\_override ( [bool](class_bool#class-bool) enable, [Vector2](class_vector2#class-vector2) size=Vector2( -1, -1 ), [Vector2](class_vector2#class-vector2) margin=Vector2( 0, 0 ) ) Sets the size override of the viewport. If the `enable` parameter is `true` the override is used, otherwise it uses the default size. If the size parameter is `(-1, -1)`, it won't update the size. ### void unhandled\_input ( [InputEvent](class_inputevent#class-inputevent) local\_event ) ### void update\_worlds ( ) Forces update of the 2D and 3D worlds. ### void warp\_mouse ( [Vector2](class_vector2#class-vector2) to\_position ) Moves the mouse pointer to the specified position in this `Viewport` using the coordinate system of this `Viewport`.
programming_docs
godot WebSocketMultiplayerPeer WebSocketMultiplayerPeer ======================== **Inherits:** [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer) **<** [PacketPeer](class_packetpeer#class-packetpeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [WebSocketClient](class_websocketclient#class-websocketclient), [WebSocketServer](class_websocketserver#class-websocketserver) Base class for WebSocket server and client. Description ----------- Base class for WebSocket server and client, allowing them to be used as network peer for the [MultiplayerAPI](class_multiplayerapi#class-multiplayerapi). Methods ------- | | | | --- | --- | | [WebSocketPeer](class_websocketpeer#class-websocketpeer) | [get\_peer](#class-websocketmultiplayerpeer-method-get-peer) **(** [int](class_int#class-int) peer\_id **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [set\_buffers](#class-websocketmultiplayerpeer-method-set-buffers) **(** [int](class_int#class-int) input\_buffer\_size\_kb, [int](class_int#class-int) input\_max\_packets, [int](class_int#class-int) output\_buffer\_size\_kb, [int](class_int#class-int) output\_max\_packets **)** | Signals ------- ### peer\_packet ( [int](class_int#class-int) peer\_source ) Emitted when a packet is received from a peer. **Note:** This signal is only emitted when the client or server is configured to use Godot multiplayer API. Method Descriptions ------------------- ### [WebSocketPeer](class_websocketpeer#class-websocketpeer) get\_peer ( [int](class_int#class-int) peer\_id ) const Returns the [WebSocketPeer](class_websocketpeer#class-websocketpeer) associated to the given `peer_id`. ### [Error](class_%40globalscope#enum-globalscope-error) set\_buffers ( [int](class_int#class-int) input\_buffer\_size\_kb, [int](class_int#class-int) input\_max\_packets, [int](class_int#class-int) output\_buffer\_size\_kb, [int](class_int#class-int) output\_max\_packets ) Configures the buffer sizes for this WebSocket peer. Default values can be specified in the Project Settings under `network/limits`. For server, values are meant per connected peer. The first two parameters define the size and queued packets limits of the input buffer, the last two of the output buffer. Buffer sizes are expressed in KiB, so `4 = 2^12 = 4096 bytes`. All parameters will be rounded up to the nearest power of two. **Note:** HTML5 exports only use the input buffer since the output one is managed by browsers. godot Vector2 Vector2 ======= Vector used for 2D math. Description ----------- 2-element structure that can be used to represent positions in 2D space or any other pair of numeric values. **Note:** In a boolean context, a Vector2 will evaluate to `false` if it's equal to `Vector2(0, 0)`. Otherwise, a Vector2 will always evaluate to `true`. Tutorials --------- * [Math tutorial index](https://docs.godotengine.org/en/3.5/tutorials/math/index.html) * [Vector math](https://docs.godotengine.org/en/3.5/tutorials/math/vector_math.html) * [Advanced vector math](https://docs.godotengine.org/en/3.5/tutorials/math/vectors_advanced.html) * [3Blue1Brown Essence of Linear Algebra](https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab) * [Matrix Transform Demo](https://godotengine.org/asset-library/asset/584) * [All 2D Demos](https://github.com/godotengine/godot-demo-projects/tree/master/2d) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [x](#class-vector2-property-x) | `0.0` | | [float](class_float#class-float) | [y](#class-vector2-property-y) | `0.0` | Methods ------- | | | | --- | --- | | [Vector2](#class-vector2) | [Vector2](#class-vector2-method-vector2) **(** [float](class_float#class-float) x, [float](class_float#class-float) y **)** | | [Vector2](#class-vector2) | [abs](#class-vector2-method-abs) **(** **)** | | [float](class_float#class-float) | [angle](#class-vector2-method-angle) **(** **)** | | [float](class_float#class-float) | [angle\_to](#class-vector2-method-angle-to) **(** [Vector2](#class-vector2) to **)** | | [float](class_float#class-float) | [angle\_to\_point](#class-vector2-method-angle-to-point) **(** [Vector2](#class-vector2) to **)** | | [float](class_float#class-float) | [aspect](#class-vector2-method-aspect) **(** **)** | | [Vector2](#class-vector2) | [bounce](#class-vector2-method-bounce) **(** [Vector2](#class-vector2) n **)** | | [Vector2](#class-vector2) | [ceil](#class-vector2-method-ceil) **(** **)** | | [Vector2](#class-vector2) | [clamped](#class-vector2-method-clamped) **(** [float](class_float#class-float) length **)** | | [float](class_float#class-float) | [cross](#class-vector2-method-cross) **(** [Vector2](#class-vector2) with **)** | | [Vector2](#class-vector2) | [cubic\_interpolate](#class-vector2-method-cubic-interpolate) **(** [Vector2](#class-vector2) b, [Vector2](#class-vector2) pre\_a, [Vector2](#class-vector2) post\_b, [float](class_float#class-float) weight **)** | | [Vector2](#class-vector2) | [direction\_to](#class-vector2-method-direction-to) **(** [Vector2](#class-vector2) b **)** | | [float](class_float#class-float) | [distance\_squared\_to](#class-vector2-method-distance-squared-to) **(** [Vector2](#class-vector2) to **)** | | [float](class_float#class-float) | [distance\_to](#class-vector2-method-distance-to) **(** [Vector2](#class-vector2) to **)** | | [float](class_float#class-float) | [dot](#class-vector2-method-dot) **(** [Vector2](#class-vector2) with **)** | | [Vector2](#class-vector2) | [floor](#class-vector2-method-floor) **(** **)** | | [bool](class_bool#class-bool) | [is\_equal\_approx](#class-vector2-method-is-equal-approx) **(** [Vector2](#class-vector2) v **)** | | [bool](class_bool#class-bool) | [is\_normalized](#class-vector2-method-is-normalized) **(** **)** | | [float](class_float#class-float) | [length](#class-vector2-method-length) **(** **)** | | [float](class_float#class-float) | [length\_squared](#class-vector2-method-length-squared) **(** **)** | | [Vector2](#class-vector2) | [limit\_length](#class-vector2-method-limit-length) **(** [float](class_float#class-float) length=1.0 **)** | | [Vector2](#class-vector2) | [linear\_interpolate](#class-vector2-method-linear-interpolate) **(** [Vector2](#class-vector2) to, [float](class_float#class-float) weight **)** | | [Vector2](#class-vector2) | [move\_toward](#class-vector2-method-move-toward) **(** [Vector2](#class-vector2) to, [float](class_float#class-float) delta **)** | | [Vector2](#class-vector2) | [normalized](#class-vector2-method-normalized) **(** **)** | | [Vector2](#class-vector2) | [posmod](#class-vector2-method-posmod) **(** [float](class_float#class-float) mod **)** | | [Vector2](#class-vector2) | [posmodv](#class-vector2-method-posmodv) **(** [Vector2](#class-vector2) modv **)** | | [Vector2](#class-vector2) | [project](#class-vector2-method-project) **(** [Vector2](#class-vector2) b **)** | | [Vector2](#class-vector2) | [reflect](#class-vector2-method-reflect) **(** [Vector2](#class-vector2) n **)** | | [Vector2](#class-vector2) | [rotated](#class-vector2-method-rotated) **(** [float](class_float#class-float) angle **)** | | [Vector2](#class-vector2) | [round](#class-vector2-method-round) **(** **)** | | [Vector2](#class-vector2) | [sign](#class-vector2-method-sign) **(** **)** | | [Vector2](#class-vector2) | [slerp](#class-vector2-method-slerp) **(** [Vector2](#class-vector2) to, [float](class_float#class-float) weight **)** | | [Vector2](#class-vector2) | [slide](#class-vector2-method-slide) **(** [Vector2](#class-vector2) n **)** | | [Vector2](#class-vector2) | [snapped](#class-vector2-method-snapped) **(** [Vector2](#class-vector2) by **)** | | [Vector2](#class-vector2) | [tangent](#class-vector2-method-tangent) **(** **)** | Constants --------- * **AXIS\_X** = **0** --- Enumerated value for the X axis. * **AXIS\_Y** = **1** --- Enumerated value for the Y axis. * **ZERO** = **Vector2( 0, 0 )** --- Zero vector, a vector with all components set to `0`. * **ONE** = **Vector2( 1, 1 )** --- One vector, a vector with all components set to `1`. * **INF** = **Vector2( inf, inf )** --- Infinity vector, a vector with all components set to [@GDScript.INF](class_%40gdscript#class-gdscript-constant-inf). * **LEFT** = **Vector2( -1, 0 )** --- Left unit vector. Represents the direction of left. * **RIGHT** = **Vector2( 1, 0 )** --- Right unit vector. Represents the direction of right. * **UP** = **Vector2( 0, -1 )** --- Up unit vector. Y is down in 2D, so this vector points -Y. * **DOWN** = **Vector2( 0, 1 )** --- Down unit vector. Y is down in 2D, so this vector points +Y. Property Descriptions --------------------- ### [float](class_float#class-float) x | | | | --- | --- | | *Default* | `0.0` | The vector's X component. Also accessible by using the index position `[0]`. ### [float](class_float#class-float) y | | | | --- | --- | | *Default* | `0.0` | The vector's Y component. Also accessible by using the index position `[1]`. Method Descriptions ------------------- ### [Vector2](#class-vector2) Vector2 ( [float](class_float#class-float) x, [float](class_float#class-float) y ) Constructs a new Vector2 from the given `x` and `y`. ### [Vector2](#class-vector2) abs ( ) Returns a new vector with all components in absolute values (i.e. positive). ### [float](class_float#class-float) angle ( ) Returns this vector's angle with respect to the positive X axis, or `(1, 0)` vector, in radians. For example, `Vector2.RIGHT.angle()` will return zero, `Vector2.DOWN.angle()` will return `PI / 2` (a quarter turn, or 90 degrees), and `Vector2(1, -1).angle()` will return `-PI / 4` (a negative eighth turn, or -45 degrees). [Illustration of the returned angle.](https://raw.githubusercontent.com/godotengine/godot-docs/master/img/vector2_angle.png) Equivalent to the result of [@GDScript.atan2](class_%40gdscript#class-gdscript-method-atan2) when called with the vector's [y](#class-vector2-property-y) and [x](#class-vector2-property-x) as parameters: `atan2(y, x)`. ### [float](class_float#class-float) angle\_to ( [Vector2](#class-vector2) to ) Returns the angle to the given vector, in radians. [Illustration of the returned angle.](https://raw.githubusercontent.com/godotengine/godot-docs/master/img/vector2_angle_to.png) ### [float](class_float#class-float) angle\_to\_point ( [Vector2](#class-vector2) to ) Returns the angle between the line connecting the two points and the X axis, in radians. [Illustration of the returned angle.](https://raw.githubusercontent.com/godotengine/godot-docs/stable/img/vector2_angle_to_point.png) ### [float](class_float#class-float) aspect ( ) Returns the aspect ratio of this vector, the ratio of [x](#class-vector2-property-x) to [y](#class-vector2-property-y). ### [Vector2](#class-vector2) bounce ( [Vector2](#class-vector2) n ) Returns the vector "bounced off" from a plane defined by the given normal. ### [Vector2](#class-vector2) ceil ( ) Returns a new vector with all components rounded up (towards positive infinity). ### [Vector2](#class-vector2) clamped ( [float](class_float#class-float) length ) Deprecated, please use [limit\_length](#class-vector2-method-limit-length) instead. Returns the vector with a maximum length by limiting its length to `length`. ### [float](class_float#class-float) cross ( [Vector2](#class-vector2) with ) Returns the 2D analog of the cross product for this vector and `with`. This is the signed area of the parallelogram formed by the two vectors. If the second vector is clockwise from the first vector, then the cross product is the positive area. If counter-clockwise, the cross product is the negative area. **Note:** Cross product is not defined in 2D mathematically. This method embeds the 2D vectors in the XY plane of 3D space and uses their cross product's Z component as the analog. ### [Vector2](#class-vector2) cubic\_interpolate ( [Vector2](#class-vector2) b, [Vector2](#class-vector2) pre\_a, [Vector2](#class-vector2) post\_b, [float](class_float#class-float) weight ) Cubically interpolates between this vector and `b` using `pre_a` and `post_b` as handles, and returns the result at position `weight`. `weight` is on the range of 0.0 to 1.0, representing the amount of interpolation. ### [Vector2](#class-vector2) direction\_to ( [Vector2](#class-vector2) b ) Returns the normalized vector pointing from this vector to `b`. This is equivalent to using `(b - a).normalized()`. ### [float](class_float#class-float) distance\_squared\_to ( [Vector2](#class-vector2) to ) Returns the squared distance between this vector and `b`. This method runs faster than [distance\_to](#class-vector2-method-distance-to), so prefer it if you need to compare vectors or need the squared distance for some formula. ### [float](class_float#class-float) distance\_to ( [Vector2](#class-vector2) to ) Returns the distance between this vector and `to`. ### [float](class_float#class-float) dot ( [Vector2](#class-vector2) with ) Returns the dot product of this vector and `with`. This can be used to compare the angle between two vectors. For example, this can be used to determine whether an enemy is facing the player. The dot product will be `0` for a straight angle (90 degrees), greater than 0 for angles narrower than 90 degrees and lower than 0 for angles wider than 90 degrees. When using unit (normalized) vectors, the result will always be between `-1.0` (180 degree angle) when the vectors are facing opposite directions, and `1.0` (0 degree angle) when the vectors are aligned. **Note:** `a.dot(b)` is equivalent to `b.dot(a)`. ### [Vector2](#class-vector2) floor ( ) Returns a new vector with all components rounded down (towards negative infinity). ### [bool](class_bool#class-bool) is\_equal\_approx ( [Vector2](#class-vector2) v ) Returns `true` if this vector and `v` are approximately equal, by running [@GDScript.is\_equal\_approx](class_%40gdscript#class-gdscript-method-is-equal-approx) on each component. ### [bool](class_bool#class-bool) is\_normalized ( ) Returns `true` if the vector is normalized, `false` otherwise. ### [float](class_float#class-float) length ( ) Returns the length (magnitude) of this vector. ### [float](class_float#class-float) length\_squared ( ) Returns the squared length (squared magnitude) of this vector. This method runs faster than [length](#class-vector2-method-length), so prefer it if you need to compare vectors or need the squared distance for some formula. ### [Vector2](#class-vector2) limit\_length ( [float](class_float#class-float) length=1.0 ) Returns the vector with a maximum length by limiting its length to `length`. ### [Vector2](#class-vector2) linear\_interpolate ( [Vector2](#class-vector2) to, [float](class_float#class-float) weight ) Returns the result of the linear interpolation between this vector and `to` by amount `weight`. `weight` is on the range of 0.0 to 1.0, representing the amount of interpolation. ### [Vector2](#class-vector2) move\_toward ( [Vector2](#class-vector2) to, [float](class_float#class-float) delta ) Returns a new vector moved toward `to` by the fixed `delta` amount. Will not go past the final value. ### [Vector2](#class-vector2) normalized ( ) Returns the vector scaled to unit length. Equivalent to `v / v.length()`. ### [Vector2](#class-vector2) posmod ( [float](class_float#class-float) mod ) Returns a vector composed of the [@GDScript.fposmod](class_%40gdscript#class-gdscript-method-fposmod) of this vector's components and `mod`. ### [Vector2](#class-vector2) posmodv ( [Vector2](#class-vector2) modv ) Returns a vector composed of the [@GDScript.fposmod](class_%40gdscript#class-gdscript-method-fposmod) of this vector's components and `modv`'s components. ### [Vector2](#class-vector2) project ( [Vector2](#class-vector2) b ) Returns this vector projected onto the vector `b`. ### [Vector2](#class-vector2) reflect ( [Vector2](#class-vector2) n ) Returns the vector reflected (i.e. mirrored, or symmetric) over a line defined by the given direction vector `n`. ### [Vector2](#class-vector2) rotated ( [float](class_float#class-float) angle ) Returns the vector rotated by `angle` (in radians). See also [@GDScript.deg2rad](class_%40gdscript#class-gdscript-method-deg2rad). ### [Vector2](#class-vector2) round ( ) Returns a new vector with all components rounded to the nearest integer, with halfway cases rounded away from zero. ### [Vector2](#class-vector2) sign ( ) Returns a new vector with each component set to one or negative one, depending on the signs of the components. If a component is zero, it returns positive one. ### [Vector2](#class-vector2) slerp ( [Vector2](#class-vector2) to, [float](class_float#class-float) weight ) Returns the result of spherical linear interpolation between this vector and `to`, by amount `weight`. `weight` is on the range of 0.0 to 1.0, representing the amount of interpolation. **Note:** Both vectors must be normalized. ### [Vector2](#class-vector2) slide ( [Vector2](#class-vector2) n ) Returns this vector slid along a plane defined by the given normal. ### [Vector2](#class-vector2) snapped ( [Vector2](#class-vector2) by ) Returns this vector with each component snapped to the nearest multiple of `step`. This can also be used to round to an arbitrary number of decimals. ### [Vector2](#class-vector2) tangent ( ) Returns a perpendicular vector rotated 90 degrees counter-clockwise compared to the original, with the same length. godot PCKPacker PCKPacker ========= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Creates packages that can be loaded into a running project. Description ----------- The `PCKPacker` is used to create packages that can be loaded into a running project using [ProjectSettings.load\_resource\_pack](class_projectsettings#class-projectsettings-method-load-resource-pack). ``` var packer = PCKPacker.new() packer.pck_start("test.pck") packer.add_file("res://text.txt", "text.txt") packer.flush() ``` The above `PCKPacker` creates package `test.pck`, then adds a file named `text.txt` at the root of the package. Methods ------- | | | | --- | --- | | [Error](class_%40globalscope#enum-globalscope-error) | [add\_file](#class-pckpacker-method-add-file) **(** [String](class_string#class-string) pck\_path, [String](class_string#class-string) source\_path **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [flush](#class-pckpacker-method-flush) **(** [bool](class_bool#class-bool) verbose=false **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [pck\_start](#class-pckpacker-method-pck-start) **(** [String](class_string#class-string) pck\_name, [int](class_int#class-int) alignment=0 **)** | Method Descriptions ------------------- ### [Error](class_%40globalscope#enum-globalscope-error) add\_file ( [String](class_string#class-string) pck\_path, [String](class_string#class-string) source\_path ) Adds the `source_path` file to the current PCK package at the `pck_path` internal path (should start with `res://`). ### [Error](class_%40globalscope#enum-globalscope-error) flush ( [bool](class_bool#class-bool) verbose=false ) Writes the files specified using all [add\_file](#class-pckpacker-method-add-file) calls since the last flush. If `verbose` is `true`, a list of files added will be printed to the console for easier debugging. ### [Error](class_%40globalscope#enum-globalscope-error) pck\_start ( [String](class_string#class-string) pck\_name, [int](class_int#class-int) alignment=0 ) Creates a new PCK file with the name `pck_name`. The `.pck` file extension isn't added automatically, so it should be part of `pck_name` (even though it's not required).
programming_docs
godot StaticBody2D StaticBody2D ============ **Inherits:** [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d) **<** [CollisionObject2D](class_collisionobject2d#class-collisionobject2d) **<** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Static body for 2D physics. Description ----------- Static body for 2D physics. A StaticBody2D is a body that is not intended to move. It is ideal for implementing objects in the environment, such as walls or platforms. Additionally, a constant linear or angular velocity can be set for the static body, which will affect colliding bodies as if it were moving (for example, a conveyor belt). Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [bounce](#class-staticbody2d-property-bounce) | | | [float](class_float#class-float) | [constant\_angular\_velocity](#class-staticbody2d-property-constant-angular-velocity) | `0.0` | | [Vector2](class_vector2#class-vector2) | [constant\_linear\_velocity](#class-staticbody2d-property-constant-linear-velocity) | `Vector2( 0, 0 )` | | [float](class_float#class-float) | [friction](#class-staticbody2d-property-friction) | | | [PhysicsMaterial](class_physicsmaterial#class-physicsmaterial) | [physics\_material\_override](#class-staticbody2d-property-physics-material-override) | | Property Descriptions --------------------- ### [float](class_float#class-float) bounce | | | | --- | --- | | *Setter* | set\_bounce(value) | | *Getter* | get\_bounce() | The body's bounciness. Values range from `0` (no bounce) to `1` (full bounciness). Deprecated, use [PhysicsMaterial.bounce](class_physicsmaterial#class-physicsmaterial-property-bounce) instead via [physics\_material\_override](#class-staticbody2d-property-physics-material-override). ### [float](class_float#class-float) constant\_angular\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_constant\_angular\_velocity(value) | | *Getter* | get\_constant\_angular\_velocity() | The body's constant angular velocity. This does not rotate the body, but affects colliding bodies, as if it were rotating. ### [Vector2](class_vector2#class-vector2) constant\_linear\_velocity | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_constant\_linear\_velocity(value) | | *Getter* | get\_constant\_linear\_velocity() | The body's constant linear velocity. This does not move the body, but affects colliding bodies, as if it were moving. ### [float](class_float#class-float) friction | | | | --- | --- | | *Setter* | set\_friction(value) | | *Getter* | get\_friction() | The body's friction. Values range from `0` (no friction) to `1` (full friction). Deprecated, use [PhysicsMaterial.friction](class_physicsmaterial#class-physicsmaterial-property-friction) instead via [physics\_material\_override](#class-staticbody2d-property-physics-material-override). ### [PhysicsMaterial](class_physicsmaterial#class-physicsmaterial) physics\_material\_override | | | | --- | --- | | *Setter* | set\_physics\_material\_override(value) | | *Getter* | get\_physics\_material\_override() | The physics material override for the body. If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. godot PackedDataContainer PackedDataContainer =================== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [\_\_data\_\_](#class-packeddatacontainer-property-data) | `PoolByteArray(  )` | Methods ------- | | | | --- | --- | | [Error](class_%40globalscope#enum-globalscope-error) | [pack](#class-packeddatacontainer-method-pack) **(** [Variant](class_variant#class-variant) value **)** | | [int](class_int#class-int) | [size](#class-packeddatacontainer-method-size) **(** **)** const | Property Descriptions --------------------- ### [PoolByteArray](class_poolbytearray#class-poolbytearray) \_\_data\_\_ | | | | --- | --- | | *Default* | `PoolByteArray(  )` | Method Descriptions ------------------- ### [Error](class_%40globalscope#enum-globalscope-error) pack ( [Variant](class_variant#class-variant) value ) ### [int](class_int#class-int) size ( ) const godot VisualShaderNodeColorConstant VisualShaderNodeColorConstant ============================= **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A [Color](class_color#class-color) constant to be used within the visual shader graph. Description ----------- Has two output ports representing RGB and alpha channels of [Color](class_color#class-color). Translated to `vec3 rgb` and `float alpha` in the shader language. Properties ---------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [constant](#class-visualshadernodecolorconstant-property-constant) | `Color( 1, 1, 1, 1 )` | Property Descriptions --------------------- ### [Color](class_color#class-color) constant | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_constant(value) | | *Getter* | get\_constant() | A [Color](class_color#class-color) constant which represents a state of this node. godot MainLoop MainLoop ======== **Inherits:** [Object](class_object#class-object) **Inherited By:** [SceneTree](class_scenetree#class-scenetree) Abstract base class for the game's main loop. Description ----------- `MainLoop` is the abstract base class for a Godot project's game loop. It is inherited by [SceneTree](class_scenetree#class-scenetree), which is the default game loop implementation used in Godot projects, though it is also possible to write and use one's own `MainLoop` subclass instead of the scene tree. Upon the application start, a `MainLoop` implementation must be provided to the OS; otherwise, the application will exit. This happens automatically (and a [SceneTree](class_scenetree#class-scenetree) is created) unless a main [Script](class_script#class-script) is provided from the command line (with e.g. `godot -s my_loop.gd`, which should then be a `MainLoop` implementation. Here is an example script implementing a simple `MainLoop`: ``` extends MainLoop var time_elapsed = 0 var keys_typed = [] var quit = false func _initialize(): print("Initialized:") print(" Starting time: %s" % str(time_elapsed)) func _idle(delta): time_elapsed += delta # Return true to end the main loop. return quit func _input_event(event): # Record keys. if event is InputEventKey and event.pressed and !event.echo: keys_typed.append(OS.get_scancode_string(event.scancode)) # Quit on Escape press. if event.scancode == KEY_ESCAPE: quit = true # Quit on any mouse click. if event is InputEventMouseButton: quit = true func _finalize(): print("Finalized:") print(" End time: %s" % str(time_elapsed)) print(" Keys typed: %s" % var2str(keys_typed)) ``` Methods ------- | | | | --- | --- | | void | [\_drop\_files](#class-mainloop-method-drop-files) **(** [PoolStringArray](class_poolstringarray#class-poolstringarray) files, [int](class_int#class-int) from\_screen **)** virtual | | void | [\_finalize](#class-mainloop-method-finalize) **(** **)** virtual | | void | [\_global\_menu\_action](#class-mainloop-method-global-menu-action) **(** [Variant](class_variant#class-variant) id, [Variant](class_variant#class-variant) meta **)** virtual | | [bool](class_bool#class-bool) | [\_idle](#class-mainloop-method-idle) **(** [float](class_float#class-float) delta **)** virtual | | void | [\_initialize](#class-mainloop-method-initialize) **(** **)** virtual | | void | [\_input\_event](#class-mainloop-method-input-event) **(** [InputEvent](class_inputevent#class-inputevent) event **)** virtual | | void | [\_input\_text](#class-mainloop-method-input-text) **(** [String](class_string#class-string) text **)** virtual | | [bool](class_bool#class-bool) | [\_iteration](#class-mainloop-method-iteration) **(** [float](class_float#class-float) delta **)** virtual | | void | [finish](#class-mainloop-method-finish) **(** **)** | | [bool](class_bool#class-bool) | [idle](#id1) **(** [float](class_float#class-float) delta **)** | | void | [init](#class-mainloop-method-init) **(** **)** | | void | [input\_event](#id2) **(** [InputEvent](class_inputevent#class-inputevent) event **)** | | void | [input\_text](#id3) **(** [String](class_string#class-string) text **)** | | [bool](class_bool#class-bool) | [iteration](#id4) **(** [float](class_float#class-float) delta **)** | Signals ------- ### on\_request\_permissions\_result ( [String](class_string#class-string) permission, [bool](class_bool#class-bool) granted ) Emitted when a user responds to a permission request. Constants --------- ### NOTIFICATION\_WM\_MOUSE\_ENTER = 1002 --- Notification received from the OS when the mouse enters the game window. Implemented on desktop and web platforms. * **NOTIFICATION\_WM\_MOUSE\_EXIT** = **1003** --- Notification received from the OS when the mouse leaves the game window. Implemented on desktop and web platforms. * **NOTIFICATION\_WM\_FOCUS\_IN** = **1004** --- Notification received from the OS when the game window is focused. Implemented on all platforms. * **NOTIFICATION\_WM\_FOCUS\_OUT** = **1005** --- Notification received from the OS when the game window is unfocused. Implemented on all platforms. * **NOTIFICATION\_WM\_QUIT\_REQUEST** = **1006** --- Notification received from the OS when a quit request is sent (e.g. closing the window with a "Close" button or Alt+F4). Implemented on desktop platforms. * **NOTIFICATION\_WM\_GO\_BACK\_REQUEST** = **1007** --- Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android). Specific to the Android platform. * **NOTIFICATION\_WM\_UNFOCUS\_REQUEST** = **1008** --- Notification received from the OS when an unfocus request is sent (e.g. another OS window wants to take the focus). No supported platforms currently send this notification. * **NOTIFICATION\_OS\_MEMORY\_WARNING** = **1009** --- Notification received from the OS when the application is exceeding its allocated memory. Specific to the iOS platform. * **NOTIFICATION\_TRANSLATION\_CHANGED** = **1010** --- Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like [Object.tr](class_object#class-object-method-tr). * **NOTIFICATION\_WM\_ABOUT** = **1011** --- Notification received from the OS when a request for "About" information is sent. Specific to the macOS platform. * **NOTIFICATION\_CRASH** = **1012** --- Notification received from Godot's crash handler when the engine is about to crash. Implemented on desktop platforms if the crash handler is enabled. * **NOTIFICATION\_OS\_IME\_UPDATE** = **1013** --- Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string). Specific to the macOS platform. * **NOTIFICATION\_APP\_RESUMED** = **1014** --- Notification received from the OS when the app is resumed. Specific to the Android platform. * **NOTIFICATION\_APP\_PAUSED** = **1015** --- Notification received from the OS when the app is paused. Specific to the Android platform. Method Descriptions ------------------- ### void \_drop\_files ( [PoolStringArray](class_poolstringarray#class-poolstringarray) files, [int](class_int#class-int) from\_screen ) virtual Called when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated. ### void \_finalize ( ) virtual Called before the program exits. ### void \_global\_menu\_action ( [Variant](class_variant#class-variant) id, [Variant](class_variant#class-variant) meta ) virtual Called when the user performs an action in the system global menu (e.g. the Mac OS menu bar). ### [bool](class_bool#class-bool) \_idle ( [float](class_float#class-float) delta ) virtual Called each idle frame with the time since the last idle frame as argument (in seconds). Equivalent to [Node.\_process](class_node#class-node-method-process). If implemented, the method must return a boolean value. `true` ends the main loop, while `false` lets it proceed to the next frame. ### void \_initialize ( ) virtual Called once during initialization. ### void \_input\_event ( [InputEvent](class_inputevent#class-inputevent) event ) virtual Called whenever an [InputEvent](class_inputevent#class-inputevent) is received by the main loop. ### void \_input\_text ( [String](class_string#class-string) text ) virtual Deprecated callback, does not do anything. Use [\_input\_event](#class-mainloop-method-input-event) to parse text input. Will be removed in Godot 4.0. ### [bool](class_bool#class-bool) \_iteration ( [float](class_float#class-float) delta ) virtual Called each physics frame with the time since the last physics frame as argument (`delta`, in seconds). Equivalent to [Node.\_physics\_process](class_node#class-node-method-physics-process). If implemented, the method must return a boolean value. `true` ends the main loop, while `false` lets it proceed to the next frame. ### void finish ( ) Should not be called manually, override [\_finalize](#class-mainloop-method-finalize) instead. Will be removed in Godot 4.0. ### [bool](class_bool#class-bool) idle ( [float](class_float#class-float) delta ) Should not be called manually, override [\_idle](#class-mainloop-method-idle) instead. Will be removed in Godot 4.0. ### void init ( ) Should not be called manually, override [\_initialize](#class-mainloop-method-initialize) instead. Will be removed in Godot 4.0. ### void input\_event ( [InputEvent](class_inputevent#class-inputevent) event ) Should not be called manually, override [\_input\_event](#class-mainloop-method-input-event) instead. Will be removed in Godot 4.0. ### void input\_text ( [String](class_string#class-string) text ) Should not be called manually, override [\_input\_text](#class-mainloop-method-input-text) instead. Will be removed in Godot 4.0. ### [bool](class_bool#class-bool) iteration ( [float](class_float#class-float) delta ) Should not be called manually, override [\_iteration](#class-mainloop-method-iteration) instead. Will be removed in Godot 4.0. godot Navigation2D Navigation2D ============ **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) 2D navigation and pathfinding node. Description ----------- *Deprecated.* `Navigation2D` node and [get\_simple\_path](#class-navigation2d-method-get-simple-path) are deprecated and will be removed in a future version. Use [Navigation2DServer.map\_get\_path](class_navigation2dserver#class-navigation2dserver-method-map-get-path) instead. Navigation2D provides navigation and pathfinding within a 2D area, specified as a collection of [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) resources. By default, these are automatically collected from child [NavigationPolygonInstance](class_navigationpolygoninstance#class-navigationpolygoninstance) nodes. Tutorials --------- * [2D Navigation Demo](https://godotengine.org/asset-library/asset/117) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [cell\_size](#class-navigation2d-property-cell-size) | `1.0` | | [float](class_float#class-float) | [edge\_connection\_margin](#class-navigation2d-property-edge-connection-margin) | `1.0` | | [int](class_int#class-int) | [navigation\_layers](#class-navigation2d-property-navigation-layers) | `1` | Methods ------- | | | | --- | --- | | [Vector2](class_vector2#class-vector2) | [get\_closest\_point](#class-navigation2d-method-get-closest-point) **(** [Vector2](class_vector2#class-vector2) to\_point **)** const | | [RID](class_rid#class-rid) | [get\_closest\_point\_owner](#class-navigation2d-method-get-closest-point-owner) **(** [Vector2](class_vector2#class-vector2) to\_point **)** const | | [RID](class_rid#class-rid) | [get\_rid](#class-navigation2d-method-get-rid) **(** **)** const | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [get\_simple\_path](#class-navigation2d-method-get-simple-path) **(** [Vector2](class_vector2#class-vector2) start, [Vector2](class_vector2#class-vector2) end, [bool](class_bool#class-bool) optimize=true **)** const | Property Descriptions --------------------- ### [float](class_float#class-float) cell\_size | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_cell\_size(value) | | *Getter* | get\_cell\_size() | The XY plane cell size to use for fields. ### [float](class_float#class-float) edge\_connection\_margin | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_edge\_connection\_margin(value) | | *Getter* | get\_edge\_connection\_margin() | This value is used to detect the near edges to connect compatible regions. ### [int](class_int#class-int) navigation\_layers | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_navigation\_layers(value) | | *Getter* | get\_navigation\_layers() | A bitfield determining all navigation map layers the navigation can use on a [get\_simple\_path](#class-navigation2d-method-get-simple-path) path query. Method Descriptions ------------------- ### [Vector2](class_vector2#class-vector2) get\_closest\_point ( [Vector2](class_vector2#class-vector2) to\_point ) const Returns the navigation point closest to the point given. Points are in local coordinate space. ### [RID](class_rid#class-rid) get\_closest\_point\_owner ( [Vector2](class_vector2#class-vector2) to\_point ) const Returns the owner of the [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) which contains the navigation point closest to the point given. This is usually a [NavigationPolygonInstance](class_navigationpolygoninstance#class-navigationpolygoninstance). ### [RID](class_rid#class-rid) get\_rid ( ) const Returns the object's [RID](class_rid#class-rid). ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) get\_simple\_path ( [Vector2](class_vector2#class-vector2) start, [Vector2](class_vector2#class-vector2) end, [bool](class_bool#class-bool) optimize=true ) const *Deprecated.* `Navigation2D` node and [get\_simple\_path](#class-navigation2d-method-get-simple-path) are deprecated and will be removed in a future version. Use [Navigation2DServer.map\_get\_path](class_navigation2dserver#class-navigation2dserver-method-map-get-path) instead. Returns the path between two given points. Points are in local coordinate space. If `optimize` is `true` (the default), the path is smoothed by merging path segments where possible. godot EditorFeatureProfile EditorFeatureProfile ==================== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) An editor feature profile which can be used to disable specific features. Description ----------- An editor feature profile can be used to disable specific features of the Godot editor. When disabled, the features won't appear in the editor, which makes the editor less cluttered. This is useful in education settings to reduce confusion or when working in a team. For example, artists and level designers could use a feature profile that disables the script editor to avoid accidentally making changes to files they aren't supposed to edit. To manage editor feature profiles visually, use **Editor > Manage Feature Profiles...** at the top of the editor window. Methods ------- | | | | --- | --- | | [String](class_string#class-string) | [get\_feature\_name](#class-editorfeatureprofile-method-get-feature-name) **(** [Feature](#enum-editorfeatureprofile-feature) feature **)** | | [bool](class_bool#class-bool) | [is\_class\_disabled](#class-editorfeatureprofile-method-is-class-disabled) **(** [String](class_string#class-string) class\_name **)** const | | [bool](class_bool#class-bool) | [is\_class\_editor\_disabled](#class-editorfeatureprofile-method-is-class-editor-disabled) **(** [String](class_string#class-string) class\_name **)** const | | [bool](class_bool#class-bool) | [is\_class\_property\_disabled](#class-editorfeatureprofile-method-is-class-property-disabled) **(** [String](class_string#class-string) class\_name, [String](class_string#class-string) property **)** const | | [bool](class_bool#class-bool) | [is\_feature\_disabled](#class-editorfeatureprofile-method-is-feature-disabled) **(** [Feature](#enum-editorfeatureprofile-feature) feature **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [load\_from\_file](#class-editorfeatureprofile-method-load-from-file) **(** [String](class_string#class-string) path **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [save\_to\_file](#class-editorfeatureprofile-method-save-to-file) **(** [String](class_string#class-string) path **)** | | void | [set\_disable\_class](#class-editorfeatureprofile-method-set-disable-class) **(** [String](class_string#class-string) class\_name, [bool](class_bool#class-bool) disable **)** | | void | [set\_disable\_class\_editor](#class-editorfeatureprofile-method-set-disable-class-editor) **(** [String](class_string#class-string) class\_name, [bool](class_bool#class-bool) disable **)** | | void | [set\_disable\_class\_property](#class-editorfeatureprofile-method-set-disable-class-property) **(** [String](class_string#class-string) class\_name, [String](class_string#class-string) property, [bool](class_bool#class-bool) disable **)** | | void | [set\_disable\_feature](#class-editorfeatureprofile-method-set-disable-feature) **(** [Feature](#enum-editorfeatureprofile-feature) feature, [bool](class_bool#class-bool) disable **)** | Enumerations ------------ enum **Feature**: * **FEATURE\_3D** = **0** --- The 3D editor. If this feature is disabled, the 3D editor won't display but 3D nodes will still display in the Create New Node dialog. * **FEATURE\_SCRIPT** = **1** --- The Script tab, which contains the script editor and class reference browser. If this feature is disabled, the Script tab won't display. * **FEATURE\_ASSET\_LIB** = **2** --- The AssetLib tab. If this feature is disabled, the AssetLib tab won't display. * **FEATURE\_SCENE\_TREE** = **3** --- Scene tree editing. If this feature is disabled, the Scene tree dock will still be visible but will be read-only. * **FEATURE\_NODE\_DOCK** = **4** --- The Node dock. If this feature is disabled, signals and groups won't be visible and modifiable from the editor. * **FEATURE\_FILESYSTEM\_DOCK** = **5** --- The FileSystem dock. If this feature is disabled, the FileSystem dock won't be visible. * **FEATURE\_IMPORT\_DOCK** = **6** --- The Import dock. If this feature is disabled, the Import dock won't be visible. * **FEATURE\_MAX** = **7** --- Represents the size of the [Feature](#enum-editorfeatureprofile-feature) enum. Method Descriptions ------------------- ### [String](class_string#class-string) get\_feature\_name ( [Feature](#enum-editorfeatureprofile-feature) feature ) Returns the specified `feature`'s human-readable name. ### [bool](class_bool#class-bool) is\_class\_disabled ( [String](class_string#class-string) class\_name ) const Returns `true` if the class specified by `class_name` is disabled. When disabled, the class won't appear in the Create New Node dialog. ### [bool](class_bool#class-bool) is\_class\_editor\_disabled ( [String](class_string#class-string) class\_name ) const Returns `true` if editing for the class specified by `class_name` is disabled. When disabled, the class will still appear in the Create New Node dialog but the inspector will be read-only when selecting a node that extends the class. ### [bool](class_bool#class-bool) is\_class\_property\_disabled ( [String](class_string#class-string) class\_name, [String](class_string#class-string) property ) const Returns `true` if `property` is disabled in the class specified by `class_name`. When a property is disabled, it won't appear in the inspector when selecting a node that extends the class specified by `class_name`. ### [bool](class_bool#class-bool) is\_feature\_disabled ( [Feature](#enum-editorfeatureprofile-feature) feature ) const Returns `true` if the `feature` is disabled. When a feature is disabled, it will disappear from the editor entirely. ### [Error](class_%40globalscope#enum-globalscope-error) load\_from\_file ( [String](class_string#class-string) path ) Loads an editor feature profile from a file. The file must follow the JSON format obtained by using the feature profile manager's **Export** button or the [save\_to\_file](#class-editorfeatureprofile-method-save-to-file) method. ### [Error](class_%40globalscope#enum-globalscope-error) save\_to\_file ( [String](class_string#class-string) path ) Saves the editor feature profile to a file in JSON format. It can then be imported using the feature profile manager's **Import** button or the [load\_from\_file](#class-editorfeatureprofile-method-load-from-file) method. ### void set\_disable\_class ( [String](class_string#class-string) class\_name, [bool](class_bool#class-bool) disable ) If `disable` is `true`, disables the class specified by `class_name`. When disabled, the class won't appear in the Create New Node dialog. ### void set\_disable\_class\_editor ( [String](class_string#class-string) class\_name, [bool](class_bool#class-bool) disable ) If `disable` is `true`, disables editing for the class specified by `class_name`. When disabled, the class will still appear in the Create New Node dialog but the inspector will be read-only when selecting a node that extends the class. ### void set\_disable\_class\_property ( [String](class_string#class-string) class\_name, [String](class_string#class-string) property, [bool](class_bool#class-bool) disable ) If `disable` is `true`, disables editing for `property` in the class specified by `class_name`. When a property is disabled, it won't appear in the inspector when selecting a node that extends the class specified by `class_name`. ### void set\_disable\_feature ( [Feature](#enum-editorfeatureprofile-feature) feature, [bool](class_bool#class-bool) disable ) If `disable` is `true`, disables the editor feature specified in `feature`. When a feature is disabled, it will disappear from the editor entirely.
programming_docs
godot VisualScriptLocalVarSet VisualScriptLocalVarSet ======================= **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Changes a local variable's value. Description ----------- Changes a local variable's value to the given input. The new value is also provided on an output Data port. **Input Ports:** * Sequence * Data (variant): `set` **Output Ports:** * Sequence * Data (variant): `get` Properties ---------- | | | | | --- | --- | --- | | [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) | [type](#class-visualscriptlocalvarset-property-type) | `0` | | [String](class_string#class-string) | [var\_name](#class-visualscriptlocalvarset-property-var-name) | `"new_local"` | Property Descriptions --------------------- ### [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_var\_type(value) | | *Getter* | get\_var\_type() | The local variable's type. ### [String](class_string#class-string) var\_name | | | | --- | --- | | *Default* | `"new_local"` | | *Setter* | set\_var\_name(value) | | *Getter* | get\_var\_name() | The local variable's name. godot Physics2DServer Physics2DServer =============== **Inherits:** [Object](class_object#class-object) Server interface for low-level 2D physics access. Description ----------- Physics2DServer is the server responsible for all 2D physics. It can create many kinds of physics objects, but does not insert them on the node tree. Methods ------- | | | | --- | --- | | void | [area\_add\_shape](#class-physics2dserver-method-area-add-shape) **(** [RID](class_rid#class-rid) area, [RID](class_rid#class-rid) shape, [Transform2D](class_transform2d#class-transform2d) transform=Transform2D( 1, 0, 0, 1, 0, 0 ), [bool](class_bool#class-bool) disabled=false **)** | | void | [area\_attach\_canvas\_instance\_id](#class-physics2dserver-method-area-attach-canvas-instance-id) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) id **)** | | void | [area\_attach\_object\_instance\_id](#class-physics2dserver-method-area-attach-object-instance-id) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) id **)** | | void | [area\_clear\_shapes](#class-physics2dserver-method-area-clear-shapes) **(** [RID](class_rid#class-rid) area **)** | | [RID](class_rid#class-rid) | [area\_create](#class-physics2dserver-method-area-create) **(** **)** | | [int](class_int#class-int) | [area\_get\_canvas\_instance\_id](#class-physics2dserver-method-area-get-canvas-instance-id) **(** [RID](class_rid#class-rid) area **)** const | | [int](class_int#class-int) | [area\_get\_object\_instance\_id](#class-physics2dserver-method-area-get-object-instance-id) **(** [RID](class_rid#class-rid) area **)** const | | [Variant](class_variant#class-variant) | [area\_get\_param](#class-physics2dserver-method-area-get-param) **(** [RID](class_rid#class-rid) area, [AreaParameter](#enum-physics2dserver-areaparameter) param **)** const | | [RID](class_rid#class-rid) | [area\_get\_shape](#class-physics2dserver-method-area-get-shape) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx **)** const | | [int](class_int#class-int) | [area\_get\_shape\_count](#class-physics2dserver-method-area-get-shape-count) **(** [RID](class_rid#class-rid) area **)** const | | [Transform2D](class_transform2d#class-transform2d) | [area\_get\_shape\_transform](#class-physics2dserver-method-area-get-shape-transform) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx **)** const | | [RID](class_rid#class-rid) | [area\_get\_space](#class-physics2dserver-method-area-get-space) **(** [RID](class_rid#class-rid) area **)** const | | [AreaSpaceOverrideMode](#enum-physics2dserver-areaspaceoverridemode) | [area\_get\_space\_override\_mode](#class-physics2dserver-method-area-get-space-override-mode) **(** [RID](class_rid#class-rid) area **)** const | | [Transform2D](class_transform2d#class-transform2d) | [area\_get\_transform](#class-physics2dserver-method-area-get-transform) **(** [RID](class_rid#class-rid) area **)** const | | void | [area\_remove\_shape](#class-physics2dserver-method-area-remove-shape) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx **)** | | void | [area\_set\_area\_monitor\_callback](#class-physics2dserver-method-area-set-area-monitor-callback) **(** [RID](class_rid#class-rid) area, [Object](class_object#class-object) receiver, [String](class_string#class-string) method **)** | | void | [area\_set\_collision\_layer](#class-physics2dserver-method-area-set-collision-layer) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) layer **)** | | void | [area\_set\_collision\_mask](#class-physics2dserver-method-area-set-collision-mask) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) mask **)** | | void | [area\_set\_monitor\_callback](#class-physics2dserver-method-area-set-monitor-callback) **(** [RID](class_rid#class-rid) area, [Object](class_object#class-object) receiver, [String](class_string#class-string) method **)** | | void | [area\_set\_monitorable](#class-physics2dserver-method-area-set-monitorable) **(** [RID](class_rid#class-rid) area, [bool](class_bool#class-bool) monitorable **)** | | void | [area\_set\_param](#class-physics2dserver-method-area-set-param) **(** [RID](class_rid#class-rid) area, [AreaParameter](#enum-physics2dserver-areaparameter) param, [Variant](class_variant#class-variant) value **)** | | void | [area\_set\_shape](#class-physics2dserver-method-area-set-shape) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx, [RID](class_rid#class-rid) shape **)** | | void | [area\_set\_shape\_disabled](#class-physics2dserver-method-area-set-shape-disabled) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx, [bool](class_bool#class-bool) disabled **)** | | void | [area\_set\_shape\_transform](#class-physics2dserver-method-area-set-shape-transform) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx, [Transform2D](class_transform2d#class-transform2d) transform **)** | | void | [area\_set\_space](#class-physics2dserver-method-area-set-space) **(** [RID](class_rid#class-rid) area, [RID](class_rid#class-rid) space **)** | | void | [area\_set\_space\_override\_mode](#class-physics2dserver-method-area-set-space-override-mode) **(** [RID](class_rid#class-rid) area, [AreaSpaceOverrideMode](#enum-physics2dserver-areaspaceoverridemode) mode **)** | | void | [area\_set\_transform](#class-physics2dserver-method-area-set-transform) **(** [RID](class_rid#class-rid) area, [Transform2D](class_transform2d#class-transform2d) transform **)** | | void | [body\_add\_central\_force](#class-physics2dserver-method-body-add-central-force) **(** [RID](class_rid#class-rid) body, [Vector2](class_vector2#class-vector2) force **)** | | void | [body\_add\_collision\_exception](#class-physics2dserver-method-body-add-collision-exception) **(** [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) excepted\_body **)** | | void | [body\_add\_force](#class-physics2dserver-method-body-add-force) **(** [RID](class_rid#class-rid) body, [Vector2](class_vector2#class-vector2) offset, [Vector2](class_vector2#class-vector2) force **)** | | void | [body\_add\_shape](#class-physics2dserver-method-body-add-shape) **(** [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) shape, [Transform2D](class_transform2d#class-transform2d) transform=Transform2D( 1, 0, 0, 1, 0, 0 ), [bool](class_bool#class-bool) disabled=false **)** | | void | [body\_add\_torque](#class-physics2dserver-method-body-add-torque) **(** [RID](class_rid#class-rid) body, [float](class_float#class-float) torque **)** | | void | [body\_apply\_central\_impulse](#class-physics2dserver-method-body-apply-central-impulse) **(** [RID](class_rid#class-rid) body, [Vector2](class_vector2#class-vector2) impulse **)** | | void | [body\_apply\_impulse](#class-physics2dserver-method-body-apply-impulse) **(** [RID](class_rid#class-rid) body, [Vector2](class_vector2#class-vector2) position, [Vector2](class_vector2#class-vector2) impulse **)** | | void | [body\_apply\_torque\_impulse](#class-physics2dserver-method-body-apply-torque-impulse) **(** [RID](class_rid#class-rid) body, [float](class_float#class-float) impulse **)** | | void | [body\_attach\_canvas\_instance\_id](#class-physics2dserver-method-body-attach-canvas-instance-id) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) id **)** | | void | [body\_attach\_object\_instance\_id](#class-physics2dserver-method-body-attach-object-instance-id) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) id **)** | | void | [body\_clear\_shapes](#class-physics2dserver-method-body-clear-shapes) **(** [RID](class_rid#class-rid) body **)** | | [RID](class_rid#class-rid) | [body\_create](#class-physics2dserver-method-body-create) **(** **)** | | [int](class_int#class-int) | [body\_get\_canvas\_instance\_id](#class-physics2dserver-method-body-get-canvas-instance-id) **(** [RID](class_rid#class-rid) body **)** const | | [int](class_int#class-int) | [body\_get\_collision\_layer](#class-physics2dserver-method-body-get-collision-layer) **(** [RID](class_rid#class-rid) body **)** const | | [int](class_int#class-int) | [body\_get\_collision\_mask](#class-physics2dserver-method-body-get-collision-mask) **(** [RID](class_rid#class-rid) body **)** const | | [CCDMode](#enum-physics2dserver-ccdmode) | [body\_get\_continuous\_collision\_detection\_mode](#class-physics2dserver-method-body-get-continuous-collision-detection-mode) **(** [RID](class_rid#class-rid) body **)** const | | [Physics2DDirectBodyState](class_physics2ddirectbodystate#class-physics2ddirectbodystate) | [body\_get\_direct\_state](#class-physics2dserver-method-body-get-direct-state) **(** [RID](class_rid#class-rid) body **)** | | [int](class_int#class-int) | [body\_get\_max\_contacts\_reported](#class-physics2dserver-method-body-get-max-contacts-reported) **(** [RID](class_rid#class-rid) body **)** const | | [BodyMode](#enum-physics2dserver-bodymode) | [body\_get\_mode](#class-physics2dserver-method-body-get-mode) **(** [RID](class_rid#class-rid) body **)** const | | [int](class_int#class-int) | [body\_get\_object\_instance\_id](#class-physics2dserver-method-body-get-object-instance-id) **(** [RID](class_rid#class-rid) body **)** const | | [float](class_float#class-float) | [body\_get\_param](#class-physics2dserver-method-body-get-param) **(** [RID](class_rid#class-rid) body, [BodyParameter](#enum-physics2dserver-bodyparameter) param **)** const | | [RID](class_rid#class-rid) | [body\_get\_shape](#class-physics2dserver-method-body-get-shape) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx **)** const | | [int](class_int#class-int) | [body\_get\_shape\_count](#class-physics2dserver-method-body-get-shape-count) **(** [RID](class_rid#class-rid) body **)** const | | [Variant](class_variant#class-variant) | [body\_get\_shape\_metadata](#class-physics2dserver-method-body-get-shape-metadata) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx **)** const | | [Transform2D](class_transform2d#class-transform2d) | [body\_get\_shape\_transform](#class-physics2dserver-method-body-get-shape-transform) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx **)** const | | [RID](class_rid#class-rid) | [body\_get\_space](#class-physics2dserver-method-body-get-space) **(** [RID](class_rid#class-rid) body **)** const | | [Variant](class_variant#class-variant) | [body\_get\_state](#class-physics2dserver-method-body-get-state) **(** [RID](class_rid#class-rid) body, [BodyState](#enum-physics2dserver-bodystate) state **)** const | | [bool](class_bool#class-bool) | [body\_is\_omitting\_force\_integration](#class-physics2dserver-method-body-is-omitting-force-integration) **(** [RID](class_rid#class-rid) body **)** const | | void | [body\_remove\_collision\_exception](#class-physics2dserver-method-body-remove-collision-exception) **(** [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) excepted\_body **)** | | void | [body\_remove\_shape](#class-physics2dserver-method-body-remove-shape) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx **)** | | void | [body\_set\_axis\_velocity](#class-physics2dserver-method-body-set-axis-velocity) **(** [RID](class_rid#class-rid) body, [Vector2](class_vector2#class-vector2) axis\_velocity **)** | | void | [body\_set\_collision\_layer](#class-physics2dserver-method-body-set-collision-layer) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) layer **)** | | void | [body\_set\_collision\_mask](#class-physics2dserver-method-body-set-collision-mask) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) mask **)** | | void | [body\_set\_continuous\_collision\_detection\_mode](#class-physics2dserver-method-body-set-continuous-collision-detection-mode) **(** [RID](class_rid#class-rid) body, [CCDMode](#enum-physics2dserver-ccdmode) mode **)** | | void | [body\_set\_force\_integration\_callback](#class-physics2dserver-method-body-set-force-integration-callback) **(** [RID](class_rid#class-rid) body, [Object](class_object#class-object) receiver, [String](class_string#class-string) method, [Variant](class_variant#class-variant) userdata=null **)** | | void | [body\_set\_max\_contacts\_reported](#class-physics2dserver-method-body-set-max-contacts-reported) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) amount **)** | | void | [body\_set\_mode](#class-physics2dserver-method-body-set-mode) **(** [RID](class_rid#class-rid) body, [BodyMode](#enum-physics2dserver-bodymode) mode **)** | | void | [body\_set\_omit\_force\_integration](#class-physics2dserver-method-body-set-omit-force-integration) **(** [RID](class_rid#class-rid) body, [bool](class_bool#class-bool) enable **)** | | void | [body\_set\_param](#class-physics2dserver-method-body-set-param) **(** [RID](class_rid#class-rid) body, [BodyParameter](#enum-physics2dserver-bodyparameter) param, [float](class_float#class-float) value **)** | | void | [body\_set\_shape](#class-physics2dserver-method-body-set-shape) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [RID](class_rid#class-rid) shape **)** | | void | [body\_set\_shape\_as\_one\_way\_collision](#class-physics2dserver-method-body-set-shape-as-one-way-collision) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [bool](class_bool#class-bool) enable, [float](class_float#class-float) margin **)** | | void | [body\_set\_shape\_disabled](#class-physics2dserver-method-body-set-shape-disabled) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [bool](class_bool#class-bool) disabled **)** | | void | [body\_set\_shape\_metadata](#class-physics2dserver-method-body-set-shape-metadata) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [Variant](class_variant#class-variant) metadata **)** | | void | [body\_set\_shape\_transform](#class-physics2dserver-method-body-set-shape-transform) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [Transform2D](class_transform2d#class-transform2d) transform **)** | | void | [body\_set\_space](#class-physics2dserver-method-body-set-space) **(** [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) space **)** | | void | [body\_set\_state](#class-physics2dserver-method-body-set-state) **(** [RID](class_rid#class-rid) body, [BodyState](#enum-physics2dserver-bodystate) state, [Variant](class_variant#class-variant) value **)** | | [bool](class_bool#class-bool) | [body\_test\_motion](#class-physics2dserver-method-body-test-motion) **(** [RID](class_rid#class-rid) body, [Transform2D](class_transform2d#class-transform2d) from, [Vector2](class_vector2#class-vector2) motion, [bool](class_bool#class-bool) infinite\_inertia, [float](class_float#class-float) margin=0.08, [Physics2DTestMotionResult](class_physics2dtestmotionresult#class-physics2dtestmotionresult) result=null, [bool](class_bool#class-bool) exclude\_raycast\_shapes=true, [Array](class_array#class-array) exclude=[ ] **)** | | [RID](class_rid#class-rid) | [capsule\_shape\_create](#class-physics2dserver-method-capsule-shape-create) **(** **)** | | [RID](class_rid#class-rid) | [circle\_shape\_create](#class-physics2dserver-method-circle-shape-create) **(** **)** | | [RID](class_rid#class-rid) | [concave\_polygon\_shape\_create](#class-physics2dserver-method-concave-polygon-shape-create) **(** **)** | | [RID](class_rid#class-rid) | [convex\_polygon\_shape\_create](#class-physics2dserver-method-convex-polygon-shape-create) **(** **)** | | [RID](class_rid#class-rid) | [damped\_spring\_joint\_create](#class-physics2dserver-method-damped-spring-joint-create) **(** [Vector2](class_vector2#class-vector2) anchor\_a, [Vector2](class_vector2#class-vector2) anchor\_b, [RID](class_rid#class-rid) body\_a, [RID](class_rid#class-rid) body\_b **)** | | [float](class_float#class-float) | [damped\_string\_joint\_get\_param](#class-physics2dserver-method-damped-string-joint-get-param) **(** [RID](class_rid#class-rid) joint, [DampedStringParam](#enum-physics2dserver-dampedstringparam) param **)** const | | void | [damped\_string\_joint\_set\_param](#class-physics2dserver-method-damped-string-joint-set-param) **(** [RID](class_rid#class-rid) joint, [DampedStringParam](#enum-physics2dserver-dampedstringparam) param, [float](class_float#class-float) value **)** | | void | [free\_rid](#class-physics2dserver-method-free-rid) **(** [RID](class_rid#class-rid) rid **)** | | [int](class_int#class-int) | [get\_process\_info](#class-physics2dserver-method-get-process-info) **(** [ProcessInfo](#enum-physics2dserver-processinfo) process\_info **)** | | [RID](class_rid#class-rid) | [groove\_joint\_create](#class-physics2dserver-method-groove-joint-create) **(** [Vector2](class_vector2#class-vector2) groove1\_a, [Vector2](class_vector2#class-vector2) groove2\_a, [Vector2](class_vector2#class-vector2) anchor\_b, [RID](class_rid#class-rid) body\_a, [RID](class_rid#class-rid) body\_b **)** | | [float](class_float#class-float) | [joint\_get\_param](#class-physics2dserver-method-joint-get-param) **(** [RID](class_rid#class-rid) joint, [JointParam](#enum-physics2dserver-jointparam) param **)** const | | [JointType](#enum-physics2dserver-jointtype) | [joint\_get\_type](#class-physics2dserver-method-joint-get-type) **(** [RID](class_rid#class-rid) joint **)** const | | void | [joint\_set\_param](#class-physics2dserver-method-joint-set-param) **(** [RID](class_rid#class-rid) joint, [JointParam](#enum-physics2dserver-jointparam) param, [float](class_float#class-float) value **)** | | [RID](class_rid#class-rid) | [line\_shape\_create](#class-physics2dserver-method-line-shape-create) **(** **)** | | [RID](class_rid#class-rid) | [pin\_joint\_create](#class-physics2dserver-method-pin-joint-create) **(** [Vector2](class_vector2#class-vector2) anchor, [RID](class_rid#class-rid) body\_a, [RID](class_rid#class-rid) body\_b **)** | | [RID](class_rid#class-rid) | [ray\_shape\_create](#class-physics2dserver-method-ray-shape-create) **(** **)** | | [RID](class_rid#class-rid) | [rectangle\_shape\_create](#class-physics2dserver-method-rectangle-shape-create) **(** **)** | | [RID](class_rid#class-rid) | [segment\_shape\_create](#class-physics2dserver-method-segment-shape-create) **(** **)** | | void | [set\_active](#class-physics2dserver-method-set-active) **(** [bool](class_bool#class-bool) active **)** | | void | [set\_collision\_iterations](#class-physics2dserver-method-set-collision-iterations) **(** [int](class_int#class-int) iterations **)** | | [Variant](class_variant#class-variant) | [shape\_get\_data](#class-physics2dserver-method-shape-get-data) **(** [RID](class_rid#class-rid) shape **)** const | | [ShapeType](#enum-physics2dserver-shapetype) | [shape\_get\_type](#class-physics2dserver-method-shape-get-type) **(** [RID](class_rid#class-rid) shape **)** const | | void | [shape\_set\_data](#class-physics2dserver-method-shape-set-data) **(** [RID](class_rid#class-rid) shape, [Variant](class_variant#class-variant) data **)** | | [RID](class_rid#class-rid) | [space\_create](#class-physics2dserver-method-space-create) **(** **)** | | [Physics2DDirectSpaceState](class_physics2ddirectspacestate#class-physics2ddirectspacestate) | [space\_get\_direct\_state](#class-physics2dserver-method-space-get-direct-state) **(** [RID](class_rid#class-rid) space **)** | | [float](class_float#class-float) | [space\_get\_param](#class-physics2dserver-method-space-get-param) **(** [RID](class_rid#class-rid) space, [SpaceParameter](#enum-physics2dserver-spaceparameter) param **)** const | | [bool](class_bool#class-bool) | [space\_is\_active](#class-physics2dserver-method-space-is-active) **(** [RID](class_rid#class-rid) space **)** const | | void | [space\_set\_active](#class-physics2dserver-method-space-set-active) **(** [RID](class_rid#class-rid) space, [bool](class_bool#class-bool) active **)** | | void | [space\_set\_param](#class-physics2dserver-method-space-set-param) **(** [RID](class_rid#class-rid) space, [SpaceParameter](#enum-physics2dserver-spaceparameter) param, [float](class_float#class-float) value **)** | Enumerations ------------ enum **SpaceParameter**: * **SPACE\_PARAM\_CONTACT\_RECYCLE\_RADIUS** = **0** --- Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. * **SPACE\_PARAM\_CONTACT\_MAX\_SEPARATION** = **1** --- Constant to set/get the maximum distance a shape can be from another before they are considered separated. * **SPACE\_PARAM\_BODY\_MAX\_ALLOWED\_PENETRATION** = **2** --- Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. * **SPACE\_PARAM\_BODY\_LINEAR\_VELOCITY\_SLEEP\_THRESHOLD** = **3** --- Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. * **SPACE\_PARAM\_BODY\_ANGULAR\_VELOCITY\_SLEEP\_THRESHOLD** = **4** --- Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. * **SPACE\_PARAM\_BODY\_TIME\_TO\_SLEEP** = **5** --- Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. * **SPACE\_PARAM\_CONSTRAINT\_DEFAULT\_BIAS** = **6** --- Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision. enum **ShapeType**: * **SHAPE\_LINE** = **0** --- This is the constant for creating line shapes. A line shape is an infinite line with an origin point, and a normal. Thus, it can be used for front/behind checks. * **SHAPE\_RAY** = **1** * **SHAPE\_SEGMENT** = **2** --- This is the constant for creating segment shapes. A segment shape is a line from a point A to a point B. It can be checked for intersections. * **SHAPE\_CIRCLE** = **3** --- This is the constant for creating circle shapes. A circle shape only has a radius. It can be used for intersections and inside/outside checks. * **SHAPE\_RECTANGLE** = **4** --- This is the constant for creating rectangle shapes. A rectangle shape is defined by a width and a height. It can be used for intersections and inside/outside checks. * **SHAPE\_CAPSULE** = **5** --- This is the constant for creating capsule shapes. A capsule shape is defined by a radius and a length. It can be used for intersections and inside/outside checks. * **SHAPE\_CONVEX\_POLYGON** = **6** --- This is the constant for creating convex polygon shapes. A polygon is defined by a list of points. It can be used for intersections and inside/outside checks. Unlike the [CollisionPolygon2D.polygon](class_collisionpolygon2d#class-collisionpolygon2d-property-polygon) property, polygons modified with [shape\_set\_data](#class-physics2dserver-method-shape-set-data) do not verify that the points supplied form is a convex polygon. * **SHAPE\_CONCAVE\_POLYGON** = **7** --- This is the constant for creating concave polygon shapes. A polygon is defined by a list of points. It can be used for intersections checks, but not for inside/outside checks. * **SHAPE\_CUSTOM** = **8** --- This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. enum **AreaParameter**: * **AREA\_PARAM\_GRAVITY** = **0** --- Constant to set/get gravity strength in an area. * **AREA\_PARAM\_GRAVITY\_VECTOR** = **1** --- Constant to set/get gravity vector/center in an area. * **AREA\_PARAM\_GRAVITY\_IS\_POINT** = **2** --- Constant to set/get whether the gravity vector of an area is a direction, or a center point. * **AREA\_PARAM\_GRAVITY\_DISTANCE\_SCALE** = **3** --- Constant to set/get the falloff factor for point gravity of an area. The greater this value is, the faster the strength of gravity decreases with the square of distance. * **AREA\_PARAM\_GRAVITY\_POINT\_ATTENUATION** = **4** --- This constant was used to set/get the falloff factor for point gravity. It has been superseded by [AREA\_PARAM\_GRAVITY\_DISTANCE\_SCALE](#class-physics2dserver-constant-area-param-gravity-distance-scale). * **AREA\_PARAM\_LINEAR\_DAMP** = **5** --- Constant to set/get the linear dampening factor of an area. * **AREA\_PARAM\_ANGULAR\_DAMP** = **6** --- Constant to set/get the angular dampening factor of an area. * **AREA\_PARAM\_PRIORITY** = **7** --- Constant to set/get the priority (order of processing) of an area. enum **AreaSpaceOverrideMode**: * **AREA\_SPACE\_OVERRIDE\_DISABLED** = **0** --- This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. * **AREA\_SPACE\_OVERRIDE\_COMBINE** = **1** --- This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. * **AREA\_SPACE\_OVERRIDE\_COMBINE\_REPLACE** = **2** --- This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. * **AREA\_SPACE\_OVERRIDE\_REPLACE** = **3** --- This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. * **AREA\_SPACE\_OVERRIDE\_REPLACE\_COMBINE** = **4** --- This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. enum **BodyMode**: * **BODY\_MODE\_STATIC** = **0** --- Constant for static bodies. * **BODY\_MODE\_KINEMATIC** = **1** --- Constant for kinematic bodies. * **BODY\_MODE\_RIGID** = **2** --- Constant for rigid bodies. * **BODY\_MODE\_CHARACTER** = **3** --- Constant for rigid bodies in character mode. In this mode, a body can not rotate, and only its linear velocity is affected by physics. enum **BodyParameter**: * **BODY\_PARAM\_BOUNCE** = **0** --- Constant to set/get a body's bounce factor. * **BODY\_PARAM\_FRICTION** = **1** --- Constant to set/get a body's friction. * **BODY\_PARAM\_MASS** = **2** --- Constant to set/get a body's mass. * **BODY\_PARAM\_INERTIA** = **3** --- Constant to set/get a body's inertia. * **BODY\_PARAM\_GRAVITY\_SCALE** = **4** --- Constant to set/get a body's gravity multiplier. * **BODY\_PARAM\_LINEAR\_DAMP** = **5** --- Constant to set/get a body's linear dampening factor. * **BODY\_PARAM\_ANGULAR\_DAMP** = **6** --- Constant to set/get a body's angular dampening factor. * **BODY\_PARAM\_MAX** = **7** --- Represents the size of the [BodyParameter](#enum-physics2dserver-bodyparameter) enum. enum **BodyState**: * **BODY\_STATE\_TRANSFORM** = **0** --- Constant to set/get the current transform matrix of the body. * **BODY\_STATE\_LINEAR\_VELOCITY** = **1** --- Constant to set/get the current linear velocity of the body. * **BODY\_STATE\_ANGULAR\_VELOCITY** = **2** --- Constant to set/get the current angular velocity of the body. * **BODY\_STATE\_SLEEPING** = **3** --- Constant to sleep/wake up a body, or to get whether it is sleeping. * **BODY\_STATE\_CAN\_SLEEP** = **4** --- Constant to set/get whether the body can sleep. enum **JointType**: * **JOINT\_PIN** = **0** --- Constant to create pin joints. * **JOINT\_GROOVE** = **1** --- Constant to create groove joints. * **JOINT\_DAMPED\_SPRING** = **2** --- Constant to create damped spring joints. enum **JointParam**: * **JOINT\_PARAM\_BIAS** = **0** * **JOINT\_PARAM\_MAX\_BIAS** = **1** * **JOINT\_PARAM\_MAX\_FORCE** = **2** enum **DampedStringParam**: * **DAMPED\_STRING\_REST\_LENGTH** = **0** --- Sets the resting length of the spring joint. The joint will always try to go to back this length when pulled apart. * **DAMPED\_STRING\_STIFFNESS** = **1** --- Sets the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length. * **DAMPED\_STRING\_DAMPING** = **2** --- Sets the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping). enum **CCDMode**: * **CCD\_MODE\_DISABLED** = **0** --- Disables continuous collision detection. This is the fastest way to detect body collisions, but can miss small, fast-moving objects. * **CCD\_MODE\_CAST\_RAY** = **1** --- Enables continuous collision detection by raycasting. It is faster than shapecasting, but less precise. * **CCD\_MODE\_CAST\_SHAPE** = **2** --- Enables continuous collision detection by shapecasting. It is the slowest CCD method, and the most precise. enum **AreaBodyStatus**: * **AREA\_BODY\_ADDED** = **0** --- The value of the first parameter and area callback function receives, when an object enters one of its shapes. * **AREA\_BODY\_REMOVED** = **1** --- The value of the first parameter and area callback function receives, when an object exits one of its shapes. enum **ProcessInfo**: * **INFO\_ACTIVE\_OBJECTS** = **0** --- Constant to get the number of objects that are not sleeping. * **INFO\_COLLISION\_PAIRS** = **1** --- Constant to get the number of possible collisions. * **INFO\_ISLAND\_COUNT** = **2** --- Constant to get the number of space regions where a collision could occur. Method Descriptions ------------------- ### void area\_add\_shape ( [RID](class_rid#class-rid) area, [RID](class_rid#class-rid) shape, [Transform2D](class_transform2d#class-transform2d) transform=Transform2D( 1, 0, 0, 1, 0, 0 ), [bool](class_bool#class-bool) disabled=false ) Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. ### void area\_attach\_canvas\_instance\_id ( [RID](class_rid#class-rid) area, [int](class_int#class-int) id ) ### void area\_attach\_object\_instance\_id ( [RID](class_rid#class-rid) area, [int](class_int#class-int) id ) Assigns the area to a descendant of [Object](class_object#class-object), so it can exist in the node tree. ### void area\_clear\_shapes ( [RID](class_rid#class-rid) area ) Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later. ### [RID](class_rid#class-rid) area\_create ( ) Creates an [Area2D](class_area2d#class-area2d). After creating an [Area2D](class_area2d#class-area2d) with this method, assign it to a space using [area\_set\_space](#class-physics2dserver-method-area-set-space) to use the created [Area2D](class_area2d#class-area2d) in the physics world. ### [int](class_int#class-int) area\_get\_canvas\_instance\_id ( [RID](class_rid#class-rid) area ) const ### [int](class_int#class-int) area\_get\_object\_instance\_id ( [RID](class_rid#class-rid) area ) const Gets the instance ID of the object the area is assigned to. ### [Variant](class_variant#class-variant) area\_get\_param ( [RID](class_rid#class-rid) area, [AreaParameter](#enum-physics2dserver-areaparameter) param ) const Returns an area parameter value. See [AreaParameter](#enum-physics2dserver-areaparameter) for a list of available parameters. ### [RID](class_rid#class-rid) area\_get\_shape ( [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx ) const Returns the [RID](class_rid#class-rid) of the nth shape of an area. ### [int](class_int#class-int) area\_get\_shape\_count ( [RID](class_rid#class-rid) area ) const Returns the number of shapes assigned to an area. ### [Transform2D](class_transform2d#class-transform2d) area\_get\_shape\_transform ( [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx ) const Returns the transform matrix of a shape within an area. ### [RID](class_rid#class-rid) area\_get\_space ( [RID](class_rid#class-rid) area ) const Returns the space assigned to the area. ### [AreaSpaceOverrideMode](#enum-physics2dserver-areaspaceoverridemode) area\_get\_space\_override\_mode ( [RID](class_rid#class-rid) area ) const Returns the space override mode for the area. ### [Transform2D](class_transform2d#class-transform2d) area\_get\_transform ( [RID](class_rid#class-rid) area ) const Returns the transform matrix for an area. ### void area\_remove\_shape ( [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx ) Removes a shape from an area. It does not delete the shape, so it can be reassigned later. ### void area\_set\_area\_monitor\_callback ( [RID](class_rid#class-rid) area, [Object](class_object#class-object) receiver, [String](class_string#class-string) method ) ### void area\_set\_collision\_layer ( [RID](class_rid#class-rid) area, [int](class_int#class-int) layer ) Assigns the area to one or many physics layers. ### void area\_set\_collision\_mask ( [RID](class_rid#class-rid) area, [int](class_int#class-int) mask ) Sets which physics layers the area will monitor. ### void area\_set\_monitor\_callback ( [RID](class_rid#class-rid) area, [Object](class_object#class-object) receiver, [String](class_string#class-string) method ) Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters: 1: [AREA\_BODY\_ADDED](#class-physics2dserver-constant-area-body-added) or [AREA\_BODY\_REMOVED](#class-physics2dserver-constant-area-body-removed), depending on whether the object entered or exited the area. 2: [RID](class_rid#class-rid) of the object that entered/exited the area. 3: Instance ID of the object that entered/exited the area. 4: The shape index of the object that entered/exited the area. 5: The shape index of the area where the object entered/exited. ### void area\_set\_monitorable ( [RID](class_rid#class-rid) area, [bool](class_bool#class-bool) monitorable ) ### void area\_set\_param ( [RID](class_rid#class-rid) area, [AreaParameter](#enum-physics2dserver-areaparameter) param, [Variant](class_variant#class-variant) value ) Sets the value for an area parameter. See [AreaParameter](#enum-physics2dserver-areaparameter) for a list of available parameters. ### void area\_set\_shape ( [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx, [RID](class_rid#class-rid) shape ) Substitutes a given area shape by another. The old shape is selected by its index, the new one by its [RID](class_rid#class-rid). ### void area\_set\_shape\_disabled ( [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx, [bool](class_bool#class-bool) disabled ) Disables a given shape in an area. ### void area\_set\_shape\_transform ( [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx, [Transform2D](class_transform2d#class-transform2d) transform ) Sets the transform matrix for an area shape. ### void area\_set\_space ( [RID](class_rid#class-rid) area, [RID](class_rid#class-rid) space ) Assigns a space to the area. ### void area\_set\_space\_override\_mode ( [RID](class_rid#class-rid) area, [AreaSpaceOverrideMode](#enum-physics2dserver-areaspaceoverridemode) mode ) Sets the space override mode for the area. See [AreaSpaceOverrideMode](#enum-physics2dserver-areaspaceoverridemode) for a list of available modes. ### void area\_set\_transform ( [RID](class_rid#class-rid) area, [Transform2D](class_transform2d#class-transform2d) transform ) Sets the transform matrix for an area. ### void body\_add\_central\_force ( [RID](class_rid#class-rid) body, [Vector2](class_vector2#class-vector2) force ) ### void body\_add\_collision\_exception ( [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) excepted\_body ) Adds a body to the list of bodies exempt from collisions. ### void body\_add\_force ( [RID](class_rid#class-rid) body, [Vector2](class_vector2#class-vector2) offset, [Vector2](class_vector2#class-vector2) force ) Adds a positioned force to the applied force and torque. As with [body\_apply\_impulse](#class-physics2dserver-method-body-apply-impulse), both the force and the offset from the body origin are in global coordinates. A force differs from an impulse in that, while the two are forces, the impulse clears itself after being applied. ### void body\_add\_shape ( [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) shape, [Transform2D](class_transform2d#class-transform2d) transform=Transform2D( 1, 0, 0, 1, 0, 0 ), [bool](class_bool#class-bool) disabled=false ) Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. ### void body\_add\_torque ( [RID](class_rid#class-rid) body, [float](class_float#class-float) torque ) ### void body\_apply\_central\_impulse ( [RID](class_rid#class-rid) body, [Vector2](class_vector2#class-vector2) impulse ) ### void body\_apply\_impulse ( [RID](class_rid#class-rid) body, [Vector2](class_vector2#class-vector2) position, [Vector2](class_vector2#class-vector2) impulse ) Adds a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates. ### void body\_apply\_torque\_impulse ( [RID](class_rid#class-rid) body, [float](class_float#class-float) impulse ) ### void body\_attach\_canvas\_instance\_id ( [RID](class_rid#class-rid) body, [int](class_int#class-int) id ) ### void body\_attach\_object\_instance\_id ( [RID](class_rid#class-rid) body, [int](class_int#class-int) id ) Assigns the area to a descendant of [Object](class_object#class-object), so it can exist in the node tree. ### void body\_clear\_shapes ( [RID](class_rid#class-rid) body ) Removes all shapes from a body. ### [RID](class_rid#class-rid) body\_create ( ) Creates a physics body. ### [int](class_int#class-int) body\_get\_canvas\_instance\_id ( [RID](class_rid#class-rid) body ) const ### [int](class_int#class-int) body\_get\_collision\_layer ( [RID](class_rid#class-rid) body ) const Returns the physics layer or layers a body belongs to. ### [int](class_int#class-int) body\_get\_collision\_mask ( [RID](class_rid#class-rid) body ) const Returns the physics layer or layers a body can collide with. ### [CCDMode](#enum-physics2dserver-ccdmode) body\_get\_continuous\_collision\_detection\_mode ( [RID](class_rid#class-rid) body ) const Returns the continuous collision detection mode. ### [Physics2DDirectBodyState](class_physics2ddirectbodystate#class-physics2ddirectbodystate) body\_get\_direct\_state ( [RID](class_rid#class-rid) body ) Returns the [Physics2DDirectBodyState](class_physics2ddirectbodystate#class-physics2ddirectbodystate) of the body. Returns `null` if the body is destroyed or removed from the physics space. ### [int](class_int#class-int) body\_get\_max\_contacts\_reported ( [RID](class_rid#class-rid) body ) const Returns the maximum contacts that can be reported. See [body\_set\_max\_contacts\_reported](#class-physics2dserver-method-body-set-max-contacts-reported). ### [BodyMode](#enum-physics2dserver-bodymode) body\_get\_mode ( [RID](class_rid#class-rid) body ) const Returns the body mode. ### [int](class_int#class-int) body\_get\_object\_instance\_id ( [RID](class_rid#class-rid) body ) const Gets the instance ID of the object the area is assigned to. ### [float](class_float#class-float) body\_get\_param ( [RID](class_rid#class-rid) body, [BodyParameter](#enum-physics2dserver-bodyparameter) param ) const Returns the value of a body parameter. See [BodyParameter](#enum-physics2dserver-bodyparameter) for a list of available parameters. ### [RID](class_rid#class-rid) body\_get\_shape ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx ) const Returns the [RID](class_rid#class-rid) of the nth shape of a body. ### [int](class_int#class-int) body\_get\_shape\_count ( [RID](class_rid#class-rid) body ) const Returns the number of shapes assigned to a body. ### [Variant](class_variant#class-variant) body\_get\_shape\_metadata ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx ) const Returns the metadata of a shape of a body. ### [Transform2D](class_transform2d#class-transform2d) body\_get\_shape\_transform ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx ) const Returns the transform matrix of a body shape. ### [RID](class_rid#class-rid) body\_get\_space ( [RID](class_rid#class-rid) body ) const Returns the [RID](class_rid#class-rid) of the space assigned to a body. ### [Variant](class_variant#class-variant) body\_get\_state ( [RID](class_rid#class-rid) body, [BodyState](#enum-physics2dserver-bodystate) state ) const Returns a body state. ### [bool](class_bool#class-bool) body\_is\_omitting\_force\_integration ( [RID](class_rid#class-rid) body ) const Returns whether a body uses a callback function to calculate its own physics (see [body\_set\_force\_integration\_callback](#class-physics2dserver-method-body-set-force-integration-callback)). ### void body\_remove\_collision\_exception ( [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) excepted\_body ) Removes a body from the list of bodies exempt from collisions. ### void body\_remove\_shape ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx ) Removes a shape from a body. The shape is not deleted, so it can be reused afterwards. ### void body\_set\_axis\_velocity ( [RID](class_rid#class-rid) body, [Vector2](class_vector2#class-vector2) axis\_velocity ) Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. ### void body\_set\_collision\_layer ( [RID](class_rid#class-rid) body, [int](class_int#class-int) layer ) Sets the physics layer or layers a body belongs to. ### void body\_set\_collision\_mask ( [RID](class_rid#class-rid) body, [int](class_int#class-int) mask ) Sets the physics layer or layers a body can collide with. ### void body\_set\_continuous\_collision\_detection\_mode ( [RID](class_rid#class-rid) body, [CCDMode](#enum-physics2dserver-ccdmode) mode ) Sets the continuous collision detection mode using one of the [CCDMode](#enum-physics2dserver-ccdmode) constants. Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. ### void body\_set\_force\_integration\_callback ( [RID](class_rid#class-rid) body, [Object](class_object#class-object) receiver, [String](class_string#class-string) method, [Variant](class_variant#class-variant) userdata=null ) Sets the function used to calculate physics for an object, if that object allows it (see [body\_set\_omit\_force\_integration](#class-physics2dserver-method-body-set-omit-force-integration)). ### void body\_set\_max\_contacts\_reported ( [RID](class_rid#class-rid) body, [int](class_int#class-int) amount ) Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0. ### void body\_set\_mode ( [RID](class_rid#class-rid) body, [BodyMode](#enum-physics2dserver-bodymode) mode ) Sets the body mode using one of the [BodyMode](#enum-physics2dserver-bodymode) constants. ### void body\_set\_omit\_force\_integration ( [RID](class_rid#class-rid) body, [bool](class_bool#class-bool) enable ) Sets whether a body uses a callback function to calculate its own physics (see [body\_set\_force\_integration\_callback](#class-physics2dserver-method-body-set-force-integration-callback)). ### void body\_set\_param ( [RID](class_rid#class-rid) body, [BodyParameter](#enum-physics2dserver-bodyparameter) param, [float](class_float#class-float) value ) Sets a body parameter. See [BodyParameter](#enum-physics2dserver-bodyparameter) for a list of available parameters. ### void body\_set\_shape ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [RID](class_rid#class-rid) shape ) Substitutes a given body shape by another. The old shape is selected by its index, the new one by its [RID](class_rid#class-rid). ### void body\_set\_shape\_as\_one\_way\_collision ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [bool](class_bool#class-bool) enable, [float](class_float#class-float) margin ) Enables one way collision on body if `enable` is `true`. ### void body\_set\_shape\_disabled ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [bool](class_bool#class-bool) disabled ) Disables shape in body if `disable` is `true`. ### void body\_set\_shape\_metadata ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [Variant](class_variant#class-variant) metadata ) Sets metadata of a shape within a body. This metadata is different from [Object.set\_meta](class_object#class-object-method-set-meta), and can be retrieved on shape queries. ### void body\_set\_shape\_transform ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [Transform2D](class_transform2d#class-transform2d) transform ) Sets the transform matrix for a body shape. ### void body\_set\_space ( [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) space ) Assigns a space to the body (see [space\_create](#class-physics2dserver-method-space-create)). ### void body\_set\_state ( [RID](class_rid#class-rid) body, [BodyState](#enum-physics2dserver-bodystate) state, [Variant](class_variant#class-variant) value ) Sets a body state using one of the [BodyState](#enum-physics2dserver-bodystate) constants. Note that the method doesn't take effect immediately. The state will change on the next physics frame. ### [bool](class_bool#class-bool) body\_test\_motion ( [RID](class_rid#class-rid) body, [Transform2D](class_transform2d#class-transform2d) from, [Vector2](class_vector2#class-vector2) motion, [bool](class_bool#class-bool) infinite\_inertia, [float](class_float#class-float) margin=0.08, [Physics2DTestMotionResult](class_physics2dtestmotionresult#class-physics2dtestmotionresult) result=null, [bool](class_bool#class-bool) exclude\_raycast\_shapes=true, [Array](class_array#class-array) exclude=[ ] ) Returns `true` if a collision would result from moving in the given direction from a given point in space. Margin increases the size of the shapes involved in the collision detection. [Physics2DTestMotionResult](class_physics2dtestmotionresult#class-physics2dtestmotionresult) can be passed to return additional information in. ### [RID](class_rid#class-rid) capsule\_shape\_create ( ) ### [RID](class_rid#class-rid) circle\_shape\_create ( ) ### [RID](class_rid#class-rid) concave\_polygon\_shape\_create ( ) ### [RID](class_rid#class-rid) convex\_polygon\_shape\_create ( ) ### [RID](class_rid#class-rid) damped\_spring\_joint\_create ( [Vector2](class_vector2#class-vector2) anchor\_a, [Vector2](class_vector2#class-vector2) anchor\_b, [RID](class_rid#class-rid) body\_a, [RID](class_rid#class-rid) body\_b ) Creates a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself. ### [float](class_float#class-float) damped\_string\_joint\_get\_param ( [RID](class_rid#class-rid) joint, [DampedStringParam](#enum-physics2dserver-dampedstringparam) param ) const Returns the value of a damped spring joint parameter. ### void damped\_string\_joint\_set\_param ( [RID](class_rid#class-rid) joint, [DampedStringParam](#enum-physics2dserver-dampedstringparam) param, [float](class_float#class-float) value ) Sets a damped spring joint parameter. See [DampedStringParam](#enum-physics2dserver-dampedstringparam) for a list of available parameters. ### void free\_rid ( [RID](class_rid#class-rid) rid ) Destroys any of the objects created by Physics2DServer. If the [RID](class_rid#class-rid) passed is not one of the objects that can be created by Physics2DServer, an error will be sent to the console. ### [int](class_int#class-int) get\_process\_info ( [ProcessInfo](#enum-physics2dserver-processinfo) process\_info ) Returns information about the current state of the 2D physics engine. See [ProcessInfo](#enum-physics2dserver-processinfo) for a list of available states. ### [RID](class_rid#class-rid) groove\_joint\_create ( [Vector2](class_vector2#class-vector2) groove1\_a, [Vector2](class_vector2#class-vector2) groove2\_a, [Vector2](class_vector2#class-vector2) anchor\_b, [RID](class_rid#class-rid) body\_a, [RID](class_rid#class-rid) body\_b ) Creates a groove joint between two bodies. If not specified, the bodies are assumed to be the joint itself. ### [float](class_float#class-float) joint\_get\_param ( [RID](class_rid#class-rid) joint, [JointParam](#enum-physics2dserver-jointparam) param ) const Returns the value of a joint parameter. ### [JointType](#enum-physics2dserver-jointtype) joint\_get\_type ( [RID](class_rid#class-rid) joint ) const Returns a joint's type (see [JointType](#enum-physics2dserver-jointtype)). ### void joint\_set\_param ( [RID](class_rid#class-rid) joint, [JointParam](#enum-physics2dserver-jointparam) param, [float](class_float#class-float) value ) Sets a joint parameter. See [JointParam](#enum-physics2dserver-jointparam) for a list of available parameters. ### [RID](class_rid#class-rid) line\_shape\_create ( ) ### [RID](class_rid#class-rid) pin\_joint\_create ( [Vector2](class_vector2#class-vector2) anchor, [RID](class_rid#class-rid) body\_a, [RID](class_rid#class-rid) body\_b ) Creates a pin joint between two bodies. If not specified, the second body is assumed to be the joint itself. ### [RID](class_rid#class-rid) ray\_shape\_create ( ) ### [RID](class_rid#class-rid) rectangle\_shape\_create ( ) ### [RID](class_rid#class-rid) segment\_shape\_create ( ) ### void set\_active ( [bool](class_bool#class-bool) active ) Activates or deactivates the 2D physics engine. ### void set\_collision\_iterations ( [int](class_int#class-int) iterations ) Sets the amount of iterations for calculating velocities of colliding bodies. The greater the amount of iterations, the more accurate the collisions will be. However, a greater amount of iterations requires more CPU power, which can decrease performance. The default value is `8`. ### [Variant](class_variant#class-variant) shape\_get\_data ( [RID](class_rid#class-rid) shape ) const Returns the shape data. ### [ShapeType](#enum-physics2dserver-shapetype) shape\_get\_type ( [RID](class_rid#class-rid) shape ) const Returns a shape's type (see [ShapeType](#enum-physics2dserver-shapetype)). ### void shape\_set\_data ( [RID](class_rid#class-rid) shape, [Variant](class_variant#class-variant) data ) Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created [shape\_get\_type](#class-physics2dserver-method-shape-get-type). ### [RID](class_rid#class-rid) space\_create ( ) Creates a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with [area\_set\_space](#class-physics2dserver-method-area-set-space), or to a body with [body\_set\_space](#class-physics2dserver-method-body-set-space). ### [Physics2DDirectSpaceState](class_physics2ddirectspacestate#class-physics2ddirectspacestate) space\_get\_direct\_state ( [RID](class_rid#class-rid) space ) Returns the state of a space, a [Physics2DDirectSpaceState](class_physics2ddirectspacestate#class-physics2ddirectspacestate). This object can be used to make collision/intersection queries. ### [float](class_float#class-float) space\_get\_param ( [RID](class_rid#class-rid) space, [SpaceParameter](#enum-physics2dserver-spaceparameter) param ) const Returns the value of a space parameter. ### [bool](class_bool#class-bool) space\_is\_active ( [RID](class_rid#class-rid) space ) const Returns whether the space is active. ### void space\_set\_active ( [RID](class_rid#class-rid) space, [bool](class_bool#class-bool) active ) Marks a space as active. It will not have an effect, unless it is assigned to an area or body. ### void space\_set\_param ( [RID](class_rid#class-rid) space, [SpaceParameter](#enum-physics2dserver-spaceparameter) param, [float](class_float#class-float) value ) Sets the value for a space parameter. See [SpaceParameter](#enum-physics2dserver-spaceparameter) for a list of available parameters.
programming_docs
godot VisualScriptIndexGet VisualScriptIndexGet ==================== **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A Visual Script node for getting a value from an array or a dictionary. Description ----------- `VisualScriptIndexGet` will return the value stored in an array or a dictionary under the given index. godot VisualScriptBuiltinFunc VisualScriptBuiltinFunc ======================= **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A Visual Script node used to call built-in functions. Description ----------- A built-in function used inside a [VisualScript](class_visualscript#class-visualscript). It is usually a math function or an utility function. See also [@GDScript](class_%40gdscript#class-gdscript), for the same functions in the GDScript language. Properties ---------- | | | | | --- | --- | --- | | [BuiltinFunc](#enum-visualscriptbuiltinfunc-builtinfunc) | [function](#class-visualscriptbuiltinfunc-property-function) | `0` | Enumerations ------------ enum **BuiltinFunc**: * **MATH\_SIN** = **0** --- Return the sine of the input. * **MATH\_COS** = **1** --- Return the cosine of the input. * **MATH\_TAN** = **2** --- Return the tangent of the input. * **MATH\_SINH** = **3** --- Return the hyperbolic sine of the input. * **MATH\_COSH** = **4** --- Return the hyperbolic cosine of the input. * **MATH\_TANH** = **5** --- Return the hyperbolic tangent of the input. * **MATH\_ASIN** = **6** --- Return the arc sine of the input. * **MATH\_ACOS** = **7** --- Return the arc cosine of the input. * **MATH\_ATAN** = **8** --- Return the arc tangent of the input. * **MATH\_ATAN2** = **9** --- Return the arc tangent of the input, using the signs of both parameters to determine the exact angle. * **MATH\_SQRT** = **10** --- Return the square root of the input. * **MATH\_FMOD** = **11** --- Return the remainder of one input divided by the other, using floating-point numbers. * **MATH\_FPOSMOD** = **12** --- Return the positive remainder of one input divided by the other, using floating-point numbers. * **MATH\_FLOOR** = **13** --- Return the input rounded down. * **MATH\_CEIL** = **14** --- Return the input rounded up. * **MATH\_ROUND** = **15** --- Return the input rounded to the nearest integer. * **MATH\_ABS** = **16** --- Return the absolute value of the input. * **MATH\_SIGN** = **17** --- Return the sign of the input, turning it into 1, -1, or 0. Useful to determine if the input is positive or negative. * **MATH\_POW** = **18** --- Return the input raised to a given power. * **MATH\_LOG** = **19** --- Return the natural logarithm of the input. Note that this is not the typical base-10 logarithm function calculators use. * **MATH\_EXP** = **20** --- Return the mathematical constant **e** raised to the specified power of the input. **e** has an approximate value of 2.71828. * **MATH\_ISNAN** = **21** --- Return whether the input is NaN (Not a Number) or not. NaN is usually produced by dividing 0 by 0, though other ways exist. * **MATH\_ISINF** = **22** --- Return whether the input is an infinite floating-point number or not. Infinity is usually produced by dividing a number by 0, though other ways exist. * **MATH\_EASE** = **23** --- Easing function, based on exponent. 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in. * **MATH\_DECIMALS** = **24** --- Return the number of digit places after the decimal that the first non-zero digit occurs. * **MATH\_STEPIFY** = **25** --- Return the input snapped to a given step. * **MATH\_LERP** = **26** --- Return a number linearly interpolated between the first two inputs, based on the third input. Uses the formula `a + (a - b) * t`. * **MATH\_INVERSE\_LERP** = **27** * **MATH\_RANGE\_LERP** = **28** * **MATH\_MOVE\_TOWARD** = **29** --- Moves the number toward a value, based on the third input. * **MATH\_DECTIME** = **30** --- Return the result of `value` decreased by `step` \* `amount`. * **MATH\_RANDOMIZE** = **31** --- Randomize the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. * **MATH\_RAND** = **32** --- Return a random 32 bits integer value. To obtain a random value between 0 to N (where N is smaller than 2^32 - 1), you can use it with the remainder function. * **MATH\_RANDF** = **33** --- Return a random floating-point value between 0 and 1. To obtain a random value between 0 to N, you can use it with multiplication. * **MATH\_RANDOM** = **34** --- Return a random floating-point value between the two inputs. * **MATH\_SEED** = **35** --- Set the seed for the random number generator. * **MATH\_RANDSEED** = **36** --- Return a random value from the given seed, along with the new seed. * **MATH\_DEG2RAD** = **37** --- Convert the input from degrees to radians. * **MATH\_RAD2DEG** = **38** --- Convert the input from radians to degrees. * **MATH\_LINEAR2DB** = **39** --- Convert the input from linear volume to decibel volume. * **MATH\_DB2LINEAR** = **40** --- Convert the input from decibel volume to linear volume. * **MATH\_POLAR2CARTESIAN** = **41** --- Converts a 2D point expressed in the polar coordinate system (a distance from the origin `r` and an angle `th`) to the cartesian coordinate system (X and Y axis). * **MATH\_CARTESIAN2POLAR** = **42** --- Converts a 2D point expressed in the cartesian coordinate system (X and Y axis) to the polar coordinate system (a distance from the origin and an angle). * **MATH\_WRAP** = **43** * **MATH\_WRAPF** = **44** * **LOGIC\_MAX** = **45** --- Return the greater of the two numbers, also known as their maximum. * **LOGIC\_MIN** = **46** --- Return the lesser of the two numbers, also known as their minimum. * **LOGIC\_CLAMP** = **47** --- Return the input clamped inside the given range, ensuring the result is never outside it. Equivalent to `min(max(input, range_low), range_high)`. * **LOGIC\_NEAREST\_PO2** = **48** --- Return the nearest power of 2 to the input. * **OBJ\_WEAKREF** = **49** --- Create a [WeakRef](class_weakref#class-weakref) from the input. * **FUNC\_FUNCREF** = **50** --- Create a [FuncRef](class_funcref#class-funcref) from the input. * **TYPE\_CONVERT** = **51** --- Convert between types. * **TYPE\_OF** = **52** --- Return the type of the input as an integer. Check [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) for the integers that might be returned. * **TYPE\_EXISTS** = **53** --- Checks if a type is registered in the [ClassDB](class_classdb#class-classdb). * **TEXT\_CHAR** = **54** --- Return a character with the given ascii value. * **TEXT\_STR** = **55** --- Convert the input to a string. * **TEXT\_PRINT** = **56** --- Print the given string to the output window. * **TEXT\_PRINTERR** = **57** --- Print the given string to the standard error output. * **TEXT\_PRINTRAW** = **58** --- Print the given string to the standard output, without adding a newline. * **VAR\_TO\_STR** = **59** --- Serialize a [Variant](class_variant#class-variant) to a string. * **STR\_TO\_VAR** = **60** --- Deserialize a [Variant](class_variant#class-variant) from a string serialized using [VAR\_TO\_STR](#class-visualscriptbuiltinfunc-constant-var-to-str). * **VAR\_TO\_BYTES** = **61** --- Serialize a [Variant](class_variant#class-variant) to a [PoolByteArray](class_poolbytearray#class-poolbytearray). * **BYTES\_TO\_VAR** = **62** --- Deserialize a [Variant](class_variant#class-variant) from a [PoolByteArray](class_poolbytearray#class-poolbytearray) serialized using [VAR\_TO\_BYTES](#class-visualscriptbuiltinfunc-constant-var-to-bytes). * **COLORN** = **63** --- Return the [Color](class_color#class-color) with the given name and alpha ranging from 0 to 1. **Note:** Names are defined in `color_names.inc`. * **MATH\_SMOOTHSTEP** = **64** --- Return a number smoothly interpolated between the first two inputs, based on the third input. Similar to [MATH\_LERP](#class-visualscriptbuiltinfunc-constant-math-lerp), but interpolates faster at the beginning and slower at the end. Using Hermite interpolation formula: ``` var t = clamp((weight - from) / (to - from), 0.0, 1.0) return t * t * (3.0 - 2.0 * t) ``` * **MATH\_POSMOD** = **65** * **MATH\_LERP\_ANGLE** = **66** * **TEXT\_ORD** = **67** * **FUNC\_MAX** = **68** --- Represents the size of the [BuiltinFunc](#enum-visualscriptbuiltinfunc-builtinfunc) enum. Property Descriptions --------------------- ### [BuiltinFunc](#enum-visualscriptbuiltinfunc-builtinfunc) function | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_func(value) | | *Getter* | get\_func() | The function to be executed. godot VisualShaderNodeTextureUniform VisualShaderNodeTextureUniform ============================== **Inherits:** [VisualShaderNodeUniform](class_visualshadernodeuniform#class-visualshadernodeuniform) **<** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [VisualShaderNodeCubeMapUniform](class_visualshadernodecubemapuniform#class-visualshadernodecubemapuniform), [VisualShaderNodeTextureUniformTriplanar](class_visualshadernodetextureuniformtriplanar#class-visualshadernodetextureuniformtriplanar) Performs a uniform texture lookup within the visual shader graph. Description ----------- Performs a lookup operation on the texture provided as a uniform for the shader. Properties ---------- | | | | | --- | --- | --- | | [ColorDefault](#enum-visualshadernodetextureuniform-colordefault) | [color\_default](#class-visualshadernodetextureuniform-property-color-default) | `0` | | [TextureType](#enum-visualshadernodetextureuniform-texturetype) | [texture\_type](#class-visualshadernodetextureuniform-property-texture-type) | `0` | Enumerations ------------ enum **TextureType**: * **TYPE\_DATA** = **0** --- No hints are added to the uniform declaration. * **TYPE\_COLOR** = **1** --- Adds `hint_albedo` as hint to the uniform declaration for proper sRGB to linear conversion. * **TYPE\_NORMALMAP** = **2** --- Adds `hint_normal` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. * **TYPE\_ANISO** = **3** --- Adds `hint_aniso` as hint to the uniform declaration to use for a flowmap. enum **ColorDefault**: * **COLOR\_DEFAULT\_WHITE** = **0** --- Defaults to white color. * **COLOR\_DEFAULT\_BLACK** = **1** --- Defaults to black color. Property Descriptions --------------------- ### [ColorDefault](#enum-visualshadernodetextureuniform-colordefault) color\_default | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_color\_default(value) | | *Getter* | get\_color\_default() | Sets the default color if no texture is assigned to the uniform. ### [TextureType](#enum-visualshadernodetextureuniform-texturetype) texture\_type | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_texture\_type(value) | | *Getter* | get\_texture\_type() | Defines the type of data provided by the source texture. See [TextureType](#enum-visualshadernodetextureuniform-texturetype) for options. godot GeometryInstance GeometryInstance ================ **Inherits:** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [CPUParticles](class_cpuparticles#class-cpuparticles), [CSGShape](class_csgshape#class-csgshape), [ImmediateGeometry](class_immediategeometry#class-immediategeometry), [Label3D](class_label3d#class-label3d), [MeshInstance](class_meshinstance#class-meshinstance), [MultiMeshInstance](class_multimeshinstance#class-multimeshinstance), [Particles](class_particles#class-particles), [SpriteBase3D](class_spritebase3d#class-spritebase3d) Base node for geometry-based visual instances. Description ----------- Base node for geometry-based visual instances. Shares some common functionality like visibility and custom materials. Properties ---------- | | | | | --- | --- | --- | | [ShadowCastingSetting](#enum-geometryinstance-shadowcastingsetting) | [cast\_shadow](#class-geometryinstance-property-cast-shadow) | `1` | | [float](class_float#class-float) | [extra\_cull\_margin](#class-geometryinstance-property-extra-cull-margin) | `0.0` | | [bool](class_bool#class-bool) | [generate\_lightmap](#class-geometryinstance-property-generate-lightmap) | `true` | | [LightmapScale](#enum-geometryinstance-lightmapscale) | [lightmap\_scale](#class-geometryinstance-property-lightmap-scale) | `0` | | [float](class_float#class-float) | [lod\_max\_distance](#class-geometryinstance-property-lod-max-distance) | `0.0` | | [float](class_float#class-float) | [lod\_max\_hysteresis](#class-geometryinstance-property-lod-max-hysteresis) | `0.0` | | [float](class_float#class-float) | [lod\_min\_distance](#class-geometryinstance-property-lod-min-distance) | `0.0` | | [float](class_float#class-float) | [lod\_min\_hysteresis](#class-geometryinstance-property-lod-min-hysteresis) | `0.0` | | [Material](class_material#class-material) | [material\_overlay](#class-geometryinstance-property-material-overlay) | | | [Material](class_material#class-material) | [material\_override](#class-geometryinstance-property-material-override) | | | [bool](class_bool#class-bool) | [use\_in\_baked\_light](#class-geometryinstance-property-use-in-baked-light) | `false` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [get\_flag](#class-geometryinstance-method-get-flag) **(** [Flags](#enum-geometryinstance-flags) flag **)** const | | void | [set\_custom\_aabb](#class-geometryinstance-method-set-custom-aabb) **(** [AABB](class_aabb#class-aabb) aabb **)** | | void | [set\_flag](#class-geometryinstance-method-set-flag) **(** [Flags](#enum-geometryinstance-flags) flag, [bool](class_bool#class-bool) value **)** | Enumerations ------------ enum **LightmapScale**: * **LIGHTMAP\_SCALE\_1X** = **0** --- The generated lightmap texture will have the original size. * **LIGHTMAP\_SCALE\_2X** = **1** --- The generated lightmap texture will be twice as large, on each axis. * **LIGHTMAP\_SCALE\_4X** = **2** --- The generated lightmap texture will be 4 times as large, on each axis. * **LIGHTMAP\_SCALE\_8X** = **3** --- The generated lightmap texture will be 8 times as large, on each axis. * **LIGHTMAP\_SCALE\_MAX** = **4** enum **ShadowCastingSetting**: * **SHADOW\_CASTING\_SETTING\_OFF** = **0** --- Will not cast any shadows. * **SHADOW\_CASTING\_SETTING\_ON** = **1** --- Will cast shadows from all visible faces in the GeometryInstance. Will take culling into account, so faces not being rendered will not be taken into account when shadow casting. * **SHADOW\_CASTING\_SETTING\_DOUBLE\_SIDED** = **2** --- Will cast shadows from all visible faces in the GeometryInstance. Will not take culling into account, so all faces will be taken into account when shadow casting. * **SHADOW\_CASTING\_SETTING\_SHADOWS\_ONLY** = **3** --- Will only show the shadows casted from this object. In other words, the actual mesh will not be visible, only the shadows casted from the mesh will be. enum **Flags**: * **FLAG\_USE\_BAKED\_LIGHT** = **0** --- Will allow the GeometryInstance to be used when baking lights using a [GIProbe](class_giprobe#class-giprobe) or [BakedLightmap](class_bakedlightmap#class-bakedlightmap). * **FLAG\_DRAW\_NEXT\_FRAME\_IF\_VISIBLE** = **1** --- Unused in this class, exposed for consistency with [InstanceFlags](class_visualserver#enum-visualserver-instanceflags). * **FLAG\_MAX** = **2** --- Represents the size of the [Flags](#enum-geometryinstance-flags) enum. Property Descriptions --------------------- ### [ShadowCastingSetting](#enum-geometryinstance-shadowcastingsetting) cast\_shadow | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_cast\_shadows\_setting(value) | | *Getter* | get\_cast\_shadows\_setting() | The selected shadow casting flag. See [ShadowCastingSetting](#enum-geometryinstance-shadowcastingsetting) for possible values. ### [float](class_float#class-float) extra\_cull\_margin | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_extra\_cull\_margin(value) | | *Getter* | get\_extra\_cull\_margin() | The extra distance added to the GeometryInstance's bounding box ([AABB](class_aabb#class-aabb)) to increase its cull box. ### [bool](class_bool#class-bool) generate\_lightmap | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_generate\_lightmap(value) | | *Getter* | get\_generate\_lightmap() | When disabled, the mesh will be taken into account when computing indirect lighting, but the resulting lightmap will not be saved. Useful for emissive only materials or shadow casters. ### [LightmapScale](#enum-geometryinstance-lightmapscale) lightmap\_scale | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_lightmap\_scale(value) | | *Getter* | get\_lightmap\_scale() | Scale factor for the generated baked lightmap. Useful for adding detail to certain mesh instances. ### [float](class_float#class-float) lod\_max\_distance | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_lod\_max\_distance(value) | | *Getter* | get\_lod\_max\_distance() | The GeometryInstance's max LOD distance. **Note:** This property currently has no effect. ### [float](class_float#class-float) lod\_max\_hysteresis | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_lod\_max\_hysteresis(value) | | *Getter* | get\_lod\_max\_hysteresis() | The GeometryInstance's max LOD margin. **Note:** This property currently has no effect. ### [float](class_float#class-float) lod\_min\_distance | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_lod\_min\_distance(value) | | *Getter* | get\_lod\_min\_distance() | The GeometryInstance's min LOD distance. **Note:** This property currently has no effect. ### [float](class_float#class-float) lod\_min\_hysteresis | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_lod\_min\_hysteresis(value) | | *Getter* | get\_lod\_min\_hysteresis() | The GeometryInstance's min LOD margin. **Note:** This property currently has no effect. ### [Material](class_material#class-material) material\_overlay | | | | --- | --- | | *Setter* | set\_material\_overlay(value) | | *Getter* | get\_material\_overlay() | The material overlay for the whole geometry. If a material is assigned to this property, it will be rendered on top of any other active material for all the surfaces. ### [Material](class_material#class-material) material\_override | | | | --- | --- | | *Setter* | set\_material\_override(value) | | *Getter* | get\_material\_override() | The material override for the whole geometry. If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh. ### [bool](class_bool#class-bool) use\_in\_baked\_light | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag(value) | | *Getter* | get\_flag() | If `true`, this GeometryInstance will be used when baking lights using a [GIProbe](class_giprobe#class-giprobe) or [BakedLightmap](class_bakedlightmap#class-bakedlightmap). Method Descriptions ------------------- ### [bool](class_bool#class-bool) get\_flag ( [Flags](#enum-geometryinstance-flags) flag ) const Returns the [Flags](#enum-geometryinstance-flags) that have been set for this object. ### void set\_custom\_aabb ( [AABB](class_aabb#class-aabb) aabb ) Overrides the bounding box of this node with a custom one. To remove it, set an [AABB](class_aabb#class-aabb) with all fields set to zero. ### void set\_flag ( [Flags](#enum-geometryinstance-flags) flag, [bool](class_bool#class-bool) value ) Sets the [Flags](#enum-geometryinstance-flags) specified. See [Flags](#enum-geometryinstance-flags) for options.
programming_docs
godot CubeMap CubeMap ======= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A CubeMap is a 6-sided 3D texture. Description ----------- A 6-sided 3D texture typically used for faking reflections. It can be used to make an object look as if it's reflecting its surroundings. This usually delivers much better performance than other reflection methods. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [flags](#class-cubemap-property-flags) | `7` | | [float](class_float#class-float) | [lossy\_storage\_quality](#class-cubemap-property-lossy-storage-quality) | `0.7` | | [Storage](#enum-cubemap-storage) | [storage\_mode](#class-cubemap-property-storage-mode) | `0` | Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [get\_height](#class-cubemap-method-get-height) **(** **)** const | | [Image](class_image#class-image) | [get\_side](#class-cubemap-method-get-side) **(** [Side](#enum-cubemap-side) side **)** const | | [int](class_int#class-int) | [get\_width](#class-cubemap-method-get-width) **(** **)** const | | void | [set\_side](#class-cubemap-method-set-side) **(** [Side](#enum-cubemap-side) side, [Image](class_image#class-image) image **)** | Enumerations ------------ enum **Storage**: * **STORAGE\_RAW** = **0** --- Store the `CubeMap` without any compression. * **STORAGE\_COMPRESS\_LOSSY** = **1** --- Store the `CubeMap` with strong compression that reduces image quality. * **STORAGE\_COMPRESS\_LOSSLESS** = **2** --- Store the `CubeMap` with moderate compression that doesn't reduce image quality. enum **Side**: * **SIDE\_LEFT** = **0** --- Identifier for the left face of the `CubeMap`. * **SIDE\_RIGHT** = **1** --- Identifier for the right face of the `CubeMap`. * **SIDE\_BOTTOM** = **2** --- Identifier for the bottom face of the `CubeMap`. * **SIDE\_TOP** = **3** --- Identifier for the top face of the `CubeMap`. * **SIDE\_FRONT** = **4** --- Identifier for the front face of the `CubeMap`. * **SIDE\_BACK** = **5** --- Identifier for the back face of the `CubeMap`. enum **Flags**: * **FLAG\_MIPMAPS** = **1** --- Generate mipmaps, to enable smooth zooming out of the texture. * **FLAG\_REPEAT** = **2** --- Repeat (instead of clamp to edge). * **FLAG\_FILTER** = **4** --- Turn on magnifying filter, to enable smooth zooming in of the texture. * **FLAGS\_DEFAULT** = **7** --- Default flags. Generate mipmaps, repeat, and filter are enabled. Property Descriptions --------------------- ### [int](class_int#class-int) flags | | | | --- | --- | | *Default* | `7` | | *Setter* | set\_flags(value) | | *Getter* | get\_flags() | The render flags for the `CubeMap`. See the [Flags](#enum-cubemap-flags) constants for details. ### [float](class_float#class-float) lossy\_storage\_quality | | | | --- | --- | | *Default* | `0.7` | | *Setter* | set\_lossy\_storage\_quality(value) | | *Getter* | get\_lossy\_storage\_quality() | The lossy storage quality of the `CubeMap` if the storage mode is set to [STORAGE\_COMPRESS\_LOSSY](#class-cubemap-constant-storage-compress-lossy). ### [Storage](#enum-cubemap-storage) storage\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_storage(value) | | *Getter* | get\_storage() | The `CubeMap`'s storage mode. See [Storage](#enum-cubemap-storage) constants. Method Descriptions ------------------- ### [int](class_int#class-int) get\_height ( ) const Returns the `CubeMap`'s height. ### [Image](class_image#class-image) get\_side ( [Side](#enum-cubemap-side) side ) const Returns an [Image](class_image#class-image) for a side of the `CubeMap` using one of the [Side](#enum-cubemap-side) constants. ### [int](class_int#class-int) get\_width ( ) const Returns the `CubeMap`'s width. ### void set\_side ( [Side](#enum-cubemap-side) side, [Image](class_image#class-image) image ) Sets an [Image](class_image#class-image) for a side of the `CubeMap` using one of the [Side](#enum-cubemap-side) constants. godot CanvasItem CanvasItem ========== **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [Control](class_control#class-control), [Node2D](class_node2d#class-node2d) Base class of anything 2D. Description ----------- Base class of anything 2D. Canvas items are laid out in a tree; children inherit and extend their parent's transform. `CanvasItem` is extended by [Control](class_control#class-control) for anything GUI-related, and by [Node2D](class_node2d#class-node2d) for anything related to the 2D engine. Any `CanvasItem` can draw. For this, [update](#class-canvasitem-method-update) is called by the engine, then [NOTIFICATION\_DRAW](#class-canvasitem-constant-notification-draw) will be received on idle time to request redraw. Because of this, canvas items don't need to be redrawn on every frame, improving the performance significantly. Several functions for drawing on the `CanvasItem` are provided (see `draw_*` functions). However, they can only be used inside [\_draw](#class-canvasitem-method-draw), its corresponding [Object.\_notification](class_object#class-object-method-notification) or methods connected to the [draw](#class-canvasitem-signal-draw) signal. Canvas items are drawn in tree order. By default, children are on top of their parents so a root `CanvasItem` will be drawn behind everything. This behavior can be changed on a per-item basis. A `CanvasItem` can also be hidden, which will also hide its children. It provides many ways to change parameters such as modulation (for itself and its children) and self modulation (only for itself), as well as its blend mode. Ultimately, a transform notification can be requested, which will notify the node that its global position changed in case the parent tree changed. **Note:** Unless otherwise specified, all methods that have angle parameters must have angles specified as *radians*. To convert degrees to radians, use [@GDScript.deg2rad](class_%40gdscript#class-gdscript-method-deg2rad). Tutorials --------- * [Viewport and canvas transforms](https://docs.godotengine.org/en/3.5/tutorials/2d/2d_transforms.html) * [Custom drawing in 2D](https://docs.godotengine.org/en/3.5/tutorials/2d/custom_drawing_in_2d.html) * [Audio Spectrum Demo](https://godotengine.org/asset-library/asset/528) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [light\_mask](#class-canvasitem-property-light-mask) | `1` | | [Material](class_material#class-material) | [material](#class-canvasitem-property-material) | | | [Color](class_color#class-color) | [modulate](#class-canvasitem-property-modulate) | `Color( 1, 1, 1, 1 )` | | [Color](class_color#class-color) | [self\_modulate](#class-canvasitem-property-self-modulate) | `Color( 1, 1, 1, 1 )` | | [bool](class_bool#class-bool) | [show\_behind\_parent](#class-canvasitem-property-show-behind-parent) | `false` | | [bool](class_bool#class-bool) | [show\_on\_top](#class-canvasitem-property-show-on-top) | | | [bool](class_bool#class-bool) | [use\_parent\_material](#class-canvasitem-property-use-parent-material) | `false` | | [bool](class_bool#class-bool) | [visible](#class-canvasitem-property-visible) | `true` | Methods ------- | | | | --- | --- | | void | [\_draw](#class-canvasitem-method-draw) **(** **)** virtual | | void | [draw\_arc](#class-canvasitem-method-draw-arc) **(** [Vector2](class_vector2#class-vector2) center, [float](class_float#class-float) radius, [float](class_float#class-float) start\_angle, [float](class_float#class-float) end\_angle, [int](class_int#class-int) point\_count, [Color](class_color#class-color) color, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false **)** | | [float](class_float#class-float) | [draw\_char](#class-canvasitem-method-draw-char) **(** [Font](class_font#class-font) font, [Vector2](class_vector2#class-vector2) position, [String](class_string#class-string) char, [String](class_string#class-string) next, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ) **)** | | void | [draw\_circle](#class-canvasitem-method-draw-circle) **(** [Vector2](class_vector2#class-vector2) position, [float](class_float#class-float) radius, [Color](class_color#class-color) color **)** | | void | [draw\_colored\_polygon](#class-canvasitem-method-draw-colored-polygon) **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [Color](class_color#class-color) color, [PoolVector2Array](class_poolvector2array#class-poolvector2array) uvs=PoolVector2Array( ), [Texture](class_texture#class-texture) texture=null, [Texture](class_texture#class-texture) normal\_map=null, [bool](class_bool#class-bool) antialiased=false **)** | | void | [draw\_line](#class-canvasitem-method-draw-line) **(** [Vector2](class_vector2#class-vector2) from, [Vector2](class_vector2#class-vector2) to, [Color](class_color#class-color) color, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false **)** | | void | [draw\_mesh](#class-canvasitem-method-draw-mesh) **(** [Mesh](class_mesh#class-mesh) mesh, [Texture](class_texture#class-texture) texture, [Texture](class_texture#class-texture) normal\_map=null, [Transform2D](class_transform2d#class-transform2d) transform=Transform2D( 1, 0, 0, 1, 0, 0 ), [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ) **)** | | void | [draw\_multiline](#class-canvasitem-method-draw-multiline) **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [Color](class_color#class-color) color, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false **)** | | void | [draw\_multiline\_colors](#class-canvasitem-method-draw-multiline-colors) **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [PoolColorArray](class_poolcolorarray#class-poolcolorarray) colors, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false **)** | | void | [draw\_multimesh](#class-canvasitem-method-draw-multimesh) **(** [MultiMesh](class_multimesh#class-multimesh) multimesh, [Texture](class_texture#class-texture) texture, [Texture](class_texture#class-texture) normal\_map=null **)** | | void | [draw\_polygon](#class-canvasitem-method-draw-polygon) **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [PoolColorArray](class_poolcolorarray#class-poolcolorarray) colors, [PoolVector2Array](class_poolvector2array#class-poolvector2array) uvs=PoolVector2Array( ), [Texture](class_texture#class-texture) texture=null, [Texture](class_texture#class-texture) normal\_map=null, [bool](class_bool#class-bool) antialiased=false **)** | | void | [draw\_polyline](#class-canvasitem-method-draw-polyline) **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [Color](class_color#class-color) color, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false **)** | | void | [draw\_polyline\_colors](#class-canvasitem-method-draw-polyline-colors) **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [PoolColorArray](class_poolcolorarray#class-poolcolorarray) colors, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false **)** | | void | [draw\_primitive](#class-canvasitem-method-draw-primitive) **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [PoolColorArray](class_poolcolorarray#class-poolcolorarray) colors, [PoolVector2Array](class_poolvector2array#class-poolvector2array) uvs, [Texture](class_texture#class-texture) texture=null, [float](class_float#class-float) width=1.0, [Texture](class_texture#class-texture) normal\_map=null **)** | | void | [draw\_rect](#class-canvasitem-method-draw-rect) **(** [Rect2](class_rect2#class-rect2) rect, [Color](class_color#class-color) color, [bool](class_bool#class-bool) filled=true, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false **)** | | void | [draw\_set\_transform](#class-canvasitem-method-draw-set-transform) **(** [Vector2](class_vector2#class-vector2) position, [float](class_float#class-float) rotation, [Vector2](class_vector2#class-vector2) scale **)** | | void | [draw\_set\_transform\_matrix](#class-canvasitem-method-draw-set-transform-matrix) **(** [Transform2D](class_transform2d#class-transform2d) xform **)** | | void | [draw\_string](#class-canvasitem-method-draw-string) **(** [Font](class_font#class-font) font, [Vector2](class_vector2#class-vector2) position, [String](class_string#class-string) text, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ), [int](class_int#class-int) clip\_w=-1 **)** | | void | [draw\_style\_box](#class-canvasitem-method-draw-style-box) **(** [StyleBox](class_stylebox#class-stylebox) style\_box, [Rect2](class_rect2#class-rect2) rect **)** | | void | [draw\_texture](#class-canvasitem-method-draw-texture) **(** [Texture](class_texture#class-texture) texture, [Vector2](class_vector2#class-vector2) position, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ), [Texture](class_texture#class-texture) normal\_map=null **)** | | void | [draw\_texture\_rect](#class-canvasitem-method-draw-texture-rect) **(** [Texture](class_texture#class-texture) texture, [Rect2](class_rect2#class-rect2) rect, [bool](class_bool#class-bool) tile, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ), [bool](class_bool#class-bool) transpose=false, [Texture](class_texture#class-texture) normal\_map=null **)** | | void | [draw\_texture\_rect\_region](#class-canvasitem-method-draw-texture-rect-region) **(** [Texture](class_texture#class-texture) texture, [Rect2](class_rect2#class-rect2) rect, [Rect2](class_rect2#class-rect2) src\_rect, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ), [bool](class_bool#class-bool) transpose=false, [Texture](class_texture#class-texture) normal\_map=null, [bool](class_bool#class-bool) clip\_uv=true **)** | | void | [force\_update\_transform](#class-canvasitem-method-force-update-transform) **(** **)** | | [RID](class_rid#class-rid) | [get\_canvas](#class-canvasitem-method-get-canvas) **(** **)** const | | [RID](class_rid#class-rid) | [get\_canvas\_item](#class-canvasitem-method-get-canvas-item) **(** **)** const | | [Transform2D](class_transform2d#class-transform2d) | [get\_canvas\_transform](#class-canvasitem-method-get-canvas-transform) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_global\_mouse\_position](#class-canvasitem-method-get-global-mouse-position) **(** **)** const | | [Transform2D](class_transform2d#class-transform2d) | [get\_global\_transform](#class-canvasitem-method-get-global-transform) **(** **)** const | | [Transform2D](class_transform2d#class-transform2d) | [get\_global\_transform\_with\_canvas](#class-canvasitem-method-get-global-transform-with-canvas) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_local\_mouse\_position](#class-canvasitem-method-get-local-mouse-position) **(** **)** const | | [Transform2D](class_transform2d#class-transform2d) | [get\_transform](#class-canvasitem-method-get-transform) **(** **)** const | | [Rect2](class_rect2#class-rect2) | [get\_viewport\_rect](#class-canvasitem-method-get-viewport-rect) **(** **)** const | | [Transform2D](class_transform2d#class-transform2d) | [get\_viewport\_transform](#class-canvasitem-method-get-viewport-transform) **(** **)** const | | [World2D](class_world2d#class-world2d) | [get\_world\_2d](#class-canvasitem-method-get-world-2d) **(** **)** const | | void | [hide](#class-canvasitem-method-hide) **(** **)** | | [bool](class_bool#class-bool) | [is\_local\_transform\_notification\_enabled](#class-canvasitem-method-is-local-transform-notification-enabled) **(** **)** const | | [bool](class_bool#class-bool) | [is\_set\_as\_toplevel](#class-canvasitem-method-is-set-as-toplevel) **(** **)** const | | [bool](class_bool#class-bool) | [is\_transform\_notification\_enabled](#class-canvasitem-method-is-transform-notification-enabled) **(** **)** const | | [bool](class_bool#class-bool) | [is\_visible\_in\_tree](#class-canvasitem-method-is-visible-in-tree) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [make\_canvas\_position\_local](#class-canvasitem-method-make-canvas-position-local) **(** [Vector2](class_vector2#class-vector2) screen\_point **)** const | | [InputEvent](class_inputevent#class-inputevent) | [make\_input\_local](#class-canvasitem-method-make-input-local) **(** [InputEvent](class_inputevent#class-inputevent) event **)** const | | void | [set\_as\_toplevel](#class-canvasitem-method-set-as-toplevel) **(** [bool](class_bool#class-bool) enable **)** | | void | [set\_notify\_local\_transform](#class-canvasitem-method-set-notify-local-transform) **(** [bool](class_bool#class-bool) enable **)** | | void | [set\_notify\_transform](#class-canvasitem-method-set-notify-transform) **(** [bool](class_bool#class-bool) enable **)** | | void | [show](#class-canvasitem-method-show) **(** **)** | | void | [update](#class-canvasitem-method-update) **(** **)** | Signals ------- ### draw ( ) Emitted when the `CanvasItem` must redraw, *after* the related [NOTIFICATION\_DRAW](#class-canvasitem-constant-notification-draw) notification, and *before* [\_draw](#class-canvasitem-method-draw) is called. **Note:** Deferred connections do not allow drawing through the `draw_*` methods. ### hide ( ) Emitted when becoming hidden. ### item\_rect\_changed ( ) Emitted when the item's [Rect2](class_rect2#class-rect2) boundaries (position or size) have changed, or when an action is taking place that may have impacted these boundaries (e.g. changing [Sprite.texture](class_sprite#class-sprite-property-texture)). ### visibility\_changed ( ) Emitted when the visibility (hidden/visible) changes. Enumerations ------------ enum **BlendMode**: * **BLEND\_MODE\_MIX** = **0** --- Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value. * **BLEND\_MODE\_ADD** = **1** --- Additive blending mode. * **BLEND\_MODE\_SUB** = **2** --- Subtractive blending mode. * **BLEND\_MODE\_MUL** = **3** --- Multiplicative blending mode. * **BLEND\_MODE\_PREMULT\_ALPHA** = **4** --- Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value. * **BLEND\_MODE\_DISABLED** = **5** --- Disables blending mode. Colors including alpha are written as-is. Only applicable for render targets with a transparent background. No lighting will be applied. Constants --------- * **NOTIFICATION\_TRANSFORM\_CHANGED** = **2000** --- The `CanvasItem`'s global transform has changed. This notification is only received if enabled by [set\_notify\_transform](#class-canvasitem-method-set-notify-transform). * **NOTIFICATION\_LOCAL\_TRANSFORM\_CHANGED** = **35** --- The `CanvasItem`'s local transform has changed. This notification is only received if enabled by [set\_notify\_local\_transform](#class-canvasitem-method-set-notify-local-transform). * **NOTIFICATION\_DRAW** = **30** --- The `CanvasItem` is requested to draw (see [\_draw](#class-canvasitem-method-draw)). * **NOTIFICATION\_VISIBILITY\_CHANGED** = **31** --- The `CanvasItem`'s visibility has changed. * **NOTIFICATION\_ENTER\_CANVAS** = **32** --- The `CanvasItem` has entered the canvas. * **NOTIFICATION\_EXIT\_CANVAS** = **33** --- The `CanvasItem` has exited the canvas. Property Descriptions --------------------- ### [int](class_int#class-int) light\_mask | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_light\_mask(value) | | *Getter* | get\_light\_mask() | The rendering layers in which this `CanvasItem` responds to [Light2D](class_light2d#class-light2d) nodes. ### [Material](class_material#class-material) material | | | | --- | --- | | *Setter* | set\_material(value) | | *Getter* | get\_material() | The material applied to textures on this `CanvasItem`. ### [Color](class_color#class-color) modulate | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_modulate(value) | | *Getter* | get\_modulate() | The color applied to textures on this `CanvasItem`. ### [Color](class_color#class-color) self\_modulate | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_self\_modulate(value) | | *Getter* | get\_self\_modulate() | The color applied to textures on this `CanvasItem`. This is not inherited by children `CanvasItem`s. ### [bool](class_bool#class-bool) show\_behind\_parent | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_draw\_behind\_parent(value) | | *Getter* | is\_draw\_behind\_parent\_enabled() | If `true`, the object draws behind its parent. ### [bool](class_bool#class-bool) show\_on\_top If `true`, the object draws on top of its parent. ### [bool](class_bool#class-bool) use\_parent\_material | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_parent\_material(value) | | *Getter* | get\_use\_parent\_material() | If `true`, the parent `CanvasItem`'s [material](#class-canvasitem-property-material) property is used as this one's material. ### [bool](class_bool#class-bool) visible | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_visible(value) | | *Getter* | is\_visible() | If `true`, this `CanvasItem` is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [is\_visible\_in\_tree](#class-canvasitem-method-is-visible-in-tree) must return `true`). **Note:** For controls that inherit [Popup](class_popup#class-popup), the correct way to make them visible is to call one of the multiple `popup*()` functions instead. Method Descriptions ------------------- ### void \_draw ( ) virtual Called when `CanvasItem` has been requested to redraw (when [update](#class-canvasitem-method-update) is called, either manually or by the engine). Corresponds to the [NOTIFICATION\_DRAW](#class-canvasitem-constant-notification-draw) notification in [Object.\_notification](class_object#class-object-method-notification). ### void draw\_arc ( [Vector2](class_vector2#class-vector2) center, [float](class_float#class-float) radius, [float](class_float#class-float) start\_angle, [float](class_float#class-float) end\_angle, [int](class_int#class-int) point\_count, [Color](class_color#class-color) color, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false ) Draws a unfilled arc between the given angles. The larger the value of `point_count`, the smoother the curve. See also [draw\_circle](#class-canvasitem-method-draw-circle). **Note:** Line drawing is not accelerated by batching if `antialiased` is `true`. **Note:** Due to how it works, built-in antialiasing will not look correct for translucent lines and may not work on certain platforms. As a workaround, install the [Antialiased Line2D](https://github.com/godot-extended-libraries/godot-antialiased-line2d) add-on then create an AntialiasedRegularPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines. ### [float](class_float#class-float) draw\_char ( [Font](class_font#class-font) font, [Vector2](class_vector2#class-vector2) position, [String](class_string#class-string) char, [String](class_string#class-string) next, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ) ) Draws a string character using a custom font. Returns the advance, depending on the character width and kerning with an optional next character. ### void draw\_circle ( [Vector2](class_vector2#class-vector2) position, [float](class_float#class-float) radius, [Color](class_color#class-color) color ) Draws a colored, filled circle. See also [draw\_arc](#class-canvasitem-method-draw-arc), [draw\_polyline](#class-canvasitem-method-draw-polyline) and [draw\_polygon](#class-canvasitem-method-draw-polygon). **Note:** Built-in antialiasing is not provided for [draw\_circle](#class-canvasitem-method-draw-circle). As a workaround, install the [Antialiased Line2D](https://github.com/godot-extended-libraries/godot-antialiased-line2d) add-on then create an AntialiasedRegularPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. ### void draw\_colored\_polygon ( [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [Color](class_color#class-color) color, [PoolVector2Array](class_poolvector2array#class-poolvector2array) uvs=PoolVector2Array( ), [Texture](class_texture#class-texture) texture=null, [Texture](class_texture#class-texture) normal\_map=null, [bool](class_bool#class-bool) antialiased=false ) Draws a colored polygon of any amount of points, convex or concave. Unlike [draw\_polygon](#class-canvasitem-method-draw-polygon), a single color must be specified for the whole polygon. **Note:** Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the [Antialiased Line2D](https://github.com/godot-extended-libraries/godot-antialiased-line2d) add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. ### void draw\_line ( [Vector2](class_vector2#class-vector2) from, [Vector2](class_vector2#class-vector2) to, [Color](class_color#class-color) color, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false ) Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also [draw\_multiline](#class-canvasitem-method-draw-multiline) and [draw\_polyline](#class-canvasitem-method-draw-polyline). **Note:** Line drawing is not accelerated by batching if `antialiased` is `true`. **Note:** Due to how it works, built-in antialiasing will not look correct for translucent lines and may not work on certain platforms. As a workaround, install the [Antialiased Line2D](https://github.com/godot-extended-libraries/godot-antialiased-line2d) add-on then create an AntialiasedLine2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines. ### void draw\_mesh ( [Mesh](class_mesh#class-mesh) mesh, [Texture](class_texture#class-texture) texture, [Texture](class_texture#class-texture) normal\_map=null, [Transform2D](class_transform2d#class-transform2d) transform=Transform2D( 1, 0, 0, 1, 0, 0 ), [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ) ) Draws a [Mesh](class_mesh#class-mesh) in 2D, using the provided texture. See [MeshInstance2D](class_meshinstance2d#class-meshinstance2d) for related documentation. ### void draw\_multiline ( [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [Color](class_color#class-color) color, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false ) Draws multiple disconnected lines with a uniform `color`. When drawing large amounts of lines, this is faster than using individual [draw\_line](#class-canvasitem-method-draw-line) calls. To draw interconnected lines, use [draw\_polyline](#class-canvasitem-method-draw-polyline) instead. **Note:** `width` and `antialiased` are currently not implemented and have no effect. As a workaround, install the [Antialiased Line2D](https://github.com/godot-extended-libraries/godot-antialiased-line2d) add-on then create an AntialiasedLine2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines. ### void draw\_multiline\_colors ( [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [PoolColorArray](class_poolcolorarray#class-poolcolorarray) colors, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false ) Draws multiple disconnected lines with a uniform `width` and segment-by-segment coloring. Colors assigned to line segments match by index between `points` and `colors`. When drawing large amounts of lines, this is faster than using individual [draw\_line](#class-canvasitem-method-draw-line) calls. To draw interconnected lines, use [draw\_polyline\_colors](#class-canvasitem-method-draw-polyline-colors) instead. **Note:** `width` and `antialiased` are currently not implemented and have no effect. As a workaround, install the [Antialiased Line2D](https://github.com/godot-extended-libraries/godot-antialiased-line2d) add-on then create an AntialiasedLine2D node. That node relies on a texture with custom mipmaps to perform antialiasing. 2D batching is also still supported with those antialiased lines. ### void draw\_multimesh ( [MultiMesh](class_multimesh#class-multimesh) multimesh, [Texture](class_texture#class-texture) texture, [Texture](class_texture#class-texture) normal\_map=null ) Draws a [MultiMesh](class_multimesh#class-multimesh) in 2D with the provided texture. See [MultiMeshInstance2D](class_multimeshinstance2d#class-multimeshinstance2d) for related documentation. ### void draw\_polygon ( [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [PoolColorArray](class_poolcolorarray#class-poolcolorarray) colors, [PoolVector2Array](class_poolvector2array#class-poolvector2array) uvs=PoolVector2Array( ), [Texture](class_texture#class-texture) texture=null, [Texture](class_texture#class-texture) normal\_map=null, [bool](class_bool#class-bool) antialiased=false ) Draws a solid polygon of any amount of points, convex or concave. Unlike [draw\_colored\_polygon](#class-canvasitem-method-draw-colored-polygon), each point's color can be changed individually. See also [draw\_polyline](#class-canvasitem-method-draw-polyline) and [draw\_polyline\_colors](#class-canvasitem-method-draw-polyline-colors). **Note:** Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the [Antialiased Line2D](https://github.com/godot-extended-libraries/godot-antialiased-line2d) add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. ### void draw\_polyline ( [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [Color](class_color#class-color) color, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false ) Draws interconnected line segments with a uniform `color` and `width` and optional antialiasing. When drawing large amounts of lines, this is faster than using individual [draw\_line](#class-canvasitem-method-draw-line) calls. To draw disconnected lines, use [draw\_multiline](#class-canvasitem-method-draw-multiline) instead. See also [draw\_polygon](#class-canvasitem-method-draw-polygon). **Note:** Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the [Antialiased Line2D](https://github.com/godot-extended-libraries/godot-antialiased-line2d) add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. ### void draw\_polyline\_colors ( [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [PoolColorArray](class_poolcolorarray#class-poolcolorarray) colors, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false ) Draws interconnected line segments with a uniform `width` and segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between `points` and `colors`. When drawing large amounts of lines, this is faster than using individual [draw\_line](#class-canvasitem-method-draw-line) calls. To draw disconnected lines, use [draw\_multiline\_colors](#class-canvasitem-method-draw-multiline-colors) instead. See also [draw\_polygon](#class-canvasitem-method-draw-polygon). **Note:** Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the [Antialiased Line2D](https://github.com/godot-extended-libraries/godot-antialiased-line2d) add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. ### void draw\_primitive ( [PoolVector2Array](class_poolvector2array#class-poolvector2array) points, [PoolColorArray](class_poolcolorarray#class-poolcolorarray) colors, [PoolVector2Array](class_poolvector2array#class-poolvector2array) uvs, [Texture](class_texture#class-texture) texture=null, [float](class_float#class-float) width=1.0, [Texture](class_texture#class-texture) normal\_map=null ) Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle, and 4 points for a quad. If 0 points or more than 4 points are specified, nothing will be drawn and an error message will be printed. See also [draw\_line](#class-canvasitem-method-draw-line), [draw\_polyline](#class-canvasitem-method-draw-polyline), [draw\_polygon](#class-canvasitem-method-draw-polygon), and [draw\_rect](#class-canvasitem-method-draw-rect). ### void draw\_rect ( [Rect2](class_rect2#class-rect2) rect, [Color](class_color#class-color) color, [bool](class_bool#class-bool) filled=true, [float](class_float#class-float) width=1.0, [bool](class_bool#class-bool) antialiased=false ) Draws a rectangle. If `filled` is `true`, the rectangle will be filled with the `color` specified. If `filled` is `false`, the rectangle will be drawn as a stroke with the `color` and `width` specified. If `antialiased` is `true`, the lines will attempt to perform antialiasing using OpenGL line smoothing. **Note:** `width` and `antialiased` are only effective if `filled` is `false`. **Note:** Due to how it works, built-in antialiasing will not look correct for translucent polygons and may not work on certain platforms. As a workaround, install the [Antialiased Line2D](https://github.com/godot-extended-libraries/godot-antialiased-line2d) add-on then create an AntialiasedPolygon2D node. That node relies on a texture with custom mipmaps to perform antialiasing. ### void draw\_set\_transform ( [Vector2](class_vector2#class-vector2) position, [float](class_float#class-float) rotation, [Vector2](class_vector2#class-vector2) scale ) Sets a custom transform for drawing via components. Anything drawn afterwards will be transformed by this. ### void draw\_set\_transform\_matrix ( [Transform2D](class_transform2d#class-transform2d) xform ) Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this. ### void draw\_string ( [Font](class_font#class-font) font, [Vector2](class_vector2#class-vector2) position, [String](class_string#class-string) text, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ), [int](class_int#class-int) clip\_w=-1 ) Draws `text` using the specified `font` at the `position` (bottom-left corner using the baseline of the font). The text will have its color multiplied by `modulate`. If `clip_w` is greater than or equal to 0, the text will be clipped if it exceeds the specified width. **Example using the default project font:** ``` # If using this method in a script that redraws constantly, move the # `default_font` declaration to a member variable assigned in `_ready()` # so the Control is only created once. var default_font = Control.new().get_font("font") draw_string(default_font, Vector2(64, 64), "Hello world") ``` See also [Font.draw](class_font#class-font-method-draw). ### void draw\_style\_box ( [StyleBox](class_stylebox#class-stylebox) style\_box, [Rect2](class_rect2#class-rect2) rect ) Draws a styled rectangle. ### void draw\_texture ( [Texture](class_texture#class-texture) texture, [Vector2](class_vector2#class-vector2) position, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ), [Texture](class_texture#class-texture) normal\_map=null ) Draws a texture at a given position. ### void draw\_texture\_rect ( [Texture](class_texture#class-texture) texture, [Rect2](class_rect2#class-rect2) rect, [bool](class_bool#class-bool) tile, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ), [bool](class_bool#class-bool) transpose=false, [Texture](class_texture#class-texture) normal\_map=null ) Draws a textured rectangle at a given position, optionally modulated by a color. If `transpose` is `true`, the texture will have its X and Y coordinates swapped. ### void draw\_texture\_rect\_region ( [Texture](class_texture#class-texture) texture, [Rect2](class_rect2#class-rect2) rect, [Rect2](class_rect2#class-rect2) src\_rect, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ), [bool](class_bool#class-bool) transpose=false, [Texture](class_texture#class-texture) normal\_map=null, [bool](class_bool#class-bool) clip\_uv=true ) Draws a textured rectangle region at a given position, optionally modulated by a color. If `transpose` is `true`, the texture will have its X and Y coordinates swapped. ### void force\_update\_transform ( ) Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. ### [RID](class_rid#class-rid) get\_canvas ( ) const Returns the [RID](class_rid#class-rid) of the [World2D](class_world2d#class-world2d) canvas where this item is in. ### [RID](class_rid#class-rid) get\_canvas\_item ( ) const Returns the canvas item RID used by [VisualServer](class_visualserver#class-visualserver) for this item. ### [Transform2D](class_transform2d#class-transform2d) get\_canvas\_transform ( ) const Returns the transform matrix of this item's canvas. ### [Vector2](class_vector2#class-vector2) get\_global\_mouse\_position ( ) const Returns the mouse's position in the [CanvasLayer](class_canvaslayer#class-canvaslayer) that this `CanvasItem` is in using the coordinate system of the [CanvasLayer](class_canvaslayer#class-canvaslayer). ### [Transform2D](class_transform2d#class-transform2d) get\_global\_transform ( ) const Returns the global transform matrix of this item. ### [Transform2D](class_transform2d#class-transform2d) get\_global\_transform\_with\_canvas ( ) const Returns the global transform matrix of this item in relation to the canvas. ### [Vector2](class_vector2#class-vector2) get\_local\_mouse\_position ( ) const Returns the mouse's position in this `CanvasItem` using the local coordinate system of this `CanvasItem`. ### [Transform2D](class_transform2d#class-transform2d) get\_transform ( ) const Returns the transform matrix of this item. ### [Rect2](class_rect2#class-rect2) get\_viewport\_rect ( ) const Returns the viewport's boundaries as a [Rect2](class_rect2#class-rect2). ### [Transform2D](class_transform2d#class-transform2d) get\_viewport\_transform ( ) const Returns this item's transform in relation to the viewport. ### [World2D](class_world2d#class-world2d) get\_world\_2d ( ) const Returns the [World2D](class_world2d#class-world2d) where this item is in. ### void hide ( ) Hide the `CanvasItem` if it's currently visible. This is equivalent to setting [visible](#class-canvasitem-property-visible) to `false`. ### [bool](class_bool#class-bool) is\_local\_transform\_notification\_enabled ( ) const Returns `true` if local transform notifications are communicated to children. ### [bool](class_bool#class-bool) is\_set\_as\_toplevel ( ) const Returns `true` if the node is set as top-level. See [set\_as\_toplevel](#class-canvasitem-method-set-as-toplevel). ### [bool](class_bool#class-bool) is\_transform\_notification\_enabled ( ) const Returns `true` if global transform notifications are communicated to children. ### [bool](class_bool#class-bool) is\_visible\_in\_tree ( ) const Returns `true` if the node is present in the [SceneTree](class_scenetree#class-scenetree), its [visible](#class-canvasitem-property-visible) property is `true` and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree, and is consequently not drawn (see [\_draw](#class-canvasitem-method-draw)). ### [Vector2](class_vector2#class-vector2) make\_canvas\_position\_local ( [Vector2](class_vector2#class-vector2) screen\_point ) const Assigns `screen_point` as this node's new local transform. ### [InputEvent](class_inputevent#class-inputevent) make\_input\_local ( [InputEvent](class_inputevent#class-inputevent) event ) const Transformations issued by `event`'s inputs are applied in local space instead of global space. ### void set\_as\_toplevel ( [bool](class_bool#class-bool) enable ) If `enable` is `true`, this `CanvasItem` will *not* inherit its transform from parent `CanvasItem`s. Its draw order will also be changed to make it draw on top of other `CanvasItem`s that are not set as top-level. The `CanvasItem` will effectively act as if it was placed as a child of a bare [Node](class_node#class-node). See also [is\_set\_as\_toplevel](#class-canvasitem-method-is-set-as-toplevel). ### void set\_notify\_local\_transform ( [bool](class_bool#class-bool) enable ) If `enable` is `true`, this node will receive [NOTIFICATION\_LOCAL\_TRANSFORM\_CHANGED](#class-canvasitem-constant-notification-local-transform-changed) when its local transform changes. ### void set\_notify\_transform ( [bool](class_bool#class-bool) enable ) If `enable` is `true`, this node will receive [NOTIFICATION\_TRANSFORM\_CHANGED](#class-canvasitem-constant-notification-transform-changed) when its global transform changes. ### void show ( ) Show the `CanvasItem` if it's currently hidden. This is equivalent to setting [visible](#class-canvasitem-property-visible) to `true`. For controls that inherit [Popup](class_popup#class-popup), the correct way to make them visible is to call one of the multiple `popup*()` functions instead. ### void update ( ) Queues the `CanvasItem` to redraw. During idle time, if `CanvasItem` is visible, [NOTIFICATION\_DRAW](#class-canvasitem-constant-notification-draw) is sent and [\_draw](#class-canvasitem-method-draw) is called. This only occurs **once** per frame, even if this method has been called multiple times.
programming_docs
godot VisualShaderNodeDeterminant VisualShaderNodeDeterminant =========================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Calculates the determinant of a [Transform](class_transform#class-transform) within the visual shader graph. Description ----------- Translates to `determinant(x)` in the shader language. godot Popup Popup ===== **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [PopupDialog](class_popupdialog#class-popupdialog), [PopupMenu](class_popupmenu#class-popupmenu), [PopupPanel](class_popuppanel#class-popuppanel), [WindowDialog](class_windowdialog#class-windowdialog) Base container control for popups and dialogs. Description ----------- Popup is a base [Control](class_control#class-control) used to show dialogs and popups. It's a subwindow and modal by default (see [Control](class_control#class-control)) and has helpers for custom popup behavior. All popup methods ensure correct placement within the viewport. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [popup\_exclusive](#class-popup-property-popup-exclusive) | `false` | | [bool](class_bool#class-bool) | visible | `false` (overrides [CanvasItem](class_canvasitem#class-canvasitem-property-visible)) | Methods ------- | | | | --- | --- | | void | [popup](#class-popup-method-popup) **(** [Rect2](class_rect2#class-rect2) bounds=Rect2( 0, 0, 0, 0 ) **)** | | void | [popup\_centered](#class-popup-method-popup-centered) **(** [Vector2](class_vector2#class-vector2) size=Vector2( 0, 0 ) **)** | | void | [popup\_centered\_clamped](#class-popup-method-popup-centered-clamped) **(** [Vector2](class_vector2#class-vector2) size=Vector2( 0, 0 ), [float](class_float#class-float) fallback\_ratio=0.75 **)** | | void | [popup\_centered\_minsize](#class-popup-method-popup-centered-minsize) **(** [Vector2](class_vector2#class-vector2) minsize=Vector2( 0, 0 ) **)** | | void | [popup\_centered\_ratio](#class-popup-method-popup-centered-ratio) **(** [float](class_float#class-float) ratio=0.75 **)** | | void | [set\_as\_minsize](#class-popup-method-set-as-minsize) **(** **)** | Signals ------- ### about\_to\_show ( ) Emitted when a popup is about to be shown. This is often used in [PopupMenu](class_popupmenu#class-popupmenu) to clear the list of options then create a new one according to the current context. ### popup\_hide ( ) Emitted when a popup is hidden. Constants --------- * **NOTIFICATION\_POST\_POPUP** = **80** --- Notification sent right after the popup is shown. * **NOTIFICATION\_POPUP\_HIDE** = **81** --- Notification sent right after the popup is hidden. Property Descriptions --------------------- ### [bool](class_bool#class-bool) popup\_exclusive | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_exclusive(value) | | *Getter* | is\_exclusive() | If `true`, the popup will not be hidden when a click event occurs outside of it, or when it receives the `ui_cancel` action event. **Note:** Enabling this property doesn't affect the Close or Cancel buttons' behavior in dialogs that inherit from this class. As a workaround, you can use [WindowDialog.get\_close\_button](class_windowdialog#class-windowdialog-method-get-close-button) or [ConfirmationDialog.get\_cancel](class_confirmationdialog#class-confirmationdialog-method-get-cancel) and hide the buttons in question by setting their [CanvasItem.visible](class_canvasitem#class-canvasitem-property-visible) property to `false`. Method Descriptions ------------------- ### void popup ( [Rect2](class_rect2#class-rect2) bounds=Rect2( 0, 0, 0, 0 ) ) Popup (show the control in modal form). ### void popup\_centered ( [Vector2](class_vector2#class-vector2) size=Vector2( 0, 0 ) ) Popup (show the control in modal form) in the center of the screen relative to its current canvas transform, at the current size, or at a size determined by `size`. ### void popup\_centered\_clamped ( [Vector2](class_vector2#class-vector2) size=Vector2( 0, 0 ), [float](class_float#class-float) fallback\_ratio=0.75 ) Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, clamping the size to `size`, then ensuring the popup is no larger than the viewport size multiplied by `fallback_ratio`. ### void popup\_centered\_minsize ( [Vector2](class_vector2#class-vector2) minsize=Vector2( 0, 0 ) ) Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, ensuring the size is never smaller than `minsize`. ### void popup\_centered\_ratio ( [float](class_float#class-float) ratio=0.75 ) Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, scaled at a ratio of size of the screen. ### void set\_as\_minsize ( ) Shrink popup to keep to the minimum size of content. godot Expression Expression ========== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A class that stores an expression you can execute. Description ----------- An expression can be made of any arithmetic operation, built-in math function call, method call of a passed instance, or built-in type construction call. An example expression text using the built-in math functions could be `sqrt(pow(3,2) + pow(4,2))`. In the following example we use a [LineEdit](class_lineedit#class-lineedit) node to write our expression and show the result. ``` onready var expression = Expression.new() func _ready(): $LineEdit.connect("text_entered", self, "_on_text_entered") func _on_text_entered(command): var error = expression.parse(command, []) if error != OK: print(expression.get_error_text()) return var result = expression.execute([], null, true) if not expression.has_execute_failed(): $LineEdit.text = str(result) ``` Methods ------- | | | | --- | --- | | [Variant](class_variant#class-variant) | [execute](#class-expression-method-execute) **(** [Array](class_array#class-array) inputs=[ ], [Object](class_object#class-object) base\_instance=null, [bool](class_bool#class-bool) show\_error=true **)** | | [String](class_string#class-string) | [get\_error\_text](#class-expression-method-get-error-text) **(** **)** const | | [bool](class_bool#class-bool) | [has\_execute\_failed](#class-expression-method-has-execute-failed) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [parse](#class-expression-method-parse) **(** [String](class_string#class-string) expression, [PoolStringArray](class_poolstringarray#class-poolstringarray) input\_names=PoolStringArray( ) **)** | Method Descriptions ------------------- ### [Variant](class_variant#class-variant) execute ( [Array](class_array#class-array) inputs=[ ], [Object](class_object#class-object) base\_instance=null, [bool](class_bool#class-bool) show\_error=true ) Executes the expression that was previously parsed by [parse](#class-expression-method-parse) and returns the result. Before you use the returned object, you should check if the method failed by calling [has\_execute\_failed](#class-expression-method-has-execute-failed). If you defined input variables in [parse](#class-expression-method-parse), you can specify their values in the inputs array, in the same order. ### [String](class_string#class-string) get\_error\_text ( ) const Returns the error text if [parse](#class-expression-method-parse) has failed. ### [bool](class_bool#class-bool) has\_execute\_failed ( ) const Returns `true` if [execute](#class-expression-method-execute) has failed. ### [Error](class_%40globalscope#enum-globalscope-error) parse ( [String](class_string#class-string) expression, [PoolStringArray](class_poolstringarray#class-poolstringarray) input\_names=PoolStringArray( ) ) Parses the expression and returns an [Error](class_%40globalscope#enum-globalscope-error) code. You can optionally specify names of variables that may appear in the expression with `input_names`, so that you can bind them when it gets executed. godot @GDScript @GDScript ========= Built-in GDScript functions. Description ----------- List of core built-in GDScript functions. Math functions and other utilities. Everything else is provided by objects. (Keywords: builtin, built in, global functions.) Methods ------- | | | | --- | --- | | [Color](class_color#class-color) | [Color8](#class-gdscript-method-color8) **(** [int](class_int#class-int) r8, [int](class_int#class-int) g8, [int](class_int#class-int) b8, [int](class_int#class-int) a8=255 **)** | | [Color](class_color#class-color) | [ColorN](#class-gdscript-method-colorn) **(** [String](class_string#class-string) name, [float](class_float#class-float) alpha=1.0 **)** | | [float](class_float#class-float) | [abs](#class-gdscript-method-abs) **(** [float](class_float#class-float) s **)** | | [float](class_float#class-float) | [acos](#class-gdscript-method-acos) **(** [float](class_float#class-float) s **)** | | [float](class_float#class-float) | [asin](#class-gdscript-method-asin) **(** [float](class_float#class-float) s **)** | | void | [assert](#class-gdscript-method-assert) **(** [bool](class_bool#class-bool) condition, [String](class_string#class-string) message="" **)** | | [float](class_float#class-float) | [atan](#class-gdscript-method-atan) **(** [float](class_float#class-float) s **)** | | [float](class_float#class-float) | [atan2](#class-gdscript-method-atan2) **(** [float](class_float#class-float) y, [float](class_float#class-float) x **)** | | [Variant](class_variant#class-variant) | [bytes2var](#class-gdscript-method-bytes2var) **(** [PoolByteArray](class_poolbytearray#class-poolbytearray) bytes, [bool](class_bool#class-bool) allow\_objects=false **)** | | [Vector2](class_vector2#class-vector2) | [cartesian2polar](#class-gdscript-method-cartesian2polar) **(** [float](class_float#class-float) x, [float](class_float#class-float) y **)** | | [float](class_float#class-float) | [ceil](#class-gdscript-method-ceil) **(** [float](class_float#class-float) s **)** | | [String](class_string#class-string) | [char](#class-gdscript-method-char) **(** [int](class_int#class-int) code **)** | | [float](class_float#class-float) | [clamp](#class-gdscript-method-clamp) **(** [float](class_float#class-float) value, [float](class_float#class-float) min, [float](class_float#class-float) max **)** | | [Variant](class_variant#class-variant) | [convert](#class-gdscript-method-convert) **(** [Variant](class_variant#class-variant) what, [int](class_int#class-int) type **)** | | [float](class_float#class-float) | [cos](#class-gdscript-method-cos) **(** [float](class_float#class-float) s **)** | | [float](class_float#class-float) | [cosh](#class-gdscript-method-cosh) **(** [float](class_float#class-float) s **)** | | [float](class_float#class-float) | [db2linear](#class-gdscript-method-db2linear) **(** [float](class_float#class-float) db **)** | | [int](class_int#class-int) | [decimals](#class-gdscript-method-decimals) **(** [float](class_float#class-float) step **)** | | [float](class_float#class-float) | [dectime](#class-gdscript-method-dectime) **(** [float](class_float#class-float) value, [float](class_float#class-float) amount, [float](class_float#class-float) step **)** | | [bool](class_bool#class-bool) | [deep\_equal](#class-gdscript-method-deep-equal) **(** [Variant](class_variant#class-variant) a, [Variant](class_variant#class-variant) b **)** | | [float](class_float#class-float) | [deg2rad](#class-gdscript-method-deg2rad) **(** [float](class_float#class-float) deg **)** | | [Object](class_object#class-object) | [dict2inst](#class-gdscript-method-dict2inst) **(** [Dictionary](class_dictionary#class-dictionary) dict **)** | | [float](class_float#class-float) | [ease](#class-gdscript-method-ease) **(** [float](class_float#class-float) s, [float](class_float#class-float) curve **)** | | [float](class_float#class-float) | [exp](#class-gdscript-method-exp) **(** [float](class_float#class-float) s **)** | | [float](class_float#class-float) | [floor](#class-gdscript-method-floor) **(** [float](class_float#class-float) s **)** | | [float](class_float#class-float) | [fmod](#class-gdscript-method-fmod) **(** [float](class_float#class-float) a, [float](class_float#class-float) b **)** | | [float](class_float#class-float) | [fposmod](#class-gdscript-method-fposmod) **(** [float](class_float#class-float) a, [float](class_float#class-float) b **)** | | [FuncRef](class_funcref#class-funcref) | [funcref](#class-gdscript-method-funcref) **(** [Object](class_object#class-object) instance, [String](class_string#class-string) funcname **)** | | [Array](class_array#class-array) | [get\_stack](#class-gdscript-method-get-stack) **(** **)** | | [int](class_int#class-int) | [hash](#class-gdscript-method-hash) **(** [Variant](class_variant#class-variant) var **)** | | [Dictionary](class_dictionary#class-dictionary) | [inst2dict](#class-gdscript-method-inst2dict) **(** [Object](class_object#class-object) inst **)** | | [Object](class_object#class-object) | [instance\_from\_id](#class-gdscript-method-instance-from-id) **(** [int](class_int#class-int) instance\_id **)** | | [float](class_float#class-float) | [inverse\_lerp](#class-gdscript-method-inverse-lerp) **(** [float](class_float#class-float) from, [float](class_float#class-float) to, [float](class_float#class-float) weight **)** | | [bool](class_bool#class-bool) | [is\_equal\_approx](#class-gdscript-method-is-equal-approx) **(** [float](class_float#class-float) a, [float](class_float#class-float) b **)** | | [bool](class_bool#class-bool) | [is\_inf](#class-gdscript-method-is-inf) **(** [float](class_float#class-float) s **)** | | [bool](class_bool#class-bool) | [is\_instance\_valid](#class-gdscript-method-is-instance-valid) **(** [Object](class_object#class-object) instance **)** | | [bool](class_bool#class-bool) | [is\_nan](#class-gdscript-method-is-nan) **(** [float](class_float#class-float) s **)** | | [bool](class_bool#class-bool) | [is\_zero\_approx](#class-gdscript-method-is-zero-approx) **(** [float](class_float#class-float) s **)** | | [int](class_int#class-int) | [len](#class-gdscript-method-len) **(** [Variant](class_variant#class-variant) var **)** | | [Variant](class_variant#class-variant) | [lerp](#class-gdscript-method-lerp) **(** [Variant](class_variant#class-variant) from, [Variant](class_variant#class-variant) to, [float](class_float#class-float) weight **)** | | [float](class_float#class-float) | [lerp\_angle](#class-gdscript-method-lerp-angle) **(** [float](class_float#class-float) from, [float](class_float#class-float) to, [float](class_float#class-float) weight **)** | | [float](class_float#class-float) | [linear2db](#class-gdscript-method-linear2db) **(** [float](class_float#class-float) nrg **)** | | [Resource](class_resource#class-resource) | [load](#class-gdscript-method-load) **(** [String](class_string#class-string) path **)** | | [float](class_float#class-float) | [log](#class-gdscript-method-log) **(** [float](class_float#class-float) s **)** | | [float](class_float#class-float) | [max](#class-gdscript-method-max) **(** [float](class_float#class-float) a, [float](class_float#class-float) b **)** | | [float](class_float#class-float) | [min](#class-gdscript-method-min) **(** [float](class_float#class-float) a, [float](class_float#class-float) b **)** | | [float](class_float#class-float) | [move\_toward](#class-gdscript-method-move-toward) **(** [float](class_float#class-float) from, [float](class_float#class-float) to, [float](class_float#class-float) delta **)** | | [int](class_int#class-int) | [nearest\_po2](#class-gdscript-method-nearest-po2) **(** [int](class_int#class-int) value **)** | | [int](class_int#class-int) | [ord](#class-gdscript-method-ord) **(** [String](class_string#class-string) char **)** | | [Variant](class_variant#class-variant) | [parse\_json](#class-gdscript-method-parse-json) **(** [String](class_string#class-string) json **)** | | [Vector2](class_vector2#class-vector2) | [polar2cartesian](#class-gdscript-method-polar2cartesian) **(** [float](class_float#class-float) r, [float](class_float#class-float) th **)** | | [int](class_int#class-int) | [posmod](#class-gdscript-method-posmod) **(** [int](class_int#class-int) a, [int](class_int#class-int) b **)** | | [float](class_float#class-float) | [pow](#class-gdscript-method-pow) **(** [float](class_float#class-float) base, [float](class_float#class-float) exp **)** | | [Resource](class_resource#class-resource) | [preload](#class-gdscript-method-preload) **(** [String](class_string#class-string) path **)** | | void | [print](#class-gdscript-method-print) **(** ... **)** vararg | | void | [print\_debug](#class-gdscript-method-print-debug) **(** ... **)** vararg | | void | [print\_stack](#class-gdscript-method-print-stack) **(** **)** | | void | [printerr](#class-gdscript-method-printerr) **(** ... **)** vararg | | void | [printraw](#class-gdscript-method-printraw) **(** ... **)** vararg | | void | [prints](#class-gdscript-method-prints) **(** ... **)** vararg | | void | [printt](#class-gdscript-method-printt) **(** ... **)** vararg | | void | [push\_error](#class-gdscript-method-push-error) **(** [String](class_string#class-string) message **)** | | void | [push\_warning](#class-gdscript-method-push-warning) **(** [String](class_string#class-string) message **)** | | [float](class_float#class-float) | [rad2deg](#class-gdscript-method-rad2deg) **(** [float](class_float#class-float) rad **)** | | [float](class_float#class-float) | [rand\_range](#class-gdscript-method-rand-range) **(** [float](class_float#class-float) from, [float](class_float#class-float) to **)** | | [Array](class_array#class-array) | [rand\_seed](#class-gdscript-method-rand-seed) **(** [int](class_int#class-int) seed **)** | | [float](class_float#class-float) | [randf](#class-gdscript-method-randf) **(** **)** | | [int](class_int#class-int) | [randi](#class-gdscript-method-randi) **(** **)** | | void | [randomize](#class-gdscript-method-randomize) **(** **)** | | [Array](class_array#class-array) | [range](#class-gdscript-method-range) **(** ... **)** vararg | | [float](class_float#class-float) | [range\_lerp](#class-gdscript-method-range-lerp) **(** [float](class_float#class-float) value, [float](class_float#class-float) istart, [float](class_float#class-float) istop, [float](class_float#class-float) ostart, [float](class_float#class-float) ostop **)** | | [float](class_float#class-float) | [round](#class-gdscript-method-round) **(** [float](class_float#class-float) s **)** | | void | [seed](#class-gdscript-method-seed) **(** [int](class_int#class-int) seed **)** | | [float](class_float#class-float) | [sign](#class-gdscript-method-sign) **(** [float](class_float#class-float) s **)** | | [float](class_float#class-float) | [sin](#class-gdscript-method-sin) **(** [float](class_float#class-float) s **)** | | [float](class_float#class-float) | [sinh](#class-gdscript-method-sinh) **(** [float](class_float#class-float) s **)** | | [float](class_float#class-float) | [smoothstep](#class-gdscript-method-smoothstep) **(** [float](class_float#class-float) from, [float](class_float#class-float) to, [float](class_float#class-float) s **)** | | [float](class_float#class-float) | [sqrt](#class-gdscript-method-sqrt) **(** [float](class_float#class-float) s **)** | | [int](class_int#class-int) | [step\_decimals](#class-gdscript-method-step-decimals) **(** [float](class_float#class-float) step **)** | | [float](class_float#class-float) | [stepify](#class-gdscript-method-stepify) **(** [float](class_float#class-float) s, [float](class_float#class-float) step **)** | | [String](class_string#class-string) | [str](#class-gdscript-method-str) **(** ... **)** vararg | | [Variant](class_variant#class-variant) | [str2var](#class-gdscript-method-str2var) **(** [String](class_string#class-string) string **)** | | [float](class_float#class-float) | [tan](#class-gdscript-method-tan) **(** [float](class_float#class-float) s **)** | | [float](class_float#class-float) | [tanh](#class-gdscript-method-tanh) **(** [float](class_float#class-float) s **)** | | [String](class_string#class-string) | [to\_json](#class-gdscript-method-to-json) **(** [Variant](class_variant#class-variant) var **)** | | [bool](class_bool#class-bool) | [type\_exists](#class-gdscript-method-type-exists) **(** [String](class_string#class-string) type **)** | | [int](class_int#class-int) | [typeof](#class-gdscript-method-typeof) **(** [Variant](class_variant#class-variant) what **)** | | [String](class_string#class-string) | [validate\_json](#class-gdscript-method-validate-json) **(** [String](class_string#class-string) json **)** | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [var2bytes](#class-gdscript-method-var2bytes) **(** [Variant](class_variant#class-variant) var, [bool](class_bool#class-bool) full\_objects=false **)** | | [String](class_string#class-string) | [var2str](#class-gdscript-method-var2str) **(** [Variant](class_variant#class-variant) var **)** | | [WeakRef](class_weakref#class-weakref) | [weakref](#class-gdscript-method-weakref) **(** [Object](class_object#class-object) obj **)** | | [float](class_float#class-float) | [wrapf](#class-gdscript-method-wrapf) **(** [float](class_float#class-float) value, [float](class_float#class-float) min, [float](class_float#class-float) max **)** | | [int](class_int#class-int) | [wrapi](#class-gdscript-method-wrapi) **(** [int](class_int#class-int) value, [int](class_int#class-int) min, [int](class_int#class-int) max **)** | | [GDScriptFunctionState](class_gdscriptfunctionstate#class-gdscriptfunctionstate) | [yield](#class-gdscript-method-yield) **(** [Object](class_object#class-object) object=null, [String](class_string#class-string) signal="" **)** | Constants --------- * **PI** = **3.141593** --- Constant that represents how many times the diameter of a circle fits around its perimeter. This is equivalent to `TAU / 2`. * **TAU** = **6.283185** --- The circle constant, the circumference of the unit circle in radians. This is equivalent to `PI * 2`, or 360 degrees in rotations. * **INF** = **inf** --- Positive floating-point infinity. This is the result of floating-point division when the divisor is `0.0`. For negative infinity, use `-INF`. Dividing by `-0.0` will result in negative infinity if the numerator is positive, so dividing by `0.0` is not the same as dividing by `-0.0` (despite `0.0 == -0.0` returning `true`). **Note:** Numeric infinity is only a concept with floating-point numbers, and has no equivalent for integers. Dividing an integer number by `0` will not result in [INF](#class-gdscript-constant-inf) and will result in a run-time error instead. * **NAN** = **nan** --- "Not a Number", an invalid floating-point value. [NAN](#class-gdscript-constant-nan) has special properties, including that it is not equal to itself (`NAN == NAN` returns `false`). It is output by some invalid operations, such as dividing floating-point `0.0` by `0.0`. **Note:** "Not a Number" is only a concept with floating-point numbers, and has no equivalent for integers. Dividing an integer `0` by `0` will not result in [NAN](#class-gdscript-constant-nan) and will result in a run-time error instead. Method Descriptions ------------------- ### [Color](class_color#class-color) Color8 ( [int](class_int#class-int) r8, [int](class_int#class-int) g8, [int](class_int#class-int) b8, [int](class_int#class-int) a8=255 ) Returns a color constructed from integer red, green, blue, and alpha channels. Each channel should have 8 bits of information ranging from 0 to 255. `r8` red channel `g8` green channel `b8` blue channel `a8` alpha channel ``` red = Color8(255, 0, 0) ``` ### [Color](class_color#class-color) ColorN ( [String](class_string#class-string) name, [float](class_float#class-float) alpha=1.0 ) Returns a color according to the standardized `name` with `alpha` ranging from 0 to 1. ``` red = ColorN("red", 1) ``` Supported color names are the same as the constants defined in [Color](class_color#class-color). ### [float](class_float#class-float) abs ( [float](class_float#class-float) s ) Returns the absolute value of parameter `s` (i.e. positive value). ``` a = abs(-1) # a is 1 ``` ### [float](class_float#class-float) acos ( [float](class_float#class-float) s ) Returns the arc cosine of `s` in radians. Use to get the angle of cosine `s`. `s` must be between `-1.0` and `1.0` (inclusive), otherwise, [acos](#class-gdscript-method-acos) will return [NAN](#class-gdscript-constant-nan). ``` # c is 0.523599 or 30 degrees if converted with rad2deg(s) c = acos(0.866025) ``` ### [float](class_float#class-float) asin ( [float](class_float#class-float) s ) Returns the arc sine of `s` in radians. Use to get the angle of sine `s`. `s` must be between `-1.0` and `1.0` (inclusive), otherwise, [asin](#class-gdscript-method-asin) will return [NAN](#class-gdscript-constant-nan). ``` # s is 0.523599 or 30 degrees if converted with rad2deg(s) s = asin(0.5) ``` ### void assert ( [bool](class_bool#class-bool) condition, [String](class_string#class-string) message="" ) Asserts that the `condition` is `true`. If the `condition` is `false`, an error is generated. When running from the editor, the running project will also be paused until you resume it. This can be used as a stronger form of [push\_error](#class-gdscript-method-push-error) for reporting errors to project developers or add-on users. **Note:** For performance reasons, the code inside [assert](#class-gdscript-method-assert) is only executed in debug builds or when running the project from the editor. Don't include code that has side effects in an [assert](#class-gdscript-method-assert) call. Otherwise, the project will behave differently when exported in release mode. The optional `message` argument, if given, is shown in addition to the generic "Assertion failed" message. You can use this to provide additional details about why the assertion failed. ``` # Imagine we always want speed to be between 0 and 20. var speed = -10 assert(speed < 20) # True, the program will continue assert(speed >= 0) # False, the program will stop assert(speed >= 0 and speed < 20) # You can also combine the two conditional statements in one check assert(speed < 20, "speed = %f, but the speed limit is 20" % speed) # Show a message with clarifying details ``` ### [float](class_float#class-float) atan ( [float](class_float#class-float) s ) Returns the arc tangent of `s` in radians. Use it to get the angle from an angle's tangent in trigonometry: `atan(tan(angle)) == angle`. The method cannot know in which quadrant the angle should fall. See [atan2](#class-gdscript-method-atan2) if you have both `y` and `x`. ``` a = atan(0.5) # a is 0.463648 ``` ### [float](class_float#class-float) atan2 ( [float](class_float#class-float) y, [float](class_float#class-float) x ) Returns the arc tangent of `y/x` in radians. Use to get the angle of tangent `y/x`. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant. Important note: The Y coordinate comes first, by convention. ``` a = atan2(0, -1) # a is 3.141593 ``` ### [Variant](class_variant#class-variant) bytes2var ( [PoolByteArray](class_poolbytearray#class-poolbytearray) bytes, [bool](class_bool#class-bool) allow\_objects=false ) Decodes a byte array back to a value. When `allow_objects` is `true` decoding objects is allowed. **WARNING:** Deserialized object can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats (remote code execution). ### [Vector2](class_vector2#class-vector2) cartesian2polar ( [float](class_float#class-float) x, [float](class_float#class-float) y ) Converts a 2D point expressed in the cartesian coordinate system (X and Y axis) to the polar coordinate system (a distance from the origin and an angle). ### [float](class_float#class-float) ceil ( [float](class_float#class-float) s ) Rounds `s` upward (towards positive infinity), returning the smallest whole number that is not less than `s`. ``` a = ceil(1.45) # a is 2.0 a = ceil(1.001) # a is 2.0 ``` See also [floor](#class-gdscript-method-floor), [round](#class-gdscript-method-round), [stepify](#class-gdscript-method-stepify), and [int](class_int#class-int). ### [String](class_string#class-string) char ( [int](class_int#class-int) code ) Returns a character as a String of the given Unicode code point (which is compatible with ASCII code). ``` a = char(65) # a is "A" a = char(65 + 32) # a is "a" a = char(8364) # a is "€" ``` This is the inverse of [ord](#class-gdscript-method-ord). ### [float](class_float#class-float) clamp ( [float](class_float#class-float) value, [float](class_float#class-float) min, [float](class_float#class-float) max ) Clamps `value` and returns a value not less than `min` and not more than `max`. ``` a = clamp(1000, 1, 20) # a is 20 a = clamp(-10, 1, 20) # a is 1 a = clamp(15, 1, 20) # a is 15 ``` ### [Variant](class_variant#class-variant) convert ( [Variant](class_variant#class-variant) what, [int](class_int#class-int) type ) Converts from a type to another in the best way possible. The `type` parameter uses the [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) values. ``` a = Vector2(1, 0) # Prints 1 print(a.length()) a = convert(a, TYPE_STRING) # Prints 6 as "(1, 0)" is 6 characters print(a.length()) ``` ### [float](class_float#class-float) cos ( [float](class_float#class-float) s ) Returns the cosine of angle `s` in radians. ``` a = cos(TAU) # a is 1.0 a = cos(PI) # a is -1.0 ``` ### [float](class_float#class-float) cosh ( [float](class_float#class-float) s ) Returns the hyperbolic cosine of `s` in radians. ``` print(cosh(1)) # Prints 1.543081 ``` ### [float](class_float#class-float) db2linear ( [float](class_float#class-float) db ) Converts from decibels to linear energy (audio). ### [int](class_int#class-int) decimals ( [float](class_float#class-float) step ) Deprecated alias for [step\_decimals](#class-gdscript-method-step-decimals). ### [float](class_float#class-float) dectime ( [float](class_float#class-float) value, [float](class_float#class-float) amount, [float](class_float#class-float) step ) **Note:** `dectime` has been deprecated and will be removed in Godot 4.0, please use [move\_toward](#class-gdscript-method-move-toward) instead. Returns the result of `value` decreased by `step` \* `amount`. ``` a = dectime(60, 10, 0.1)) # a is 59.0 ``` ### [bool](class_bool#class-bool) deep\_equal ( [Variant](class_variant#class-variant) a, [Variant](class_variant#class-variant) b ) Compares two values by checking their actual contents, recursing into any [Array](class_array#class-array) or [Dictionary](class_dictionary#class-dictionary) up to its deepest level. This compares to `==` in a number of ways: * For `null`, `int`, `float`, `String`, `Object` and `RID` both `deep_equal` and `==` work the same. * For `Dictionary`, `==` considers equality if, and only if, both variables point to the very same `Dictionary`, with no recursion or awareness of the contents at all. * For `Array`, `==` considers equality if, and only if, each item in the first `Array` is equal to its counterpart in the second `Array`, as told by `==` itself. That implies that `==` recurses into `Array`, but not into `Dictionary`. In short, whenever a `Dictionary` is potentially involved, if you want a true content-aware comparison, you have to use `deep_equal`. ### [float](class_float#class-float) deg2rad ( [float](class_float#class-float) deg ) Converts an angle expressed in degrees to radians. ``` r = deg2rad(180) # r is 3.141593 ``` ### [Object](class_object#class-object) dict2inst ( [Dictionary](class_dictionary#class-dictionary) dict ) Converts a dictionary (previously created with [inst2dict](#class-gdscript-method-inst2dict)) back to an instance. Useful for deserializing. ### [float](class_float#class-float) ease ( [float](class_float#class-float) s, [float](class_float#class-float) curve ) Returns an "eased" value of `x` based on an easing function defined with `curve`. This easing function is based on an exponent. The `curve` can be any floating-point number, with specific values leading to the following behaviors: ``` - Lower than -1.0 (exclusive): Ease in-out - 1.0: Linear - Between -1.0 and 0.0 (exclusive): Ease out-in - 0.0: Constant - Between 0.0 to 1.0 (exclusive): Ease out - 1.0: Linear - Greater than 1.0 (exclusive): Ease in ``` [ease() curve values cheatsheet](https://raw.githubusercontent.com/godotengine/godot-docs/3.5/img/ease_cheatsheet.png) See also [smoothstep](#class-gdscript-method-smoothstep). If you need to perform more advanced transitions, use [Tween](class_tween#class-tween) or [AnimationPlayer](class_animationplayer#class-animationplayer). ### [float](class_float#class-float) exp ( [float](class_float#class-float) s ) The natural exponential function. It raises the mathematical constant **e** to the power of `s` and returns it. **e** has an approximate value of 2.71828, and can be obtained with `exp(1)`. For exponents to other bases use the method [pow](#class-gdscript-method-pow). ``` a = exp(2) # Approximately 7.39 ``` ### [float](class_float#class-float) floor ( [float](class_float#class-float) s ) Rounds `s` downward (towards negative infinity), returning the largest whole number that is not more than `s`. ``` a = floor(2.45) # a is 2.0 a = floor(2.99) # a is 2.0 a = floor(-2.99) # a is -3.0 ``` See also [ceil](#class-gdscript-method-ceil), [round](#class-gdscript-method-round), [stepify](#class-gdscript-method-stepify), and [int](class_int#class-int). **Note:** This method returns a float. If you need an integer and `s` is a non-negative number, you can use `int(s)` directly. ### [float](class_float#class-float) fmod ( [float](class_float#class-float) a, [float](class_float#class-float) b ) Returns the floating-point remainder of `a/b`, keeping the sign of `a`. ``` r = fmod(7, 5.5) # r is 1.5 ``` For the integer remainder operation, use the % operator. ### [float](class_float#class-float) fposmod ( [float](class_float#class-float) a, [float](class_float#class-float) b ) Returns the floating-point modulus of `a/b` that wraps equally in positive and negative. ``` for i in 7: var x = 0.5 * i - 1.5 print("%4.1f %4.1f %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)]) ``` Produces: ``` -1.5 -0.0 0.0 -1.0 -1.0 0.5 -0.5 -0.5 1.0 0.0 0.0 0.0 0.5 0.5 0.5 1.0 1.0 1.0 1.5 0.0 0.0 ``` ### [FuncRef](class_funcref#class-funcref) funcref ( [Object](class_object#class-object) instance, [String](class_string#class-string) funcname ) Returns a reference to the specified function `funcname` in the `instance` node. As functions aren't first-class objects in GDscript, use `funcref` to store a [FuncRef](class_funcref#class-funcref) in a variable and call it later. ``` func foo(): return("bar") a = funcref(self, "foo") print(a.call_func()) # Prints bar ``` ### [Array](class_array#class-array) get\_stack ( ) Returns an array of dictionaries representing the current call stack. ``` func _ready(): foo() func foo(): bar() func bar(): print(get_stack()) ``` would print ``` [{function:bar, line:12, source:res://script.gd}, {function:foo, line:9, source:res://script.gd}, {function:_ready, line:6, source:res://script.gd}] ``` ### [int](class_int#class-int) hash ( [Variant](class_variant#class-variant) var ) Returns the integer hash of the variable passed. ``` print(hash("a")) # Prints 177670 ``` ### [Dictionary](class_dictionary#class-dictionary) inst2dict ( [Object](class_object#class-object) inst ) Returns the passed instance converted to a dictionary (useful for serializing). ``` var foo = "bar" func _ready(): var d = inst2dict(self) print(d.keys()) print(d.values()) ``` Prints out: ``` [@subpath, @path, foo] [, res://test.gd, bar] ``` ### [Object](class_object#class-object) instance\_from\_id ( [int](class_int#class-int) instance\_id ) Returns the Object that corresponds to `instance_id`. All Objects have a unique instance ID. ``` var foo = "bar" func _ready(): var id = get_instance_id() var inst = instance_from_id(id) print(inst.foo) # Prints bar ``` ### [float](class_float#class-float) inverse\_lerp ( [float](class_float#class-float) from, [float](class_float#class-float) to, [float](class_float#class-float) weight ) Returns an interpolation or extrapolation factor considering the range specified in `from` and `to`, and the interpolated value specified in `weight`. The returned value will be between `0.0` and `1.0` if `weight` is between `from` and `to` (inclusive). If `weight` is located outside this range, then an extrapolation factor will be returned (return value lower than `0.0` or greater than `1.0`). Use [clamp](#class-gdscript-method-clamp) on the result of [inverse\_lerp](#class-gdscript-method-inverse-lerp) if this is not desired. ``` # The interpolation ratio in the `lerp()` call below is 0.75. var middle = lerp(20, 30, 0.75) # `middle` is now 27.5. # Now, we pretend to have forgotten the original ratio and want to get it back. var ratio = inverse_lerp(20, 30, 27.5) # `ratio` is now 0.75. ``` See also [lerp](#class-gdscript-method-lerp) which performs the reverse of this operation, and [range\_lerp](#class-gdscript-method-range-lerp) to map a continuous series of values to another. ### [bool](class_bool#class-bool) is\_equal\_approx ( [float](class_float#class-float) a, [float](class_float#class-float) b ) Returns `true` if `a` and `b` are approximately equal to each other. Here, approximately equal means that `a` and `b` are within a small internal epsilon of each other, which scales with the magnitude of the numbers. Infinity values of the same sign are considered equal. ### [bool](class_bool#class-bool) is\_inf ( [float](class_float#class-float) s ) Returns whether `s` is an infinity value (either positive infinity or negative infinity). ### [bool](class_bool#class-bool) is\_instance\_valid ( [Object](class_object#class-object) instance ) Returns whether `instance` is a valid object (e.g. has not been deleted from memory). ### [bool](class_bool#class-bool) is\_nan ( [float](class_float#class-float) s ) Returns whether `s` is a NaN ("Not a Number" or invalid) value. ### [bool](class_bool#class-bool) is\_zero\_approx ( [float](class_float#class-float) s ) Returns `true` if `s` is zero or almost zero. This method is faster than using [is\_equal\_approx](#class-gdscript-method-is-equal-approx) with one value as zero. ### [int](class_int#class-int) len ( [Variant](class_variant#class-variant) var ) Returns length of Variant `var`. Length is the character count of String, element count of Array, size of Dictionary, etc. **Note:** Generates a fatal error if Variant can not provide a length. ``` a = [1, 2, 3, 4] len(a) # Returns 4 ``` ### [Variant](class_variant#class-variant) lerp ( [Variant](class_variant#class-variant) from, [Variant](class_variant#class-variant) to, [float](class_float#class-float) weight ) Linearly interpolates between two values by the factor defined in `weight`. To perform interpolation, `weight` should be between `0.0` and `1.0` (inclusive). However, values outside this range are allowed and can be used to perform *extrapolation*. Use [clamp](#class-gdscript-method-clamp) on the result of [lerp](#class-gdscript-method-lerp) if this is not desired. If the `from` and `to` arguments are of type [int](class_int#class-int) or [float](class_float#class-float), the return value is a [float](class_float#class-float). If both are of the same vector type ([Vector2](class_vector2#class-vector2), [Vector3](class_vector3#class-vector3) or [Color](class_color#class-color)), the return value will be of the same type (`lerp` then calls the vector type's `linear_interpolate` method). ``` lerp(0, 4, 0.75) # Returns 3.0 lerp(Vector2(1, 5), Vector2(3, 2), 0.5) # Returns Vector2(2, 3.5) ``` See also [inverse\_lerp](#class-gdscript-method-inverse-lerp) which performs the reverse of this operation. To perform eased interpolation with [lerp](#class-gdscript-method-lerp), combine it with [ease](#class-gdscript-method-ease) or [smoothstep](#class-gdscript-method-smoothstep). See also [range\_lerp](#class-gdscript-method-range-lerp) to map a continuous series of values to another. ### [float](class_float#class-float) lerp\_angle ( [float](class_float#class-float) from, [float](class_float#class-float) to, [float](class_float#class-float) weight ) Linearly interpolates between two angles (in radians) by a normalized value. Similar to [lerp](#class-gdscript-method-lerp), but interpolates correctly when the angles wrap around [TAU](#class-gdscript-constant-tau). To perform eased interpolation with [lerp\_angle](#class-gdscript-method-lerp-angle), combine it with [ease](#class-gdscript-method-ease) or [smoothstep](#class-gdscript-method-smoothstep). ``` extends Sprite var elapsed = 0.0 func _process(delta): var min_angle = deg2rad(0.0) var max_angle = deg2rad(90.0) rotation = lerp_angle(min_angle, max_angle, elapsed) elapsed += delta ``` **Note:** This method lerps through the shortest path between `from` and `to`. However, when these two angles are approximately `PI + k * TAU` apart for any integer `k`, it's not obvious which way they lerp due to floating-point precision errors. For example, `lerp_angle(0, PI, weight)` lerps counter-clockwise, while `lerp_angle(0, PI + 5 * TAU, weight)` lerps clockwise. ### [float](class_float#class-float) linear2db ( [float](class_float#class-float) nrg ) Converts from linear energy to decibels (audio). This can be used to implement volume sliders that behave as expected (since volume isn't linear). Example: ``` # "Slider" refers to a node that inherits Range such as HSlider or VSlider. # Its range must be configured to go from 0 to 1. # Change the bus name if you'd like to change the volume of a specific bus only. AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), linear2db($Slider.value)) ``` ### [Resource](class_resource#class-resource) load ( [String](class_string#class-string) path ) Loads a resource from the filesystem located at `path`. The resource is loaded on the method call (unless it's referenced already elsewhere, e.g. in another script or in the scene), which might cause slight delay, especially when loading scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use [preload](#class-gdscript-method-preload). **Note:** Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script. ``` # Load a scene called main located in the root of the project directory and cache it in a variable. var main = load("res://main.tscn") # main will contain a PackedScene resource. ``` **Important:** The path must be absolute, a local path will just return `null`. This method is a simplified version of [ResourceLoader.load](class_resourceloader#class-resourceloader-method-load), which can be used for more advanced scenarios. ### [float](class_float#class-float) log ( [float](class_float#class-float) s ) Natural logarithm. The amount of time needed to reach a certain level of continuous growth. **Note:** This is not the same as the "log" function on most calculators, which uses a base 10 logarithm. ``` log(10) # Returns 2.302585 ``` **Note:** The logarithm of `0` returns `-inf`, while negative values return `-nan`. ### [float](class_float#class-float) max ( [float](class_float#class-float) a, [float](class_float#class-float) b ) Returns the maximum of two values. ``` max(1, 2) # Returns 2 max(-3.99, -4) # Returns -3.99 ``` ### [float](class_float#class-float) min ( [float](class_float#class-float) a, [float](class_float#class-float) b ) Returns the minimum of two values. ``` min(1, 2) # Returns 1 min(-3.99, -4) # Returns -4 ``` ### [float](class_float#class-float) move\_toward ( [float](class_float#class-float) from, [float](class_float#class-float) to, [float](class_float#class-float) delta ) Moves `from` toward `to` by the `delta` value. Use a negative `delta` value to move away. ``` move_toward(5, 10, 4) # Returns 9 move_toward(10, 5, 4) # Returns 6 move_toward(10, 5, -1.5) # Returns 11.5 ``` ### [int](class_int#class-int) nearest\_po2 ( [int](class_int#class-int) value ) Returns the nearest equal or larger power of 2 for integer `value`. In other words, returns the smallest value `a` where `a = pow(2, n)` such that `value <= a` for some non-negative integer `n`. ``` nearest_po2(3) # Returns 4 nearest_po2(4) # Returns 4 nearest_po2(5) # Returns 8 nearest_po2(0) # Returns 0 (this may not be what you expect) nearest_po2(-1) # Returns 0 (this may not be what you expect) ``` **WARNING:** Due to the way it is implemented, this function returns `0` rather than `1` for non-positive values of `value` (in reality, 1 is the smallest integer power of 2). ### [int](class_int#class-int) ord ( [String](class_string#class-string) char ) Returns an integer representing the Unicode code point of the given Unicode character `char`. ``` a = ord("A") # a is 65 a = ord("a") # a is 97 a = ord("€") # a is 8364 ``` This is the inverse of [char](#class-gdscript-method-char). ### [Variant](class_variant#class-variant) parse\_json ( [String](class_string#class-string) json ) Parse JSON text to a Variant. (Use [typeof](#class-gdscript-method-typeof) to check if the Variant's type is what you expect.) **Note:** The JSON specification does not define integer or float types, but only a *number* type. Therefore, parsing a JSON text will convert all numerical values to [float](class_float#class-float) types. **Note:** JSON objects do not preserve key order like Godot dictionaries, thus, you should not rely on keys being in a certain order if a dictionary is constructed from JSON. In contrast, JSON arrays retain the order of their elements: ``` var p = JSON.parse('["hello", "world", "!"]') if typeof(p.result) == TYPE_ARRAY: print(p.result[0]) # Prints "hello" else: push_error("Unexpected results.") ``` See also [JSON](class_json#class-json) for an alternative way to parse JSON text. ### [Vector2](class_vector2#class-vector2) polar2cartesian ( [float](class_float#class-float) r, [float](class_float#class-float) th ) Converts a 2D point expressed in the polar coordinate system (a distance from the origin `r` and an angle `th`) to the cartesian coordinate system (X and Y axis). ### [int](class_int#class-int) posmod ( [int](class_int#class-int) a, [int](class_int#class-int) b ) Returns the integer modulus of `a/b` that wraps equally in positive and negative. ``` for i in range(-3, 4): print("%2d %2d %2d" % [i, i % 3, posmod(i, 3)]) ``` Produces: ``` -3 0 0 -2 -2 1 -1 -1 2 0 0 0 1 1 1 2 2 2 3 0 0 ``` ### [float](class_float#class-float) pow ( [float](class_float#class-float) base, [float](class_float#class-float) exp ) Returns the result of `base` raised to the power of `exp`. ``` pow(2, 5) # Returns 32.0 ``` ### [Resource](class_resource#class-resource) preload ( [String](class_string#class-string) path ) Returns a [Resource](class_resource#class-resource) from the filesystem located at `path`. The resource is loaded during script parsing, i.e. is loaded with the script and [preload](#class-gdscript-method-preload) effectively acts as a reference to that resource. Note that the method requires a constant path. If you want to load a resource from a dynamic/variable path, use [load](#class-gdscript-method-load). **Note:** Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script. ``` # Instance a scene. var diamond = preload("res://diamond.tscn").instance() ``` ### void print ( ... ) vararg Converts one or more arguments of any type to string in the best way possible and prints them to the console. ``` a = [1, 2, 3] print("a", "=", a) # Prints a=[1, 2, 3] ``` **Note:** Consider using [push\_error](#class-gdscript-method-push-error) and [push\_warning](#class-gdscript-method-push-warning) to print error and warning messages instead of [print](#class-gdscript-method-print). This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. ### void print\_debug ( ... ) vararg Like [print](#class-gdscript-method-print), but includes the current stack frame when running with the debugger turned on. Output in the console would look something like this: ``` Test print At: res://test.gd:15:_process() ``` ### void print\_stack ( ) Prints a stack track at code location, only works when running with debugger turned on. Output in the console would look something like this: ``` Frame 0 - res://test.gd:16 in function '_process' ``` ### void printerr ( ... ) vararg Prints one or more arguments to strings in the best way possible to standard error line. ``` printerr("prints to stderr") ``` ### void printraw ( ... ) vararg Prints one or more arguments to strings in the best way possible to console. No newline is added at the end. ``` printraw("A") printraw("B") # Prints AB ``` **Note:** Due to limitations with Godot's built-in console, this only prints to the terminal. If you need to print in the editor, use another method, such as [print](#class-gdscript-method-print). ### void prints ( ... ) vararg Prints one or more arguments to the console with a space between each argument. ``` prints("A", "B", "C") # Prints A B C ``` ### void printt ( ... ) vararg Prints one or more arguments to the console with a tab between each argument. ``` printt("A", "B", "C") # Prints A B C ``` ### void push\_error ( [String](class_string#class-string) message ) Pushes an error message to Godot's built-in debugger and to the OS terminal. ``` push_error("test error") # Prints "test error" to debugger and terminal as error call ``` **Note:** Errors printed this way will not pause project execution. To print an error message and pause project execution in debug builds, use `assert(false, "test error")` instead. ### void push\_warning ( [String](class_string#class-string) message ) Pushes a warning message to Godot's built-in debugger and to the OS terminal. ``` push_warning("test warning") # Prints "test warning" to debugger and terminal as warning call ``` ### [float](class_float#class-float) rad2deg ( [float](class_float#class-float) rad ) Converts an angle expressed in radians to degrees. ``` rad2deg(0.523599) # Returns 30.0 ``` ### [float](class_float#class-float) rand\_range ( [float](class_float#class-float) from, [float](class_float#class-float) to ) Returns a random floating point value between `from` and `to` (both endpoints inclusive). ``` prints(rand_range(0, 1), rand_range(0, 1)) # Prints e.g. 0.135591 0.405263 ``` **Note:** This is equivalent to `randf() * (to - from) + from`. ### [Array](class_array#class-array) rand\_seed ( [int](class_int#class-int) seed ) Random from seed: pass a `seed`, and an array with both number and new seed is returned. "Seed" here refers to the internal state of the pseudo random number generator. The internal state of the current implementation is 64 bits. ### [float](class_float#class-float) randf ( ) Returns a random floating point value on the interval `[0, 1]`. ``` randf() # Returns e.g. 0.375671 ``` ### [int](class_int#class-int) randi ( ) Returns a random unsigned 32-bit integer. Use remainder to obtain a random value in the interval `[0, N - 1]` (where N is smaller than 2^32). ``` randi() # Returns random integer between 0 and 2^32 - 1 randi() % 20 # Returns random integer between 0 and 19 randi() % 100 # Returns random integer between 0 and 99 randi() % 100 + 1 # Returns random integer between 1 and 100 ``` ### void randomize ( ) Randomizes the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. ``` func _ready(): randomize() ``` ### [Array](class_array#class-array) range ( ... ) vararg Returns an array with the given range. [range](#class-gdscript-method-range) can be called in three ways: `range(n: int)`: Starts from 0, increases by steps of 1, and stops *before* `n`. The argument `n` is **exclusive**. `range(b: int, n: int)`: Starts from `b`, increases by steps of 1, and stops *before* `n`. The arguments `b` and `n` are **inclusive** and **exclusive**, respectively. `range(b: int, n: int, s: int)`: Starts from `b`, increases/decreases by steps of `s`, and stops *before* `n`. The arguments `b` and `n` are **inclusive** and **exclusive**, respectively. The argument `s` **can** be negative, but not `0`. If `s` is `0`, an error message is printed. [range](#class-gdscript-method-range) converts all arguments to [int](class_int#class-int) before processing. **Note:** Returns an empty array if no value meets the value constraint (e.g. `range(2, 5, -1)` or `range(5, 5, 1)`). Examples: ``` print(range(4)) # Prints [0, 1, 2, 3] print(range(2, 5)) # Prints [2, 3, 4] print(range(0, 6, 2)) # Prints [0, 2, 4] print(range(4, 1, -1)) # Prints [4, 3, 2] ``` To iterate over an [Array](class_array#class-array) backwards, use: ``` var array = [3, 6, 9] for i in range(array.size(), 0, -1): print(array[i - 1]) ``` Output: ``` 9 6 3 ``` ### [float](class_float#class-float) range\_lerp ( [float](class_float#class-float) value, [float](class_float#class-float) istart, [float](class_float#class-float) istop, [float](class_float#class-float) ostart, [float](class_float#class-float) ostop ) Maps a `value` from range `[istart, istop]` to `[ostart, ostop]`. See also [lerp](#class-gdscript-method-lerp) and [inverse\_lerp](#class-gdscript-method-inverse-lerp). If `value` is outside `[istart, istop]`, then the resulting value will also be outside `[ostart, ostop]`. Use [clamp](#class-gdscript-method-clamp) on the result of [range\_lerp](#class-gdscript-method-range-lerp) if this is not desired. ``` range_lerp(75, 0, 100, -1, 1) # Returns 0.5 ``` For complex use cases where you need multiple ranges, consider using [Curve](class_curve#class-curve) or [Gradient](class_gradient#class-gradient) instead. ### [float](class_float#class-float) round ( [float](class_float#class-float) s ) Rounds `s` to the nearest whole number, with halfway cases rounded away from zero. ``` a = round(2.49) # a is 2.0 a = round(2.5) # a is 3.0 a = round(2.51) # a is 3.0 ``` See also [floor](#class-gdscript-method-floor), [ceil](#class-gdscript-method-ceil), [stepify](#class-gdscript-method-stepify), and [int](class_int#class-int). ### void seed ( [int](class_int#class-int) seed ) Sets seed for the random number generator. ``` my_seed = "Godot Rocks" seed(my_seed.hash()) ``` ### [float](class_float#class-float) sign ( [float](class_float#class-float) s ) Returns the sign of `s`: -1 or 1. Returns 0 if `s` is 0. ``` sign(-6) # Returns -1 sign(0) # Returns 0 sign(6) # Returns 1 ``` ### [float](class_float#class-float) sin ( [float](class_float#class-float) s ) Returns the sine of angle `s` in radians. ``` sin(0.523599) # Returns 0.5 ``` ### [float](class_float#class-float) sinh ( [float](class_float#class-float) s ) Returns the hyperbolic sine of `s`. ``` a = log(2.0) # Returns 0.693147 sinh(a) # Returns 0.75 ``` ### [float](class_float#class-float) smoothstep ( [float](class_float#class-float) from, [float](class_float#class-float) to, [float](class_float#class-float) s ) Returns the result of smoothly interpolating the value of `s` between `0` and `1`, based on the where `s` lies with respect to the edges `from` and `to`. The return value is `0` if `s <= from`, and `1` if `s >= to`. If `s` lies between `from` and `to`, the returned value follows an S-shaped curve that maps `s` between `0` and `1`. This S-shaped curve is the cubic Hermite interpolator, given by `f(y) = 3*y^2 - 2*y^3` where `y = (x-from) / (to-from)`. ``` smoothstep(0, 2, -5.0) # Returns 0.0 smoothstep(0, 2, 0.5) # Returns 0.15625 smoothstep(0, 2, 1.0) # Returns 0.5 smoothstep(0, 2, 2.0) # Returns 1.0 ``` Compared to [ease](#class-gdscript-method-ease) with a curve value of `-1.6521`, [smoothstep](#class-gdscript-method-smoothstep) returns the smoothest possible curve with no sudden changes in the derivative. If you need to perform more advanced transitions, use [Tween](class_tween#class-tween) or [AnimationPlayer](class_animationplayer#class-animationplayer). [Comparison between smoothstep() and ease(x, -1.6521) return values](https://raw.githubusercontent.com/godotengine/godot-docs/3.5/img/smoothstep_ease_comparison.png) ### [float](class_float#class-float) sqrt ( [float](class_float#class-float) s ) Returns the square root of `s`, where `s` is a non-negative number. ``` sqrt(9) # Returns 3 ``` **Note:** Negative values of `s` return NaN. If you need negative inputs, use `System.Numerics.Complex` in C#. ### [int](class_int#class-int) step\_decimals ( [float](class_float#class-float) step ) Returns the position of the first non-zero digit, after the decimal point. Note that the maximum return value is 10, which is a design decision in the implementation. ``` n = step_decimals(5) # n is 0 n = step_decimals(1.0005) # n is 4 n = step_decimals(0.000000005) # n is 9 ``` ### [float](class_float#class-float) stepify ( [float](class_float#class-float) s, [float](class_float#class-float) step ) Snaps float value `s` to a given `step`. This can also be used to round a floating point number to an arbitrary number of decimals. ``` stepify(100, 32) # Returns 96.0 stepify(3.14159, 0.01) # Returns 3.14 ``` See also [ceil](#class-gdscript-method-ceil), [floor](#class-gdscript-method-floor), [round](#class-gdscript-method-round), and [int](class_int#class-int). ### [String](class_string#class-string) str ( ... ) vararg Converts one or more arguments of any type to string in the best way possible. ``` var a = [10, 20, 30] var b = str(a); len(a) # Returns 3 len(b) # Returns 12 ``` ### [Variant](class_variant#class-variant) str2var ( [String](class_string#class-string) string ) Converts a formatted string that was returned by [var2str](#class-gdscript-method-var2str) to the original value. ``` a = '{ "a": 1, "b": 2 }' b = str2var(a) print(b["a"]) # Prints 1 ``` ### [float](class_float#class-float) tan ( [float](class_float#class-float) s ) Returns the tangent of angle `s` in radians. ``` tan(deg2rad(45)) # Returns 1 ``` ### [float](class_float#class-float) tanh ( [float](class_float#class-float) s ) Returns the hyperbolic tangent of `s`. ``` a = log(2.0) # a is 0.693147 b = tanh(a) # b is 0.6 ``` ### [String](class_string#class-string) to\_json ( [Variant](class_variant#class-variant) var ) Converts a [Variant](class_variant#class-variant) `var` to JSON text and return the result. Useful for serializing data to store or send over the network. ``` # Both numbers below are integers. a = { "a": 1, "b": 2 } b = to_json(a) print(b) # {"a":1, "b":2} # Both numbers above are floats, even if they display without any decimal places. ``` **Note:** The JSON specification does not define integer or float types, but only a *number* type. Therefore, converting a [Variant](class_variant#class-variant) to JSON text will convert all numerical values to [float](class_float#class-float) types. See also [JSON](class_json#class-json) for an alternative way to convert a [Variant](class_variant#class-variant) to JSON text. ### [bool](class_bool#class-bool) type\_exists ( [String](class_string#class-string) type ) Returns whether the given class exists in [ClassDB](class_classdb#class-classdb). ``` type_exists("Sprite") # Returns true type_exists("Variant") # Returns false ``` ### [int](class_int#class-int) typeof ( [Variant](class_variant#class-variant) what ) Returns the internal type of the given Variant object, using the [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) values. ``` p = parse_json('["a", "b", "c"]') if typeof(p) == TYPE_ARRAY: print(p[0]) # Prints a else: print("unexpected results") ``` ### [String](class_string#class-string) validate\_json ( [String](class_string#class-string) json ) Checks that `json` is valid JSON data. Returns an empty string if valid, or an error message otherwise. ``` j = to_json([1, 2, 3]) v = validate_json(j) if not v: print("Valid JSON.") else: push_error("Invalid JSON: " + v) ``` ### [PoolByteArray](class_poolbytearray#class-poolbytearray) var2bytes ( [Variant](class_variant#class-variant) var, [bool](class_bool#class-bool) full\_objects=false ) Encodes a variable value to a byte array. When `full_objects` is `true` encoding objects is allowed (and can potentially include code). ### [String](class_string#class-string) var2str ( [Variant](class_variant#class-variant) var ) Converts a Variant `var` to a formatted string that can later be parsed using [str2var](#class-gdscript-method-str2var). ``` a = { "a": 1, "b": 2 } print(var2str(a)) ``` prints ``` { "a": 1, "b": 2 } ``` ### [WeakRef](class_weakref#class-weakref) weakref ( [Object](class_object#class-object) obj ) Returns a weak reference to an object. A weak reference to an object is not enough to keep the object alive: when the only remaining references to a referent are weak references, garbage collection is free to destroy the referent and reuse its memory for something else. However, until the object is actually destroyed the weak reference may return the object even if there are no strong references to it. ### [float](class_float#class-float) wrapf ( [float](class_float#class-float) value, [float](class_float#class-float) min, [float](class_float#class-float) max ) Wraps float `value` between `min` and `max`. Usable for creating loop-alike behavior or infinite surfaces. ``` # Infinite loop between 5.0 and 9.9 value = wrapf(value + 0.1, 5.0, 10.0) ``` ``` # Infinite rotation (in radians) angle = wrapf(angle + 0.1, 0.0, TAU) ``` ``` # Infinite rotation (in radians) angle = wrapf(angle + 0.1, -PI, PI) ``` **Note:** If `min` is `0`, this is equivalent to [fposmod](#class-gdscript-method-fposmod), so prefer using that instead. `wrapf` is more flexible than using the [fposmod](#class-gdscript-method-fposmod) approach by giving the user control over the minimum value. ### [int](class_int#class-int) wrapi ( [int](class_int#class-int) value, [int](class_int#class-int) min, [int](class_int#class-int) max ) Wraps integer `value` between `min` and `max`. Usable for creating loop-alike behavior or infinite surfaces. ``` # Infinite loop between 5 and 9 frame = wrapi(frame + 1, 5, 10) ``` ``` # result is -2 var result = wrapi(-6, -5, -1) ``` **Note:** If `min` is `0`, this is equivalent to [posmod](#class-gdscript-method-posmod), so prefer using that instead. `wrapi` is more flexible than using the [posmod](#class-gdscript-method-posmod) approach by giving the user control over the minimum value. ### [GDScriptFunctionState](class_gdscriptfunctionstate#class-gdscriptfunctionstate) yield ( [Object](class_object#class-object) object=null, [String](class_string#class-string) signal="" ) Stops the function execution and returns the current suspended state to the calling function. From the caller, call [GDScriptFunctionState.resume](class_gdscriptfunctionstate#class-gdscriptfunctionstate-method-resume) on the state to resume execution. This invalidates the state. Within the resumed function, `yield()` returns whatever was passed to the `resume()` function call. If passed an object and a signal, the execution is resumed when the object emits the given signal. In this case, `yield()` returns the argument passed to `emit_signal()` if the signal takes only one argument, or an array containing all the arguments passed to `emit_signal()` if the signal takes multiple arguments. You can also use `yield` to wait for a function to finish: ``` func _ready(): yield(countdown(), "completed") # waiting for the countdown() function to complete print('Ready') func countdown(): yield(get_tree(), "idle_frame") # returns a GDScriptFunctionState object to _ready() print(3) yield(get_tree().create_timer(1.0), "timeout") print(2) yield(get_tree().create_timer(1.0), "timeout") print(1) yield(get_tree().create_timer(1.0), "timeout") # prints: # 3 # 2 # 1 # Ready ``` When yielding on a function, the `completed` signal will be emitted automatically when the function returns. It can, therefore, be used as the `signal` parameter of the `yield` method to resume. In order to yield on a function, the resulting function should also return a `GDScriptFunctionState`. Notice `yield(get_tree(), "idle_frame")` from the above example.
programming_docs
godot EditorFileSystem EditorFileSystem ================ **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) Resource filesystem, as the editor sees it. Description ----------- This object holds information of all resources in the filesystem, their types, etc. **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using [EditorInterface.get\_resource\_filesystem](class_editorinterface#class-editorinterface-method-get-resource-filesystem). Methods ------- | | | | --- | --- | | [String](class_string#class-string) | [get\_file\_type](#class-editorfilesystem-method-get-file-type) **(** [String](class_string#class-string) path **)** const | | [EditorFileSystemDirectory](class_editorfilesystemdirectory#class-editorfilesystemdirectory) | [get\_filesystem](#class-editorfilesystem-method-get-filesystem) **(** **)** | | [EditorFileSystemDirectory](class_editorfilesystemdirectory#class-editorfilesystemdirectory) | [get\_filesystem\_path](#class-editorfilesystem-method-get-filesystem-path) **(** [String](class_string#class-string) path **)** | | [float](class_float#class-float) | [get\_scanning\_progress](#class-editorfilesystem-method-get-scanning-progress) **(** **)** const | | [bool](class_bool#class-bool) | [is\_scanning](#class-editorfilesystem-method-is-scanning) **(** **)** const | | void | [scan](#class-editorfilesystem-method-scan) **(** **)** | | void | [scan\_sources](#class-editorfilesystem-method-scan-sources) **(** **)** | | void | [update\_file](#class-editorfilesystem-method-update-file) **(** [String](class_string#class-string) path **)** | | void | [update\_script\_classes](#class-editorfilesystem-method-update-script-classes) **(** **)** | Signals ------- ### filesystem\_changed ( ) Emitted if the filesystem changed. ### resources\_reimported ( [PoolStringArray](class_poolstringarray#class-poolstringarray) resources ) Emitted if a resource is reimported. ### resources\_reload ( [PoolStringArray](class_poolstringarray#class-poolstringarray) resources ) Emitted if at least one resource is reloaded when the filesystem is scanned. ### sources\_changed ( [bool](class_bool#class-bool) exist ) Emitted if the source of any imported file changed. Method Descriptions ------------------- ### [String](class_string#class-string) get\_file\_type ( [String](class_string#class-string) path ) const Returns the resource type of the file, given the full path. This returns a string such as `"Resource"` or `"GDScript"`, *not* a file extension such as `".gd"`. ### [EditorFileSystemDirectory](class_editorfilesystemdirectory#class-editorfilesystemdirectory) get\_filesystem ( ) Gets the root directory object. ### [EditorFileSystemDirectory](class_editorfilesystemdirectory#class-editorfilesystemdirectory) get\_filesystem\_path ( [String](class_string#class-string) path ) Returns a view into the filesystem at `path`. ### [float](class_float#class-float) get\_scanning\_progress ( ) const Returns the scan progress for 0 to 1 if the FS is being scanned. ### [bool](class_bool#class-bool) is\_scanning ( ) const Returns `true` if the filesystem is being scanned. ### void scan ( ) Scan the filesystem for changes. ### void scan\_sources ( ) Check if the source of any imported resource changed. ### void update\_file ( [String](class_string#class-string) path ) Update a file information. Call this if an external program (not Godot) modified the file. ### void update\_script\_classes ( ) Scans the script files and updates the list of custom class names. godot VisualScriptSceneTree VisualScriptSceneTree ===================== **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A Visual Script node for accessing [SceneTree](class_scenetree#class-scenetree) methods. Description ----------- A Visual Script node for accessing [SceneTree](class_scenetree#class-scenetree) methods. godot PHashTranslation PHashTranslation ================ **Inherits:** [Translation](class_translation#class-translation) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Optimized translation. Description ----------- Optimized translation. Uses real-time compressed translations, which results in very small dictionaries. Methods ------- | | | | --- | --- | | void | [generate](#class-phashtranslation-method-generate) **(** [Translation](class_translation#class-translation) from **)** | Method Descriptions ------------------- ### void generate ( [Translation](class_translation#class-translation) from ) Generates and sets an optimized translation from the given [Translation](class_translation#class-translation) resource. godot AudioEffectSpectrumAnalyzerInstance AudioEffectSpectrumAnalyzerInstance =================================== **Inherits:** [AudioEffectInstance](class_audioeffectinstance#class-audioeffectinstance) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Methods ------- | | | | --- | --- | | [Vector2](class_vector2#class-vector2) | [get\_magnitude\_for\_frequency\_range](#class-audioeffectspectrumanalyzerinstance-method-get-magnitude-for-frequency-range) **(** [float](class_float#class-float) from\_hz, [float](class_float#class-float) to\_hz, [MagnitudeMode](#enum-audioeffectspectrumanalyzerinstance-magnitudemode) mode=1 **)** const | Enumerations ------------ enum **MagnitudeMode**: * **MAGNITUDE\_AVERAGE** = **0** --- Use the average value as magnitude. * **MAGNITUDE\_MAX** = **1** --- Use the maximum value as magnitude. Method Descriptions ------------------- ### [Vector2](class_vector2#class-vector2) get\_magnitude\_for\_frequency\_range ( [float](class_float#class-float) from\_hz, [float](class_float#class-float) to\_hz, [MagnitudeMode](#enum-audioeffectspectrumanalyzerinstance-magnitudemode) mode=1 ) const godot Shader Shader ====== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [VisualShader](class_visualshader#class-visualshader) A custom shader program. Description ----------- This class allows you to define a custom shader program that can be used by a [ShaderMaterial](class_shadermaterial#class-shadermaterial). Shaders allow you to write your own custom behavior for rendering objects or updating particle information. For a detailed explanation and usage, please see the tutorials linked below. Tutorials --------- * [Shaders](https://docs.godotengine.org/en/3.5/tutorials/shaders/index.html) * [Introduction to shaders](https://docs.godotengine.org/en/3.5/tutorials/shaders/introduction_to_shaders.html) Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [code](#class-shader-property-code) | `""` | | [String](class_string#class-string) | [custom\_defines](#class-shader-property-custom-defines) | `""` | Methods ------- | | | | --- | --- | | [Texture](class_texture#class-texture) | [get\_default\_texture\_param](#class-shader-method-get-default-texture-param) **(** [String](class_string#class-string) param **)** const | | [Mode](#enum-shader-mode) | [get\_mode](#class-shader-method-get-mode) **(** **)** const | | [bool](class_bool#class-bool) | [has\_param](#class-shader-method-has-param) **(** [String](class_string#class-string) name **)** const | | void | [set\_default\_texture\_param](#class-shader-method-set-default-texture-param) **(** [String](class_string#class-string) param, [Texture](class_texture#class-texture) texture **)** | Enumerations ------------ enum **Mode**: * **MODE\_SPATIAL** = **0** --- Mode used to draw all 3D objects. * **MODE\_CANVAS\_ITEM** = **1** --- Mode used to draw all 2D objects. * **MODE\_PARTICLES** = **2** --- Mode used to calculate particle information on a per-particle basis. Not used for drawing. Property Descriptions --------------------- ### [String](class_string#class-string) code | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_code(value) | | *Getter* | get\_code() | Returns the shader's code as the user has written it, not the full generated code used internally. ### [String](class_string#class-string) custom\_defines | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_custom\_defines(value) | | *Getter* | get\_custom\_defines() | Returns the shader's custom defines. Custom defines can be used in Godot to add GLSL preprocessor directives (e.g: extensions) required for the shader logic. **Note:** Custom defines are not validated by the Godot shader parser, so care should be taken when using them. Method Descriptions ------------------- ### [Texture](class_texture#class-texture) get\_default\_texture\_param ( [String](class_string#class-string) param ) const Returns the texture that is set as default for the specified parameter. **Note:** `param` must match the name of the uniform in the code exactly. ### [Mode](#enum-shader-mode) get\_mode ( ) const Returns the shader mode for the shader, either [MODE\_CANVAS\_ITEM](#class-shader-constant-mode-canvas-item), [MODE\_SPATIAL](#class-shader-constant-mode-spatial) or [MODE\_PARTICLES](#class-shader-constant-mode-particles). ### [bool](class_bool#class-bool) has\_param ( [String](class_string#class-string) name ) const Returns `true` if the shader has this param defined as a uniform in its code. **Note:** `param` must match the name of the uniform in the code exactly. ### void set\_default\_texture\_param ( [String](class_string#class-string) param, [Texture](class_texture#class-texture) texture ) Sets the default texture to be used with a texture uniform. The default is used if a texture is not set in the [ShaderMaterial](class_shadermaterial#class-shadermaterial). **Note:** `param` must match the name of the uniform in the code exactly. godot CSGMesh CSGMesh ======= **Inherits:** [CSGPrimitive](class_csgprimitive#class-csgprimitive) **<** [CSGShape](class_csgshape#class-csgshape) **<** [GeometryInstance](class_geometryinstance#class-geometryinstance) **<** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) A CSG Mesh shape that uses a mesh resource. Description ----------- This CSG node allows you to use any mesh resource as a CSG shape, provided it is closed, does not self-intersect, does not contain internal faces and has no edges that connect to more than two faces. See also [CSGPolygon](class_csgpolygon#class-csgpolygon) for drawing 2D extruded polygons to be used as CSG nodes. **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a [MeshInstance](class_meshinstance#class-meshinstance) with a [PrimitiveMesh](class_primitivemesh#class-primitivemesh). Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. Tutorials --------- * [Prototyping levels with CSG](https://docs.godotengine.org/en/3.5/tutorials/3d/csg_tools.html) Properties ---------- | | | | --- | --- | | [Material](class_material#class-material) | [material](#class-csgmesh-property-material) | | [Mesh](class_mesh#class-mesh) | [mesh](#class-csgmesh-property-mesh) | Property Descriptions --------------------- ### [Material](class_material#class-material) material | | | | --- | --- | | *Setter* | set\_material(value) | | *Getter* | get\_material() | The [Material](class_material#class-material) used in drawing the CSG shape. ### [Mesh](class_mesh#class-mesh) mesh | | | | --- | --- | | *Setter* | set\_mesh(value) | | *Getter* | get\_mesh() | The [Mesh](class_mesh#class-mesh) resource to use as a CSG shape. **Note:** When using an [ArrayMesh](class_arraymesh#class-arraymesh), avoid meshes with vertex normals unless a flat shader is required. By default, CSGMesh will ignore the mesh's vertex normals and use a smooth shader calculated using the faces' normals. If a flat shader is required, ensure that all faces' vertex normals are parallel. godot TileSet TileSet ======= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Tile library for tilemaps. Description ----------- A TileSet is a library of tiles for a [TileMap](class_tilemap#class-tilemap). It contains a list of tiles, each consisting of a sprite and optional collision shapes. Tiles are referenced by a unique integer ID. Tutorials --------- * [Using Tilemaps](https://docs.godotengine.org/en/3.5/tutorials/2d/using_tilemaps.html) * [2D Platformer Demo](https://godotengine.org/asset-library/asset/120) * [2D Isometric Demo](https://godotengine.org/asset-library/asset/112) * [2D Hexagonal Demo](https://godotengine.org/asset-library/asset/111) * [2D Navigation Astar Demo](https://godotengine.org/asset-library/asset/519) * [2D Role Playing Game Demo](https://godotengine.org/asset-library/asset/520) * [2D Kinematic Character Demo](https://godotengine.org/asset-library/asset/113) Methods ------- | | | | --- | --- | | [Vector2](class_vector2#class-vector2) | [\_forward\_atlas\_subtile\_selection](#class-tileset-method-forward-atlas-subtile-selection) **(** [int](class_int#class-int) atlastile\_id, [Object](class_object#class-object) tilemap, [Vector2](class_vector2#class-vector2) tile\_location **)** virtual | | [Vector2](class_vector2#class-vector2) | [\_forward\_subtile\_selection](#class-tileset-method-forward-subtile-selection) **(** [int](class_int#class-int) autotile\_id, [int](class_int#class-int) bitmask, [Object](class_object#class-object) tilemap, [Vector2](class_vector2#class-vector2) tile\_location **)** virtual | | [bool](class_bool#class-bool) | [\_is\_tile\_bound](#class-tileset-method-is-tile-bound) **(** [int](class_int#class-int) drawn\_id, [int](class_int#class-int) neighbor\_id **)** virtual | | void | [autotile\_clear\_bitmask\_map](#class-tileset-method-autotile-clear-bitmask-map) **(** [int](class_int#class-int) id **)** | | [int](class_int#class-int) | [autotile\_get\_bitmask](#class-tileset-method-autotile-get-bitmask) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord **)** | | [BitmaskMode](#enum-tileset-bitmaskmode) | [autotile\_get\_bitmask\_mode](#class-tileset-method-autotile-get-bitmask-mode) **(** [int](class_int#class-int) id **)** const | | [Vector2](class_vector2#class-vector2) | [autotile\_get\_icon\_coordinate](#class-tileset-method-autotile-get-icon-coordinate) **(** [int](class_int#class-int) id **)** const | | [OccluderPolygon2D](class_occluderpolygon2d#class-occluderpolygon2d) | [autotile\_get\_light\_occluder](#class-tileset-method-autotile-get-light-occluder) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord **)** const | | [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) | [autotile\_get\_navigation\_polygon](#class-tileset-method-autotile-get-navigation-polygon) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord **)** const | | [Vector2](class_vector2#class-vector2) | [autotile\_get\_size](#class-tileset-method-autotile-get-size) **(** [int](class_int#class-int) id **)** const | | [int](class_int#class-int) | [autotile\_get\_spacing](#class-tileset-method-autotile-get-spacing) **(** [int](class_int#class-int) id **)** const | | [int](class_int#class-int) | [autotile\_get\_subtile\_priority](#class-tileset-method-autotile-get-subtile-priority) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord **)** | | [int](class_int#class-int) | [autotile\_get\_z\_index](#class-tileset-method-autotile-get-z-index) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord **)** | | void | [autotile\_set\_bitmask](#class-tileset-method-autotile-set-bitmask) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) bitmask, [int](class_int#class-int) flag **)** | | void | [autotile\_set\_bitmask\_mode](#class-tileset-method-autotile-set-bitmask-mode) **(** [int](class_int#class-int) id, [BitmaskMode](#enum-tileset-bitmaskmode) mode **)** | | void | [autotile\_set\_icon\_coordinate](#class-tileset-method-autotile-set-icon-coordinate) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord **)** | | void | [autotile\_set\_light\_occluder](#class-tileset-method-autotile-set-light-occluder) **(** [int](class_int#class-int) id, [OccluderPolygon2D](class_occluderpolygon2d#class-occluderpolygon2d) light\_occluder, [Vector2](class_vector2#class-vector2) coord **)** | | void | [autotile\_set\_navigation\_polygon](#class-tileset-method-autotile-set-navigation-polygon) **(** [int](class_int#class-int) id, [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) navigation\_polygon, [Vector2](class_vector2#class-vector2) coord **)** | | void | [autotile\_set\_size](#class-tileset-method-autotile-set-size) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) size **)** | | void | [autotile\_set\_spacing](#class-tileset-method-autotile-set-spacing) **(** [int](class_int#class-int) id, [int](class_int#class-int) spacing **)** | | void | [autotile\_set\_subtile\_priority](#class-tileset-method-autotile-set-subtile-priority) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord, [int](class_int#class-int) priority **)** | | void | [autotile\_set\_z\_index](#class-tileset-method-autotile-set-z-index) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord, [int](class_int#class-int) z\_index **)** | | void | [clear](#class-tileset-method-clear) **(** **)** | | void | [create\_tile](#class-tileset-method-create-tile) **(** [int](class_int#class-int) id **)** | | [int](class_int#class-int) | [find\_tile\_by\_name](#class-tileset-method-find-tile-by-name) **(** [String](class_string#class-string) name **)** const | | [int](class_int#class-int) | [get\_last\_unused\_tile\_id](#class-tileset-method-get-last-unused-tile-id) **(** **)** const | | [Array](class_array#class-array) | [get\_tiles\_ids](#class-tileset-method-get-tiles-ids) **(** **)** const | | void | [remove\_tile](#class-tileset-method-remove-tile) **(** [int](class_int#class-int) id **)** | | void | [tile\_add\_shape](#class-tileset-method-tile-add-shape) **(** [int](class_int#class-int) id, [Shape2D](class_shape2d#class-shape2d) shape, [Transform2D](class_transform2d#class-transform2d) shape\_transform, [bool](class_bool#class-bool) one\_way=false, [Vector2](class_vector2#class-vector2) autotile\_coord=Vector2( 0, 0 ) **)** | | [OccluderPolygon2D](class_occluderpolygon2d#class-occluderpolygon2d) | [tile\_get\_light\_occluder](#class-tileset-method-tile-get-light-occluder) **(** [int](class_int#class-int) id **)** const | | [ShaderMaterial](class_shadermaterial#class-shadermaterial) | [tile\_get\_material](#class-tileset-method-tile-get-material) **(** [int](class_int#class-int) id **)** const | | [Color](class_color#class-color) | [tile\_get\_modulate](#class-tileset-method-tile-get-modulate) **(** [int](class_int#class-int) id **)** const | | [String](class_string#class-string) | [tile\_get\_name](#class-tileset-method-tile-get-name) **(** [int](class_int#class-int) id **)** const | | [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) | [tile\_get\_navigation\_polygon](#class-tileset-method-tile-get-navigation-polygon) **(** [int](class_int#class-int) id **)** const | | [Vector2](class_vector2#class-vector2) | [tile\_get\_navigation\_polygon\_offset](#class-tileset-method-tile-get-navigation-polygon-offset) **(** [int](class_int#class-int) id **)** const | | [Texture](class_texture#class-texture) | [tile\_get\_normal\_map](#class-tileset-method-tile-get-normal-map) **(** [int](class_int#class-int) id **)** const | | [Vector2](class_vector2#class-vector2) | [tile\_get\_occluder\_offset](#class-tileset-method-tile-get-occluder-offset) **(** [int](class_int#class-int) id **)** const | | [Rect2](class_rect2#class-rect2) | [tile\_get\_region](#class-tileset-method-tile-get-region) **(** [int](class_int#class-int) id **)** const | | [Shape2D](class_shape2d#class-shape2d) | [tile\_get\_shape](#class-tileset-method-tile-get-shape) **(** [int](class_int#class-int) id, [int](class_int#class-int) shape\_id **)** const | | [int](class_int#class-int) | [tile\_get\_shape\_count](#class-tileset-method-tile-get-shape-count) **(** [int](class_int#class-int) id **)** const | | [Vector2](class_vector2#class-vector2) | [tile\_get\_shape\_offset](#class-tileset-method-tile-get-shape-offset) **(** [int](class_int#class-int) id, [int](class_int#class-int) shape\_id **)** const | | [bool](class_bool#class-bool) | [tile\_get\_shape\_one\_way](#class-tileset-method-tile-get-shape-one-way) **(** [int](class_int#class-int) id, [int](class_int#class-int) shape\_id **)** const | | [float](class_float#class-float) | [tile\_get\_shape\_one\_way\_margin](#class-tileset-method-tile-get-shape-one-way-margin) **(** [int](class_int#class-int) id, [int](class_int#class-int) shape\_id **)** const | | [Transform2D](class_transform2d#class-transform2d) | [tile\_get\_shape\_transform](#class-tileset-method-tile-get-shape-transform) **(** [int](class_int#class-int) id, [int](class_int#class-int) shape\_id **)** const | | [Array](class_array#class-array) | [tile\_get\_shapes](#class-tileset-method-tile-get-shapes) **(** [int](class_int#class-int) id **)** const | | [Texture](class_texture#class-texture) | [tile\_get\_texture](#class-tileset-method-tile-get-texture) **(** [int](class_int#class-int) id **)** const | | [Vector2](class_vector2#class-vector2) | [tile\_get\_texture\_offset](#class-tileset-method-tile-get-texture-offset) **(** [int](class_int#class-int) id **)** const | | [TileMode](#enum-tileset-tilemode) | [tile\_get\_tile\_mode](#class-tileset-method-tile-get-tile-mode) **(** [int](class_int#class-int) id **)** const | | [int](class_int#class-int) | [tile\_get\_z\_index](#class-tileset-method-tile-get-z-index) **(** [int](class_int#class-int) id **)** const | | void | [tile\_set\_light\_occluder](#class-tileset-method-tile-set-light-occluder) **(** [int](class_int#class-int) id, [OccluderPolygon2D](class_occluderpolygon2d#class-occluderpolygon2d) light\_occluder **)** | | void | [tile\_set\_material](#class-tileset-method-tile-set-material) **(** [int](class_int#class-int) id, [ShaderMaterial](class_shadermaterial#class-shadermaterial) material **)** | | void | [tile\_set\_modulate](#class-tileset-method-tile-set-modulate) **(** [int](class_int#class-int) id, [Color](class_color#class-color) color **)** | | void | [tile\_set\_name](#class-tileset-method-tile-set-name) **(** [int](class_int#class-int) id, [String](class_string#class-string) name **)** | | void | [tile\_set\_navigation\_polygon](#class-tileset-method-tile-set-navigation-polygon) **(** [int](class_int#class-int) id, [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) navigation\_polygon **)** | | void | [tile\_set\_navigation\_polygon\_offset](#class-tileset-method-tile-set-navigation-polygon-offset) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) navigation\_polygon\_offset **)** | | void | [tile\_set\_normal\_map](#class-tileset-method-tile-set-normal-map) **(** [int](class_int#class-int) id, [Texture](class_texture#class-texture) normal\_map **)** | | void | [tile\_set\_occluder\_offset](#class-tileset-method-tile-set-occluder-offset) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) occluder\_offset **)** | | void | [tile\_set\_region](#class-tileset-method-tile-set-region) **(** [int](class_int#class-int) id, [Rect2](class_rect2#class-rect2) region **)** | | void | [tile\_set\_shape](#class-tileset-method-tile-set-shape) **(** [int](class_int#class-int) id, [int](class_int#class-int) shape\_id, [Shape2D](class_shape2d#class-shape2d) shape **)** | | void | [tile\_set\_shape\_offset](#class-tileset-method-tile-set-shape-offset) **(** [int](class_int#class-int) id, [int](class_int#class-int) shape\_id, [Vector2](class_vector2#class-vector2) shape\_offset **)** | | void | [tile\_set\_shape\_one\_way](#class-tileset-method-tile-set-shape-one-way) **(** [int](class_int#class-int) id, [int](class_int#class-int) shape\_id, [bool](class_bool#class-bool) one\_way **)** | | void | [tile\_set\_shape\_one\_way\_margin](#class-tileset-method-tile-set-shape-one-way-margin) **(** [int](class_int#class-int) id, [int](class_int#class-int) shape\_id, [float](class_float#class-float) one\_way **)** | | void | [tile\_set\_shape\_transform](#class-tileset-method-tile-set-shape-transform) **(** [int](class_int#class-int) id, [int](class_int#class-int) shape\_id, [Transform2D](class_transform2d#class-transform2d) shape\_transform **)** | | void | [tile\_set\_shapes](#class-tileset-method-tile-set-shapes) **(** [int](class_int#class-int) id, [Array](class_array#class-array) shapes **)** | | void | [tile\_set\_texture](#class-tileset-method-tile-set-texture) **(** [int](class_int#class-int) id, [Texture](class_texture#class-texture) texture **)** | | void | [tile\_set\_texture\_offset](#class-tileset-method-tile-set-texture-offset) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) texture\_offset **)** | | void | [tile\_set\_tile\_mode](#class-tileset-method-tile-set-tile-mode) **(** [int](class_int#class-int) id, [TileMode](#enum-tileset-tilemode) tilemode **)** | | void | [tile\_set\_z\_index](#class-tileset-method-tile-set-z-index) **(** [int](class_int#class-int) id, [int](class_int#class-int) z\_index **)** | Enumerations ------------ enum **BitmaskMode**: * **BITMASK\_2X2** = **0** * **BITMASK\_3X3\_MINIMAL** = **1** * **BITMASK\_3X3** = **2** enum **AutotileBindings**: * **BIND\_TOPLEFT** = **1** * **BIND\_TOP** = **2** * **BIND\_TOPRIGHT** = **4** * **BIND\_LEFT** = **8** * **BIND\_CENTER** = **16** * **BIND\_RIGHT** = **32** * **BIND\_BOTTOMLEFT** = **64** * **BIND\_BOTTOM** = **128** * **BIND\_BOTTOMRIGHT** = **256** enum **TileMode**: * **SINGLE\_TILE** = **0** * **AUTO\_TILE** = **1** * **ATLAS\_TILE** = **2** Method Descriptions ------------------- ### [Vector2](class_vector2#class-vector2) \_forward\_atlas\_subtile\_selection ( [int](class_int#class-int) atlastile\_id, [Object](class_object#class-object) tilemap, [Vector2](class_vector2#class-vector2) tile\_location ) virtual ### [Vector2](class_vector2#class-vector2) \_forward\_subtile\_selection ( [int](class_int#class-int) autotile\_id, [int](class_int#class-int) bitmask, [Object](class_object#class-object) tilemap, [Vector2](class_vector2#class-vector2) tile\_location ) virtual ### [bool](class_bool#class-bool) \_is\_tile\_bound ( [int](class_int#class-int) drawn\_id, [int](class_int#class-int) neighbor\_id ) virtual Determines when the auto-tiler should consider two different auto-tile IDs to be bound together. **Note:** `neighbor_id` will be `-1` ([TileMap.INVALID\_CELL](class_tilemap#class-tilemap-constant-invalid-cell)) when checking a tile against an empty neighbor tile. ### void autotile\_clear\_bitmask\_map ( [int](class_int#class-int) id ) Clears all bitmask information of the autotile. ### [int](class_int#class-int) autotile\_get\_bitmask ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord ) Returns the bitmask of the subtile from an autotile given its coordinates. The value is the sum of the values in [AutotileBindings](#enum-tileset-autotilebindings) present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right). ### [BitmaskMode](#enum-tileset-bitmaskmode) autotile\_get\_bitmask\_mode ( [int](class_int#class-int) id ) const Returns the [BitmaskMode](#enum-tileset-bitmaskmode) of the autotile. ### [Vector2](class_vector2#class-vector2) autotile\_get\_icon\_coordinate ( [int](class_int#class-int) id ) const Returns the subtile that's being used as an icon in an atlas/autotile given its coordinates. The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor. ### [OccluderPolygon2D](class_occluderpolygon2d#class-occluderpolygon2d) autotile\_get\_light\_occluder ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord ) const Returns the light occluder of the subtile from an atlas/autotile given its coordinates. ### [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) autotile\_get\_navigation\_polygon ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord ) const Returns the navigation polygon of the subtile from an atlas/autotile given its coordinates. ### [Vector2](class_vector2#class-vector2) autotile\_get\_size ( [int](class_int#class-int) id ) const Returns the size of the subtiles in an atlas/autotile. ### [int](class_int#class-int) autotile\_get\_spacing ( [int](class_int#class-int) id ) const Returns the spacing between subtiles of the atlas/autotile. ### [int](class_int#class-int) autotile\_get\_subtile\_priority ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord ) Returns the priority of the subtile from an autotile given its coordinates. When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked. ### [int](class_int#class-int) autotile\_get\_z\_index ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord ) Returns the drawing index of the subtile from an atlas/autotile given its coordinates. ### void autotile\_set\_bitmask ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) bitmask, [int](class_int#class-int) flag ) Sets the bitmask of the subtile from an autotile given its coordinates. The value is the sum of the values in [AutotileBindings](#enum-tileset-autotilebindings) present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right). ### void autotile\_set\_bitmask\_mode ( [int](class_int#class-int) id, [BitmaskMode](#enum-tileset-bitmaskmode) mode ) Sets the [BitmaskMode](#enum-tileset-bitmaskmode) of the autotile. ### void autotile\_set\_icon\_coordinate ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord ) Sets the subtile that will be used as an icon in an atlas/autotile given its coordinates. The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor. ### void autotile\_set\_light\_occluder ( [int](class_int#class-int) id, [OccluderPolygon2D](class_occluderpolygon2d#class-occluderpolygon2d) light\_occluder, [Vector2](class_vector2#class-vector2) coord ) Sets the light occluder of the subtile from an atlas/autotile given its coordinates. ### void autotile\_set\_navigation\_polygon ( [int](class_int#class-int) id, [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) navigation\_polygon, [Vector2](class_vector2#class-vector2) coord ) Sets the navigation polygon of the subtile from an atlas/autotile given its coordinates. ### void autotile\_set\_size ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) size ) Sets the size of the subtiles in an atlas/autotile. ### void autotile\_set\_spacing ( [int](class_int#class-int) id, [int](class_int#class-int) spacing ) Sets the spacing between subtiles of the atlas/autotile. ### void autotile\_set\_subtile\_priority ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord, [int](class_int#class-int) priority ) Sets the priority of the subtile from an autotile given its coordinates. When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked. ### void autotile\_set\_z\_index ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) coord, [int](class_int#class-int) z\_index ) Sets the drawing index of the subtile from an atlas/autotile given its coordinates. ### void clear ( ) Clears all tiles. ### void create\_tile ( [int](class_int#class-int) id ) Creates a new tile with the given ID. ### [int](class_int#class-int) find\_tile\_by\_name ( [String](class_string#class-string) name ) const Returns the first tile matching the given name. ### [int](class_int#class-int) get\_last\_unused\_tile\_id ( ) const Returns the ID following the last currently used ID, useful when creating a new tile. ### [Array](class_array#class-array) get\_tiles\_ids ( ) const Returns an array of all currently used tile IDs. ### void remove\_tile ( [int](class_int#class-int) id ) Removes the given tile ID. ### void tile\_add\_shape ( [int](class_int#class-int) id, [Shape2D](class_shape2d#class-shape2d) shape, [Transform2D](class_transform2d#class-transform2d) shape\_transform, [bool](class_bool#class-bool) one\_way=false, [Vector2](class_vector2#class-vector2) autotile\_coord=Vector2( 0, 0 ) ) Adds a shape to the tile. ### [OccluderPolygon2D](class_occluderpolygon2d#class-occluderpolygon2d) tile\_get\_light\_occluder ( [int](class_int#class-int) id ) const Returns the tile's light occluder. ### [ShaderMaterial](class_shadermaterial#class-shadermaterial) tile\_get\_material ( [int](class_int#class-int) id ) const Returns the tile's material. ### [Color](class_color#class-color) tile\_get\_modulate ( [int](class_int#class-int) id ) const Returns the tile's modulation color. ### [String](class_string#class-string) tile\_get\_name ( [int](class_int#class-int) id ) const Returns the tile's name. ### [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) tile\_get\_navigation\_polygon ( [int](class_int#class-int) id ) const Returns the navigation polygon of the tile. ### [Vector2](class_vector2#class-vector2) tile\_get\_navigation\_polygon\_offset ( [int](class_int#class-int) id ) const Returns the offset of the tile's navigation polygon. ### [Texture](class_texture#class-texture) tile\_get\_normal\_map ( [int](class_int#class-int) id ) const Returns the tile's normal map texture. ### [Vector2](class_vector2#class-vector2) tile\_get\_occluder\_offset ( [int](class_int#class-int) id ) const Returns the offset of the tile's light occluder. ### [Rect2](class_rect2#class-rect2) tile\_get\_region ( [int](class_int#class-int) id ) const Returns the tile sub-region in the texture. ### [Shape2D](class_shape2d#class-shape2d) tile\_get\_shape ( [int](class_int#class-int) id, [int](class_int#class-int) shape\_id ) const Returns a tile's given shape. ### [int](class_int#class-int) tile\_get\_shape\_count ( [int](class_int#class-int) id ) const Returns the number of shapes assigned to a tile. ### [Vector2](class_vector2#class-vector2) tile\_get\_shape\_offset ( [int](class_int#class-int) id, [int](class_int#class-int) shape\_id ) const Returns the offset of a tile's shape. ### [bool](class_bool#class-bool) tile\_get\_shape\_one\_way ( [int](class_int#class-int) id, [int](class_int#class-int) shape\_id ) const Returns the one-way collision value of a tile's shape. ### [float](class_float#class-float) tile\_get\_shape\_one\_way\_margin ( [int](class_int#class-int) id, [int](class_int#class-int) shape\_id ) const ### [Transform2D](class_transform2d#class-transform2d) tile\_get\_shape\_transform ( [int](class_int#class-int) id, [int](class_int#class-int) shape\_id ) const Returns the [Transform2D](class_transform2d#class-transform2d) of a tile's shape. ### [Array](class_array#class-array) tile\_get\_shapes ( [int](class_int#class-int) id ) const Returns an array of dictionaries describing the tile's shapes. **Dictionary structure in the array returned by this method:** ``` { "autotile_coord": Vector2, "one_way": bool, "one_way_margin": int, "shape": CollisionShape2D, "shape_transform": Transform2D, } ``` ### [Texture](class_texture#class-texture) tile\_get\_texture ( [int](class_int#class-int) id ) const Returns the tile's texture. ### [Vector2](class_vector2#class-vector2) tile\_get\_texture\_offset ( [int](class_int#class-int) id ) const Returns the texture offset of the tile. ### [TileMode](#enum-tileset-tilemode) tile\_get\_tile\_mode ( [int](class_int#class-int) id ) const Returns the tile's [TileMode](#enum-tileset-tilemode). ### [int](class_int#class-int) tile\_get\_z\_index ( [int](class_int#class-int) id ) const Returns the tile's Z index (drawing layer). ### void tile\_set\_light\_occluder ( [int](class_int#class-int) id, [OccluderPolygon2D](class_occluderpolygon2d#class-occluderpolygon2d) light\_occluder ) Sets a light occluder for the tile. ### void tile\_set\_material ( [int](class_int#class-int) id, [ShaderMaterial](class_shadermaterial#class-shadermaterial) material ) Sets the tile's material. ### void tile\_set\_modulate ( [int](class_int#class-int) id, [Color](class_color#class-color) color ) Sets the tile's modulation color. **Note:** Modulation is performed by setting the tile's vertex color. To access this in a shader, use `COLOR` rather than `MODULATE` (which instead accesses the [TileMap](class_tilemap#class-tilemap)'s [CanvasItem.modulate](class_canvasitem#class-canvasitem-property-modulate) property). ### void tile\_set\_name ( [int](class_int#class-int) id, [String](class_string#class-string) name ) Sets the tile's name. ### void tile\_set\_navigation\_polygon ( [int](class_int#class-int) id, [NavigationPolygon](class_navigationpolygon#class-navigationpolygon) navigation\_polygon ) Sets the tile's navigation polygon. ### void tile\_set\_navigation\_polygon\_offset ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) navigation\_polygon\_offset ) Sets an offset for the tile's navigation polygon. ### void tile\_set\_normal\_map ( [int](class_int#class-int) id, [Texture](class_texture#class-texture) normal\_map ) Sets the tile's normal map texture. **Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [this page](http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates) for a comparison of normal map coordinates expected by popular engines. ### void tile\_set\_occluder\_offset ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) occluder\_offset ) Sets an offset for the tile's light occluder. ### void tile\_set\_region ( [int](class_int#class-int) id, [Rect2](class_rect2#class-rect2) region ) Sets the tile's sub-region in the texture. This is common in texture atlases. ### void tile\_set\_shape ( [int](class_int#class-int) id, [int](class_int#class-int) shape\_id, [Shape2D](class_shape2d#class-shape2d) shape ) Sets a shape for the tile, enabling collision. ### void tile\_set\_shape\_offset ( [int](class_int#class-int) id, [int](class_int#class-int) shape\_id, [Vector2](class_vector2#class-vector2) shape\_offset ) Sets the offset of a tile's shape. ### void tile\_set\_shape\_one\_way ( [int](class_int#class-int) id, [int](class_int#class-int) shape\_id, [bool](class_bool#class-bool) one\_way ) Enables one-way collision on a tile's shape. ### void tile\_set\_shape\_one\_way\_margin ( [int](class_int#class-int) id, [int](class_int#class-int) shape\_id, [float](class_float#class-float) one\_way ) ### void tile\_set\_shape\_transform ( [int](class_int#class-int) id, [int](class_int#class-int) shape\_id, [Transform2D](class_transform2d#class-transform2d) shape\_transform ) Sets a [Transform2D](class_transform2d#class-transform2d) on a tile's shape. ### void tile\_set\_shapes ( [int](class_int#class-int) id, [Array](class_array#class-array) shapes ) Sets an array of shapes for the tile, enabling collision. ### void tile\_set\_texture ( [int](class_int#class-int) id, [Texture](class_texture#class-texture) texture ) Sets the tile's texture. ### void tile\_set\_texture\_offset ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) texture\_offset ) Sets the tile's texture offset. ### void tile\_set\_tile\_mode ( [int](class_int#class-int) id, [TileMode](#enum-tileset-tilemode) tilemode ) Sets the tile's [TileMode](#enum-tileset-tilemode). ### void tile\_set\_z\_index ( [int](class_int#class-int) id, [int](class_int#class-int) z\_index ) Sets the tile's drawing index.
programming_docs
godot TouchScreenButton TouchScreenButton ================= **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Button for touch screen devices for gameplay use. Description ----------- TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move. Unlike [Button](class_button#class-button), TouchScreenButton supports multitouch out of the box. Several TouchScreenButtons can be pressed at the same time with touch input. This node inherits from [Node2D](class_node2d#class-node2d). Unlike with [Control](class_control#class-control) nodes, you cannot set anchors on it. If you want to create menus or user interfaces, you may want to use [Button](class_button#class-button) nodes instead. To make button nodes react to touch events, you can enable the Emulate Mouse option in the Project Settings. You can configure TouchScreenButton to be visible only on touch devices, helping you develop your game both for desktop and mobile devices. Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [action](#class-touchscreenbutton-property-action) | `""` | | [BitMap](class_bitmap#class-bitmap) | [bitmask](#class-touchscreenbutton-property-bitmask) | | | [Texture](class_texture#class-texture) | [normal](#class-touchscreenbutton-property-normal) | | | [bool](class_bool#class-bool) | [passby\_press](#class-touchscreenbutton-property-passby-press) | `false` | | [Texture](class_texture#class-texture) | [pressed](#class-touchscreenbutton-property-pressed) | | | [Shape2D](class_shape2d#class-shape2d) | [shape](#class-touchscreenbutton-property-shape) | | | [bool](class_bool#class-bool) | [shape\_centered](#class-touchscreenbutton-property-shape-centered) | `true` | | [bool](class_bool#class-bool) | [shape\_visible](#class-touchscreenbutton-property-shape-visible) | `true` | | [VisibilityMode](#enum-touchscreenbutton-visibilitymode) | [visibility\_mode](#class-touchscreenbutton-property-visibility-mode) | `0` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [is\_pressed](#class-touchscreenbutton-method-is-pressed) **(** **)** const | Signals ------- ### pressed ( ) Emitted when the button is pressed (down). ### released ( ) Emitted when the button is released (up). Enumerations ------------ enum **VisibilityMode**: * **VISIBILITY\_ALWAYS** = **0** --- Always visible. * **VISIBILITY\_TOUCHSCREEN\_ONLY** = **1** --- Visible on touch screens only. Property Descriptions --------------------- ### [String](class_string#class-string) action | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_action(value) | | *Getter* | get\_action() | The button's action. Actions can be handled with [InputEventAction](class_inputeventaction#class-inputeventaction). ### [BitMap](class_bitmap#class-bitmap) bitmask | | | | --- | --- | | *Setter* | set\_bitmask(value) | | *Getter* | get\_bitmask() | The button's bitmask. ### [Texture](class_texture#class-texture) normal | | | | --- | --- | | *Setter* | set\_texture(value) | | *Getter* | get\_texture() | The button's texture for the normal state. ### [bool](class_bool#class-bool) passby\_press | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_passby\_press(value) | | *Getter* | is\_passby\_press\_enabled() | If `true`, the [pressed](#class-touchscreenbutton-signal-pressed) and [released](#class-touchscreenbutton-signal-released) signals are emitted whenever a pressed finger goes in and out of the button, even if the pressure started outside the active area of the button. **Note:** This is a "pass-by" (not "bypass") press mode. ### [Texture](class_texture#class-texture) pressed | | | | --- | --- | | *Setter* | set\_texture\_pressed(value) | | *Getter* | get\_texture\_pressed() | The button's texture for the pressed state. ### [Shape2D](class_shape2d#class-shape2d) shape | | | | --- | --- | | *Setter* | set\_shape(value) | | *Getter* | get\_shape() | The button's shape. ### [bool](class_bool#class-bool) shape\_centered | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_shape\_centered(value) | | *Getter* | is\_shape\_centered() | If `true`, the button's shape is centered in the provided texture. If no texture is used, this property has no effect. ### [bool](class_bool#class-bool) shape\_visible | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_shape\_visible(value) | | *Getter* | is\_shape\_visible() | If `true`, the button's shape is visible. ### [VisibilityMode](#enum-touchscreenbutton-visibilitymode) visibility\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_visibility\_mode(value) | | *Getter* | get\_visibility\_mode() | The button's visibility mode. See [VisibilityMode](#enum-touchscreenbutton-visibilitymode) for possible values. Method Descriptions ------------------- ### [bool](class_bool#class-bool) is\_pressed ( ) const Returns `true` if this button is currently pressed. godot InputEvent InputEvent ========== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [InputEventAction](class_inputeventaction#class-inputeventaction), [InputEventJoypadButton](class_inputeventjoypadbutton#class-inputeventjoypadbutton), [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion), [InputEventMIDI](class_inputeventmidi#class-inputeventmidi), [InputEventScreenDrag](class_inputeventscreendrag#class-inputeventscreendrag), [InputEventScreenTouch](class_inputeventscreentouch#class-inputeventscreentouch), [InputEventWithModifiers](class_inputeventwithmodifiers#class-inputeventwithmodifiers) Generic input event. Description ----------- Base class of all sort of input event. See [Node.\_input](class_node#class-node-method-input). Tutorials --------- * [InputEvent](https://docs.godotengine.org/en/3.5/tutorials/inputs/inputevent.html) * [Viewport and canvas transforms](https://docs.godotengine.org/en/3.5/tutorials/2d/2d_transforms.html) * [2D Dodge The Creeps Demo](https://godotengine.org/asset-library/asset/515) * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [device](#class-inputevent-property-device) | `0` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [accumulate](#class-inputevent-method-accumulate) **(** [InputEvent](#class-inputevent) with\_event **)** | | [String](class_string#class-string) | [as\_text](#class-inputevent-method-as-text) **(** **)** const | | [float](class_float#class-float) | [get\_action\_strength](#class-inputevent-method-get-action-strength) **(** [String](class_string#class-string) action, [bool](class_bool#class-bool) exact\_match=false **)** const | | [bool](class_bool#class-bool) | [is\_action](#class-inputevent-method-is-action) **(** [String](class_string#class-string) action, [bool](class_bool#class-bool) exact\_match=false **)** const | | [bool](class_bool#class-bool) | [is\_action\_pressed](#class-inputevent-method-is-action-pressed) **(** [String](class_string#class-string) action, [bool](class_bool#class-bool) allow\_echo=false, [bool](class_bool#class-bool) exact\_match=false **)** const | | [bool](class_bool#class-bool) | [is\_action\_released](#class-inputevent-method-is-action-released) **(** [String](class_string#class-string) action, [bool](class_bool#class-bool) exact\_match=false **)** const | | [bool](class_bool#class-bool) | [is\_action\_type](#class-inputevent-method-is-action-type) **(** **)** const | | [bool](class_bool#class-bool) | [is\_echo](#class-inputevent-method-is-echo) **(** **)** const | | [bool](class_bool#class-bool) | [is\_pressed](#class-inputevent-method-is-pressed) **(** **)** const | | [bool](class_bool#class-bool) | [shortcut\_match](#class-inputevent-method-shortcut-match) **(** [InputEvent](#class-inputevent) event, [bool](class_bool#class-bool) exact\_match=true **)** const | | [InputEvent](#class-inputevent) | [xformed\_by](#class-inputevent-method-xformed-by) **(** [Transform2D](class_transform2d#class-transform2d) xform, [Vector2](class_vector2#class-vector2) local\_ofs=Vector2( 0, 0 ) **)** const | Property Descriptions --------------------- ### [int](class_int#class-int) device | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_device(value) | | *Getter* | get\_device() | The event's device ID. **Note:** This device ID will always be `-1` for emulated mouse input from a touchscreen. This can be used to distinguish emulated mouse input from physical mouse input. Method Descriptions ------------------- ### [bool](class_bool#class-bool) accumulate ( [InputEvent](#class-inputevent) with\_event ) Returns `true` if the given input event and this input event can be added together (only for events of type [InputEventMouseMotion](class_inputeventmousemotion#class-inputeventmousemotion)). The given input event's position, global position and speed will be copied. The resulting `relative` is a sum of both events. Both events' modifiers have to be identical. ### [String](class_string#class-string) as\_text ( ) const Returns a [String](class_string#class-string) representation of the event. ### [float](class_float#class-float) get\_action\_strength ( [String](class_string#class-string) action, [bool](class_bool#class-bool) exact\_match=false ) const Returns a value between 0.0 and 1.0 depending on the given actions' state. Useful for getting the value of events of type [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion). If `exact_match` is `false`, it ignores additional input modifiers for [InputEventKey](class_inputeventkey#class-inputeventkey) and [InputEventMouseButton](class_inputeventmousebutton#class-inputeventmousebutton) events, and the direction for [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion) events. ### [bool](class_bool#class-bool) is\_action ( [String](class_string#class-string) action, [bool](class_bool#class-bool) exact\_match=false ) const Returns `true` if this input event matches a pre-defined action of any type. If `exact_match` is `false`, it ignores additional input modifiers for [InputEventKey](class_inputeventkey#class-inputeventkey) and [InputEventMouseButton](class_inputeventmousebutton#class-inputeventmousebutton) events, and the direction for [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion) events. ### [bool](class_bool#class-bool) is\_action\_pressed ( [String](class_string#class-string) action, [bool](class_bool#class-bool) allow\_echo=false, [bool](class_bool#class-bool) exact\_match=false ) const Returns `true` if the given action is being pressed (and is not an echo event for [InputEventKey](class_inputeventkey#class-inputeventkey) events, unless `allow_echo` is `true`). Not relevant for events of type [InputEventMouseMotion](class_inputeventmousemotion#class-inputeventmousemotion) or [InputEventScreenDrag](class_inputeventscreendrag#class-inputeventscreendrag). If `exact_match` is `false`, it ignores additional input modifiers for [InputEventKey](class_inputeventkey#class-inputeventkey) and [InputEventMouseButton](class_inputeventmousebutton#class-inputeventmousebutton) events, and the direction for [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion) events. **Note:** Due to keyboard ghosting, [is\_action\_pressed](#class-inputevent-method-is-action-pressed) may return `false` even if one of the action's keys is pressed. See [Input examples](https://docs.godotengine.org/en/3.5/tutorials/inputs/input_examples.html#keyboard-events) in the documentation for more information. ### [bool](class_bool#class-bool) is\_action\_released ( [String](class_string#class-string) action, [bool](class_bool#class-bool) exact\_match=false ) const Returns `true` if the given action is released (i.e. not pressed). Not relevant for events of type [InputEventMouseMotion](class_inputeventmousemotion#class-inputeventmousemotion) or [InputEventScreenDrag](class_inputeventscreendrag#class-inputeventscreendrag). If `exact_match` is `false`, it ignores additional input modifiers for [InputEventKey](class_inputeventkey#class-inputeventkey) and [InputEventMouseButton](class_inputeventmousebutton#class-inputeventmousebutton) events, and the direction for [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion) events. ### [bool](class_bool#class-bool) is\_action\_type ( ) const Returns `true` if this input event's type is one that can be assigned to an input action. ### [bool](class_bool#class-bool) is\_echo ( ) const Returns `true` if this input event is an echo event (only for events of type [InputEventKey](class_inputeventkey#class-inputeventkey)). ### [bool](class_bool#class-bool) is\_pressed ( ) const Returns `true` if this input event is pressed. Not relevant for events of type [InputEventMouseMotion](class_inputeventmousemotion#class-inputeventmousemotion) or [InputEventScreenDrag](class_inputeventscreendrag#class-inputeventscreendrag). **Note:** Due to keyboard ghosting, [is\_action\_pressed](#class-inputevent-method-is-action-pressed) may return `false` even if one of the action's keys is pressed. See [Input examples](https://docs.godotengine.org/en/3.5/tutorials/inputs/input_examples.html#keyboard-events) in the documentation for more information. ### [bool](class_bool#class-bool) shortcut\_match ( [InputEvent](#class-inputevent) event, [bool](class_bool#class-bool) exact\_match=true ) const Returns `true` if the specified `event` matches this event. Only valid for action events i.e key ([InputEventKey](class_inputeventkey#class-inputeventkey)), button ([InputEventMouseButton](class_inputeventmousebutton#class-inputeventmousebutton) or [InputEventJoypadButton](class_inputeventjoypadbutton#class-inputeventjoypadbutton)), axis [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion) or action ([InputEventAction](class_inputeventaction#class-inputeventaction)) events. If `exact_match` is `false`, it ignores additional input modifiers for [InputEventKey](class_inputeventkey#class-inputeventkey) and [InputEventMouseButton](class_inputeventmousebutton#class-inputeventmousebutton) events, and the direction for [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion) events. ### [InputEvent](#class-inputevent) xformed\_by ( [Transform2D](class_transform2d#class-transform2d) xform, [Vector2](class_vector2#class-vector2) local\_ofs=Vector2( 0, 0 ) ) const Returns a copy of the given input event which has been offset by `local_ofs` and transformed by `xform`. Relevant for events of type [InputEventMouseButton](class_inputeventmousebutton#class-inputeventmousebutton), [InputEventMouseMotion](class_inputeventmousemotion#class-inputeventmousemotion), [InputEventScreenTouch](class_inputeventscreentouch#class-inputeventscreentouch), [InputEventScreenDrag](class_inputeventscreendrag#class-inputeventscreendrag), [InputEventMagnifyGesture](class_inputeventmagnifygesture#class-inputeventmagnifygesture) and [InputEventPanGesture](class_inputeventpangesture#class-inputeventpangesture). godot MethodTweener MethodTweener ============= **Inherits:** [Tweener](class_tweener#class-tweener) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Interpolates an abstract value and supplies it to a method called over time. Description ----------- `MethodTweener` is similar to a combination of [CallbackTweener](class_callbacktweener#class-callbacktweener) and [PropertyTweener](class_propertytweener#class-propertytweener). It calls a method providing an interpolated value as a parameter. See [SceneTreeTween.tween\_method](class_scenetreetween#class-scenetreetween-method-tween-method) for more usage information. **Note:** [SceneTreeTween.tween\_method](class_scenetreetween#class-scenetreetween-method-tween-method) is the only correct way to create `MethodTweener`. Any `MethodTweener` created manually will not function correctly. Methods ------- | | | | --- | --- | | [MethodTweener](#class-methodtweener) | [set\_delay](#class-methodtweener-method-set-delay) **(** [float](class_float#class-float) delay **)** | | [MethodTweener](#class-methodtweener) | [set\_ease](#class-methodtweener-method-set-ease) **(** [EaseType](class_tween#enum-tween-easetype) ease **)** | | [MethodTweener](#class-methodtweener) | [set\_trans](#class-methodtweener-method-set-trans) **(** [TransitionType](class_tween#enum-tween-transitiontype) trans **)** | Method Descriptions ------------------- ### [MethodTweener](#class-methodtweener) set\_delay ( [float](class_float#class-float) delay ) Sets the time in seconds after which the `MethodTweener` will start interpolating. By default there's no delay. ### [MethodTweener](#class-methodtweener) set\_ease ( [EaseType](class_tween#enum-tween-easetype) ease ) Sets the type of used easing from [EaseType](class_tween#enum-tween-easetype). If not set, the default easing is used from the [SceneTreeTween](class_scenetreetween#class-scenetreetween) that contains this Tweener. ### [MethodTweener](#class-methodtweener) set\_trans ( [TransitionType](class_tween#enum-tween-transitiontype) trans ) Sets the type of used transition from [TransitionType](class_tween#enum-tween-transitiontype). If not set, the default transition is used from the [SceneTreeTween](class_scenetreetween#class-scenetreetween) that contains this Tweener. godot VisualShaderNodeFresnel VisualShaderNodeFresnel ======================= **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A Fresnel effect to be used within the visual shader graph. Description ----------- Returns falloff based on the dot product of surface normal and view direction of camera (pass associated inputs to it). godot String String ====== Built-in string class. Description ----------- This is the built-in string class (and the one used by GDScript). It supports Unicode and provides all necessary means for string handling. Strings are reference-counted and use a copy-on-write approach, so passing them around is cheap in resources. Tutorials --------- * [GDScript format strings](https://docs.godotengine.org/en/3.5/tutorials/scripting/gdscript/gdscript_format_string.html) Methods ------- | | | | --- | --- | | [String](#class-string) | [String](#class-string-method-string) **(** [bool](class_bool#class-bool) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [int](class_int#class-int) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [float](class_float#class-float) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [Vector2](class_vector2#class-vector2) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [Rect2](class_rect2#class-rect2) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [Vector3](class_vector3#class-vector3) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [Transform2D](class_transform2d#class-transform2d) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [Plane](class_plane#class-plane) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [Quat](class_quat#class-quat) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [AABB](class_aabb#class-aabb) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [Basis](class_basis#class-basis) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [Transform](class_transform#class-transform) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [Color](class_color#class-color) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [NodePath](class_nodepath#class-nodepath) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [RID](class_rid#class-rid) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [Dictionary](class_dictionary#class-dictionary) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [Array](class_array#class-array) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [PoolByteArray](class_poolbytearray#class-poolbytearray) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [PoolIntArray](class_poolintarray#class-poolintarray) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [PoolRealArray](class_poolrealarray#class-poolrealarray) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [PoolStringArray](class_poolstringarray#class-poolstringarray) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [PoolVector3Array](class_poolvector3array#class-poolvector3array) from **)** | | [String](#class-string) | [String](#class-string-method-string) **(** [PoolColorArray](class_poolcolorarray#class-poolcolorarray) from **)** | | [bool](class_bool#class-bool) | [begins\_with](#class-string-method-begins-with) **(** [String](#class-string) text **)** | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [bigrams](#class-string-method-bigrams) **(** **)** | | [String](#class-string) | [c\_escape](#class-string-method-c-escape) **(** **)** | | [String](#class-string) | [c\_unescape](#class-string-method-c-unescape) **(** **)** | | [String](#class-string) | [capitalize](#class-string-method-capitalize) **(** **)** | | [int](class_int#class-int) | [casecmp\_to](#class-string-method-casecmp-to) **(** [String](#class-string) to **)** | | [int](class_int#class-int) | [count](#class-string-method-count) **(** [String](#class-string) what, [int](class_int#class-int) from=0, [int](class_int#class-int) to=0 **)** | | [int](class_int#class-int) | [countn](#class-string-method-countn) **(** [String](#class-string) what, [int](class_int#class-int) from=0, [int](class_int#class-int) to=0 **)** | | [String](#class-string) | [dedent](#class-string-method-dedent) **(** **)** | | [bool](class_bool#class-bool) | [empty](#class-string-method-empty) **(** **)** | | [bool](class_bool#class-bool) | [ends\_with](#class-string-method-ends-with) **(** [String](#class-string) text **)** | | void | [erase](#class-string-method-erase) **(** [int](class_int#class-int) position, [int](class_int#class-int) chars **)** | | [int](class_int#class-int) | [find](#class-string-method-find) **(** [String](#class-string) what, [int](class_int#class-int) from=0 **)** | | [int](class_int#class-int) | [find\_last](#class-string-method-find-last) **(** [String](#class-string) what **)** | | [int](class_int#class-int) | [findn](#class-string-method-findn) **(** [String](#class-string) what, [int](class_int#class-int) from=0 **)** | | [String](#class-string) | [format](#class-string-method-format) **(** [Variant](class_variant#class-variant) values, [String](#class-string) placeholder="{\_}" **)** | | [String](#class-string) | [get\_base\_dir](#class-string-method-get-base-dir) **(** **)** | | [String](#class-string) | [get\_basename](#class-string-method-get-basename) **(** **)** | | [String](#class-string) | [get\_extension](#class-string-method-get-extension) **(** **)** | | [String](#class-string) | [get\_file](#class-string-method-get-file) **(** **)** | | [String](#class-string) | [get\_slice](#class-string-method-get-slice) **(** [String](#class-string) delimiter, [int](class_int#class-int) slice **)** | | [int](class_int#class-int) | [hash](#class-string-method-hash) **(** **)** | | [int](class_int#class-int) | [hex\_to\_int](#class-string-method-hex-to-int) **(** **)** | | [String](#class-string) | [http\_escape](#class-string-method-http-escape) **(** **)** | | [String](#class-string) | [http\_unescape](#class-string-method-http-unescape) **(** **)** | | [String](#class-string) | [humanize\_size](#class-string-method-humanize-size) **(** [int](class_int#class-int) size **)** | | [String](#class-string) | [indent](#class-string-method-indent) **(** [String](#class-string) prefix **)** | | [String](#class-string) | [insert](#class-string-method-insert) **(** [int](class_int#class-int) position, [String](#class-string) what **)** | | [bool](class_bool#class-bool) | [is\_abs\_path](#class-string-method-is-abs-path) **(** **)** | | [bool](class_bool#class-bool) | [is\_rel\_path](#class-string-method-is-rel-path) **(** **)** | | [bool](class_bool#class-bool) | [is\_subsequence\_of](#class-string-method-is-subsequence-of) **(** [String](#class-string) text **)** | | [bool](class_bool#class-bool) | [is\_subsequence\_ofi](#class-string-method-is-subsequence-ofi) **(** [String](#class-string) text **)** | | [bool](class_bool#class-bool) | [is\_valid\_filename](#class-string-method-is-valid-filename) **(** **)** | | [bool](class_bool#class-bool) | [is\_valid\_float](#class-string-method-is-valid-float) **(** **)** | | [bool](class_bool#class-bool) | [is\_valid\_hex\_number](#class-string-method-is-valid-hex-number) **(** [bool](class_bool#class-bool) with\_prefix=false **)** | | [bool](class_bool#class-bool) | [is\_valid\_html\_color](#class-string-method-is-valid-html-color) **(** **)** | | [bool](class_bool#class-bool) | [is\_valid\_identifier](#class-string-method-is-valid-identifier) **(** **)** | | [bool](class_bool#class-bool) | [is\_valid\_integer](#class-string-method-is-valid-integer) **(** **)** | | [bool](class_bool#class-bool) | [is\_valid\_ip\_address](#class-string-method-is-valid-ip-address) **(** **)** | | [String](#class-string) | [join](#class-string-method-join) **(** [PoolStringArray](class_poolstringarray#class-poolstringarray) parts **)** | | [String](#class-string) | [json\_escape](#class-string-method-json-escape) **(** **)** | | [String](#class-string) | [left](#class-string-method-left) **(** [int](class_int#class-int) position **)** | | [int](class_int#class-int) | [length](#class-string-method-length) **(** **)** | | [String](#class-string) | [lstrip](#class-string-method-lstrip) **(** [String](#class-string) chars **)** | | [bool](class_bool#class-bool) | [match](#class-string-method-match) **(** [String](#class-string) expr **)** | | [bool](class_bool#class-bool) | [matchn](#class-string-method-matchn) **(** [String](#class-string) expr **)** | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [md5\_buffer](#class-string-method-md5-buffer) **(** **)** | | [String](#class-string) | [md5\_text](#class-string-method-md5-text) **(** **)** | | [int](class_int#class-int) | [naturalnocasecmp\_to](#class-string-method-naturalnocasecmp-to) **(** [String](#class-string) to **)** | | [int](class_int#class-int) | [nocasecmp\_to](#class-string-method-nocasecmp-to) **(** [String](#class-string) to **)** | | [int](class_int#class-int) | [ord\_at](#class-string-method-ord-at) **(** [int](class_int#class-int) at **)** | | [String](#class-string) | [pad\_decimals](#class-string-method-pad-decimals) **(** [int](class_int#class-int) digits **)** | | [String](#class-string) | [pad\_zeros](#class-string-method-pad-zeros) **(** [int](class_int#class-int) digits **)** | | [String](#class-string) | [percent\_decode](#class-string-method-percent-decode) **(** **)** | | [String](#class-string) | [percent\_encode](#class-string-method-percent-encode) **(** **)** | | [String](#class-string) | [plus\_file](#class-string-method-plus-file) **(** [String](#class-string) file **)** | | [String](#class-string) | [repeat](#class-string-method-repeat) **(** [int](class_int#class-int) count **)** | | [String](#class-string) | [replace](#class-string-method-replace) **(** [String](#class-string) what, [String](#class-string) forwhat **)** | | [String](#class-string) | [replacen](#class-string-method-replacen) **(** [String](#class-string) what, [String](#class-string) forwhat **)** | | [int](class_int#class-int) | [rfind](#class-string-method-rfind) **(** [String](#class-string) what, [int](class_int#class-int) from=-1 **)** | | [int](class_int#class-int) | [rfindn](#class-string-method-rfindn) **(** [String](#class-string) what, [int](class_int#class-int) from=-1 **)** | | [String](#class-string) | [right](#class-string-method-right) **(** [int](class_int#class-int) position **)** | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [rsplit](#class-string-method-rsplit) **(** [String](#class-string) delimiter, [bool](class_bool#class-bool) allow\_empty=true, [int](class_int#class-int) maxsplit=0 **)** | | [String](#class-string) | [rstrip](#class-string-method-rstrip) **(** [String](#class-string) chars **)** | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [sha1\_buffer](#class-string-method-sha1-buffer) **(** **)** | | [String](#class-string) | [sha1\_text](#class-string-method-sha1-text) **(** **)** | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [sha256\_buffer](#class-string-method-sha256-buffer) **(** **)** | | [String](#class-string) | [sha256\_text](#class-string-method-sha256-text) **(** **)** | | [float](class_float#class-float) | [similarity](#class-string-method-similarity) **(** [String](#class-string) text **)** | | [String](#class-string) | [simplify\_path](#class-string-method-simplify-path) **(** **)** | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [split](#class-string-method-split) **(** [String](#class-string) delimiter, [bool](class_bool#class-bool) allow\_empty=true, [int](class_int#class-int) maxsplit=0 **)** | | [PoolRealArray](class_poolrealarray#class-poolrealarray) | [split\_floats](#class-string-method-split-floats) **(** [String](#class-string) delimiter, [bool](class_bool#class-bool) allow\_empty=true **)** | | [String](#class-string) | [strip\_edges](#class-string-method-strip-edges) **(** [bool](class_bool#class-bool) left=true, [bool](class_bool#class-bool) right=true **)** | | [String](#class-string) | [strip\_escapes](#class-string-method-strip-escapes) **(** **)** | | [String](#class-string) | [substr](#class-string-method-substr) **(** [int](class_int#class-int) from, [int](class_int#class-int) len=-1 **)** | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [to\_ascii](#class-string-method-to-ascii) **(** **)** | | [float](class_float#class-float) | [to\_float](#class-string-method-to-float) **(** **)** | | [int](class_int#class-int) | [to\_int](#class-string-method-to-int) **(** **)** | | [String](#class-string) | [to\_lower](#class-string-method-to-lower) **(** **)** | | [String](#class-string) | [to\_upper](#class-string-method-to-upper) **(** **)** | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [to\_utf8](#class-string-method-to-utf8) **(** **)** | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [to\_wchar](#class-string-method-to-wchar) **(** **)** | | [String](#class-string) | [trim\_prefix](#class-string-method-trim-prefix) **(** [String](#class-string) prefix **)** | | [String](#class-string) | [trim\_suffix](#class-string-method-trim-suffix) **(** [String](#class-string) suffix **)** | | [String](#class-string) | [validate\_node\_name](#class-string-method-validate-node-name) **(** **)** | | [String](#class-string) | [xml\_escape](#class-string-method-xml-escape) **(** **)** | | [String](#class-string) | [xml\_unescape](#class-string-method-xml-unescape) **(** **)** | Method Descriptions ------------------- ### [String](#class-string) String ( [bool](class_bool#class-bool) from ) Constructs a new String from the given [bool](class_bool#class-bool). * [String](#class-string) **String** **(** [int](class_int#class-int) from **)** Constructs a new String from the given [int](class_int#class-int). * [String](#class-string) **String** **(** [float](class_float#class-float) from **)** Constructs a new String from the given [float](class_float#class-float). * [String](#class-string) **String** **(** [Vector2](class_vector2#class-vector2) from **)** Constructs a new String from the given [Vector2](class_vector2#class-vector2). * [String](#class-string) **String** **(** [Rect2](class_rect2#class-rect2) from **)** Constructs a new String from the given [Rect2](class_rect2#class-rect2). * [String](#class-string) **String** **(** [Vector3](class_vector3#class-vector3) from **)** Constructs a new String from the given [Vector3](class_vector3#class-vector3). * [String](#class-string) **String** **(** [Transform2D](class_transform2d#class-transform2d) from **)** Constructs a new String from the given [Transform2D](class_transform2d#class-transform2d). * [String](#class-string) **String** **(** [Plane](class_plane#class-plane) from **)** Constructs a new String from the given [Plane](class_plane#class-plane). * [String](#class-string) **String** **(** [Quat](class_quat#class-quat) from **)** Constructs a new String from the given [Quat](class_quat#class-quat). * [String](#class-string) **String** **(** [AABB](class_aabb#class-aabb) from **)** Constructs a new String from the given [AABB](class_aabb#class-aabb). * [String](#class-string) **String** **(** [Basis](class_basis#class-basis) from **)** Constructs a new String from the given [Basis](class_basis#class-basis). * [String](#class-string) **String** **(** [Transform](class_transform#class-transform) from **)** Constructs a new String from the given [Transform](class_transform#class-transform). * [String](#class-string) **String** **(** [Color](class_color#class-color) from **)** Constructs a new String from the given [Color](class_color#class-color). * [String](#class-string) **String** **(** [NodePath](class_nodepath#class-nodepath) from **)** Constructs a new String from the given [NodePath](class_nodepath#class-nodepath). * [String](#class-string) **String** **(** [RID](class_rid#class-rid) from **)** Constructs a new String from the given [RID](class_rid#class-rid). * [String](#class-string) **String** **(** [Dictionary](class_dictionary#class-dictionary) from **)** Constructs a new String from the given [Dictionary](class_dictionary#class-dictionary). * [String](#class-string) **String** **(** [Array](class_array#class-array) from **)** Constructs a new String from the given [Array](class_array#class-array). * [String](#class-string) **String** **(** [PoolByteArray](class_poolbytearray#class-poolbytearray) from **)** Constructs a new String from the given [PoolByteArray](class_poolbytearray#class-poolbytearray). * [String](#class-string) **String** **(** [PoolIntArray](class_poolintarray#class-poolintarray) from **)** Constructs a new String from the given [PoolIntArray](class_poolintarray#class-poolintarray). * [String](#class-string) **String** **(** [PoolRealArray](class_poolrealarray#class-poolrealarray) from **)** Constructs a new String from the given [PoolRealArray](class_poolrealarray#class-poolrealarray). * [String](#class-string) **String** **(** [PoolStringArray](class_poolstringarray#class-poolstringarray) from **)** Constructs a new String from the given [PoolStringArray](class_poolstringarray#class-poolstringarray). * [String](#class-string) **String** **(** [PoolVector2Array](class_poolvector2array#class-poolvector2array) from **)** Constructs a new String from the given [PoolVector2Array](class_poolvector2array#class-poolvector2array). * [String](#class-string) **String** **(** [PoolVector3Array](class_poolvector3array#class-poolvector3array) from **)** Constructs a new String from the given [PoolVector3Array](class_poolvector3array#class-poolvector3array). * [String](#class-string) **String** **(** [PoolColorArray](class_poolcolorarray#class-poolcolorarray) from **)** Constructs a new String from the given [PoolColorArray](class_poolcolorarray#class-poolcolorarray). ### [bool](class_bool#class-bool) begins\_with ( [String](#class-string) text ) Returns `true` if the string begins with the given string. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) bigrams ( ) Returns an array containing the bigrams (pairs of consecutive letters) of this string. ``` print("Bigrams".bigrams()) # Prints "[Bi, ig, gr, ra, am, ms]" ``` ### [String](#class-string) c\_escape ( ) Returns a copy of the string with special characters escaped using the C language standard. ### [String](#class-string) c\_unescape ( ) Returns a copy of the string with escaped characters replaced by their meanings. Supported escape sequences are `\'`, `\"`, `\?`, `\\`, `\a`, `\b`, `\f`, `\n`, `\r`, `\t`, `\v`. **Note:** Unlike the GDScript parser, this method doesn't support the `\uXXXX` escape sequence. ### [String](#class-string) capitalize ( ) Changes the case of some letters. Replaces underscores with spaces, adds spaces before in-word uppercase characters, converts all letters to lowercase, then capitalizes the first letter and every letter following a space character. For `capitalize camelCase mixed_with_underscores`, it will return `Capitalize Camel Case Mixed With Underscores`. ### [int](class_int#class-int) casecmp\_to ( [String](#class-string) to ) Performs a case-sensitive comparison to another string. Returns `-1` if less than, `1` if greater than, or `0` if equal. "less than" or "greater than" are determined by the [Unicode code points](https://en.wikipedia.org/wiki/List_of_Unicode_characters) of each string, which roughly matches the alphabetical order. **Behavior with different string lengths:** Returns `1` if the "base" string is longer than the `to` string or `-1` if the "base" string is shorter than the `to` string. Keep in mind this length is determined by the number of Unicode codepoints, *not* the actual visible characters. **Behavior with empty strings:** Returns `-1` if the "base" string is empty, `1` if the `to` string is empty or `0` if both strings are empty. To get a boolean result from a string comparison, use the `==` operator instead. See also [nocasecmp\_to](#class-string-method-nocasecmp-to). ### [int](class_int#class-int) count ( [String](#class-string) what, [int](class_int#class-int) from=0, [int](class_int#class-int) to=0 ) Returns the number of occurrences of substring `what` between `from` and `to` positions. If `from` and `to` equals 0 the whole string will be used. If only `to` equals 0 the remained substring will be used. ### [int](class_int#class-int) countn ( [String](#class-string) what, [int](class_int#class-int) from=0, [int](class_int#class-int) to=0 ) Returns the number of occurrences of substring `what` (ignoring case) between `from` and `to` positions. If `from` and `to` equals 0 the whole string will be used. If only `to` equals 0 the remained substring will be used. ### [String](#class-string) dedent ( ) Returns a copy of the string with indentation (leading tabs and spaces) removed. See also [indent](#class-string-method-indent) to add indentation. ### [bool](class_bool#class-bool) empty ( ) Returns `true` if the length of the string equals `0`. ### [bool](class_bool#class-bool) ends\_with ( [String](#class-string) text ) Returns `true` if the string ends with the given string. ### void erase ( [int](class_int#class-int) position, [int](class_int#class-int) chars ) Erases `chars` characters from the string starting from `position`. ### [int](class_int#class-int) find ( [String](#class-string) what, [int](class_int#class-int) from=0 ) Finds the first occurrence of a substring. Returns the starting position of the substring or `-1` if not found. Optionally, the initial search index can be passed. **Note:** If you just want to know whether a string contains a substring, use the `in` operator as follows: ``` # Will evaluate to `false`. if "i" in "team": pass ``` ### [int](class_int#class-int) find\_last ( [String](#class-string) what ) Finds the last occurrence of a substring. Returns the starting position of the substring or `-1` if not found. ### [int](class_int#class-int) findn ( [String](#class-string) what, [int](class_int#class-int) from=0 ) Finds the first occurrence of a substring, ignoring case. Returns the starting position of the substring or `-1` if not found. Optionally, the initial search index can be passed. ### [String](#class-string) format ( [Variant](class_variant#class-variant) values, [String](#class-string) placeholder="{\_}" ) Formats the string by replacing all occurrences of `placeholder` with the elements of `values`. `values` can be a [Dictionary](class_dictionary#class-dictionary) or an [Array](class_array#class-array). Any underscores in `placeholder` will be replaced with the corresponding keys in advance. Array elements use their index as keys. ``` # Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is named after it. var use_array_values = "Waiting for {0} is a play by {1}, and {0} Engine is named after it." print(use_array_values.format(["Godot", "Samuel Beckett"])) # Prints: User 42 is Godot. print("User {id} is {name}.".format({"id": 42, "name": "Godot"})) ``` Some additional handling is performed when `values` is an array. If `placeholder` does not contain an underscore, the elements of the array will be used to replace one occurrence of the placeholder in turn; If an array element is another 2-element array, it'll be interpreted as a key-value pair. ``` # Prints: User 42 is Godot. print("User {} is {}.".format([42, "Godot"], "{}")) print("User {id} is {name}.".format([["id", 42], ["name", "Godot"]])) ``` ### [String](#class-string) get\_base\_dir ( ) If the string is a valid file path, returns the base directory name. ### [String](#class-string) get\_basename ( ) If the string is a valid file path, returns the full file path without the extension. ### [String](#class-string) get\_extension ( ) Returns the extension without the leading period character (`.`) if the string is a valid file name or path. If the string does not contain an extension, returns an empty string instead. ``` print("/path/to/file.txt".get_extension()) # "txt" print("file.txt".get_extension()) # "txt" print("file.sample.txt".get_extension()) # "txt" print(".txt".get_extension()) # "txt" print("file.txt.".get_extension()) # "" (empty string) print("file.txt..".get_extension()) # "" (empty string) print("txt".get_extension()) # "" (empty string) print("".get_extension()) # "" (empty string) ``` ### [String](#class-string) get\_file ( ) If the string is a valid file path, returns the filename. ### [String](#class-string) get\_slice ( [String](#class-string) delimiter, [int](class_int#class-int) slice ) Splits a string using a `delimiter` and returns a substring at index `slice`. Returns an empty string if the index doesn't exist. This is a more performant alternative to [split](#class-string-method-split) for cases when you need only one element from the array at a fixed index. Example: ``` print("i/am/example/string".get_slice("/", 2)) # Prints 'example'. ``` ### [int](class_int#class-int) hash ( ) Returns the 32-bit hash value representing the string's contents. **Note:** `String`s with equal content will always produce identical hash values. However, the reverse is not true. Returning identical hash values does *not* imply the strings are equal, because different strings can have identical hash values due to hash collisions. ### [int](class_int#class-int) hex\_to\_int ( ) Converts a string containing a hexadecimal number into an integer. Hexadecimal strings are expected to be prefixed with "`0x`" otherwise `0` is returned. ``` print("0xff".hex_to_int()) # Print "255" ``` ### [String](#class-string) http\_escape ( ) Escapes (encodes) a string to URL friendly format. Also referred to as 'URL encode'. ``` print("https://example.org/?escaped=" + "Godot Engine:'docs'".http_escape()) ``` ### [String](#class-string) http\_unescape ( ) Unescapes (decodes) a string in URL encoded format. Also referred to as 'URL decode'. ``` print("https://example.org/?escaped=" + "Godot%20Engine%3A%27docs%27".http_unescape()) ``` ### [String](#class-string) humanize\_size ( [int](class_int#class-int) size ) Converts `size` represented as number of bytes to human-readable format using internationalized set of data size units, namely: B, KiB, MiB, GiB, TiB, PiB, EiB. Note that the next smallest unit is picked automatically to hold at most 1024 units. ``` var bytes = 133790307 var size = String.humanize_size(bytes) print(size) # prints "127.5 MiB" ``` ### [String](#class-string) indent ( [String](#class-string) prefix ) Returns a copy of the string with lines indented with `prefix`. For example, the string can be indented with two tabs using `"\t\t"`, or four spaces using `"    "`. The prefix can be any string so it can also be used to comment out strings with e.g. `"# "`. See also [dedent](#class-string-method-dedent) to remove indentation. **Note:** Empty lines are kept empty. ### [String](#class-string) insert ( [int](class_int#class-int) position, [String](#class-string) what ) Returns a copy of the string with the substring `what` inserted at the given position. ### [bool](class_bool#class-bool) is\_abs\_path ( ) If the string is a path to a file or directory, returns `true` if the path is absolute. ### [bool](class_bool#class-bool) is\_rel\_path ( ) If the string is a path to a file or directory, returns `true` if the path is relative. ### [bool](class_bool#class-bool) is\_subsequence\_of ( [String](#class-string) text ) Returns `true` if this string is a subsequence of the given string. ### [bool](class_bool#class-bool) is\_subsequence\_ofi ( [String](#class-string) text ) Returns `true` if this string is a subsequence of the given string, without considering case. ### [bool](class_bool#class-bool) is\_valid\_filename ( ) Returns `true` if this string is free from characters that aren't allowed in file names, those being: `: / \ ? * " | % < >` ### [bool](class_bool#class-bool) is\_valid\_float ( ) Returns `true` if this string contains a valid float. This is inclusive of integers, and also supports exponents: ``` print("1.7".is_valid_float()) # Prints "True" print("24".is_valid_float()) # Prints "True" print("7e3".is_valid_float()) # Prints "True" print("Hello".is_valid_float()) # Prints "False" ``` ### [bool](class_bool#class-bool) is\_valid\_hex\_number ( [bool](class_bool#class-bool) with\_prefix=false ) Returns `true` if this string contains a valid hexadecimal number. If `with_prefix` is `true`, then a validity of the hexadecimal number is determined by `0x` prefix, for instance: `0xDEADC0DE`. ### [bool](class_bool#class-bool) is\_valid\_html\_color ( ) Returns `true` if this string contains a valid color in hexadecimal HTML notation. Other HTML notations such as named colors or `hsl()` colors aren't considered valid by this method and will return `false`. ### [bool](class_bool#class-bool) is\_valid\_identifier ( ) Returns `true` if this string is a valid identifier. A valid identifier may contain only letters, digits and underscores (`_`) and the first character may not be a digit. ``` print("good_ident_1".is_valid_identifier()) # Prints "True" print("1st_bad_ident".is_valid_identifier()) # Prints "False" print("bad_ident_#2".is_valid_identifier()) # Prints "False" ``` ### [bool](class_bool#class-bool) is\_valid\_integer ( ) Returns `true` if this string contains a valid integer. ``` print("7".is_valid_integer()) # Prints "True" print("14.6".is_valid_integer()) # Prints "False" print("L".is_valid_integer()) # Prints "False" print("+3".is_valid_integer()) # Prints "True" print("-12".is_valid_integer()) # Prints "True" ``` ### [bool](class_bool#class-bool) is\_valid\_ip\_address ( ) Returns `true` if this string contains only a well-formatted IPv4 or IPv6 address. This method considers [reserved IP addresses](https://en.wikipedia.org/wiki/Reserved_IP_addresses) such as `0.0.0.0` as valid. ### [String](#class-string) join ( [PoolStringArray](class_poolstringarray#class-poolstringarray) parts ) Return a `String` which is the concatenation of the `parts`. The separator between elements is the string providing this method. Example: ``` print(", ".join(["One", "Two", "Three", "Four"])) ``` ### [String](#class-string) json\_escape ( ) Returns a copy of the string with special characters escaped using the JSON standard. ### [String](#class-string) left ( [int](class_int#class-int) position ) Returns a number of characters from the left of the string. ### [int](class_int#class-int) length ( ) Returns the string's amount of characters. ### [String](#class-string) lstrip ( [String](#class-string) chars ) Returns a copy of the string with characters removed from the left. The `chars` argument is a string specifying the set of characters to be removed. **Note:** The `chars` is not a prefix. See [trim\_prefix](#class-string-method-trim-prefix) method that will remove a single prefix string rather than a set of characters. ### [bool](class_bool#class-bool) match ( [String](#class-string) expr ) Does a simple case-sensitive expression match, where `"*"` matches zero or more arbitrary characters and `"?"` matches any single character except a period (`"."`). An empty string or empty expression always evaluates to `false`. ### [bool](class_bool#class-bool) matchn ( [String](#class-string) expr ) Does a simple case-insensitive expression match, where `"*"` matches zero or more arbitrary characters and `"?"` matches any single character except a period (`"."`). An empty string or empty expression always evaluates to `false`. ### [PoolByteArray](class_poolbytearray#class-poolbytearray) md5\_buffer ( ) Returns the MD5 hash of the string as an array of bytes. ### [String](#class-string) md5\_text ( ) Returns the MD5 hash of the string as a string. ### [int](class_int#class-int) naturalnocasecmp\_to ( [String](#class-string) to ) Performs a case-insensitive *natural order* comparison to another string. Returns `-1` if less than, `1` if greater than, or `0` if equal. "less than" or "greater than" are determined by the [Unicode code points](https://en.wikipedia.org/wiki/List_of_Unicode_characters) of each string, which roughly matches the alphabetical order. Internally, lowercase characters will be converted to uppercase during the comparison. When used for sorting, natural order comparison will order suites of numbers as expected by most people. If you sort the numbers from 1 to 10 using natural order, you will get `[1, 2, 3, ...]` instead of `[1, 10, 2, 3, ...]`. **Behavior with different string lengths:** Returns `1` if the "base" string is longer than the `to` string or `-1` if the "base" string is shorter than the `to` string. Keep in mind this length is determined by the number of Unicode codepoints, *not* the actual visible characters. **Behavior with empty strings:** Returns `-1` if the "base" string is empty, `1` if the `to` string is empty or `0` if both strings are empty. To get a boolean result from a string comparison, use the `==` operator instead. See also [nocasecmp\_to](#class-string-method-nocasecmp-to) and [casecmp\_to](#class-string-method-casecmp-to). ### [int](class_int#class-int) nocasecmp\_to ( [String](#class-string) to ) Performs a case-insensitive comparison to another string. Returns `-1` if less than, `1` if greater than, or `0` if equal. "less than" or "greater than" are determined by the [Unicode code points](https://en.wikipedia.org/wiki/List_of_Unicode_characters) of each string, which roughly matches the alphabetical order. Internally, lowercase characters will be converted to uppercase during the comparison. **Behavior with different string lengths:** Returns `1` if the "base" string is longer than the `to` string or `-1` if the "base" string is shorter than the `to` string. Keep in mind this length is determined by the number of Unicode codepoints, *not* the actual visible characters. **Behavior with empty strings:** Returns `-1` if the "base" string is empty, `1` if the `to` string is empty or `0` if both strings are empty. To get a boolean result from a string comparison, use the `==` operator instead. See also [casecmp\_to](#class-string-method-casecmp-to). ### [int](class_int#class-int) ord\_at ( [int](class_int#class-int) at ) Returns the character code at position `at`. ### [String](#class-string) pad\_decimals ( [int](class_int#class-int) digits ) Formats a number to have an exact number of `digits` after the decimal point. ### [String](#class-string) pad\_zeros ( [int](class_int#class-int) digits ) Formats a number to have an exact number of `digits` before the decimal point. ### [String](#class-string) percent\_decode ( ) Decode a percent-encoded string. See [percent\_encode](#class-string-method-percent-encode). ### [String](#class-string) percent\_encode ( ) Percent-encodes a string. Encodes parameters in a URL when sending a HTTP GET request (and bodies of form-urlencoded POST requests). ### [String](#class-string) plus\_file ( [String](#class-string) file ) If the string is a path, this concatenates `file` at the end of the string as a subpath. E.g. `"this/is".plus_file("path") == "this/is/path"`. ### [String](#class-string) repeat ( [int](class_int#class-int) count ) Returns original string repeated a number of times. The number of repetitions is given by the argument. ### [String](#class-string) replace ( [String](#class-string) what, [String](#class-string) forwhat ) Replaces occurrences of a case-sensitive substring with the given one inside the string. ### [String](#class-string) replacen ( [String](#class-string) what, [String](#class-string) forwhat ) Replaces occurrences of a case-insensitive substring with the given one inside the string. ### [int](class_int#class-int) rfind ( [String](#class-string) what, [int](class_int#class-int) from=-1 ) Performs a case-sensitive search for a substring, but starts from the end of the string instead of the beginning. ### [int](class_int#class-int) rfindn ( [String](#class-string) what, [int](class_int#class-int) from=-1 ) Performs a case-insensitive search for a substring, but starts from the end of the string instead of the beginning. ### [String](#class-string) right ( [int](class_int#class-int) position ) Returns the right side of the string from a given position. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) rsplit ( [String](#class-string) delimiter, [bool](class_bool#class-bool) allow\_empty=true, [int](class_int#class-int) maxsplit=0 ) Splits the string by a `delimiter` string and returns an array of the substrings, starting from right. The splits in the returned array are sorted in the same order as the original string, from left to right. If `allow_empty` is `true`, and there are two adjacent delimiters in the string, it will add an empty string to the array of substrings at this position. If `maxsplit` is specified, it defines the number of splits to do from the right up to `maxsplit`. The default value of 0 means that all items are split, thus giving the same result as [split](#class-string-method-split). Example: ``` var some_string = "One,Two,Three,Four" var some_array = some_string.rsplit(",", true, 1) print(some_array.size()) # Prints 2 print(some_array[0]) # Prints "One,Two,Three" print(some_array[1]) # Prints "Four" ``` ### [String](#class-string) rstrip ( [String](#class-string) chars ) Returns a copy of the string with characters removed from the right. The `chars` argument is a string specifying the set of characters to be removed. **Note:** The `chars` is not a suffix. See [trim\_suffix](#class-string-method-trim-suffix) method that will remove a single suffix string rather than a set of characters. ### [PoolByteArray](class_poolbytearray#class-poolbytearray) sha1\_buffer ( ) Returns the SHA-1 hash of the string as an array of bytes. ### [String](#class-string) sha1\_text ( ) Returns the SHA-1 hash of the string as a string. ### [PoolByteArray](class_poolbytearray#class-poolbytearray) sha256\_buffer ( ) Returns the SHA-256 hash of the string as an array of bytes. ### [String](#class-string) sha256\_text ( ) Returns the SHA-256 hash of the string as a string. ### [float](class_float#class-float) similarity ( [String](#class-string) text ) Returns the similarity index ([Sorensen-Dice coefficient](https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient)) of this string compared to another. A result of 1.0 means totally similar, while 0.0 means totally dissimilar. ``` print("ABC123".similarity("ABC123")) # Prints "1" print("ABC123".similarity("XYZ456")) # Prints "0" print("ABC123".similarity("123ABC")) # Prints "0.8" print("ABC123".similarity("abc123")) # Prints "0.4" ``` ### [String](#class-string) simplify\_path ( ) Returns a simplified canonical path. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) split ( [String](#class-string) delimiter, [bool](class_bool#class-bool) allow\_empty=true, [int](class_int#class-int) maxsplit=0 ) Splits the string by a `delimiter` string and returns an array of the substrings. The `delimiter` can be of any length. If `allow_empty` is `true`, and there are two adjacent delimiters in the string, it will add an empty string to the array of substrings at this position. If `maxsplit` is specified, it defines the number of splits to do from the left up to `maxsplit`. The default value of `0` means that all items are split. If you need only one element from the array at a specific index, [get\_slice](#class-string-method-get-slice) is a more performant option. Example: ``` var some_string = "One,Two,Three,Four" var some_array = some_string.split(",", true, 1) print(some_array.size()) # Prints 2 print(some_array[0]) # Prints "One" print(some_array[1]) # Prints "Two,Three,Four" ``` If you need to split strings with more complex rules, use the [RegEx](class_regex#class-regex) class instead. ### [PoolRealArray](class_poolrealarray#class-poolrealarray) split\_floats ( [String](#class-string) delimiter, [bool](class_bool#class-bool) allow\_empty=true ) Splits the string in floats by using a delimiter string and returns an array of the substrings. For example, `"1,2.5,3"` will return `[1,2.5,3]` if split by `","`. If `allow_empty` is `true`, and there are two adjacent delimiters in the string, it will add an empty string to the array of substrings at this position. ### [String](#class-string) strip\_edges ( [bool](class_bool#class-bool) left=true, [bool](class_bool#class-bool) right=true ) Returns a copy of the string stripped of any non-printable character (including tabulations, spaces and line breaks) at the beginning and the end. The optional arguments are used to toggle stripping on the left and right edges respectively. ### [String](#class-string) strip\_escapes ( ) Returns a copy of the string stripped of any escape character. These include all non-printable control characters of the first page of the ASCII table (< 32), such as tabulation (`\t` in C) and newline (`\n` and `\r`) characters, but not spaces. ### [String](#class-string) substr ( [int](class_int#class-int) from, [int](class_int#class-int) len=-1 ) Returns part of the string from the position `from` with length `len`. Argument `len` is optional and using `-1` will return remaining characters from given position. ### [PoolByteArray](class_poolbytearray#class-poolbytearray) to\_ascii ( ) Converts the String (which is a character array) to [PoolByteArray](class_poolbytearray#class-poolbytearray) (which is an array of bytes). The conversion is faster compared to [to\_utf8](#class-string-method-to-utf8), as this method assumes that all the characters in the String are ASCII characters. ### [float](class_float#class-float) to\_float ( ) Converts a string containing a decimal number into a `float`. The method will stop on the first non-number character except the first `.` (decimal point), and `e` which is used for exponential. ``` print("12.3".to_float()) # 12.3 print("1.2.3".to_float()) # 1.2 print("12ab3".to_float()) # 12 print("1e3".to_float()) # 1000 ``` ### [int](class_int#class-int) to\_int ( ) Converts a string containing an integer number into an `int`. The method will remove any non-number character and stop if it encounters a `.`. ``` print("123".to_int()) # 123 print("a1b2c3".to_int()) # 123 print("1.2.3".to_int()) # 1 ``` ### [String](#class-string) to\_lower ( ) Returns the string converted to lowercase. ### [String](#class-string) to\_upper ( ) Returns the string converted to uppercase. ### [PoolByteArray](class_poolbytearray#class-poolbytearray) to\_utf8 ( ) Converts the String (which is an array of characters) to [PoolByteArray](class_poolbytearray#class-poolbytearray) (which is an array of bytes). The conversion is a bit slower than [to\_ascii](#class-string-method-to-ascii), but supports all UTF-8 characters. Therefore, you should prefer this function over [to\_ascii](#class-string-method-to-ascii). ### [PoolByteArray](class_poolbytearray#class-poolbytearray) to\_wchar ( ) Converts the String (which is an array of characters) to [PoolByteArray](class_poolbytearray#class-poolbytearray) (which is an array of bytes). ### [String](#class-string) trim\_prefix ( [String](#class-string) prefix ) Removes a given string from the start if it starts with it or leaves the string unchanged. ### [String](#class-string) trim\_suffix ( [String](#class-string) suffix ) Removes a given string from the end if it ends with it or leaves the string unchanged. ### [String](#class-string) validate\_node\_name ( ) Removes any characters from the string that are prohibited in [Node](class_node#class-node) names (`.` `:` `@` `/` `"`). ### [String](#class-string) xml\_escape ( ) Returns a copy of the string with special characters escaped using the XML standard. ### [String](#class-string) xml\_unescape ( ) Returns a copy of the string with escaped characters replaced by their meanings according to the XML standard.
programming_docs
godot NavigationServer NavigationServer ================ **Inherits:** [Object](class_object#class-object) Server interface for low-level 3D navigation access. Description ----------- NavigationServer is the server responsible for all 3D navigation. It handles several objects, namely maps, regions and agents. Maps are made up of regions, which are made of navigation meshes. Together, they define the navigable areas in the 3D world. **Note:** Most NavigationServer changes take effect after the next physics frame and not immediately. This includes all changes made to maps, regions or agents by navigation related Nodes in the SceneTree or made through scripts. For two regions to be connected to each other, they must share a similar edge. An edge is considered connected to another if both of its two vertices are at a distance less than [Navigation.edge\_connection\_margin](class_navigation#class-navigation-property-edge-connection-margin) to the respective other edge's vertex. To use the collision avoidance system, you may use agents. You can set an agent's target velocity, then the servers will emit a callback with a modified velocity. **Note:** The collision avoidance system ignores regions. Using the modified velocity as-is might lead to pushing and agent outside of a navigable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine. This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. Tutorials --------- * [3D Navmesh Demo](https://godotengine.org/asset-library/asset/124) Methods ------- | | | | --- | --- | | [RID](class_rid#class-rid) | [agent\_create](#class-navigationserver-method-agent-create) **(** **)** const | | [RID](class_rid#class-rid) | [agent\_get\_map](#class-navigationserver-method-agent-get-map) **(** [RID](class_rid#class-rid) agent **)** const | | [bool](class_bool#class-bool) | [agent\_is\_map\_changed](#class-navigationserver-method-agent-is-map-changed) **(** [RID](class_rid#class-rid) agent **)** const | | void | [agent\_set\_callback](#class-navigationserver-method-agent-set-callback) **(** [RID](class_rid#class-rid) agent, [Object](class_object#class-object) receiver, [String](class_string#class-string) method, [Variant](class_variant#class-variant) userdata=null **)** const | | void | [agent\_set\_map](#class-navigationserver-method-agent-set-map) **(** [RID](class_rid#class-rid) agent, [RID](class_rid#class-rid) map **)** const | | void | [agent\_set\_max\_neighbors](#class-navigationserver-method-agent-set-max-neighbors) **(** [RID](class_rid#class-rid) agent, [int](class_int#class-int) count **)** const | | void | [agent\_set\_max\_speed](#class-navigationserver-method-agent-set-max-speed) **(** [RID](class_rid#class-rid) agent, [float](class_float#class-float) max\_speed **)** const | | void | [agent\_set\_neighbor\_dist](#class-navigationserver-method-agent-set-neighbor-dist) **(** [RID](class_rid#class-rid) agent, [float](class_float#class-float) dist **)** const | | void | [agent\_set\_position](#class-navigationserver-method-agent-set-position) **(** [RID](class_rid#class-rid) agent, [Vector3](class_vector3#class-vector3) position **)** const | | void | [agent\_set\_radius](#class-navigationserver-method-agent-set-radius) **(** [RID](class_rid#class-rid) agent, [float](class_float#class-float) radius **)** const | | void | [agent\_set\_target\_velocity](#class-navigationserver-method-agent-set-target-velocity) **(** [RID](class_rid#class-rid) agent, [Vector3](class_vector3#class-vector3) target\_velocity **)** const | | void | [agent\_set\_time\_horizon](#class-navigationserver-method-agent-set-time-horizon) **(** [RID](class_rid#class-rid) agent, [float](class_float#class-float) time **)** const | | void | [agent\_set\_velocity](#class-navigationserver-method-agent-set-velocity) **(** [RID](class_rid#class-rid) agent, [Vector3](class_vector3#class-vector3) velocity **)** const | | void | [free\_rid](#class-navigationserver-method-free-rid) **(** [RID](class_rid#class-rid) rid **)** const | | [Array](class_array#class-array) | [get\_maps](#class-navigationserver-method-get-maps) **(** **)** const | | [RID](class_rid#class-rid) | [map\_create](#class-navigationserver-method-map-create) **(** **)** const | | void | [map\_force\_update](#class-navigationserver-method-map-force-update) **(** [RID](class_rid#class-rid) map **)** | | [Array](class_array#class-array) | [map\_get\_agents](#class-navigationserver-method-map-get-agents) **(** [RID](class_rid#class-rid) map **)** const | | [float](class_float#class-float) | [map\_get\_cell\_height](#class-navigationserver-method-map-get-cell-height) **(** [RID](class_rid#class-rid) map **)** const | | [float](class_float#class-float) | [map\_get\_cell\_size](#class-navigationserver-method-map-get-cell-size) **(** [RID](class_rid#class-rid) map **)** const | | [Vector3](class_vector3#class-vector3) | [map\_get\_closest\_point](#class-navigationserver-method-map-get-closest-point) **(** [RID](class_rid#class-rid) map, [Vector3](class_vector3#class-vector3) to\_point **)** const | | [Vector3](class_vector3#class-vector3) | [map\_get\_closest\_point\_normal](#class-navigationserver-method-map-get-closest-point-normal) **(** [RID](class_rid#class-rid) map, [Vector3](class_vector3#class-vector3) to\_point **)** const | | [RID](class_rid#class-rid) | [map\_get\_closest\_point\_owner](#class-navigationserver-method-map-get-closest-point-owner) **(** [RID](class_rid#class-rid) map, [Vector3](class_vector3#class-vector3) to\_point **)** const | | [Vector3](class_vector3#class-vector3) | [map\_get\_closest\_point\_to\_segment](#class-navigationserver-method-map-get-closest-point-to-segment) **(** [RID](class_rid#class-rid) map, [Vector3](class_vector3#class-vector3) start, [Vector3](class_vector3#class-vector3) end, [bool](class_bool#class-bool) use\_collision=false **)** const | | [float](class_float#class-float) | [map\_get\_edge\_connection\_margin](#class-navigationserver-method-map-get-edge-connection-margin) **(** [RID](class_rid#class-rid) map **)** const | | [PoolVector3Array](class_poolvector3array#class-poolvector3array) | [map\_get\_path](#class-navigationserver-method-map-get-path) **(** [RID](class_rid#class-rid) map, [Vector3](class_vector3#class-vector3) origin, [Vector3](class_vector3#class-vector3) destination, [bool](class_bool#class-bool) optimize, [int](class_int#class-int) navigation\_layers=1 **)** const | | [Array](class_array#class-array) | [map\_get\_regions](#class-navigationserver-method-map-get-regions) **(** [RID](class_rid#class-rid) map **)** const | | [Vector3](class_vector3#class-vector3) | [map\_get\_up](#class-navigationserver-method-map-get-up) **(** [RID](class_rid#class-rid) map **)** const | | [bool](class_bool#class-bool) | [map\_is\_active](#class-navigationserver-method-map-is-active) **(** [RID](class_rid#class-rid) map **)** const | | void | [map\_set\_active](#class-navigationserver-method-map-set-active) **(** [RID](class_rid#class-rid) map, [bool](class_bool#class-bool) active **)** const | | void | [map\_set\_cell\_height](#class-navigationserver-method-map-set-cell-height) **(** [RID](class_rid#class-rid) map, [float](class_float#class-float) cell\_height **)** const | | void | [map\_set\_cell\_size](#class-navigationserver-method-map-set-cell-size) **(** [RID](class_rid#class-rid) map, [float](class_float#class-float) cell\_size **)** const | | void | [map\_set\_edge\_connection\_margin](#class-navigationserver-method-map-set-edge-connection-margin) **(** [RID](class_rid#class-rid) map, [float](class_float#class-float) margin **)** const | | void | [map\_set\_up](#class-navigationserver-method-map-set-up) **(** [RID](class_rid#class-rid) map, [Vector3](class_vector3#class-vector3) up **)** const | | void | [process](#class-navigationserver-method-process) **(** [float](class_float#class-float) delta\_time **)** | | void | [region\_bake\_navmesh](#class-navigationserver-method-region-bake-navmesh) **(** [NavigationMesh](class_navigationmesh#class-navigationmesh) mesh, [Node](class_node#class-node) node **)** const | | [RID](class_rid#class-rid) | [region\_create](#class-navigationserver-method-region-create) **(** **)** const | | [Vector3](class_vector3#class-vector3) | [region\_get\_connection\_pathway\_end](#class-navigationserver-method-region-get-connection-pathway-end) **(** [RID](class_rid#class-rid) region, [int](class_int#class-int) connection **)** const | | [Vector3](class_vector3#class-vector3) | [region\_get\_connection\_pathway\_start](#class-navigationserver-method-region-get-connection-pathway-start) **(** [RID](class_rid#class-rid) region, [int](class_int#class-int) connection **)** const | | [int](class_int#class-int) | [region\_get\_connections\_count](#class-navigationserver-method-region-get-connections-count) **(** [RID](class_rid#class-rid) region **)** const | | [float](class_float#class-float) | [region\_get\_enter\_cost](#class-navigationserver-method-region-get-enter-cost) **(** [RID](class_rid#class-rid) region **)** const | | [RID](class_rid#class-rid) | [region\_get\_map](#class-navigationserver-method-region-get-map) **(** [RID](class_rid#class-rid) region **)** const | | [int](class_int#class-int) | [region\_get\_navigation\_layers](#class-navigationserver-method-region-get-navigation-layers) **(** [RID](class_rid#class-rid) region **)** const | | [float](class_float#class-float) | [region\_get\_travel\_cost](#class-navigationserver-method-region-get-travel-cost) **(** [RID](class_rid#class-rid) region **)** const | | [bool](class_bool#class-bool) | [region\_owns\_point](#class-navigationserver-method-region-owns-point) **(** [RID](class_rid#class-rid) region, [Vector3](class_vector3#class-vector3) point **)** const | | void | [region\_set\_enter\_cost](#class-navigationserver-method-region-set-enter-cost) **(** [RID](class_rid#class-rid) region, [float](class_float#class-float) enter\_cost **)** const | | void | [region\_set\_map](#class-navigationserver-method-region-set-map) **(** [RID](class_rid#class-rid) region, [RID](class_rid#class-rid) map **)** const | | void | [region\_set\_navigation\_layers](#class-navigationserver-method-region-set-navigation-layers) **(** [RID](class_rid#class-rid) region, [int](class_int#class-int) navigation\_layers **)** const | | void | [region\_set\_navmesh](#class-navigationserver-method-region-set-navmesh) **(** [RID](class_rid#class-rid) region, [NavigationMesh](class_navigationmesh#class-navigationmesh) nav\_mesh **)** const | | void | [region\_set\_transform](#class-navigationserver-method-region-set-transform) **(** [RID](class_rid#class-rid) region, [Transform](class_transform#class-transform) transform **)** const | | void | [region\_set\_travel\_cost](#class-navigationserver-method-region-set-travel-cost) **(** [RID](class_rid#class-rid) region, [float](class_float#class-float) travel\_cost **)** const | | void | [set\_active](#class-navigationserver-method-set-active) **(** [bool](class_bool#class-bool) active **)** const | Signals ------- ### map\_changed ( [RID](class_rid#class-rid) map ) Emitted when a navigation map is updated, when a region moves or is modified. Method Descriptions ------------------- ### [RID](class_rid#class-rid) agent\_create ( ) const Creates the agent. ### [RID](class_rid#class-rid) agent\_get\_map ( [RID](class_rid#class-rid) agent ) const Returns the navigation map [RID](class_rid#class-rid) the requested `agent` is currently assigned to. ### [bool](class_bool#class-bool) agent\_is\_map\_changed ( [RID](class_rid#class-rid) agent ) const Returns `true` if the map got changed the previous frame. ### void agent\_set\_callback ( [RID](class_rid#class-rid) agent, [Object](class_object#class-object) receiver, [String](class_string#class-string) method, [Variant](class_variant#class-variant) userdata=null ) const Callback called at the end of the RVO process. If a callback is created manually and the agent is placed on a navigation map it will calculate avoidance for the agent and dispatch the calculated `safe_velocity` to the `receiver` object with a signal to the chosen `method` name. **Note:** Created callbacks are always processed independently of the SceneTree state as long as the agent is on a navigation map and not freed. To disable the dispatch of a callback from an agent use [agent\_set\_callback](#class-navigationserver-method-agent-set-callback) again with a `null` object as the `receiver`. ### void agent\_set\_map ( [RID](class_rid#class-rid) agent, [RID](class_rid#class-rid) map ) const Puts the agent in the map. ### void agent\_set\_max\_neighbors ( [RID](class_rid#class-rid) agent, [int](class_int#class-int) count ) const Sets the maximum number of other agents the agent takes into account in the navigation. The larger this number, the longer the running time of the simulation. If the number is too low, the simulation will not be safe. ### void agent\_set\_max\_speed ( [RID](class_rid#class-rid) agent, [float](class_float#class-float) max\_speed ) const Sets the maximum speed of the agent. Must be positive. ### void agent\_set\_neighbor\_dist ( [RID](class_rid#class-rid) agent, [float](class_float#class-float) dist ) const Sets the maximum distance to other agents this agent takes into account in the navigation. The larger this number, the longer the running time of the simulation. If the number is too low, the simulation will not be safe. ### void agent\_set\_position ( [RID](class_rid#class-rid) agent, [Vector3](class_vector3#class-vector3) position ) const Sets the position of the agent in world space. ### void agent\_set\_radius ( [RID](class_rid#class-rid) agent, [float](class_float#class-float) radius ) const Sets the radius of the agent. ### void agent\_set\_target\_velocity ( [RID](class_rid#class-rid) agent, [Vector3](class_vector3#class-vector3) target\_velocity ) const Sets the new target velocity. ### void agent\_set\_time\_horizon ( [RID](class_rid#class-rid) agent, [float](class_float#class-float) time ) const The minimal amount of time for which the agent's velocities that are computed by the simulation are safe with respect to other agents. The larger this number, the sooner this agent will respond to the presence of other agents, but the less freedom this agent has in choosing its velocities. Must be positive. ### void agent\_set\_velocity ( [RID](class_rid#class-rid) agent, [Vector3](class_vector3#class-vector3) velocity ) const Sets the current velocity of the agent. ### void free\_rid ( [RID](class_rid#class-rid) rid ) const Destroys the given RID. ### [Array](class_array#class-array) get\_maps ( ) const Returns all created navigation map [RID](class_rid#class-rid)s on the NavigationServer. This returns both 2D and 3D created navigation maps as there is technically no distinction between them. ### [RID](class_rid#class-rid) map\_create ( ) const Create a new map. ### void map\_force\_update ( [RID](class_rid#class-rid) map ) This function immediately forces synchronization of the specified navigation `map` [RID](class_rid#class-rid). By default navigation maps are only synchronized at the end of each physics frame. This function can be used to immediately (re)calculate all the navigation meshes and region connections of the navigation map. This makes it possible to query a navigation path for a changed map immediately and in the same frame (multiple times if needed). Due to technical restrictions the current NavigationServer command queue will be flushed. This means all already queued update commands for this physics frame will be executed, even those intended for other maps, regions and agents not part of the specified map. The expensive computation of the navigation meshes and region connections of a map will only be done for the specified map. Other maps will receive the normal synchronization at the end of the physics frame. Should the specified map receive changes after the forced update it will update again as well when the other maps receive their update. Avoidance processing and dispatch of the `safe_velocity` signals is untouched by this function and continues to happen for all maps and agents at the end of the physics frame. **Note:** With great power comes great responsibility. This function should only be used by users that really know what they are doing and have a good reason for it. Forcing an immediate update of a navigation map requires locking the NavigationServer and flushing the entire NavigationServer command queue. Not only can this severely impact the performance of a game but it can also introduce bugs if used inappropriately without much foresight. ### [Array](class_array#class-array) map\_get\_agents ( [RID](class_rid#class-rid) map ) const Returns all navigation agents [RID](class_rid#class-rid)s that are currently assigned to the requested navigation `map`. ### [float](class_float#class-float) map\_get\_cell\_height ( [RID](class_rid#class-rid) map ) const Returns the map cell height. ### [float](class_float#class-float) map\_get\_cell\_size ( [RID](class_rid#class-rid) map ) const Returns the map cell size. ### [Vector3](class_vector3#class-vector3) map\_get\_closest\_point ( [RID](class_rid#class-rid) map, [Vector3](class_vector3#class-vector3) to\_point ) const Returns the point closest to the provided `to_point` on the navigation mesh surface. ### [Vector3](class_vector3#class-vector3) map\_get\_closest\_point\_normal ( [RID](class_rid#class-rid) map, [Vector3](class_vector3#class-vector3) to\_point ) const Returns the normal for the point returned by [map\_get\_closest\_point](#class-navigationserver-method-map-get-closest-point). ### [RID](class_rid#class-rid) map\_get\_closest\_point\_owner ( [RID](class_rid#class-rid) map, [Vector3](class_vector3#class-vector3) to\_point ) const Returns the owner region RID for the point returned by [map\_get\_closest\_point](#class-navigationserver-method-map-get-closest-point). ### [Vector3](class_vector3#class-vector3) map\_get\_closest\_point\_to\_segment ( [RID](class_rid#class-rid) map, [Vector3](class_vector3#class-vector3) start, [Vector3](class_vector3#class-vector3) end, [bool](class_bool#class-bool) use\_collision=false ) const Returns the closest point between the navigation surface and the segment. ### [float](class_float#class-float) map\_get\_edge\_connection\_margin ( [RID](class_rid#class-rid) map ) const Returns the edge connection margin of the map. This distance is the minimum vertex distance needed to connect two edges from different regions. ### [PoolVector3Array](class_poolvector3array#class-poolvector3array) map\_get\_path ( [RID](class_rid#class-rid) map, [Vector3](class_vector3#class-vector3) origin, [Vector3](class_vector3#class-vector3) destination, [bool](class_bool#class-bool) optimize, [int](class_int#class-int) navigation\_layers=1 ) const Returns the navigation path to reach the destination from the origin. `navigation_layers` is a bitmask of all region layers that are allowed to be in the path. ### [Array](class_array#class-array) map\_get\_regions ( [RID](class_rid#class-rid) map ) const Returns all navigation regions [RID](class_rid#class-rid)s that are currently assigned to the requested navigation `map`. ### [Vector3](class_vector3#class-vector3) map\_get\_up ( [RID](class_rid#class-rid) map ) const Returns the map's up direction. ### [bool](class_bool#class-bool) map\_is\_active ( [RID](class_rid#class-rid) map ) const Returns `true` if the map is active. ### void map\_set\_active ( [RID](class_rid#class-rid) map, [bool](class_bool#class-bool) active ) const Sets the map active. ### void map\_set\_cell\_height ( [RID](class_rid#class-rid) map, [float](class_float#class-float) cell\_height ) const Set the map cell height used to weld the navigation mesh polygons. ### void map\_set\_cell\_size ( [RID](class_rid#class-rid) map, [float](class_float#class-float) cell\_size ) const Set the map cell size used to weld the navigation mesh polygons. ### void map\_set\_edge\_connection\_margin ( [RID](class_rid#class-rid) map, [float](class_float#class-float) margin ) const Set the map edge connection margin used to weld the compatible region edges. ### void map\_set\_up ( [RID](class_rid#class-rid) map, [Vector3](class_vector3#class-vector3) up ) const Sets the map up direction. ### void process ( [float](class_float#class-float) delta\_time ) Process the collision avoidance agents. The result of this process is needed by the physics server, so this must be called in the main thread. **Note:** This function is not thread safe. ### void region\_bake\_navmesh ( [NavigationMesh](class_navigationmesh#class-navigationmesh) mesh, [Node](class_node#class-node) node ) const Bakes the navigation mesh. ### [RID](class_rid#class-rid) region\_create ( ) const Creates a new region. ### [Vector3](class_vector3#class-vector3) region\_get\_connection\_pathway\_end ( [RID](class_rid#class-rid) region, [int](class_int#class-int) connection ) const Returns the ending point of a connection door. `connection` is an index between 0 and the return value of [region\_get\_connections\_count](#class-navigationserver-method-region-get-connections-count). ### [Vector3](class_vector3#class-vector3) region\_get\_connection\_pathway\_start ( [RID](class_rid#class-rid) region, [int](class_int#class-int) connection ) const Returns the starting point of a connection door. `connection` is an index between 0 and the return value of [region\_get\_connections\_count](#class-navigationserver-method-region-get-connections-count). ### [int](class_int#class-int) region\_get\_connections\_count ( [RID](class_rid#class-rid) region ) const Returns how many connections this `region` has with other regions in the map. ### [float](class_float#class-float) region\_get\_enter\_cost ( [RID](class_rid#class-rid) region ) const Returns the `enter_cost` of this `region`. ### [RID](class_rid#class-rid) region\_get\_map ( [RID](class_rid#class-rid) region ) const Returns the navigation map [RID](class_rid#class-rid) the requested `region` is currently assigned to. ### [int](class_int#class-int) region\_get\_navigation\_layers ( [RID](class_rid#class-rid) region ) const Returns the region's navigation layers. ### [float](class_float#class-float) region\_get\_travel\_cost ( [RID](class_rid#class-rid) region ) const Returns the `travel_cost` of this `region`. ### [bool](class_bool#class-bool) region\_owns\_point ( [RID](class_rid#class-rid) region, [Vector3](class_vector3#class-vector3) point ) const Returns `true` if the provided `point` in world space is currently owned by the provided navigation `region`. Owned in this context means that one of the region's navigation mesh polygon faces has a possible position at the closest distance to this point compared to all other navigation meshes from other navigation regions that are also registered on the navigation map of the provided region. If multiple navigation meshes have positions at equal distance the navigation region whose polygons are processed first wins the ownership. Polygons are processed in the same order that navigation regions were registered on the NavigationServer. **Note:** If navigation meshes from different navigation regions overlap (which should be avoided in general) the result might not be what is expected. ### void region\_set\_enter\_cost ( [RID](class_rid#class-rid) region, [float](class_float#class-float) enter\_cost ) const Sets the `enter_cost` for this `region`. ### void region\_set\_map ( [RID](class_rid#class-rid) region, [RID](class_rid#class-rid) map ) const Sets the map for the region. ### void region\_set\_navigation\_layers ( [RID](class_rid#class-rid) region, [int](class_int#class-int) navigation\_layers ) const Set the region's navigation layers. This allows selecting regions from a path request (when using [map\_get\_path](#class-navigationserver-method-map-get-path)). ### void region\_set\_navmesh ( [RID](class_rid#class-rid) region, [NavigationMesh](class_navigationmesh#class-navigationmesh) nav\_mesh ) const Sets the navigation mesh for the region. ### void region\_set\_transform ( [RID](class_rid#class-rid) region, [Transform](class_transform#class-transform) transform ) const Sets the global transformation for the region. ### void region\_set\_travel\_cost ( [RID](class_rid#class-rid) region, [float](class_float#class-float) travel\_cost ) const Sets the `travel_cost` for this `region`. ### void set\_active ( [bool](class_bool#class-bool) active ) const Control activation of this server.
programming_docs
godot VisualShaderNodeInput VisualShaderNodeInput ===================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Description ----------- Gives access to input variables (built-ins) available for the shader. See the shading reference for the list of available built-ins for each shader type (check `Tutorials` section for link). Tutorials --------- * [Shading reference](https://docs.godotengine.org/en/3.5/tutorials/shaders/shader_reference/index.html) Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [input\_name](#class-visualshadernodeinput-property-input-name) | `"[None]"` | Methods ------- | | | | --- | --- | | [String](class_string#class-string) | [get\_input\_real\_name](#class-visualshadernodeinput-method-get-input-real-name) **(** **)** const | Signals ------- ### input\_type\_changed ( ) Property Descriptions --------------------- ### [String](class_string#class-string) input\_name | | | | --- | --- | | *Default* | `"[None]"` | | *Setter* | set\_input\_name(value) | | *Getter* | get\_input\_name() | One of the several input constants in lower-case style like: "vertex"(`VERTEX`) or "point\_size"(`POINT_SIZE`). Method Descriptions ------------------- ### [String](class_string#class-string) get\_input\_real\_name ( ) const godot InputEventMagnifyGesture InputEventMagnifyGesture ======================== **Inherits:** [InputEventGesture](class_inputeventgesture#class-inputeventgesture) **<** [InputEventWithModifiers](class_inputeventwithmodifiers#class-inputeventwithmodifiers) **<** [InputEvent](class_inputevent#class-inputevent) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [factor](#class-inputeventmagnifygesture-property-factor) | `1.0` | Property Descriptions --------------------- ### [float](class_float#class-float) factor | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_factor(value) | | *Getter* | get\_factor() | godot CapsuleShape2D CapsuleShape2D ============== **Inherits:** [Shape2D](class_shape2d#class-shape2d) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Capsule shape for 2D collisions. Description ----------- Capsule shape for 2D collisions. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [height](#class-capsuleshape2d-property-height) | `20.0` | | [float](class_float#class-float) | [radius](#class-capsuleshape2d-property-radius) | `10.0` | Property Descriptions --------------------- ### [float](class_float#class-float) height | | | | --- | --- | | *Default* | `20.0` | | *Setter* | set\_height(value) | | *Getter* | get\_height() | The capsule's height. ### [float](class_float#class-float) radius | | | | --- | --- | | *Default* | `10.0` | | *Setter* | set\_radius(value) | | *Getter* | get\_radius() | The capsule's radius. godot AudioEffectCompressor AudioEffectCompressor ===================== **Inherits:** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Adds a compressor audio effect to an audio bus. Reduces sounds that exceed a certain threshold level, smooths out the dynamics and increases the overall volume. Description ----------- Dynamic range compressor reduces the level of the sound when the amplitude goes over a certain threshold in Decibels. One of the main uses of a compressor is to increase the dynamic range by clipping as little as possible (when sound goes over 0dB). Compressor has many uses in the mix: * In the Master bus to compress the whole output (although an [AudioEffectLimiter](class_audioeffectlimiter#class-audioeffectlimiter) is probably better). * In voice channels to ensure they sound as balanced as possible. * Sidechained. This can reduce the sound level sidechained with another audio bus for threshold detection. This technique is common in video game mixing to the level of music and SFX while voices are being heard. * Accentuates transients by using a wider attack, making effects sound more punchy. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [attack\_us](#class-audioeffectcompressor-property-attack-us) | `20.0` | | [float](class_float#class-float) | [gain](#class-audioeffectcompressor-property-gain) | `0.0` | | [float](class_float#class-float) | [mix](#class-audioeffectcompressor-property-mix) | `1.0` | | [float](class_float#class-float) | [ratio](#class-audioeffectcompressor-property-ratio) | `4.0` | | [float](class_float#class-float) | [release\_ms](#class-audioeffectcompressor-property-release-ms) | `250.0` | | [String](class_string#class-string) | [sidechain](#class-audioeffectcompressor-property-sidechain) | `""` | | [float](class_float#class-float) | [threshold](#class-audioeffectcompressor-property-threshold) | `0.0` | Property Descriptions --------------------- ### [float](class_float#class-float) attack\_us | | | | --- | --- | | *Default* | `20.0` | | *Setter* | set\_attack\_us(value) | | *Getter* | get\_attack\_us() | Compressor's reaction time when the signal exceeds the threshold, in microseconds. Value can range from 20 to 2000. ### [float](class_float#class-float) gain | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_gain(value) | | *Getter* | get\_gain() | Gain applied to the output signal. ### [float](class_float#class-float) mix | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_mix(value) | | *Getter* | get\_mix() | Balance between original signal and effect signal. Value can range from 0 (totally dry) to 1 (totally wet). ### [float](class_float#class-float) ratio | | | | --- | --- | | *Default* | `4.0` | | *Setter* | set\_ratio(value) | | *Getter* | get\_ratio() | Amount of compression applied to the audio once it passes the threshold level. The higher the ratio, the more the loud parts of the audio will be compressed. Value can range from 1 to 48. ### [float](class_float#class-float) release\_ms | | | | --- | --- | | *Default* | `250.0` | | *Setter* | set\_release\_ms(value) | | *Getter* | get\_release\_ms() | Compressor's delay time to stop reducing the signal after the signal level falls below the threshold, in milliseconds. Value can range from 20 to 2000. ### [String](class_string#class-string) sidechain | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_sidechain(value) | | *Getter* | get\_sidechain() | Reduce the sound level using another audio bus for threshold detection. ### [float](class_float#class-float) threshold | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_threshold(value) | | *Getter* | get\_threshold() | The level above which compression is applied to the audio. Value can range from -60 to 0. godot CPUParticles2D CPUParticles2D ============== **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) CPU-based 2D particle emitter. Description ----------- CPU-based 2D particle node used to create a variety of particle systems and effects. See also [Particles2D](class_particles2d#class-particles2d), which provides the same functionality with hardware acceleration, but may not run on older devices. **Note:** Unlike [Particles2D](class_particles2d#class-particles2d), the visibility rect is generated on-the-fly and doesn't need to be configured by the user. Tutorials --------- * [Particle systems (2D)](https://docs.godotengine.org/en/3.5/tutorials/2d/particle_systems_2d.html) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [amount](#class-cpuparticles2d-property-amount) | `8` | | [float](class_float#class-float) | [angle](#class-cpuparticles2d-property-angle) | `0.0` | | [Curve](class_curve#class-curve) | [angle\_curve](#class-cpuparticles2d-property-angle-curve) | | | [float](class_float#class-float) | [angle\_random](#class-cpuparticles2d-property-angle-random) | `0.0` | | [float](class_float#class-float) | [angular\_velocity](#class-cpuparticles2d-property-angular-velocity) | `0.0` | | [Curve](class_curve#class-curve) | [angular\_velocity\_curve](#class-cpuparticles2d-property-angular-velocity-curve) | | | [float](class_float#class-float) | [angular\_velocity\_random](#class-cpuparticles2d-property-angular-velocity-random) | `0.0` | | [float](class_float#class-float) | [anim\_offset](#class-cpuparticles2d-property-anim-offset) | `0.0` | | [Curve](class_curve#class-curve) | [anim\_offset\_curve](#class-cpuparticles2d-property-anim-offset-curve) | | | [float](class_float#class-float) | [anim\_offset\_random](#class-cpuparticles2d-property-anim-offset-random) | `0.0` | | [float](class_float#class-float) | [anim\_speed](#class-cpuparticles2d-property-anim-speed) | `0.0` | | [Curve](class_curve#class-curve) | [anim\_speed\_curve](#class-cpuparticles2d-property-anim-speed-curve) | | | [float](class_float#class-float) | [anim\_speed\_random](#class-cpuparticles2d-property-anim-speed-random) | `0.0` | | [Color](class_color#class-color) | [color](#class-cpuparticles2d-property-color) | `Color( 1, 1, 1, 1 )` | | [Gradient](class_gradient#class-gradient) | [color\_initial\_ramp](#class-cpuparticles2d-property-color-initial-ramp) | | | [Gradient](class_gradient#class-gradient) | [color\_ramp](#class-cpuparticles2d-property-color-ramp) | | | [float](class_float#class-float) | [damping](#class-cpuparticles2d-property-damping) | `0.0` | | [Curve](class_curve#class-curve) | [damping\_curve](#class-cpuparticles2d-property-damping-curve) | | | [float](class_float#class-float) | [damping\_random](#class-cpuparticles2d-property-damping-random) | `0.0` | | [Vector2](class_vector2#class-vector2) | [direction](#class-cpuparticles2d-property-direction) | `Vector2( 1, 0 )` | | [DrawOrder](#enum-cpuparticles2d-draworder) | [draw\_order](#class-cpuparticles2d-property-draw-order) | `0` | | [PoolColorArray](class_poolcolorarray#class-poolcolorarray) | [emission\_colors](#class-cpuparticles2d-property-emission-colors) | | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [emission\_normals](#class-cpuparticles2d-property-emission-normals) | | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [emission\_points](#class-cpuparticles2d-property-emission-points) | | | [Vector2](class_vector2#class-vector2) | [emission\_rect\_extents](#class-cpuparticles2d-property-emission-rect-extents) | | | [EmissionShape](#enum-cpuparticles2d-emissionshape) | [emission\_shape](#class-cpuparticles2d-property-emission-shape) | `0` | | [float](class_float#class-float) | [emission\_sphere\_radius](#class-cpuparticles2d-property-emission-sphere-radius) | | | [bool](class_bool#class-bool) | [emitting](#class-cpuparticles2d-property-emitting) | `true` | | [float](class_float#class-float) | [explosiveness](#class-cpuparticles2d-property-explosiveness) | `0.0` | | [int](class_int#class-int) | [fixed\_fps](#class-cpuparticles2d-property-fixed-fps) | `0` | | [bool](class_bool#class-bool) | [flag\_align\_y](#class-cpuparticles2d-property-flag-align-y) | `false` | | [bool](class_bool#class-bool) | [fract\_delta](#class-cpuparticles2d-property-fract-delta) | `true` | | [Vector2](class_vector2#class-vector2) | [gravity](#class-cpuparticles2d-property-gravity) | `Vector2( 0, 98 )` | | [float](class_float#class-float) | [hue\_variation](#class-cpuparticles2d-property-hue-variation) | `0.0` | | [Curve](class_curve#class-curve) | [hue\_variation\_curve](#class-cpuparticles2d-property-hue-variation-curve) | | | [float](class_float#class-float) | [hue\_variation\_random](#class-cpuparticles2d-property-hue-variation-random) | `0.0` | | [float](class_float#class-float) | [initial\_velocity](#class-cpuparticles2d-property-initial-velocity) | `0.0` | | [float](class_float#class-float) | [initial\_velocity\_random](#class-cpuparticles2d-property-initial-velocity-random) | `0.0` | | [float](class_float#class-float) | [lifetime](#class-cpuparticles2d-property-lifetime) | `1.0` | | [float](class_float#class-float) | [lifetime\_randomness](#class-cpuparticles2d-property-lifetime-randomness) | `0.0` | | [float](class_float#class-float) | [linear\_accel](#class-cpuparticles2d-property-linear-accel) | `0.0` | | [Curve](class_curve#class-curve) | [linear\_accel\_curve](#class-cpuparticles2d-property-linear-accel-curve) | | | [float](class_float#class-float) | [linear\_accel\_random](#class-cpuparticles2d-property-linear-accel-random) | `0.0` | | [bool](class_bool#class-bool) | [local\_coords](#class-cpuparticles2d-property-local-coords) | `true` | | [Texture](class_texture#class-texture) | [normalmap](#class-cpuparticles2d-property-normalmap) | | | [bool](class_bool#class-bool) | [one\_shot](#class-cpuparticles2d-property-one-shot) | `false` | | [float](class_float#class-float) | [orbit\_velocity](#class-cpuparticles2d-property-orbit-velocity) | `0.0` | | [Curve](class_curve#class-curve) | [orbit\_velocity\_curve](#class-cpuparticles2d-property-orbit-velocity-curve) | | | [float](class_float#class-float) | [orbit\_velocity\_random](#class-cpuparticles2d-property-orbit-velocity-random) | `0.0` | | [float](class_float#class-float) | [preprocess](#class-cpuparticles2d-property-preprocess) | `0.0` | | [float](class_float#class-float) | [radial\_accel](#class-cpuparticles2d-property-radial-accel) | `0.0` | | [Curve](class_curve#class-curve) | [radial\_accel\_curve](#class-cpuparticles2d-property-radial-accel-curve) | | | [float](class_float#class-float) | [radial\_accel\_random](#class-cpuparticles2d-property-radial-accel-random) | `0.0` | | [float](class_float#class-float) | [randomness](#class-cpuparticles2d-property-randomness) | `0.0` | | [float](class_float#class-float) | [scale\_amount](#class-cpuparticles2d-property-scale-amount) | `1.0` | | [Curve](class_curve#class-curve) | [scale\_amount\_curve](#class-cpuparticles2d-property-scale-amount-curve) | | | [float](class_float#class-float) | [scale\_amount\_random](#class-cpuparticles2d-property-scale-amount-random) | `0.0` | | [float](class_float#class-float) | [speed\_scale](#class-cpuparticles2d-property-speed-scale) | `1.0` | | [float](class_float#class-float) | [spread](#class-cpuparticles2d-property-spread) | `45.0` | | [float](class_float#class-float) | [tangential\_accel](#class-cpuparticles2d-property-tangential-accel) | `0.0` | | [Curve](class_curve#class-curve) | [tangential\_accel\_curve](#class-cpuparticles2d-property-tangential-accel-curve) | | | [float](class_float#class-float) | [tangential\_accel\_random](#class-cpuparticles2d-property-tangential-accel-random) | `0.0` | | [Texture](class_texture#class-texture) | [texture](#class-cpuparticles2d-property-texture) | | Methods ------- | | | | --- | --- | | void | [convert\_from\_particles](#class-cpuparticles2d-method-convert-from-particles) **(** [Node](class_node#class-node) particles **)** | | [float](class_float#class-float) | [get\_param](#class-cpuparticles2d-method-get-param) **(** [Parameter](#enum-cpuparticles2d-parameter) param **)** const | | [Curve](class_curve#class-curve) | [get\_param\_curve](#class-cpuparticles2d-method-get-param-curve) **(** [Parameter](#enum-cpuparticles2d-parameter) param **)** const | | [float](class_float#class-float) | [get\_param\_randomness](#class-cpuparticles2d-method-get-param-randomness) **(** [Parameter](#enum-cpuparticles2d-parameter) param **)** const | | [bool](class_bool#class-bool) | [get\_particle\_flag](#class-cpuparticles2d-method-get-particle-flag) **(** [Flags](#enum-cpuparticles2d-flags) flag **)** const | | void | [restart](#class-cpuparticles2d-method-restart) **(** **)** | | void | [set\_param](#class-cpuparticles2d-method-set-param) **(** [Parameter](#enum-cpuparticles2d-parameter) param, [float](class_float#class-float) value **)** | | void | [set\_param\_curve](#class-cpuparticles2d-method-set-param-curve) **(** [Parameter](#enum-cpuparticles2d-parameter) param, [Curve](class_curve#class-curve) curve **)** | | void | [set\_param\_randomness](#class-cpuparticles2d-method-set-param-randomness) **(** [Parameter](#enum-cpuparticles2d-parameter) param, [float](class_float#class-float) randomness **)** | | void | [set\_particle\_flag](#class-cpuparticles2d-method-set-particle-flag) **(** [Flags](#enum-cpuparticles2d-flags) flag, [bool](class_bool#class-bool) enable **)** | Enumerations ------------ enum **DrawOrder**: * **DRAW\_ORDER\_INDEX** = **0** --- Particles are drawn in the order emitted. * **DRAW\_ORDER\_LIFETIME** = **1** --- Particles are drawn in order of remaining lifetime. enum **Parameter**: * **PARAM\_INITIAL\_LINEAR\_VELOCITY** = **0** --- Use with [set\_param](#class-cpuparticles2d-method-set-param), [set\_param\_randomness](#class-cpuparticles2d-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles2d-method-set-param-curve) to set initial velocity properties. * **PARAM\_ANGULAR\_VELOCITY** = **1** --- Use with [set\_param](#class-cpuparticles2d-method-set-param), [set\_param\_randomness](#class-cpuparticles2d-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles2d-method-set-param-curve) to set angular velocity properties. * **PARAM\_ORBIT\_VELOCITY** = **2** --- Use with [set\_param](#class-cpuparticles2d-method-set-param), [set\_param\_randomness](#class-cpuparticles2d-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles2d-method-set-param-curve) to set orbital velocity properties. * **PARAM\_LINEAR\_ACCEL** = **3** --- Use with [set\_param](#class-cpuparticles2d-method-set-param), [set\_param\_randomness](#class-cpuparticles2d-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles2d-method-set-param-curve) to set linear acceleration properties. * **PARAM\_RADIAL\_ACCEL** = **4** --- Use with [set\_param](#class-cpuparticles2d-method-set-param), [set\_param\_randomness](#class-cpuparticles2d-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles2d-method-set-param-curve) to set radial acceleration properties. * **PARAM\_TANGENTIAL\_ACCEL** = **5** --- Use with [set\_param](#class-cpuparticles2d-method-set-param), [set\_param\_randomness](#class-cpuparticles2d-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles2d-method-set-param-curve) to set tangential acceleration properties. * **PARAM\_DAMPING** = **6** --- Use with [set\_param](#class-cpuparticles2d-method-set-param), [set\_param\_randomness](#class-cpuparticles2d-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles2d-method-set-param-curve) to set damping properties. * **PARAM\_ANGLE** = **7** --- Use with [set\_param](#class-cpuparticles2d-method-set-param), [set\_param\_randomness](#class-cpuparticles2d-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles2d-method-set-param-curve) to set angle properties. * **PARAM\_SCALE** = **8** --- Use with [set\_param](#class-cpuparticles2d-method-set-param), [set\_param\_randomness](#class-cpuparticles2d-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles2d-method-set-param-curve) to set scale properties. * **PARAM\_HUE\_VARIATION** = **9** --- Use with [set\_param](#class-cpuparticles2d-method-set-param), [set\_param\_randomness](#class-cpuparticles2d-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles2d-method-set-param-curve) to set hue variation properties. * **PARAM\_ANIM\_SPEED** = **10** --- Use with [set\_param](#class-cpuparticles2d-method-set-param), [set\_param\_randomness](#class-cpuparticles2d-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles2d-method-set-param-curve) to set animation speed properties. * **PARAM\_ANIM\_OFFSET** = **11** --- Use with [set\_param](#class-cpuparticles2d-method-set-param), [set\_param\_randomness](#class-cpuparticles2d-method-set-param-randomness), and [set\_param\_curve](#class-cpuparticles2d-method-set-param-curve) to set animation offset properties. * **PARAM\_MAX** = **12** --- Represents the size of the [Parameter](#enum-cpuparticles2d-parameter) enum. enum **Flags**: * **FLAG\_ALIGN\_Y\_TO\_VELOCITY** = **0** --- Use with [set\_particle\_flag](#class-cpuparticles2d-method-set-particle-flag) to set [flag\_align\_y](#class-cpuparticles2d-property-flag-align-y). * **FLAG\_ROTATE\_Y** = **1** --- Present for consistency with 3D particle nodes, not used in 2D. * **FLAG\_DISABLE\_Z** = **2** --- Present for consistency with 3D particle nodes, not used in 2D. * **FLAG\_MAX** = **3** --- Represents the size of the [Flags](#enum-cpuparticles2d-flags) enum. enum **EmissionShape**: * **EMISSION\_SHAPE\_POINT** = **0** --- All particles will be emitted from a single point. * **EMISSION\_SHAPE\_SPHERE** = **1** --- Particles will be emitted on the surface of a sphere flattened to two dimensions. * **EMISSION\_SHAPE\_RECTANGLE** = **2** --- Particles will be emitted in the area of a rectangle. * **EMISSION\_SHAPE\_POINTS** = **3** --- Particles will be emitted at a position chosen randomly among [emission\_points](#class-cpuparticles2d-property-emission-points). Particle color will be modulated by [emission\_colors](#class-cpuparticles2d-property-emission-colors). * **EMISSION\_SHAPE\_DIRECTED\_POINTS** = **4** --- Particles will be emitted at a position chosen randomly among [emission\_points](#class-cpuparticles2d-property-emission-points). Particle velocity and rotation will be set based on [emission\_normals](#class-cpuparticles2d-property-emission-normals). Particle color will be modulated by [emission\_colors](#class-cpuparticles2d-property-emission-colors). * **EMISSION\_SHAPE\_MAX** = **5** --- Represents the size of the [EmissionShape](#enum-cpuparticles2d-emissionshape) enum. Property Descriptions --------------------- ### [int](class_int#class-int) amount | | | | --- | --- | | *Default* | `8` | | *Setter* | set\_amount(value) | | *Getter* | get\_amount() | The number of particles emitted in one emission cycle (corresponding to the [lifetime](#class-cpuparticles2d-property-lifetime)). **Note:** Changing [amount](#class-cpuparticles2d-property-amount) will reset the particle emission, therefore removing all particles that were already emitted before changing [amount](#class-cpuparticles2d-property-amount). ### [float](class_float#class-float) angle | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial rotation applied to each particle, in degrees. ### [Curve](class_curve#class-curve) angle\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's rotation will be animated along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) angle\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Rotation randomness ratio. ### [float](class_float#class-float) angular\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial angular velocity applied to each particle in *degrees* per second. Sets the speed of rotation of the particle. ### [Curve](class_curve#class-curve) angular\_velocity\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's angular velocity will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) angular\_velocity\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Angular velocity randomness ratio. ### [float](class_float#class-float) anim\_offset | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Particle animation offset. ### [Curve](class_curve#class-curve) anim\_offset\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's animation offset will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) anim\_offset\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Animation offset randomness ratio. ### [float](class_float#class-float) anim\_speed | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Particle animation speed. ### [Curve](class_curve#class-curve) anim\_speed\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's animation speed will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) anim\_speed\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Animation speed randomness ratio. ### [Color](class_color#class-color) color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_color(value) | | *Getter* | get\_color() | Each particle's initial color. If [texture](#class-cpuparticles2d-property-texture) is defined, it will be multiplied by this color. ### [Gradient](class_gradient#class-gradient) color\_initial\_ramp | | | | --- | --- | | *Setter* | set\_color\_initial\_ramp(value) | | *Getter* | get\_color\_initial\_ramp() | Each particle's initial color will vary along this [GradientTexture](class_gradienttexture#class-gradienttexture) (multiplied with [color](#class-cpuparticles2d-property-color)). ### [Gradient](class_gradient#class-gradient) color\_ramp | | | | --- | --- | | *Setter* | set\_color\_ramp(value) | | *Getter* | get\_color\_ramp() | Each particle's color will vary along this [Gradient](class_gradient#class-gradient) (multiplied with [color](#class-cpuparticles2d-property-color)). ### [float](class_float#class-float) damping | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The rate at which particles lose velocity. ### [Curve](class_curve#class-curve) damping\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Damping will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) damping\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Damping randomness ratio. ### [Vector2](class_vector2#class-vector2) direction | | | | --- | --- | | *Default* | `Vector2( 1, 0 )` | | *Setter* | set\_direction(value) | | *Getter* | get\_direction() | Unit vector specifying the particles' emission direction. ### [DrawOrder](#enum-cpuparticles2d-draworder) draw\_order | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_draw\_order(value) | | *Getter* | get\_draw\_order() | Particle draw order. Uses [DrawOrder](#enum-cpuparticles2d-draworder) values. ### [PoolColorArray](class_poolcolorarray#class-poolcolorarray) emission\_colors | | | | --- | --- | | *Setter* | set\_emission\_colors(value) | | *Getter* | get\_emission\_colors() | Sets the [Color](class_color#class-color)s to modulate particles by when using [EMISSION\_SHAPE\_POINTS](#class-cpuparticles2d-constant-emission-shape-points) or [EMISSION\_SHAPE\_DIRECTED\_POINTS](#class-cpuparticles2d-constant-emission-shape-directed-points). ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) emission\_normals | | | | --- | --- | | *Setter* | set\_emission\_normals(value) | | *Getter* | get\_emission\_normals() | Sets the direction the particles will be emitted in when using [EMISSION\_SHAPE\_DIRECTED\_POINTS](#class-cpuparticles2d-constant-emission-shape-directed-points). ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) emission\_points | | | | --- | --- | | *Setter* | set\_emission\_points(value) | | *Getter* | get\_emission\_points() | Sets the initial positions to spawn particles when using [EMISSION\_SHAPE\_POINTS](#class-cpuparticles2d-constant-emission-shape-points) or [EMISSION\_SHAPE\_DIRECTED\_POINTS](#class-cpuparticles2d-constant-emission-shape-directed-points). ### [Vector2](class_vector2#class-vector2) emission\_rect\_extents | | | | --- | --- | | *Setter* | set\_emission\_rect\_extents(value) | | *Getter* | get\_emission\_rect\_extents() | The rectangle's extents if [emission\_shape](#class-cpuparticles2d-property-emission-shape) is set to [EMISSION\_SHAPE\_RECTANGLE](#class-cpuparticles2d-constant-emission-shape-rectangle). ### [EmissionShape](#enum-cpuparticles2d-emissionshape) emission\_shape | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_emission\_shape(value) | | *Getter* | get\_emission\_shape() | Particles will be emitted inside this region. See [EmissionShape](#enum-cpuparticles2d-emissionshape) for possible values. ### [float](class_float#class-float) emission\_sphere\_radius | | | | --- | --- | | *Setter* | set\_emission\_sphere\_radius(value) | | *Getter* | get\_emission\_sphere\_radius() | The sphere's radius if [emission\_shape](#class-cpuparticles2d-property-emission-shape) is set to [EMISSION\_SHAPE\_SPHERE](#class-cpuparticles2d-constant-emission-shape-sphere). ### [bool](class_bool#class-bool) emitting | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_emitting(value) | | *Getter* | is\_emitting() | If `true`, particles are being emitted. ### [float](class_float#class-float) explosiveness | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_explosiveness\_ratio(value) | | *Getter* | get\_explosiveness\_ratio() | How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins. ### [int](class_int#class-int) fixed\_fps | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_fixed\_fps(value) | | *Getter* | get\_fixed\_fps() | The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. ### [bool](class_bool#class-bool) flag\_align\_y | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_particle\_flag(value) | | *Getter* | get\_particle\_flag() | Align Y axis of particle with the direction of its velocity. ### [bool](class_bool#class-bool) fract\_delta | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_fractional\_delta(value) | | *Getter* | get\_fractional\_delta() | If `true`, results in fractional delta calculation which has a smoother particles display effect. ### [Vector2](class_vector2#class-vector2) gravity | | | | --- | --- | | *Default* | `Vector2( 0, 98 )` | | *Setter* | set\_gravity(value) | | *Getter* | get\_gravity() | Gravity applied to every particle. ### [float](class_float#class-float) hue\_variation | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial hue variation applied to each particle. ### [Curve](class_curve#class-curve) hue\_variation\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's hue will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) hue\_variation\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Hue variation randomness ratio. ### [float](class_float#class-float) initial\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial velocity magnitude for each particle. Direction comes from [spread](#class-cpuparticles2d-property-spread) and the node's orientation. ### [float](class_float#class-float) initial\_velocity\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Initial velocity randomness ratio. ### [float](class_float#class-float) lifetime | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_lifetime(value) | | *Getter* | get\_lifetime() | The amount of time each particle will exist (in seconds). ### [float](class_float#class-float) lifetime\_randomness | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_lifetime\_randomness(value) | | *Getter* | get\_lifetime\_randomness() | Particle lifetime randomness ratio. ### [float](class_float#class-float) linear\_accel | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Linear acceleration applied to each particle in the direction of motion. ### [Curve](class_curve#class-curve) linear\_accel\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's linear acceleration will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) linear\_accel\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Linear acceleration randomness ratio. ### [bool](class_bool#class-bool) local\_coords | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_use\_local\_coordinates(value) | | *Getter* | get\_use\_local\_coordinates() | If `true`, particles use the parent node's coordinate space. If `false`, they use global coordinates. ### [Texture](class_texture#class-texture) normalmap | | | | --- | --- | | *Setter* | set\_normalmap(value) | | *Getter* | get\_normalmap() | Normal map to be used for the [texture](#class-cpuparticles2d-property-texture) property. **Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See [this page](http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates) for a comparison of normal map coordinates expected by popular engines. ### [bool](class_bool#class-bool) one\_shot | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_one\_shot(value) | | *Getter* | get\_one\_shot() | If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end. ### [float](class_float#class-float) orbit\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. ### [Curve](class_curve#class-curve) orbit\_velocity\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's orbital velocity will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) orbit\_velocity\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Orbital velocity randomness ratio. ### [float](class_float#class-float) preprocess | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_pre\_process\_time(value) | | *Getter* | get\_pre\_process\_time() | Particle system starts as if it had already run for this many seconds. ### [float](class_float#class-float) radial\_accel | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Radial acceleration applied to each particle. Makes particle accelerate away from origin. ### [Curve](class_curve#class-curve) radial\_accel\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's radial acceleration will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) radial\_accel\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Radial acceleration randomness ratio. ### [float](class_float#class-float) randomness | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_randomness\_ratio(value) | | *Getter* | get\_randomness\_ratio() | Emission lifetime randomness ratio. ### [float](class_float#class-float) scale\_amount | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial scale applied to each particle. ### [Curve](class_curve#class-curve) scale\_amount\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's scale will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) scale\_amount\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Scale randomness ratio. ### [float](class_float#class-float) speed\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_speed\_scale(value) | | *Getter* | get\_speed\_scale() | Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles. ### [float](class_float#class-float) spread | | | | --- | --- | | *Default* | `45.0` | | *Setter* | set\_spread(value) | | *Getter* | get\_spread() | Each particle's initial direction range from `+spread` to `-spread` degrees. ### [float](class_float#class-float) tangential\_accel | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. ### [Curve](class_curve#class-curve) tangential\_accel\_curve | | | | --- | --- | | *Setter* | set\_param\_curve(value) | | *Getter* | get\_param\_curve() | Each particle's tangential acceleration will vary along this [Curve](class_curve#class-curve). ### [float](class_float#class-float) tangential\_accel\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Tangential acceleration randomness ratio. ### [Texture](class_texture#class-texture) texture | | | | --- | --- | | *Setter* | set\_texture(value) | | *Getter* | get\_texture() | Particle texture. If `null`, particles will be squares. Method Descriptions ------------------- ### void convert\_from\_particles ( [Node](class_node#class-node) particles ) Sets this node's properties to match a given [Particles2D](class_particles2d#class-particles2d) node with an assigned [ParticlesMaterial](class_particlesmaterial#class-particlesmaterial). ### [float](class_float#class-float) get\_param ( [Parameter](#enum-cpuparticles2d-parameter) param ) const Returns the base value of the parameter specified by [Parameter](#enum-cpuparticles2d-parameter). ### [Curve](class_curve#class-curve) get\_param\_curve ( [Parameter](#enum-cpuparticles2d-parameter) param ) const Returns the [Curve](class_curve#class-curve) of the parameter specified by [Parameter](#enum-cpuparticles2d-parameter). ### [float](class_float#class-float) get\_param\_randomness ( [Parameter](#enum-cpuparticles2d-parameter) param ) const Returns the randomness factor of the parameter specified by [Parameter](#enum-cpuparticles2d-parameter). ### [bool](class_bool#class-bool) get\_particle\_flag ( [Flags](#enum-cpuparticles2d-flags) flag ) const Returns the enabled state of the given flag (see [Flags](#enum-cpuparticles2d-flags) for options). ### void restart ( ) Restarts the particle emitter. ### void set\_param ( [Parameter](#enum-cpuparticles2d-parameter) param, [float](class_float#class-float) value ) Sets the base value of the parameter specified by [Parameter](#enum-cpuparticles2d-parameter). ### void set\_param\_curve ( [Parameter](#enum-cpuparticles2d-parameter) param, [Curve](class_curve#class-curve) curve ) Sets the [Curve](class_curve#class-curve) of the parameter specified by [Parameter](#enum-cpuparticles2d-parameter). ### void set\_param\_randomness ( [Parameter](#enum-cpuparticles2d-parameter) param, [float](class_float#class-float) randomness ) Sets the randomness factor of the parameter specified by [Parameter](#enum-cpuparticles2d-parameter). ### void set\_particle\_flag ( [Flags](#enum-cpuparticles2d-flags) flag, [bool](class_bool#class-bool) enable ) Enables or disables the given flag (see [Flags](#enum-cpuparticles2d-flags) for options).
programming_docs
godot WebSocketClient WebSocketClient =============== **Inherits:** [WebSocketMultiplayerPeer](class_websocketmultiplayerpeer#class-websocketmultiplayerpeer) **<** [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer) **<** [PacketPeer](class_packetpeer#class-packetpeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A WebSocket client implementation. Description ----------- This class implements a WebSocket client compatible with any RFC 6455-compliant WebSocket server. This client can be optionally used as a network peer for the [MultiplayerAPI](class_multiplayerapi#class-multiplayerapi). After starting the client ([connect\_to\_url](#class-websocketclient-method-connect-to-url)), you will need to [NetworkedMultiplayerPeer.poll](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-method-poll) it at regular intervals (e.g. inside [Node.\_process](class_node#class-node-method-process)). You will receive appropriate signals when connecting, disconnecting, or when new data is available. Properties ---------- | | | | --- | --- | | [X509Certificate](class_x509certificate#class-x509certificate) | [trusted\_ssl\_certificate](#class-websocketclient-property-trusted-ssl-certificate) | | [bool](class_bool#class-bool) | [verify\_ssl](#class-websocketclient-property-verify-ssl) | Methods ------- | | | | --- | --- | | [Error](class_%40globalscope#enum-globalscope-error) | [connect\_to\_url](#class-websocketclient-method-connect-to-url) **(** [String](class_string#class-string) url, [PoolStringArray](class_poolstringarray#class-poolstringarray) protocols=PoolStringArray( ), [bool](class_bool#class-bool) gd\_mp\_api=false, [PoolStringArray](class_poolstringarray#class-poolstringarray) custom\_headers=PoolStringArray( ) **)** | | void | [disconnect\_from\_host](#class-websocketclient-method-disconnect-from-host) **(** [int](class_int#class-int) code=1000, [String](class_string#class-string) reason="" **)** | | [String](class_string#class-string) | [get\_connected\_host](#class-websocketclient-method-get-connected-host) **(** **)** const | | [int](class_int#class-int) | [get\_connected\_port](#class-websocketclient-method-get-connected-port) **(** **)** const | Signals ------- ### connection\_closed ( [bool](class_bool#class-bool) was\_clean\_close ) Emitted when the connection to the server is closed. `was_clean_close` will be `true` if the connection was shutdown cleanly. ### connection\_error ( ) Emitted when the connection to the server fails. ### connection\_established ( [String](class_string#class-string) protocol ) Emitted when a connection with the server is established, `protocol` will contain the sub-protocol agreed with the server. ### data\_received ( ) Emitted when a WebSocket message is received. **Note:** This signal is *not* emitted when used as high-level multiplayer peer. ### server\_close\_request ( [int](class_int#class-int) code, [String](class_string#class-string) reason ) Emitted when the server requests a clean close. You should keep polling until you get a [connection\_closed](#class-websocketclient-signal-connection-closed) signal to achieve the clean close. See [WebSocketPeer.close](class_websocketpeer#class-websocketpeer-method-close) for more details. Property Descriptions --------------------- ### [X509Certificate](class_x509certificate#class-x509certificate) trusted\_ssl\_certificate | | | | --- | --- | | *Setter* | set\_trusted\_ssl\_certificate(value) | | *Getter* | get\_trusted\_ssl\_certificate() | If specified, this [X509Certificate](class_x509certificate#class-x509certificate) will be the only one accepted when connecting to an SSL host. Any other certificate provided by the server will be regarded as invalid. **Note:** Specifying a custom `trusted_ssl_certificate` is not supported in HTML5 exports due to browsers restrictions. ### [bool](class_bool#class-bool) verify\_ssl | | | | --- | --- | | *Setter* | set\_verify\_ssl\_enabled(value) | | *Getter* | is\_verify\_ssl\_enabled() | If `true`, SSL certificate verification is enabled. **Note:** You must specify the certificates to be used in the Project Settings for it to work when exported. Method Descriptions ------------------- ### [Error](class_%40globalscope#enum-globalscope-error) connect\_to\_url ( [String](class_string#class-string) url, [PoolStringArray](class_poolstringarray#class-poolstringarray) protocols=PoolStringArray( ), [bool](class_bool#class-bool) gd\_mp\_api=false, [PoolStringArray](class_poolstringarray#class-poolstringarray) custom\_headers=PoolStringArray( ) ) Connects to the given URL requesting one of the given `protocols` as sub-protocol. If the list empty (default), no sub-protocol will be requested. If `true` is passed as `gd_mp_api`, the client will behave like a network peer for the [MultiplayerAPI](class_multiplayerapi#class-multiplayerapi), connections to non-Godot servers will not work, and [data\_received](#class-websocketclient-signal-data-received) will not be emitted. If `false` is passed instead (default), you must call [PacketPeer](class_packetpeer#class-packetpeer) functions (`put_packet`, `get_packet`, etc.) on the [WebSocketPeer](class_websocketpeer#class-websocketpeer) returned via `get_peer(1)` and not on this object directly (e.g. `get_peer(1).put_packet(data)`). You can optionally pass a list of `custom_headers` to be added to the handshake HTTP request. **Note:** To avoid mixed content warnings or errors in HTML5, you may have to use a `url` that starts with `wss://` (secure) instead of `ws://`. When doing so, make sure to use the fully qualified domain name that matches the one defined in the server's SSL certificate. Do not connect directly via the IP address for `wss://` connections, as it won't match with the SSL certificate. **Note:** Specifying `custom_headers` is not supported in HTML5 exports due to browsers restrictions. ### void disconnect\_from\_host ( [int](class_int#class-int) code=1000, [String](class_string#class-string) reason="" ) Disconnects this client from the connected host. See [WebSocketPeer.close](class_websocketpeer#class-websocketpeer-method-close) for more information. ### [String](class_string#class-string) get\_connected\_host ( ) const Return the IP address of the currently connected host. ### [int](class_int#class-int) get\_connected\_port ( ) const Return the IP port of the currently connected host. godot AudioStream AudioStream =========== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [AudioStreamGenerator](class_audiostreamgenerator#class-audiostreamgenerator), [AudioStreamMP3](class_audiostreammp3#class-audiostreammp3), [AudioStreamMicrophone](class_audiostreammicrophone#class-audiostreammicrophone), [AudioStreamOGGVorbis](class_audiostreamoggvorbis#class-audiostreamoggvorbis), [AudioStreamRandomPitch](class_audiostreamrandompitch#class-audiostreamrandompitch), [AudioStreamSample](class_audiostreamsample#class-audiostreamsample) Base class for audio streams. Description ----------- Base class for audio streams. Audio streams are used for sound effects and music playback, and support WAV (via [AudioStreamSample](class_audiostreamsample#class-audiostreamsample)) and OGG (via [AudioStreamOGGVorbis](class_audiostreamoggvorbis#class-audiostreamoggvorbis)) file formats. Tutorials --------- * [Audio streams](https://docs.godotengine.org/en/3.5/tutorials/audio/audio_streams.html) * [Audio Generator Demo](https://godotengine.org/asset-library/asset/526) * [Audio Mic Record Demo](https://godotengine.org/asset-library/asset/527) * [Audio Spectrum Demo](https://godotengine.org/asset-library/asset/528) Methods ------- | | | | --- | --- | | [float](class_float#class-float) | [get\_length](#class-audiostream-method-get-length) **(** **)** const | Method Descriptions ------------------- ### [float](class_float#class-float) get\_length ( ) const Returns the length of the audio stream in seconds. godot Tweener Tweener ======= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [CallbackTweener](class_callbacktweener#class-callbacktweener), [IntervalTweener](class_intervaltweener#class-intervaltweener), [MethodTweener](class_methodtweener#class-methodtweener), [PropertyTweener](class_propertytweener#class-propertytweener) Abstract class for all Tweeners used by [SceneTreeTween](class_scenetreetween#class-scenetreetween). Description ----------- Tweeners are objects that perform a specific animating task, e.g. interpolating a property or calling a method at a given time. A `Tweener` can't be created manually, you need to use a dedicated method from [SceneTreeTween](class_scenetreetween#class-scenetreetween). Signals ------- ### finished ( ) Emitted when the `Tweener` has just finished its job. godot GDScript GDScript ======== **Inherits:** [Script](class_script#class-script) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A script implemented in the GDScript programming language. Description ----------- A script implemented in the GDScript programming language. The script extends the functionality of all objects that instance it. [new](#class-gdscript-method-new) creates a new instance of the script. [Object.set\_script](class_object#class-object-method-set-script) extends an existing object, if that object's class matches one of the script's base classes. Tutorials --------- * [GDScript](https://docs.godotengine.org/en/3.5/tutorials/scripting/gdscript/index.html) Methods ------- | | | | --- | --- | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [get\_as\_byte\_code](#class-gdscript-method-get-as-byte-code) **(** **)** const | | [Variant](class_variant#class-variant) | [new](#class-gdscript-method-new) **(** ... **)** vararg | Method Descriptions ------------------- ### [PoolByteArray](class_poolbytearray#class-poolbytearray) get\_as\_byte\_code ( ) const Returns byte code for the script source code. ### [Variant](class_variant#class-variant) new ( ... ) vararg Returns a new instance of the script. For example: ``` var MyClass = load("myclass.gd") var instance = MyClass.new() assert(instance.get_script() == MyClass) ``` godot ArrayMesh ArrayMesh ========= **Inherits:** [Mesh](class_mesh#class-mesh) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) [Mesh](class_mesh#class-mesh) type that provides utility for constructing a surface from arrays. Description ----------- The `ArrayMesh` is used to construct a [Mesh](class_mesh#class-mesh) by specifying the attributes as arrays. The most basic example is the creation of a single triangle: ``` var vertices = PoolVector3Array() vertices.push_back(Vector3(0, 1, 0)) vertices.push_back(Vector3(1, 0, 0)) vertices.push_back(Vector3(0, 0, 1)) # Initialize the ArrayMesh. var arr_mesh = ArrayMesh.new() var arrays = [] arrays.resize(ArrayMesh.ARRAY_MAX) arrays[ArrayMesh.ARRAY_VERTEX] = vertices # Create the Mesh. arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays) var m = MeshInstance.new() m.mesh = arr_mesh ``` The [MeshInstance](class_meshinstance#class-meshinstance) is ready to be added to the [SceneTree](class_scenetree#class-scenetree) to be shown. See also [ImmediateGeometry](class_immediategeometry#class-immediategeometry), [MeshDataTool](class_meshdatatool#class-meshdatatool) and [SurfaceTool](class_surfacetool#class-surfacetool) for procedural geometry generation. **Note:** Godot uses clockwise [winding order](https://learnopengl.com/Advanced-OpenGL/Face-culling) for front faces of triangle primitive modes. Tutorials --------- * [Using the ArrayMesh](https://docs.godotengine.org/en/3.5/tutorials/3d/procedural_geometry/arraymesh.html) Properties ---------- | | | | | --- | --- | --- | | [BlendShapeMode](class_mesh#enum-mesh-blendshapemode) | [blend\_shape\_mode](#class-arraymesh-property-blend-shape-mode) | `1` | | [AABB](class_aabb#class-aabb) | [custom\_aabb](#class-arraymesh-property-custom-aabb) | `AABB( 0, 0, 0, 0, 0, 0 )` | Methods ------- | | | | --- | --- | | void | [add\_blend\_shape](#class-arraymesh-method-add-blend-shape) **(** [String](class_string#class-string) name **)** | | void | [add\_surface\_from\_arrays](#class-arraymesh-method-add-surface-from-arrays) **(** [PrimitiveType](class_mesh#enum-mesh-primitivetype) primitive, [Array](class_array#class-array) arrays, [Array](class_array#class-array) blend\_shapes=[ ], [int](class_int#class-int) compress\_flags=2194432 **)** | | void | [clear\_blend\_shapes](#class-arraymesh-method-clear-blend-shapes) **(** **)** | | void | [clear\_surfaces](#class-arraymesh-method-clear-surfaces) **(** **)** | | [int](class_int#class-int) | [get\_blend\_shape\_count](#class-arraymesh-method-get-blend-shape-count) **(** **)** const | | [String](class_string#class-string) | [get\_blend\_shape\_name](#class-arraymesh-method-get-blend-shape-name) **(** [int](class_int#class-int) index **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [lightmap\_unwrap](#class-arraymesh-method-lightmap-unwrap) **(** [Transform](class_transform#class-transform) transform, [float](class_float#class-float) texel\_size **)** | | void | [regen\_normalmaps](#class-arraymesh-method-regen-normalmaps) **(** **)** | | void | [set\_blend\_shape\_name](#class-arraymesh-method-set-blend-shape-name) **(** [int](class_int#class-int) index, [String](class_string#class-string) name **)** | | [int](class_int#class-int) | [surface\_find\_by\_name](#class-arraymesh-method-surface-find-by-name) **(** [String](class_string#class-string) name **)** const | | [int](class_int#class-int) | [surface\_get\_array\_index\_len](#class-arraymesh-method-surface-get-array-index-len) **(** [int](class_int#class-int) surf\_idx **)** const | | [int](class_int#class-int) | [surface\_get\_array\_len](#class-arraymesh-method-surface-get-array-len) **(** [int](class_int#class-int) surf\_idx **)** const | | [int](class_int#class-int) | [surface\_get\_format](#class-arraymesh-method-surface-get-format) **(** [int](class_int#class-int) surf\_idx **)** const | | [String](class_string#class-string) | [surface\_get\_name](#class-arraymesh-method-surface-get-name) **(** [int](class_int#class-int) surf\_idx **)** const | | [PrimitiveType](class_mesh#enum-mesh-primitivetype) | [surface\_get\_primitive\_type](#class-arraymesh-method-surface-get-primitive-type) **(** [int](class_int#class-int) surf\_idx **)** const | | void | [surface\_remove](#class-arraymesh-method-surface-remove) **(** [int](class_int#class-int) surf\_idx **)** | | void | [surface\_set\_name](#class-arraymesh-method-surface-set-name) **(** [int](class_int#class-int) surf\_idx, [String](class_string#class-string) name **)** | | void | [surface\_update\_region](#class-arraymesh-method-surface-update-region) **(** [int](class_int#class-int) surf\_idx, [int](class_int#class-int) offset, [PoolByteArray](class_poolbytearray#class-poolbytearray) data **)** | Enumerations ------------ enum **ArrayType**: * **ARRAY\_VERTEX** = **0** --- [PoolVector3Array](class_poolvector3array#class-poolvector3array), [PoolVector2Array](class_poolvector2array#class-poolvector2array), or [Array](class_array#class-array) of vertex positions. * **ARRAY\_NORMAL** = **1** --- [PoolVector3Array](class_poolvector3array#class-poolvector3array) of vertex normals. * **ARRAY\_TANGENT** = **2** --- [PoolRealArray](class_poolrealarray#class-poolrealarray) of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1. * **ARRAY\_COLOR** = **3** --- [PoolColorArray](class_poolcolorarray#class-poolcolorarray) of vertex colors. * **ARRAY\_TEX\_UV** = **4** --- [PoolVector2Array](class_poolvector2array#class-poolvector2array) for UV coordinates. * **ARRAY\_TEX\_UV2** = **5** --- [PoolVector2Array](class_poolvector2array#class-poolvector2array) for second UV coordinates. * **ARRAY\_BONES** = **6** --- [PoolRealArray](class_poolrealarray#class-poolrealarray) or [PoolIntArray](class_poolintarray#class-poolintarray) of bone indices. Each element in groups of 4 floats. * **ARRAY\_WEIGHTS** = **7** --- [PoolRealArray](class_poolrealarray#class-poolrealarray) of bone weights. Each element in groups of 4 floats. * **ARRAY\_INDEX** = **8** --- [PoolIntArray](class_poolintarray#class-poolintarray) of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the \*i\*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices. For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line. * **ARRAY\_MAX** = **9** --- Represents the size of the [ArrayType](#enum-arraymesh-arraytype) enum. enum **ArrayFormat**: * **ARRAY\_FORMAT\_VERTEX** = **1** --- Array format will include vertices (mandatory). * **ARRAY\_FORMAT\_NORMAL** = **2** --- Array format will include normals. * **ARRAY\_FORMAT\_TANGENT** = **4** --- Array format will include tangents. * **ARRAY\_FORMAT\_COLOR** = **8** --- Array format will include a color array. * **ARRAY\_FORMAT\_TEX\_UV** = **16** --- Array format will include UVs. * **ARRAY\_FORMAT\_TEX\_UV2** = **32** --- Array format will include another set of UVs. * **ARRAY\_FORMAT\_BONES** = **64** --- Array format will include bone indices. * **ARRAY\_FORMAT\_WEIGHTS** = **128** --- Array format will include bone weights. * **ARRAY\_FORMAT\_INDEX** = **256** --- Index array will be used. Constants --------- * **NO\_INDEX\_ARRAY** = **-1** --- Value used internally when no indices are present. * **ARRAY\_WEIGHTS\_SIZE** = **4** --- Amount of weights/bone indices per vertex (always 4). Property Descriptions --------------------- ### [BlendShapeMode](class_mesh#enum-mesh-blendshapemode) blend\_shape\_mode | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_blend\_shape\_mode(value) | | *Getter* | get\_blend\_shape\_mode() | Sets the blend shape mode to one of [BlendShapeMode](class_mesh#enum-mesh-blendshapemode). ### [AABB](class_aabb#class-aabb) custom\_aabb | | | | --- | --- | | *Default* | `AABB( 0, 0, 0, 0, 0, 0 )` | | *Setter* | set\_custom\_aabb(value) | | *Getter* | get\_custom\_aabb() | Overrides the [AABB](class_aabb#class-aabb) with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. Method Descriptions ------------------- ### void add\_blend\_shape ( [String](class_string#class-string) name ) Adds name for a blend shape that will be added with [add\_surface\_from\_arrays](#class-arraymesh-method-add-surface-from-arrays). Must be called before surface is added. ### void add\_surface\_from\_arrays ( [PrimitiveType](class_mesh#enum-mesh-primitivetype) primitive, [Array](class_array#class-array) arrays, [Array](class_array#class-array) blend\_shapes=[ ], [int](class_int#class-int) compress\_flags=2194432 ) Creates a new surface. Surfaces are created to be rendered using a `primitive`, which may be any of the types defined in [PrimitiveType](class_mesh#enum-mesh-primitivetype). (As a note, when using indices, it is recommended to only use points, lines, or triangles.) [Mesh.get\_surface\_count](class_mesh#class-mesh-method-get-surface-count) will become the `surf_idx` for this new surface. The `arrays` argument is an array of arrays. See [ArrayType](#enum-arraymesh-arraytype) for the values used in this array. For example, `arrays[0]` is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for [ARRAY\_INDEX](#class-arraymesh-constant-array-index) if it is used. `compress_flags` is a bitfield made of [ArrayFormat](class_mesh#enum-mesh-arrayformat) values. It defaults to [Mesh.ARRAY\_COMPRESS\_DEFAULT](class_mesh#class-mesh-constant-array-compress-default). **Note:** The default `compress_flags` enable [Mesh.ARRAY\_COMPRESS\_COLOR](class_mesh#class-mesh-constant-array-compress-color), which makes vertex colors stored as 8-bit unsigned integers. This will clamp overbright vertex colors to `Color(1, 1, 1, 1)` and reduce their precision. To store HDR vertex colors, remove the vertex color compression flag by passing `Mesh.ARRAY_COMPRESS_DEFAULT ^ Mesh.ARRAY_COMPRESS_COLOR` as the value of `compress_flags`. ### void clear\_blend\_shapes ( ) Removes all blend shapes from this `ArrayMesh`. ### void clear\_surfaces ( ) Removes all surfaces from this `ArrayMesh`. ### [int](class_int#class-int) get\_blend\_shape\_count ( ) const Returns the number of blend shapes that the `ArrayMesh` holds. ### [String](class_string#class-string) get\_blend\_shape\_name ( [int](class_int#class-int) index ) const Returns the name of the blend shape at this index. ### [Error](class_%40globalscope#enum-globalscope-error) lightmap\_unwrap ( [Transform](class_transform#class-transform) transform, [float](class_float#class-float) texel\_size ) Will perform a UV unwrap on the `ArrayMesh` to prepare the mesh for lightmapping. ### void regen\_normalmaps ( ) Will regenerate normal maps for the `ArrayMesh`. ### void set\_blend\_shape\_name ( [int](class_int#class-int) index, [String](class_string#class-string) name ) ### [int](class_int#class-int) surface\_find\_by\_name ( [String](class_string#class-string) name ) const Returns the index of the first surface with this name held within this `ArrayMesh`. If none are found, -1 is returned. ### [int](class_int#class-int) surface\_get\_array\_index\_len ( [int](class_int#class-int) surf\_idx ) const Returns the length in indices of the index array in the requested surface (see [add\_surface\_from\_arrays](#class-arraymesh-method-add-surface-from-arrays)). ### [int](class_int#class-int) surface\_get\_array\_len ( [int](class_int#class-int) surf\_idx ) const Returns the length in vertices of the vertex array in the requested surface (see [add\_surface\_from\_arrays](#class-arraymesh-method-add-surface-from-arrays)). ### [int](class_int#class-int) surface\_get\_format ( [int](class_int#class-int) surf\_idx ) const Returns the format mask of the requested surface (see [add\_surface\_from\_arrays](#class-arraymesh-method-add-surface-from-arrays)). ### [String](class_string#class-string) surface\_get\_name ( [int](class_int#class-int) surf\_idx ) const Gets the name assigned to this surface. ### [PrimitiveType](class_mesh#enum-mesh-primitivetype) surface\_get\_primitive\_type ( [int](class_int#class-int) surf\_idx ) const Returns the primitive type of the requested surface (see [add\_surface\_from\_arrays](#class-arraymesh-method-add-surface-from-arrays)). ### void surface\_remove ( [int](class_int#class-int) surf\_idx ) Removes a surface at position `surf_idx`, shifting greater surfaces one `surf_idx` slot down. ### void surface\_set\_name ( [int](class_int#class-int) surf\_idx, [String](class_string#class-string) name ) Sets a name for a given surface. ### void surface\_update\_region ( [int](class_int#class-int) surf\_idx, [int](class_int#class-int) offset, [PoolByteArray](class_poolbytearray#class-poolbytearray) data ) Updates a specified region of mesh arrays on the GPU. **Warning:** Only use if you know what you are doing. You can easily cause crashes by calling this function with improper arguments.
programming_docs
godot CSharpScript CSharpScript ============ **Inherits:** [Script](class_script#class-script) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A script implemented in the C# programming language (Mono-enabled builds only). Description ----------- This class represents a C# script. It is the C# equivalent of the [GDScript](class_gdscript#class-gdscript) class and is only available in Mono-enabled Godot builds. See also [GodotSharp](class_godotsharp#class-godotsharp). Tutorials --------- * [C#](https://docs.godotengine.org/en/3.5/tutorials/scripting/c_sharp/index.html) Methods ------- | | | | --- | --- | | [Variant](class_variant#class-variant) | [new](#class-csharpscript-method-new) **(** ... **)** vararg | Method Descriptions ------------------- ### [Variant](class_variant#class-variant) new ( ... ) vararg Returns a new instance of the script. godot Environment Environment =========== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Resource for environment nodes (like [WorldEnvironment](class_worldenvironment#class-worldenvironment)) that define multiple rendering options. Description ----------- Resource for environment nodes (like [WorldEnvironment](class_worldenvironment#class-worldenvironment)) that define multiple environment operations (such as background [Sky](class_sky#class-sky) or [Color](class_color#class-color), ambient light, fog, depth-of-field...). These parameters affect the final render of the scene. The order of these operations is: * Depth of Field Blur * Glow * Tonemap (Auto Exposure) * Adjustments If the target [Viewport](class_viewport#class-viewport) is set to "2D Without Sampling", all post-processing effects will be unavailable. With "3D Without Effects", the following options will be unavailable: * Ssao * Ss Reflections This can be configured for the root Viewport with [ProjectSettings.rendering/quality/intended\_usage/framebuffer\_allocation](class_projectsettings#class-projectsettings-property-rendering-quality-intended-usage-framebuffer-allocation), or for specific Viewports via the [Viewport.usage](class_viewport#class-viewport-property-usage) property. Note that [ProjectSettings.rendering/quality/intended\_usage/framebuffer\_allocation](class_projectsettings#class-projectsettings-property-rendering-quality-intended-usage-framebuffer-allocation) has a mobile platform override to use "3D Without Effects" by default. It improves the performance on mobile devices, but at the same time affects the screen display on mobile devices. Tutorials --------- * [Environment and post-processing](https://docs.godotengine.org/en/3.5/tutorials/3d/environment_and_post_processing.html) * [Light transport in game engines](https://docs.godotengine.org/en/3.5/tutorials/3d/high_dynamic_range.html) * [3D Material Testers Demo](https://godotengine.org/asset-library/asset/123) * [2D HDR Demo](https://godotengine.org/asset-library/asset/110) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [adjustment\_brightness](#class-environment-property-adjustment-brightness) | `1.0` | | [Texture](class_texture#class-texture) | [adjustment\_color\_correction](#class-environment-property-adjustment-color-correction) | | | [float](class_float#class-float) | [adjustment\_contrast](#class-environment-property-adjustment-contrast) | `1.0` | | [bool](class_bool#class-bool) | [adjustment\_enabled](#class-environment-property-adjustment-enabled) | `false` | | [float](class_float#class-float) | [adjustment\_saturation](#class-environment-property-adjustment-saturation) | `1.0` | | [Color](class_color#class-color) | [ambient\_light\_color](#class-environment-property-ambient-light-color) | `Color( 0, 0, 0, 1 )` | | [float](class_float#class-float) | [ambient\_light\_energy](#class-environment-property-ambient-light-energy) | `1.0` | | [float](class_float#class-float) | [ambient\_light\_sky\_contribution](#class-environment-property-ambient-light-sky-contribution) | `1.0` | | [bool](class_bool#class-bool) | [auto\_exposure\_enabled](#class-environment-property-auto-exposure-enabled) | `false` | | [float](class_float#class-float) | [auto\_exposure\_max\_luma](#class-environment-property-auto-exposure-max-luma) | `8.0` | | [float](class_float#class-float) | [auto\_exposure\_min\_luma](#class-environment-property-auto-exposure-min-luma) | `0.05` | | [float](class_float#class-float) | [auto\_exposure\_scale](#class-environment-property-auto-exposure-scale) | `0.4` | | [float](class_float#class-float) | [auto\_exposure\_speed](#class-environment-property-auto-exposure-speed) | `0.5` | | [int](class_int#class-int) | [background\_camera\_feed\_id](#class-environment-property-background-camera-feed-id) | `1` | | [int](class_int#class-int) | [background\_canvas\_max\_layer](#class-environment-property-background-canvas-max-layer) | `0` | | [Color](class_color#class-color) | [background\_color](#class-environment-property-background-color) | `Color( 0, 0, 0, 1 )` | | [float](class_float#class-float) | [background\_energy](#class-environment-property-background-energy) | `1.0` | | [BGMode](#enum-environment-bgmode) | [background\_mode](#class-environment-property-background-mode) | `0` | | [Sky](class_sky#class-sky) | [background\_sky](#class-environment-property-background-sky) | | | [float](class_float#class-float) | [background\_sky\_custom\_fov](#class-environment-property-background-sky-custom-fov) | `0.0` | | [Basis](class_basis#class-basis) | [background\_sky\_orientation](#class-environment-property-background-sky-orientation) | `Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )` | | [Vector3](class_vector3#class-vector3) | [background\_sky\_rotation](#class-environment-property-background-sky-rotation) | `Vector3( 0, 0, 0 )` | | [Vector3](class_vector3#class-vector3) | [background\_sky\_rotation\_degrees](#class-environment-property-background-sky-rotation-degrees) | `Vector3( 0, 0, 0 )` | | [float](class_float#class-float) | [dof\_blur\_far\_amount](#class-environment-property-dof-blur-far-amount) | `0.1` | | [float](class_float#class-float) | [dof\_blur\_far\_distance](#class-environment-property-dof-blur-far-distance) | `10.0` | | [bool](class_bool#class-bool) | [dof\_blur\_far\_enabled](#class-environment-property-dof-blur-far-enabled) | `false` | | [DOFBlurQuality](#enum-environment-dofblurquality) | [dof\_blur\_far\_quality](#class-environment-property-dof-blur-far-quality) | `1` | | [float](class_float#class-float) | [dof\_blur\_far\_transition](#class-environment-property-dof-blur-far-transition) | `5.0` | | [float](class_float#class-float) | [dof\_blur\_near\_amount](#class-environment-property-dof-blur-near-amount) | `0.1` | | [float](class_float#class-float) | [dof\_blur\_near\_distance](#class-environment-property-dof-blur-near-distance) | `2.0` | | [bool](class_bool#class-bool) | [dof\_blur\_near\_enabled](#class-environment-property-dof-blur-near-enabled) | `false` | | [DOFBlurQuality](#enum-environment-dofblurquality) | [dof\_blur\_near\_quality](#class-environment-property-dof-blur-near-quality) | `1` | | [float](class_float#class-float) | [dof\_blur\_near\_transition](#class-environment-property-dof-blur-near-transition) | `1.0` | | [Color](class_color#class-color) | [fog\_color](#class-environment-property-fog-color) | `Color( 0.5, 0.6, 0.7, 1 )` | | [float](class_float#class-float) | [fog\_depth\_begin](#class-environment-property-fog-depth-begin) | `10.0` | | [float](class_float#class-float) | [fog\_depth\_curve](#class-environment-property-fog-depth-curve) | `1.0` | | [bool](class_bool#class-bool) | [fog\_depth\_enabled](#class-environment-property-fog-depth-enabled) | `true` | | [float](class_float#class-float) | [fog\_depth\_end](#class-environment-property-fog-depth-end) | `100.0` | | [bool](class_bool#class-bool) | [fog\_enabled](#class-environment-property-fog-enabled) | `false` | | [float](class_float#class-float) | [fog\_height\_curve](#class-environment-property-fog-height-curve) | `1.0` | | [bool](class_bool#class-bool) | [fog\_height\_enabled](#class-environment-property-fog-height-enabled) | `false` | | [float](class_float#class-float) | [fog\_height\_max](#class-environment-property-fog-height-max) | `0.0` | | [float](class_float#class-float) | [fog\_height\_min](#class-environment-property-fog-height-min) | `10.0` | | [float](class_float#class-float) | [fog\_sun\_amount](#class-environment-property-fog-sun-amount) | `0.0` | | [Color](class_color#class-color) | [fog\_sun\_color](#class-environment-property-fog-sun-color) | `Color( 1, 0.9, 0.7, 1 )` | | [float](class_float#class-float) | [fog\_transmit\_curve](#class-environment-property-fog-transmit-curve) | `1.0` | | [bool](class_bool#class-bool) | [fog\_transmit\_enabled](#class-environment-property-fog-transmit-enabled) | `false` | | [bool](class_bool#class-bool) | [glow\_bicubic\_upscale](#class-environment-property-glow-bicubic-upscale) | `false` | | [GlowBlendMode](#enum-environment-glowblendmode) | [glow\_blend\_mode](#class-environment-property-glow-blend-mode) | `2` | | [float](class_float#class-float) | [glow\_bloom](#class-environment-property-glow-bloom) | `0.0` | | [bool](class_bool#class-bool) | [glow\_enabled](#class-environment-property-glow-enabled) | `false` | | [float](class_float#class-float) | [glow\_hdr\_luminance\_cap](#class-environment-property-glow-hdr-luminance-cap) | `12.0` | | [float](class_float#class-float) | [glow\_hdr\_scale](#class-environment-property-glow-hdr-scale) | `2.0` | | [float](class_float#class-float) | [glow\_hdr\_threshold](#class-environment-property-glow-hdr-threshold) | `1.0` | | [bool](class_bool#class-bool) | [glow\_high\_quality](#class-environment-property-glow-high-quality) | `false` | | [float](class_float#class-float) | [glow\_intensity](#class-environment-property-glow-intensity) | `0.8` | | [bool](class_bool#class-bool) | [glow\_levels/1](#class-environment-property-glow-levels-1) | `false` | | [bool](class_bool#class-bool) | [glow\_levels/2](#class-environment-property-glow-levels-2) | `false` | | [bool](class_bool#class-bool) | [glow\_levels/3](#class-environment-property-glow-levels-3) | `true` | | [bool](class_bool#class-bool) | [glow\_levels/4](#class-environment-property-glow-levels-4) | `false` | | [bool](class_bool#class-bool) | [glow\_levels/5](#class-environment-property-glow-levels-5) | `true` | | [bool](class_bool#class-bool) | [glow\_levels/6](#class-environment-property-glow-levels-6) | `false` | | [bool](class_bool#class-bool) | [glow\_levels/7](#class-environment-property-glow-levels-7) | `false` | | [float](class_float#class-float) | [glow\_strength](#class-environment-property-glow-strength) | `1.0` | | [float](class_float#class-float) | [ss\_reflections\_depth\_tolerance](#class-environment-property-ss-reflections-depth-tolerance) | `0.2` | | [bool](class_bool#class-bool) | [ss\_reflections\_enabled](#class-environment-property-ss-reflections-enabled) | `false` | | [float](class_float#class-float) | [ss\_reflections\_fade\_in](#class-environment-property-ss-reflections-fade-in) | `0.15` | | [float](class_float#class-float) | [ss\_reflections\_fade\_out](#class-environment-property-ss-reflections-fade-out) | `2.0` | | [int](class_int#class-int) | [ss\_reflections\_max\_steps](#class-environment-property-ss-reflections-max-steps) | `64` | | [bool](class_bool#class-bool) | [ss\_reflections\_roughness](#class-environment-property-ss-reflections-roughness) | `true` | | [float](class_float#class-float) | [ssao\_ao\_channel\_affect](#class-environment-property-ssao-ao-channel-affect) | `0.0` | | [float](class_float#class-float) | [ssao\_bias](#class-environment-property-ssao-bias) | `0.01` | | [SSAOBlur](#enum-environment-ssaoblur) | [ssao\_blur](#class-environment-property-ssao-blur) | `3` | | [Color](class_color#class-color) | [ssao\_color](#class-environment-property-ssao-color) | `Color( 0, 0, 0, 1 )` | | [float](class_float#class-float) | [ssao\_edge\_sharpness](#class-environment-property-ssao-edge-sharpness) | `4.0` | | [bool](class_bool#class-bool) | [ssao\_enabled](#class-environment-property-ssao-enabled) | `false` | | [float](class_float#class-float) | [ssao\_intensity](#class-environment-property-ssao-intensity) | `1.0` | | [float](class_float#class-float) | [ssao\_intensity2](#class-environment-property-ssao-intensity2) | `1.0` | | [float](class_float#class-float) | [ssao\_light\_affect](#class-environment-property-ssao-light-affect) | `0.0` | | [SSAOQuality](#enum-environment-ssaoquality) | [ssao\_quality](#class-environment-property-ssao-quality) | `1` | | [float](class_float#class-float) | [ssao\_radius](#class-environment-property-ssao-radius) | `1.0` | | [float](class_float#class-float) | [ssao\_radius2](#class-environment-property-ssao-radius2) | `0.0` | | [float](class_float#class-float) | [tonemap\_exposure](#class-environment-property-tonemap-exposure) | `1.0` | | [ToneMapper](#enum-environment-tonemapper) | [tonemap\_mode](#class-environment-property-tonemap-mode) | `0` | | [float](class_float#class-float) | [tonemap\_white](#class-environment-property-tonemap-white) | `1.0` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [is\_glow\_level\_enabled](#class-environment-method-is-glow-level-enabled) **(** [int](class_int#class-int) idx **)** const | | void | [set\_glow\_level](#class-environment-method-set-glow-level) **(** [int](class_int#class-int) idx, [bool](class_bool#class-bool) enabled **)** | Enumerations ------------ enum **BGMode**: * **BG\_KEEP** = **5** --- Keeps on screen every pixel drawn in the background. Only select this mode if you really need to keep the old data. On modern GPUs it will generally not be faster than clearing the background, and can be significantly slower, particularly on mobile. It can only be safely used in fully-interior scenes (no visible sky or sky reflections). If enabled in a scene where the background is visible, "ghost trail" artifacts will be visible when moving the camera. * **BG\_CLEAR\_COLOR** = **0** --- Clears the background using the clear color defined in [ProjectSettings.rendering/environment/default\_clear\_color](class_projectsettings#class-projectsettings-property-rendering-environment-default-clear-color). * **BG\_COLOR** = **1** --- Clears the background using a custom clear color. * **BG\_SKY** = **2** --- Displays a user-defined sky in the background. * **BG\_COLOR\_SKY** = **3** --- Clears the background using a custom clear color and allows defining a sky for shading and reflection. This mode is slightly faster than [BG\_SKY](#class-environment-constant-bg-sky) and should be preferred in scenes where reflections can be visible, but the sky itself never is (e.g. top-down camera). * **BG\_CANVAS** = **4** --- Displays a [CanvasLayer](class_canvaslayer#class-canvaslayer) in the background. * **BG\_CAMERA\_FEED** = **6** --- Displays a camera feed in the background. * **BG\_MAX** = **7** --- Represents the size of the [BGMode](#enum-environment-bgmode) enum. enum **GlowBlendMode**: * **GLOW\_BLEND\_MODE\_ADDITIVE** = **0** --- Additive glow blending mode. Mostly used for particles, glows (bloom), lens flare, bright sources. * **GLOW\_BLEND\_MODE\_SCREEN** = **1** --- Screen glow blending mode. Increases brightness, used frequently with bloom. * **GLOW\_BLEND\_MODE\_SOFTLIGHT** = **2** --- Soft light glow blending mode. Modifies contrast, exposes shadows and highlights (vivid bloom). * **GLOW\_BLEND\_MODE\_REPLACE** = **3** --- Replace glow blending mode. Replaces all pixels' color by the glow value. This can be used to simulate a full-screen blur effect by tweaking the glow parameters to match the original image's brightness. enum **ToneMapper**: * **TONE\_MAPPER\_LINEAR** = **0** --- Linear tonemapper operator. Reads the linear data and passes it on unmodified. This can cause bright lighting to look blown out, with noticeable clipping in the output colors. * **TONE\_MAPPER\_REINHARDT** = **1** --- Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this formula: `color = color / (1 + color)`. This avoids clipping bright highlights, but the resulting image can look a bit dull. * **TONE\_MAPPER\_FILMIC** = **2** --- Filmic tonemapper operator. This avoids clipping bright highlights, with a resulting image that usually looks more vivid than [TONE\_MAPPER\_REINHARDT](#class-environment-constant-tone-mapper-reinhardt). * **TONE\_MAPPER\_ACES** = **3** --- Use the legacy Godot version of the Academy Color Encoding System tonemapper. Unlike [TONE\_MAPPER\_ACES\_FITTED](#class-environment-constant-tone-mapper-aces-fitted), this version of ACES does not handle bright lighting in a physically accurate way. ACES typically has a more contrasted output compared to [TONE\_MAPPER\_REINHARDT](#class-environment-constant-tone-mapper-reinhardt) and [TONE\_MAPPER\_FILMIC](#class-environment-constant-tone-mapper-filmic). **Note:** This tonemapping operator will be removed in Godot 4.0 in favor of the more accurate [TONE\_MAPPER\_ACES\_FITTED](#class-environment-constant-tone-mapper-aces-fitted). * **TONE\_MAPPER\_ACES\_FITTED** = **4** --- Use the Academy Color Encoding System tonemapper. ACES is slightly more expensive than other options, but it handles bright lighting in a more realistic fashion by desaturating it as it becomes brighter. ACES typically has a more contrasted output compared to [TONE\_MAPPER\_REINHARDT](#class-environment-constant-tone-mapper-reinhardt) and [TONE\_MAPPER\_FILMIC](#class-environment-constant-tone-mapper-filmic). enum **DOFBlurQuality**: * **DOF\_BLUR\_QUALITY\_LOW** = **0** --- Low depth-of-field blur quality (fastest). * **DOF\_BLUR\_QUALITY\_MEDIUM** = **1** --- Medium depth-of-field blur quality. * **DOF\_BLUR\_QUALITY\_HIGH** = **2** --- High depth-of-field blur quality (slowest). enum **SSAOBlur**: * **SSAO\_BLUR\_DISABLED** = **0** --- No blur for the screen-space ambient occlusion effect (fastest). * **SSAO\_BLUR\_1x1** = **1** --- 1×1 blur for the screen-space ambient occlusion effect. * **SSAO\_BLUR\_2x2** = **2** --- 2×2 blur for the screen-space ambient occlusion effect. * **SSAO\_BLUR\_3x3** = **3** --- 3×3 blur for the screen-space ambient occlusion effect (slowest). enum **SSAOQuality**: * **SSAO\_QUALITY\_LOW** = **0** --- Low quality for the screen-space ambient occlusion effect (fastest). * **SSAO\_QUALITY\_MEDIUM** = **1** --- Medium quality for the screen-space ambient occlusion effect. * **SSAO\_QUALITY\_HIGH** = **2** --- High quality for the screen-space ambient occlusion effect (slowest). Property Descriptions --------------------- ### [float](class_float#class-float) adjustment\_brightness | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_adjustment\_brightness(value) | | *Getter* | get\_adjustment\_brightness() | The global brightness value of the rendered scene. Effective only if `adjustment_enabled` is `true`. ### [Texture](class_texture#class-texture) adjustment\_color\_correction | | | | --- | --- | | *Setter* | set\_adjustment\_color\_correction(value) | | *Getter* | get\_adjustment\_color\_correction() | Applies the provided [Texture](class_texture#class-texture) resource to affect the global color aspect of the rendered scene. Effective only if `adjustment_enabled` is `true`. ### [float](class_float#class-float) adjustment\_contrast | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_adjustment\_contrast(value) | | *Getter* | get\_adjustment\_contrast() | The global contrast value of the rendered scene (default value is 1). Effective only if `adjustment_enabled` is `true`. ### [bool](class_bool#class-bool) adjustment\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_adjustment\_enable(value) | | *Getter* | is\_adjustment\_enabled() | If `true`, enables the `adjustment_*` properties provided by this resource. If `false`, modifications to the `adjustment_*` properties will have no effect on the rendered scene. ### [float](class_float#class-float) adjustment\_saturation | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_adjustment\_saturation(value) | | *Getter* | get\_adjustment\_saturation() | The global color saturation value of the rendered scene (default value is 1). Effective only if `adjustment_enabled` is `true`. ### [Color](class_color#class-color) ambient\_light\_color | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 1 )` | | *Setter* | set\_ambient\_light\_color(value) | | *Getter* | get\_ambient\_light\_color() | The ambient light's [Color](class_color#class-color). ### [float](class_float#class-float) ambient\_light\_energy | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_ambient\_light\_energy(value) | | *Getter* | get\_ambient\_light\_energy() | The ambient light's energy. The higher the value, the stronger the light. ### [float](class_float#class-float) ambient\_light\_sky\_contribution | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_ambient\_light\_sky\_contribution(value) | | *Getter* | get\_ambient\_light\_sky\_contribution() | Defines the amount of light that the sky brings on the scene. A value of `0.0` means that the sky's light emission has no effect on the scene illumination, thus all ambient illumination is provided by the ambient light. On the contrary, a value of `1.0` means that *all* the light that affects the scene is provided by the sky, thus the ambient light parameter has no effect on the scene. **Note:** [ambient\_light\_sky\_contribution](#class-environment-property-ambient-light-sky-contribution) is internally clamped between `0.0` and `1.0` (inclusive). ### [bool](class_bool#class-bool) auto\_exposure\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_tonemap\_auto\_exposure(value) | | *Getter* | get\_tonemap\_auto\_exposure() | If `true`, enables the tonemapping auto exposure mode of the scene renderer. If `true`, the renderer will automatically determine the exposure setting to adapt to the scene's illumination and the observed light. ### [float](class_float#class-float) auto\_exposure\_max\_luma | | | | --- | --- | | *Default* | `8.0` | | *Setter* | set\_tonemap\_auto\_exposure\_max(value) | | *Getter* | get\_tonemap\_auto\_exposure\_max() | The maximum luminance value for the auto exposure. ### [float](class_float#class-float) auto\_exposure\_min\_luma | | | | --- | --- | | *Default* | `0.05` | | *Setter* | set\_tonemap\_auto\_exposure\_min(value) | | *Getter* | get\_tonemap\_auto\_exposure\_min() | The minimum luminance value for the auto exposure. ### [float](class_float#class-float) auto\_exposure\_scale | | | | --- | --- | | *Default* | `0.4` | | *Setter* | set\_tonemap\_auto\_exposure\_grey(value) | | *Getter* | get\_tonemap\_auto\_exposure\_grey() | The scale of the auto exposure effect. Affects the intensity of auto exposure. ### [float](class_float#class-float) auto\_exposure\_speed | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_tonemap\_auto\_exposure\_speed(value) | | *Getter* | get\_tonemap\_auto\_exposure\_speed() | The speed of the auto exposure effect. Affects the time needed for the camera to perform auto exposure. ### [int](class_int#class-int) background\_camera\_feed\_id | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_camera\_feed\_id(value) | | *Getter* | get\_camera\_feed\_id() | The ID of the camera feed to show in the background. ### [int](class_int#class-int) background\_canvas\_max\_layer | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_canvas\_max\_layer(value) | | *Getter* | get\_canvas\_max\_layer() | The maximum layer ID to display. Only effective when using the [BG\_CANVAS](#class-environment-constant-bg-canvas) background mode. ### [Color](class_color#class-color) background\_color | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 1 )` | | *Setter* | set\_bg\_color(value) | | *Getter* | get\_bg\_color() | The [Color](class_color#class-color) displayed for clear areas of the scene. Only effective when using the [BG\_COLOR](#class-environment-constant-bg-color) or [BG\_COLOR\_SKY](#class-environment-constant-bg-color-sky) background modes). ### [float](class_float#class-float) background\_energy | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_bg\_energy(value) | | *Getter* | get\_bg\_energy() | The power of the light emitted by the background. ### [BGMode](#enum-environment-bgmode) background\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_background(value) | | *Getter* | get\_background() | The background mode. See [BGMode](#enum-environment-bgmode) for possible values. ### [Sky](class_sky#class-sky) background\_sky | | | | --- | --- | | *Setter* | set\_sky(value) | | *Getter* | get\_sky() | The [Sky](class_sky#class-sky) resource defined as background. ### [float](class_float#class-float) background\_sky\_custom\_fov | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_sky\_custom\_fov(value) | | *Getter* | get\_sky\_custom\_fov() | The [Sky](class_sky#class-sky) resource's custom field of view. ### [Basis](class_basis#class-basis) background\_sky\_orientation | | | | --- | --- | | *Default* | `Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )` | | *Setter* | set\_sky\_orientation(value) | | *Getter* | get\_sky\_orientation() | The [Sky](class_sky#class-sky) resource's rotation expressed as a [Basis](class_basis#class-basis). ### [Vector3](class_vector3#class-vector3) background\_sky\_rotation | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_sky\_rotation(value) | | *Getter* | get\_sky\_rotation() | The [Sky](class_sky#class-sky) resource's rotation expressed as Euler angles in radians. ### [Vector3](class_vector3#class-vector3) background\_sky\_rotation\_degrees | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_sky\_rotation\_degrees(value) | | *Getter* | get\_sky\_rotation\_degrees() | The [Sky](class_sky#class-sky) resource's rotation expressed as Euler angles in degrees. ### [float](class_float#class-float) dof\_blur\_far\_amount | | | | --- | --- | | *Default* | `0.1` | | *Setter* | set\_dof\_blur\_far\_amount(value) | | *Getter* | get\_dof\_blur\_far\_amount() | The amount of far blur for the depth-of-field effect. ### [float](class_float#class-float) dof\_blur\_far\_distance | | | | --- | --- | | *Default* | `10.0` | | *Setter* | set\_dof\_blur\_far\_distance(value) | | *Getter* | get\_dof\_blur\_far\_distance() | The distance from the camera where the far blur effect affects the rendering. ### [bool](class_bool#class-bool) dof\_blur\_far\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_dof\_blur\_far\_enabled(value) | | *Getter* | is\_dof\_blur\_far\_enabled() | If `true`, enables the depth-of-field far blur effect. ### [DOFBlurQuality](#enum-environment-dofblurquality) dof\_blur\_far\_quality | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_dof\_blur\_far\_quality(value) | | *Getter* | get\_dof\_blur\_far\_quality() | The depth-of-field far blur's quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower. ### [float](class_float#class-float) dof\_blur\_far\_transition | | | | --- | --- | | *Default* | `5.0` | | *Setter* | set\_dof\_blur\_far\_transition(value) | | *Getter* | get\_dof\_blur\_far\_transition() | The length of the transition between the no-blur area and far blur. ### [float](class_float#class-float) dof\_blur\_near\_amount | | | | --- | --- | | *Default* | `0.1` | | *Setter* | set\_dof\_blur\_near\_amount(value) | | *Getter* | get\_dof\_blur\_near\_amount() | The amount of near blur for the depth-of-field effect. ### [float](class_float#class-float) dof\_blur\_near\_distance | | | | --- | --- | | *Default* | `2.0` | | *Setter* | set\_dof\_blur\_near\_distance(value) | | *Getter* | get\_dof\_blur\_near\_distance() | Distance from the camera where the near blur effect affects the rendering. ### [bool](class_bool#class-bool) dof\_blur\_near\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_dof\_blur\_near\_enabled(value) | | *Getter* | is\_dof\_blur\_near\_enabled() | If `true`, enables the depth-of-field near blur effect. ### [DOFBlurQuality](#enum-environment-dofblurquality) dof\_blur\_near\_quality | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_dof\_blur\_near\_quality(value) | | *Getter* | get\_dof\_blur\_near\_quality() | The depth-of-field near blur's quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower. ### [float](class_float#class-float) dof\_blur\_near\_transition | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_dof\_blur\_near\_transition(value) | | *Getter* | get\_dof\_blur\_near\_transition() | The length of the transition between the near blur and no-blur area. ### [Color](class_color#class-color) fog\_color | | | | --- | --- | | *Default* | `Color( 0.5, 0.6, 0.7, 1 )` | | *Setter* | set\_fog\_color(value) | | *Getter* | get\_fog\_color() | The fog's [Color](class_color#class-color). ### [float](class_float#class-float) fog\_depth\_begin | | | | --- | --- | | *Default* | `10.0` | | *Setter* | set\_fog\_depth\_begin(value) | | *Getter* | get\_fog\_depth\_begin() | The fog's depth starting distance from the camera. ### [float](class_float#class-float) fog\_depth\_curve | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_fog\_depth\_curve(value) | | *Getter* | get\_fog\_depth\_curve() | The fog depth's intensity curve. A number of presets are available in the **Inspector** by right-clicking the curve. ### [bool](class_bool#class-bool) fog\_depth\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_fog\_depth\_enabled(value) | | *Getter* | is\_fog\_depth\_enabled() | If `true`, the depth fog effect is enabled. When enabled, fog will appear in the distance (relative to the camera). ### [float](class_float#class-float) fog\_depth\_end | | | | --- | --- | | *Default* | `100.0` | | *Setter* | set\_fog\_depth\_end(value) | | *Getter* | get\_fog\_depth\_end() | The fog's depth end distance from the camera. If this value is set to 0, it will be equal to the current camera's [Camera.far](class_camera#class-camera-property-far) value. ### [bool](class_bool#class-bool) fog\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_fog\_enabled(value) | | *Getter* | is\_fog\_enabled() | If `true`, fog effects are enabled. [fog\_height\_enabled](#class-environment-property-fog-height-enabled) and/or [fog\_depth\_enabled](#class-environment-property-fog-depth-enabled) must be set to `true` to actually display fog. ### [float](class_float#class-float) fog\_height\_curve | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_fog\_height\_curve(value) | | *Getter* | get\_fog\_height\_curve() | The height fog's intensity. A number of presets are available in the **Inspector** by right-clicking the curve. ### [bool](class_bool#class-bool) fog\_height\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_fog\_height\_enabled(value) | | *Getter* | is\_fog\_height\_enabled() | If `true`, the height fog effect is enabled. When enabled, fog will appear in a defined height range, regardless of the distance from the camera. This can be used to simulate "deep water" effects with a lower performance cost compared to a dedicated shader. ### [float](class_float#class-float) fog\_height\_max | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_fog\_height\_max(value) | | *Getter* | get\_fog\_height\_max() | The Y coordinate where the height fog will be the most intense. If this value is greater than [fog\_height\_min](#class-environment-property-fog-height-min), fog will be displayed from bottom to top. Otherwise, it will be displayed from top to bottom. ### [float](class_float#class-float) fog\_height\_min | | | | --- | --- | | *Default* | `10.0` | | *Setter* | set\_fog\_height\_min(value) | | *Getter* | get\_fog\_height\_min() | The Y coordinate where the height fog will be the least intense. If this value is greater than [fog\_height\_max](#class-environment-property-fog-height-max), fog will be displayed from top to bottom. Otherwise, it will be displayed from bottom to top. ### [float](class_float#class-float) fog\_sun\_amount | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_fog\_sun\_amount(value) | | *Getter* | get\_fog\_sun\_amount() | The intensity of the depth fog color transition when looking towards the sun. The sun's direction is determined automatically using the DirectionalLight node in the scene. ### [Color](class_color#class-color) fog\_sun\_color | | | | --- | --- | | *Default* | `Color( 1, 0.9, 0.7, 1 )` | | *Setter* | set\_fog\_sun\_color(value) | | *Getter* | get\_fog\_sun\_color() | The depth fog's [Color](class_color#class-color) when looking towards the sun. ### [float](class_float#class-float) fog\_transmit\_curve | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_fog\_transmit\_curve(value) | | *Getter* | get\_fog\_transmit\_curve() | The intensity of the fog light transmittance effect. Amount of light that the fog transmits. ### [bool](class_bool#class-bool) fog\_transmit\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_fog\_transmit\_enabled(value) | | *Getter* | is\_fog\_transmit\_enabled() | Enables fog's light transmission effect. If `true`, light will be more visible in the fog to simulate light scattering as in real life. ### [bool](class_bool#class-bool) glow\_bicubic\_upscale | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_glow\_bicubic\_upscale(value) | | *Getter* | is\_glow\_bicubic\_upscale\_enabled() | Smooths out the blockiness created by sampling higher levels, at the cost of performance. **Note:** When using the GLES2 renderer, this is only available if the GPU supports the `GL_EXT_gpu_shader4` extension. ### [GlowBlendMode](#enum-environment-glowblendmode) glow\_blend\_mode | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_glow\_blend\_mode(value) | | *Getter* | get\_glow\_blend\_mode() | The glow blending mode. ### [float](class_float#class-float) glow\_bloom | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_glow\_bloom(value) | | *Getter* | get\_glow\_bloom() | The bloom's intensity. If set to a value higher than `0`, this will make glow visible in areas darker than the [glow\_hdr\_threshold](#class-environment-property-glow-hdr-threshold). ### [bool](class_bool#class-bool) glow\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_glow\_enabled(value) | | *Getter* | is\_glow\_enabled() | If `true`, the glow effect is enabled. **Note:** Only effective if [ProjectSettings.rendering/quality/intended\_usage/framebuffer\_allocation](class_projectsettings#class-projectsettings-property-rendering-quality-intended-usage-framebuffer-allocation) is **3D** (*not* **3D Without Effects**). On mobile, [ProjectSettings.rendering/quality/intended\_usage/framebuffer\_allocation](class_projectsettings#class-projectsettings-property-rendering-quality-intended-usage-framebuffer-allocation) defaults to **3D Without Effects** by default, so its `.mobile` override needs to be changed to **3D**. **Note:** When using GLES3 on mobile, HDR rendering is disabled by default for performance reasons. This means glow will only be visible if [glow\_hdr\_threshold](#class-environment-property-glow-hdr-threshold) is decreased below `1.0` or if [glow\_bloom](#class-environment-property-glow-bloom) is increased above `0.0`. Also consider increasing [glow\_intensity](#class-environment-property-glow-intensity) to `1.5`. If you want glow to behave on mobile like it does on desktop (at a performance cost), enable [ProjectSettings.rendering/quality/depth/hdr](class_projectsettings#class-projectsettings-property-rendering-quality-depth-hdr)'s `.mobile` override. ### [float](class_float#class-float) glow\_hdr\_luminance\_cap | | | | --- | --- | | *Default* | `12.0` | | *Setter* | set\_glow\_hdr\_luminance\_cap(value) | | *Getter* | get\_glow\_hdr\_luminance\_cap() | The higher threshold of the HDR glow. Areas brighter than this threshold will be clamped for the purposes of the glow effect. ### [float](class_float#class-float) glow\_hdr\_scale | | | | --- | --- | | *Default* | `2.0` | | *Setter* | set\_glow\_hdr\_bleed\_scale(value) | | *Getter* | get\_glow\_hdr\_bleed\_scale() | The bleed scale of the HDR glow. ### [float](class_float#class-float) glow\_hdr\_threshold | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_glow\_hdr\_bleed\_threshold(value) | | *Getter* | get\_glow\_hdr\_bleed\_threshold() | The lower threshold of the HDR glow. When using the GLES2 renderer (which doesn't support HDR), this needs to be below `1.0` for glow to be visible. A value of `0.9` works well in this case. ### [bool](class_bool#class-bool) glow\_high\_quality | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_glow\_high\_quality(value) | | *Getter* | is\_glow\_high\_quality\_enabled() | Takes more samples during downsample pass of glow. This ensures that single pixels are captured by glow which makes the glow look smoother and more stable during movement. However, it is very expensive and makes the glow post process take twice as long. ### [float](class_float#class-float) glow\_intensity | | | | --- | --- | | *Default* | `0.8` | | *Setter* | set\_glow\_intensity(value) | | *Getter* | get\_glow\_intensity() | The glow intensity. When using the GLES2 renderer, this should be increased to 1.5 to compensate for the lack of HDR rendering. ### [bool](class_bool#class-bool) glow\_levels/1 | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_glow\_level(value) | | *Getter* | is\_glow\_level\_enabled() | If `true`, the 1st level of glow is enabled. This is the most "local" level (least blurry). ### [bool](class_bool#class-bool) glow\_levels/2 | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_glow\_level(value) | | *Getter* | is\_glow\_level\_enabled() | If `true`, the 2th level of glow is enabled. ### [bool](class_bool#class-bool) glow\_levels/3 | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_glow\_level(value) | | *Getter* | is\_glow\_level\_enabled() | If `true`, the 3th level of glow is enabled. ### [bool](class_bool#class-bool) glow\_levels/4 | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_glow\_level(value) | | *Getter* | is\_glow\_level\_enabled() | If `true`, the 4th level of glow is enabled. ### [bool](class_bool#class-bool) glow\_levels/5 | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_glow\_level(value) | | *Getter* | is\_glow\_level\_enabled() | If `true`, the 5th level of glow is enabled. ### [bool](class_bool#class-bool) glow\_levels/6 | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_glow\_level(value) | | *Getter* | is\_glow\_level\_enabled() | If `true`, the 6th level of glow is enabled. ### [bool](class_bool#class-bool) glow\_levels/7 | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_glow\_level(value) | | *Getter* | is\_glow\_level\_enabled() | If `true`, the 7th level of glow is enabled. This is the most "global" level (blurriest). ### [float](class_float#class-float) glow\_strength | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_glow\_strength(value) | | *Getter* | get\_glow\_strength() | The glow strength. When using the GLES2 renderer, this should be increased to 1.3 to compensate for the lack of HDR rendering. ### [float](class_float#class-float) ss\_reflections\_depth\_tolerance | | | | --- | --- | | *Default* | `0.2` | | *Setter* | set\_ssr\_depth\_tolerance(value) | | *Getter* | get\_ssr\_depth\_tolerance() | The depth tolerance for screen-space reflections. ### [bool](class_bool#class-bool) ss\_reflections\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_ssr\_enabled(value) | | *Getter* | is\_ssr\_enabled() | If `true`, screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from [GIProbe](class_giprobe#class-giprobe)s or [ReflectionProbe](class_reflectionprobe#class-reflectionprobe)s, but are slower and can't reflect surfaces occluded by others. ### [float](class_float#class-float) ss\_reflections\_fade\_in | | | | --- | --- | | *Default* | `0.15` | | *Setter* | set\_ssr\_fade\_in(value) | | *Getter* | get\_ssr\_fade\_in() | The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection). ### [float](class_float#class-float) ss\_reflections\_fade\_out | | | | --- | --- | | *Default* | `2.0` | | *Setter* | set\_ssr\_fade\_out(value) | | *Getter* | get\_ssr\_fade\_out() | The fade-out distance for screen-space reflections. Affects the area from the screen-space reflection to the "global" reflection. ### [int](class_int#class-int) ss\_reflections\_max\_steps | | | | --- | --- | | *Default* | `64` | | *Setter* | set\_ssr\_max\_steps(value) | | *Getter* | get\_ssr\_max\_steps() | The maximum number of steps for screen-space reflections. Higher values are slower. ### [bool](class_bool#class-bool) ss\_reflections\_roughness | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_ssr\_rough(value) | | *Getter* | is\_ssr\_rough() | If `true`, screen-space reflections will take the material roughness into account. ### [float](class_float#class-float) ssao\_ao\_channel\_affect | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_ssao\_ao\_channel\_affect(value) | | *Getter* | get\_ssao\_ao\_channel\_affect() | The screen-space ambient occlusion intensity on materials that have an AO texture defined. Values higher than `0` will make the SSAO effect visible in areas darkened by AO textures. ### [float](class_float#class-float) ssao\_bias | | | | --- | --- | | *Default* | `0.01` | | *Setter* | set\_ssao\_bias(value) | | *Getter* | get\_ssao\_bias() | The screen-space ambient occlusion bias. This should be kept high enough to prevent "smooth" curves from being affected by ambient occlusion. ### [SSAOBlur](#enum-environment-ssaoblur) ssao\_blur | | | | --- | --- | | *Default* | `3` | | *Setter* | set\_ssao\_blur(value) | | *Getter* | get\_ssao\_blur() | The screen-space ambient occlusion blur quality. See [SSAOBlur](#enum-environment-ssaoblur) for possible values. ### [Color](class_color#class-color) ssao\_color | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 1 )` | | *Setter* | set\_ssao\_color(value) | | *Getter* | get\_ssao\_color() | The screen-space ambient occlusion color. ### [float](class_float#class-float) ssao\_edge\_sharpness | | | | --- | --- | | *Default* | `4.0` | | *Setter* | set\_ssao\_edge\_sharpness(value) | | *Getter* | get\_ssao\_edge\_sharpness() | The screen-space ambient occlusion edge sharpness. ### [bool](class_bool#class-bool) ssao\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_ssao\_enabled(value) | | *Getter* | is\_ssao\_enabled() | If `true`, the screen-space ambient occlusion effect is enabled. This darkens objects' corners and cavities to simulate ambient light not reaching the entire object as in real life. This works well for small, dynamic objects, but baked lighting or ambient occlusion textures will do a better job at displaying ambient occlusion on large static objects. This is a costly effect and should be disabled first when running into performance issues. ### [float](class_float#class-float) ssao\_intensity | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_ssao\_intensity(value) | | *Getter* | get\_ssao\_intensity() | The primary screen-space ambient occlusion intensity. See also [ssao\_radius](#class-environment-property-ssao-radius). ### [float](class_float#class-float) ssao\_intensity2 | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_ssao\_intensity2(value) | | *Getter* | get\_ssao\_intensity2() | The secondary screen-space ambient occlusion intensity. See also [ssao\_radius2](#class-environment-property-ssao-radius2). ### [float](class_float#class-float) ssao\_light\_affect | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_ssao\_direct\_light\_affect(value) | | *Getter* | get\_ssao\_direct\_light\_affect() | The screen-space ambient occlusion intensity in direct light. In real life, ambient occlusion only applies to indirect light, which means its effects can't be seen in direct light. Values higher than `0` will make the SSAO effect visible in direct light. ### [SSAOQuality](#enum-environment-ssaoquality) ssao\_quality | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_ssao\_quality(value) | | *Getter* | get\_ssao\_quality() | The screen-space ambient occlusion quality. Higher qualities will make better use of small objects for ambient occlusion, but are slower. ### [float](class_float#class-float) ssao\_radius | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_ssao\_radius(value) | | *Getter* | get\_ssao\_radius() | The primary screen-space ambient occlusion radius. ### [float](class_float#class-float) ssao\_radius2 | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_ssao\_radius2(value) | | *Getter* | get\_ssao\_radius2() | The secondary screen-space ambient occlusion radius. If set to a value higher than `0`, enables the secondary screen-space ambient occlusion effect which can be used to improve the effect's appearance (at the cost of performance). ### [float](class_float#class-float) tonemap\_exposure | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_tonemap\_exposure(value) | | *Getter* | get\_tonemap\_exposure() | The default exposure used for tonemapping. ### [ToneMapper](#enum-environment-tonemapper) tonemap\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_tonemapper(value) | | *Getter* | get\_tonemapper() | The tonemapping mode to use. Tonemapping is the process that "converts" HDR values to be suitable for rendering on a SDR display. (Godot doesn't support rendering on HDR displays yet.) ### [float](class_float#class-float) tonemap\_white | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_tonemap\_white(value) | | *Getter* | get\_tonemap\_white() | The white reference value for tonemapping. Only effective if the [tonemap\_mode](#class-environment-property-tonemap-mode) isn't set to [TONE\_MAPPER\_LINEAR](#class-environment-constant-tone-mapper-linear). Method Descriptions ------------------- ### [bool](class_bool#class-bool) is\_glow\_level\_enabled ( [int](class_int#class-int) idx ) const Returns `true` if the glow level `idx` is specified, `false` otherwise. ### void set\_glow\_level ( [int](class_int#class-int) idx, [bool](class_bool#class-bool) enabled ) Enables or disables the glow level at index `idx`. Each level relies on the previous level. This means that enabling higher glow levels will slow down the glow effect rendering, even if previous levels aren't enabled.
programming_docs
godot ClippedCamera ClippedCamera ============= **Inherits:** [Camera](class_camera#class-camera) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) A [Camera](class_camera#class-camera) that includes collision. Description ----------- This node extends [Camera](class_camera#class-camera) to add collisions with [Area](class_area#class-area) and/or [PhysicsBody](class_physicsbody#class-physicsbody) nodes. The camera cannot move through colliding objects. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [clip\_to\_areas](#class-clippedcamera-property-clip-to-areas) | `false` | | [bool](class_bool#class-bool) | [clip\_to\_bodies](#class-clippedcamera-property-clip-to-bodies) | `true` | | [int](class_int#class-int) | [collision\_mask](#class-clippedcamera-property-collision-mask) | `1` | | [float](class_float#class-float) | [margin](#class-clippedcamera-property-margin) | `0.0` | | [ProcessMode](#enum-clippedcamera-processmode) | [process\_mode](#class-clippedcamera-property-process-mode) | `0` | Methods ------- | | | | --- | --- | | void | [add\_exception](#class-clippedcamera-method-add-exception) **(** [Object](class_object#class-object) node **)** | | void | [add\_exception\_rid](#class-clippedcamera-method-add-exception-rid) **(** [RID](class_rid#class-rid) rid **)** | | void | [clear\_exceptions](#class-clippedcamera-method-clear-exceptions) **(** **)** | | [float](class_float#class-float) | [get\_clip\_offset](#class-clippedcamera-method-get-clip-offset) **(** **)** const | | [bool](class_bool#class-bool) | [get\_collision\_mask\_bit](#class-clippedcamera-method-get-collision-mask-bit) **(** [int](class_int#class-int) bit **)** const | | void | [remove\_exception](#class-clippedcamera-method-remove-exception) **(** [Object](class_object#class-object) node **)** | | void | [remove\_exception\_rid](#class-clippedcamera-method-remove-exception-rid) **(** [RID](class_rid#class-rid) rid **)** | | void | [set\_collision\_mask\_bit](#class-clippedcamera-method-set-collision-mask-bit) **(** [int](class_int#class-int) bit, [bool](class_bool#class-bool) value **)** | Enumerations ------------ enum **ProcessMode**: * **CLIP\_PROCESS\_PHYSICS** = **0** --- The camera updates with the `_physics_process` callback. * **CLIP\_PROCESS\_IDLE** = **1** --- The camera updates with the `_process` callback. Property Descriptions --------------------- ### [bool](class_bool#class-bool) clip\_to\_areas | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_clip\_to\_areas(value) | | *Getter* | is\_clip\_to\_areas\_enabled() | If `true`, the camera stops on contact with [Area](class_area#class-area)s. ### [bool](class_bool#class-bool) clip\_to\_bodies | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_clip\_to\_bodies(value) | | *Getter* | is\_clip\_to\_bodies\_enabled() | If `true`, the camera stops on contact with [PhysicsBody](class_physicsbody#class-physicsbody)s. ### [int](class_int#class-int) collision\_mask | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_collision\_mask(value) | | *Getter* | get\_collision\_mask() | The camera's collision mask. Only objects in at least one collision layer matching the mask will be detected. See [Collision layers and masks](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. ### [float](class_float#class-float) margin | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_margin(value) | | *Getter* | get\_margin() | The camera's collision margin. The camera can't get closer than this distance to a colliding object. ### [ProcessMode](#enum-clippedcamera-processmode) process\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_process\_mode(value) | | *Getter* | get\_process\_mode() | The camera's process callback. See [ProcessMode](#enum-clippedcamera-processmode). Method Descriptions ------------------- ### void add\_exception ( [Object](class_object#class-object) node ) Adds a collision exception so the camera does not collide with the specified node. ### void add\_exception\_rid ( [RID](class_rid#class-rid) rid ) Adds a collision exception so the camera does not collide with the specified [RID](class_rid#class-rid). ### void clear\_exceptions ( ) Removes all collision exceptions. ### [float](class_float#class-float) get\_clip\_offset ( ) const Returns the distance the camera has been offset due to a collision. ### [bool](class_bool#class-bool) get\_collision\_mask\_bit ( [int](class_int#class-int) bit ) const Returns `true` if the specified bit index is on. **Note:** Bit indices range from 0-19. ### void remove\_exception ( [Object](class_object#class-object) node ) Removes a collision exception with the specified node. ### void remove\_exception\_rid ( [RID](class_rid#class-rid) rid ) Removes a collision exception with the specified [RID](class_rid#class-rid). ### void set\_collision\_mask\_bit ( [int](class_int#class-int) bit, [bool](class_bool#class-bool) value ) Sets the specified bit index to the `value`. **Note:** Bit indices range from 0-19. godot StaticBody StaticBody ========== **Inherits:** [PhysicsBody](class_physicsbody#class-physicsbody) **<** [CollisionObject](class_collisionobject#class-collisionobject) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Static body for 3D physics. Description ----------- Static body for 3D physics. A static body is a simple body that is not intended to move. In contrast to [RigidBody](class_rigidbody#class-rigidbody), they don't consume any CPU resources as long as they don't move. Additionally, a constant linear or angular velocity can be set for the static body, so even if it doesn't move, it affects other bodies as if it was moving (this is useful for simulating conveyor belts or conveyor wheels). Tutorials --------- * [3D Physics Tests Demo](https://godotengine.org/asset-library/asset/675) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [bounce](#class-staticbody-property-bounce) | | | [Vector3](class_vector3#class-vector3) | [constant\_angular\_velocity](#class-staticbody-property-constant-angular-velocity) | `Vector3( 0, 0, 0 )` | | [Vector3](class_vector3#class-vector3) | [constant\_linear\_velocity](#class-staticbody-property-constant-linear-velocity) | `Vector3( 0, 0, 0 )` | | [float](class_float#class-float) | [friction](#class-staticbody-property-friction) | | | [PhysicsMaterial](class_physicsmaterial#class-physicsmaterial) | [physics\_material\_override](#class-staticbody-property-physics-material-override) | | Property Descriptions --------------------- ### [float](class_float#class-float) bounce | | | | --- | --- | | *Setter* | set\_bounce(value) | | *Getter* | get\_bounce() | The body's bounciness. Values range from `0` (no bounce) to `1` (full bounciness). Deprecated, use [PhysicsMaterial.bounce](class_physicsmaterial#class-physicsmaterial-property-bounce) instead via [physics\_material\_override](#class-staticbody-property-physics-material-override). ### [Vector3](class_vector3#class-vector3) constant\_angular\_velocity | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_constant\_angular\_velocity(value) | | *Getter* | get\_constant\_angular\_velocity() | The body's constant angular velocity. This does not rotate the body, but affects other bodies that touch it, as if it was in a state of rotation. ### [Vector3](class_vector3#class-vector3) constant\_linear\_velocity | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_constant\_linear\_velocity(value) | | *Getter* | get\_constant\_linear\_velocity() | The body's constant linear velocity. This does not move the body, but affects other bodies that touch it, as if it was in a state of movement. ### [float](class_float#class-float) friction | | | | --- | --- | | *Setter* | set\_friction(value) | | *Getter* | get\_friction() | The body's friction, from 0 (frictionless) to 1 (full friction). Deprecated, use [PhysicsMaterial.friction](class_physicsmaterial#class-physicsmaterial-property-friction) instead via [physics\_material\_override](#class-staticbody-property-physics-material-override). ### [PhysicsMaterial](class_physicsmaterial#class-physicsmaterial) physics\_material\_override | | | | --- | --- | | *Setter* | set\_physics\_material\_override(value) | | *Getter* | get\_physics\_material\_override() | The physics material override for the body. If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. godot VisualShaderNodeVec3Constant VisualShaderNodeVec3Constant ============================ **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A [Vector3](class_vector3#class-vector3) constant to be used within the visual shader graph. Description ----------- A constant [Vector3](class_vector3#class-vector3), which can be used as an input node. Properties ---------- | | | | | --- | --- | --- | | [Vector3](class_vector3#class-vector3) | [constant](#class-visualshadernodevec3constant-property-constant) | `Vector3( 0, 0, 0 )` | Property Descriptions --------------------- ### [Vector3](class_vector3#class-vector3) constant | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_constant(value) | | *Getter* | get\_constant() | A [Vector3](class_vector3#class-vector3) constant which represents the state of this node. godot TextureRect TextureRect =========== **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Control for drawing textures. Description ----------- Used to draw icons and sprites in a user interface. The texture's placement can be controlled with the [stretch\_mode](#class-texturerect-property-stretch-mode) property. It can scale, tile, or stay centered inside its bounding rectangle. **Note:** You should enable [flip\_v](#class-texturerect-property-flip-v) when using a TextureRect to display a [ViewportTexture](class_viewporttexture#class-viewporttexture). Alternatively, you can enable [Viewport.render\_target\_v\_flip](class_viewport#class-viewport-property-render-target-v-flip) on the Viewport. Otherwise, the image will appear upside down. Tutorials --------- * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [expand](#class-texturerect-property-expand) | `false` | | [bool](class_bool#class-bool) | [flip\_h](#class-texturerect-property-flip-h) | `false` | | [bool](class_bool#class-bool) | [flip\_v](#class-texturerect-property-flip-v) | `false` | | [MouseFilter](class_control#enum-control-mousefilter) | mouse\_filter | `1` (overrides [Control](class_control#class-control-property-mouse-filter)) | | [StretchMode](#enum-texturerect-stretchmode) | [stretch\_mode](#class-texturerect-property-stretch-mode) | `0` | | [Texture](class_texture#class-texture) | [texture](#class-texturerect-property-texture) | | Enumerations ------------ enum **StretchMode**: * **STRETCH\_SCALE\_ON\_EXPAND** = **0** --- Scale to fit the node's bounding rectangle, only if `expand` is `true`. Default `stretch_mode`, for backwards compatibility. Until you set `expand` to `true`, the texture will behave like [STRETCH\_KEEP](#class-texturerect-constant-stretch-keep). * **STRETCH\_SCALE** = **1** --- Scale to fit the node's bounding rectangle. * **STRETCH\_TILE** = **2** --- Tile inside the node's bounding rectangle. * **STRETCH\_KEEP** = **3** --- The texture keeps its original size and stays in the bounding rectangle's top-left corner. * **STRETCH\_KEEP\_CENTERED** = **4** --- The texture keeps its original size and stays centered in the node's bounding rectangle. * **STRETCH\_KEEP\_ASPECT** = **5** --- Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio. * **STRETCH\_KEEP\_ASPECT\_CENTERED** = **6** --- Scale the texture to fit the node's bounding rectangle, center it and maintain its aspect ratio. * **STRETCH\_KEEP\_ASPECT\_COVERED** = **7** --- Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits. Property Descriptions --------------------- ### [bool](class_bool#class-bool) expand | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_expand(value) | | *Getter* | has\_expand() | If `true`, the texture scales to fit its bounding rectangle. ### [bool](class_bool#class-bool) flip\_h | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flip\_h(value) | | *Getter* | is\_flipped\_h() | If `true`, texture is flipped horizontally. ### [bool](class_bool#class-bool) flip\_v | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flip\_v(value) | | *Getter* | is\_flipped\_v() | If `true`, texture is flipped vertically. ### [StretchMode](#enum-texturerect-stretchmode) stretch\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_stretch\_mode(value) | | *Getter* | get\_stretch\_mode() | Controls the texture's behavior when resizing the node's bounding rectangle. See [StretchMode](#enum-texturerect-stretchmode). ### [Texture](class_texture#class-texture) texture | | | | --- | --- | | *Setter* | set\_texture(value) | | *Getter* | get\_texture() | The node's [Texture](class_texture#class-texture) resource. godot AudioEffectLowShelfFilter AudioEffectLowShelfFilter ========================= **Inherits:** [AudioEffectFilter](class_audioeffectfilter#class-audioeffectfilter) **<** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Reduces all frequencies below the [AudioEffectFilter.cutoff\_hz](class_audioeffectfilter#class-audioeffectfilter-property-cutoff-hz). Tutorials --------- * [Audio buses](https://docs.godotengine.org/en/3.5/tutorials/audio/audio_buses.html) godot VisualShaderNodeCubeMapUniform VisualShaderNodeCubeMapUniform ============================== **Inherits:** [VisualShaderNodeTextureUniform](class_visualshadernodetextureuniform#class-visualshadernodetextureuniform) **<** [VisualShaderNodeUniform](class_visualshadernodeuniform#class-visualshadernodeuniform) **<** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A [CubeMap](class_cubemap#class-cubemap) uniform node to be used within the visual shader graph. Description ----------- Translated to `uniform samplerCube` in the shader language. The output value can be used as port for [VisualShaderNodeCubeMap](class_visualshadernodecubemap#class-visualshadernodecubemap). godot NinePatchRect NinePatchRect ============= **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Scalable texture-based frame that tiles the texture's centers and sides, but keeps the corners' original size. Perfect for panels and dialog boxes. Description ----------- Also known as 9-slice panels, NinePatchRect produces clean panels of any size, based on a small texture. To do so, it splits the texture in a 3×3 grid. When you scale the node, it tiles the texture's sides horizontally or vertically, the center on both axes but it doesn't scale or tile the corners. Properties ---------- | | | | | --- | --- | --- | | [AxisStretchMode](#enum-ninepatchrect-axisstretchmode) | [axis\_stretch\_horizontal](#class-ninepatchrect-property-axis-stretch-horizontal) | `0` | | [AxisStretchMode](#enum-ninepatchrect-axisstretchmode) | [axis\_stretch\_vertical](#class-ninepatchrect-property-axis-stretch-vertical) | `0` | | [bool](class_bool#class-bool) | [draw\_center](#class-ninepatchrect-property-draw-center) | `true` | | [MouseFilter](class_control#enum-control-mousefilter) | mouse\_filter | `2` (overrides [Control](class_control#class-control-property-mouse-filter)) | | [int](class_int#class-int) | [patch\_margin\_bottom](#class-ninepatchrect-property-patch-margin-bottom) | `0` | | [int](class_int#class-int) | [patch\_margin\_left](#class-ninepatchrect-property-patch-margin-left) | `0` | | [int](class_int#class-int) | [patch\_margin\_right](#class-ninepatchrect-property-patch-margin-right) | `0` | | [int](class_int#class-int) | [patch\_margin\_top](#class-ninepatchrect-property-patch-margin-top) | `0` | | [Rect2](class_rect2#class-rect2) | [region\_rect](#class-ninepatchrect-property-region-rect) | `Rect2( 0, 0, 0, 0 )` | | [Texture](class_texture#class-texture) | [texture](#class-ninepatchrect-property-texture) | | Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [get\_patch\_margin](#class-ninepatchrect-method-get-patch-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin **)** const | | void | [set\_patch\_margin](#class-ninepatchrect-method-set-patch-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin, [int](class_int#class-int) value **)** | Signals ------- ### texture\_changed ( ) Emitted when the node's texture changes. Enumerations ------------ enum **AxisStretchMode**: * **AXIS\_STRETCH\_MODE\_STRETCH** = **0** --- Stretches the center texture across the NinePatchRect. This may cause the texture to be distorted. * **AXIS\_STRETCH\_MODE\_TILE** = **1** --- Repeats the center texture across the NinePatchRect. This won't cause any visible distortion. The texture must be seamless for this to work without displaying artifacts between edges. **Note:** Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like [AXIS\_STRETCH\_MODE\_STRETCH](#class-ninepatchrect-constant-axis-stretch-mode-stretch). * **AXIS\_STRETCH\_MODE\_TILE\_FIT** = **2** --- Repeats the center texture across the NinePatchRect, but will also stretch the texture to make sure each tile is visible in full. This may cause the texture to be distorted, but less than [AXIS\_STRETCH\_MODE\_STRETCH](#class-ninepatchrect-constant-axis-stretch-mode-stretch). The texture must be seamless for this to work without displaying artifacts between edges. **Note:** Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like [AXIS\_STRETCH\_MODE\_STRETCH](#class-ninepatchrect-constant-axis-stretch-mode-stretch). Property Descriptions --------------------- ### [AxisStretchMode](#enum-ninepatchrect-axisstretchmode) axis\_stretch\_horizontal | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_h\_axis\_stretch\_mode(value) | | *Getter* | get\_h\_axis\_stretch\_mode() | The stretch mode to use for horizontal stretching/tiling. See [AxisStretchMode](#enum-ninepatchrect-axisstretchmode) for possible values. ### [AxisStretchMode](#enum-ninepatchrect-axisstretchmode) axis\_stretch\_vertical | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_v\_axis\_stretch\_mode(value) | | *Getter* | get\_v\_axis\_stretch\_mode() | The stretch mode to use for vertical stretching/tiling. See [AxisStretchMode](#enum-ninepatchrect-axisstretchmode) for possible values. ### [bool](class_bool#class-bool) draw\_center | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_draw\_center(value) | | *Getter* | is\_draw\_center\_enabled() | If `true`, draw the panel's center. Else, only draw the 9-slice's borders. ### [int](class_int#class-int) patch\_margin\_bottom | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_patch\_margin(value) | | *Getter* | get\_patch\_margin() | The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. ### [int](class_int#class-int) patch\_margin\_left | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_patch\_margin(value) | | *Getter* | get\_patch\_margin() | The width of the 9-slice's left column. A margin of 16 means the 9-slice's left corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. ### [int](class_int#class-int) patch\_margin\_right | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_patch\_margin(value) | | *Getter* | get\_patch\_margin() | The width of the 9-slice's right column. A margin of 16 means the 9-slice's right corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. ### [int](class_int#class-int) patch\_margin\_top | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_patch\_margin(value) | | *Getter* | get\_patch\_margin() | The height of the 9-slice's top row. A margin of 16 means the 9-slice's top corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. ### [Rect2](class_rect2#class-rect2) region\_rect | | | | --- | --- | | *Default* | `Rect2( 0, 0, 0, 0 )` | | *Setter* | set\_region\_rect(value) | | *Getter* | get\_region\_rect() | Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. If the rect is empty, NinePatchRect will use the whole texture. ### [Texture](class_texture#class-texture) texture | | | | --- | --- | | *Setter* | set\_texture(value) | | *Getter* | get\_texture() | The node's texture resource. Method Descriptions ------------------- ### [int](class_int#class-int) get\_patch\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin ) const Returns the size of the margin identified by the given [Margin](class_%40globalscope#enum-globalscope-margin) constant. ### void set\_patch\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin, [int](class_int#class-int) value ) Sets the size of the margin identified by the given [Margin](class_%40globalscope#enum-globalscope-margin) constant to `value` in pixels.
programming_docs
godot VisibilityEnabler2D VisibilityEnabler2D =================== **Inherits:** [VisibilityNotifier2D](class_visibilitynotifier2d#class-visibilitynotifier2d) **<** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Enables certain nodes only when approximately visible. Description ----------- The VisibilityEnabler2D will disable [RigidBody2D](class_rigidbody2d#class-rigidbody2d), [AnimationPlayer](class_animationplayer#class-animationplayer), and other nodes when they are not visible. It will only affect nodes with the same root node as the VisibilityEnabler2D, and the root node itself. If you just want to receive notifications, use [VisibilityNotifier2D](class_visibilitynotifier2d#class-visibilitynotifier2d) instead. **Note:** For performance reasons, VisibilityEnabler2D uses an approximate heuristic with precision determined by [ProjectSettings.world/2d/cell\_size](class_projectsettings#class-projectsettings-property-world-2d-cell-size). If you need precise visibility checking, use another method such as adding an [Area2D](class_area2d#class-area2d) node as a child of a [Camera2D](class_camera2d#class-camera2d) node. **Note:** VisibilityEnabler2D will not affect nodes added after scene initialization. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [freeze\_bodies](#class-visibilityenabler2d-property-freeze-bodies) | `true` | | [bool](class_bool#class-bool) | [pause\_animated\_sprites](#class-visibilityenabler2d-property-pause-animated-sprites) | `true` | | [bool](class_bool#class-bool) | [pause\_animations](#class-visibilityenabler2d-property-pause-animations) | `true` | | [bool](class_bool#class-bool) | [pause\_particles](#class-visibilityenabler2d-property-pause-particles) | `true` | | [bool](class_bool#class-bool) | [physics\_process\_parent](#class-visibilityenabler2d-property-physics-process-parent) | `false` | | [bool](class_bool#class-bool) | [process\_parent](#class-visibilityenabler2d-property-process-parent) | `false` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [is\_enabler\_enabled](#class-visibilityenabler2d-method-is-enabler-enabled) **(** [Enabler](#enum-visibilityenabler2d-enabler) enabler **)** const | | void | [set\_enabler](#class-visibilityenabler2d-method-set-enabler) **(** [Enabler](#enum-visibilityenabler2d-enabler) enabler, [bool](class_bool#class-bool) enabled **)** | Enumerations ------------ enum **Enabler**: * **ENABLER\_PAUSE\_ANIMATIONS** = **0** --- This enabler will pause [AnimationPlayer](class_animationplayer#class-animationplayer) nodes. * **ENABLER\_FREEZE\_BODIES** = **1** --- This enabler will freeze [RigidBody2D](class_rigidbody2d#class-rigidbody2d) nodes. * **ENABLER\_PAUSE\_PARTICLES** = **2** --- This enabler will stop [Particles2D](class_particles2d#class-particles2d) nodes. * **ENABLER\_PARENT\_PROCESS** = **3** --- This enabler will stop the parent's [Node.\_process](class_node#class-node-method-process) function. * **ENABLER\_PARENT\_PHYSICS\_PROCESS** = **4** --- This enabler will stop the parent's [Node.\_physics\_process](class_node#class-node-method-physics-process) function. * **ENABLER\_PAUSE\_ANIMATED\_SPRITES** = **5** --- This enabler will stop [AnimatedSprite](class_animatedsprite#class-animatedsprite) nodes animations. * **ENABLER\_MAX** = **6** --- Represents the size of the [Enabler](#enum-visibilityenabler2d-enabler) enum. Property Descriptions --------------------- ### [bool](class_bool#class-bool) freeze\_bodies | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_enabler(value) | | *Getter* | is\_enabler\_enabled() | If `true`, [RigidBody2D](class_rigidbody2d#class-rigidbody2d) nodes will be paused. ### [bool](class_bool#class-bool) pause\_animated\_sprites | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_enabler(value) | | *Getter* | is\_enabler\_enabled() | If `true`, [AnimatedSprite](class_animatedsprite#class-animatedsprite) nodes will be paused. ### [bool](class_bool#class-bool) pause\_animations | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_enabler(value) | | *Getter* | is\_enabler\_enabled() | If `true`, [AnimationPlayer](class_animationplayer#class-animationplayer) nodes will be paused. ### [bool](class_bool#class-bool) pause\_particles | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_enabler(value) | | *Getter* | is\_enabler\_enabled() | If `true`, [Particles2D](class_particles2d#class-particles2d) nodes will be paused. ### [bool](class_bool#class-bool) physics\_process\_parent | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_enabler(value) | | *Getter* | is\_enabler\_enabled() | If `true`, the parent's [Node.\_physics\_process](class_node#class-node-method-physics-process) will be stopped. ### [bool](class_bool#class-bool) process\_parent | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_enabler(value) | | *Getter* | is\_enabler\_enabled() | If `true`, the parent's [Node.\_process](class_node#class-node-method-process) will be stopped. Method Descriptions ------------------- ### [bool](class_bool#class-bool) is\_enabler\_enabled ( [Enabler](#enum-visibilityenabler2d-enabler) enabler ) const Returns whether the enabler identified by given [Enabler](#enum-visibilityenabler2d-enabler) constant is active. ### void set\_enabler ( [Enabler](#enum-visibilityenabler2d-enabler) enabler, [bool](class_bool#class-bool) enabled ) Sets active state of the enabler identified by given [Enabler](#enum-visibilityenabler2d-enabler) constant. godot Light Light ===== **Inherits:** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [DirectionalLight](class_directionallight#class-directionallight), [OmniLight](class_omnilight#class-omnilight), [SpotLight](class_spotlight#class-spotlight) Provides a base class for different kinds of light nodes. Description ----------- Light is the *abstract* base class for light nodes. As it can't be instanced, it shouldn't be used directly. Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting. Tutorials --------- * [3D lights and shadows](https://docs.godotengine.org/en/3.5/tutorials/3d/lights_and_shadows.html) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [editor\_only](#class-light-property-editor-only) | `false` | | [BakeMode](#enum-light-bakemode) | [light\_bake\_mode](#class-light-property-light-bake-mode) | `1` | | [Color](class_color#class-color) | [light\_color](#class-light-property-light-color) | `Color( 1, 1, 1, 1 )` | | [int](class_int#class-int) | [light\_cull\_mask](#class-light-property-light-cull-mask) | `4294967295` | | [float](class_float#class-float) | [light\_energy](#class-light-property-light-energy) | `1.0` | | [float](class_float#class-float) | [light\_indirect\_energy](#class-light-property-light-indirect-energy) | `1.0` | | [bool](class_bool#class-bool) | [light\_negative](#class-light-property-light-negative) | `false` | | [float](class_float#class-float) | [light\_size](#class-light-property-light-size) | `0.0` | | [float](class_float#class-float) | [light\_specular](#class-light-property-light-specular) | `0.5` | | [float](class_float#class-float) | [shadow\_bias](#class-light-property-shadow-bias) | `0.15` | | [Color](class_color#class-color) | [shadow\_color](#class-light-property-shadow-color) | `Color( 0, 0, 0, 1 )` | | [float](class_float#class-float) | [shadow\_contact](#class-light-property-shadow-contact) | `0.0` | | [bool](class_bool#class-bool) | [shadow\_enabled](#class-light-property-shadow-enabled) | `false` | | [bool](class_bool#class-bool) | [shadow\_reverse\_cull\_face](#class-light-property-shadow-reverse-cull-face) | `false` | Methods ------- | | | | --- | --- | | [float](class_float#class-float) | [get\_param](#class-light-method-get-param) **(** [Param](#enum-light-param) param **)** const | | void | [set\_param](#class-light-method-set-param) **(** [Param](#enum-light-param) param, [float](class_float#class-float) value **)** | Enumerations ------------ enum **Param**: * **PARAM\_ENERGY** = **0** --- Constant for accessing [light\_energy](#class-light-property-light-energy). * **PARAM\_INDIRECT\_ENERGY** = **1** --- Constant for accessing [light\_indirect\_energy](#class-light-property-light-indirect-energy). * **PARAM\_SIZE** = **2** --- Constant for accessing [light\_size](#class-light-property-light-size). * **PARAM\_SPECULAR** = **3** --- Constant for accessing [light\_specular](#class-light-property-light-specular). * **PARAM\_RANGE** = **4** --- Constant for accessing [OmniLight.omni\_range](class_omnilight#class-omnilight-property-omni-range) or [SpotLight.spot\_range](class_spotlight#class-spotlight-property-spot-range). * **PARAM\_ATTENUATION** = **5** --- Constant for accessing [OmniLight.omni\_attenuation](class_omnilight#class-omnilight-property-omni-attenuation) or [SpotLight.spot\_attenuation](class_spotlight#class-spotlight-property-spot-attenuation). * **PARAM\_SPOT\_ANGLE** = **6** --- Constant for accessing [SpotLight.spot\_angle](class_spotlight#class-spotlight-property-spot-angle). * **PARAM\_SPOT\_ATTENUATION** = **7** --- Constant for accessing [SpotLight.spot\_angle\_attenuation](class_spotlight#class-spotlight-property-spot-angle-attenuation). * **PARAM\_CONTACT\_SHADOW\_SIZE** = **8** --- Constant for accessing [shadow\_contact](#class-light-property-shadow-contact). * **PARAM\_SHADOW\_MAX\_DISTANCE** = **9** --- Constant for accessing [DirectionalLight.directional\_shadow\_max\_distance](class_directionallight#class-directionallight-property-directional-shadow-max-distance). * **PARAM\_SHADOW\_SPLIT\_1\_OFFSET** = **10** --- Constant for accessing [DirectionalLight.directional\_shadow\_split\_1](class_directionallight#class-directionallight-property-directional-shadow-split-1). * **PARAM\_SHADOW\_SPLIT\_2\_OFFSET** = **11** --- Constant for accessing [DirectionalLight.directional\_shadow\_split\_2](class_directionallight#class-directionallight-property-directional-shadow-split-2). * **PARAM\_SHADOW\_SPLIT\_3\_OFFSET** = **12** --- Constant for accessing [DirectionalLight.directional\_shadow\_split\_3](class_directionallight#class-directionallight-property-directional-shadow-split-3). * **PARAM\_SHADOW\_NORMAL\_BIAS** = **13** --- Constant for accessing [DirectionalLight.directional\_shadow\_normal\_bias](class_directionallight#class-directionallight-property-directional-shadow-normal-bias). * **PARAM\_SHADOW\_BIAS** = **14** --- Constant for accessing [shadow\_bias](#class-light-property-shadow-bias). * **PARAM\_SHADOW\_BIAS\_SPLIT\_SCALE** = **15** --- Constant for accessing [DirectionalLight.directional\_shadow\_bias\_split\_scale](class_directionallight#class-directionallight-property-directional-shadow-bias-split-scale). * **PARAM\_MAX** = **16** --- Represents the size of the [Param](#enum-light-param) enum. enum **BakeMode**: * **BAKE\_DISABLED** = **0** --- Light is ignored when baking. **Note:** Hiding a light does *not* affect baking. * **BAKE\_INDIRECT** = **1** --- Only indirect lighting will be baked (default). * **BAKE\_ALL** = **2** --- Both direct and indirect light will be baked. **Note:** You should hide the light if you don't want it to appear twice (dynamic and baked). Property Descriptions --------------------- ### [bool](class_bool#class-bool) editor\_only | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_editor\_only(value) | | *Getter* | is\_editor\_only() | If `true`, the light only appears in the editor and will not be visible at runtime. ### [BakeMode](#enum-light-bakemode) light\_bake\_mode | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_bake\_mode(value) | | *Getter* | get\_bake\_mode() | The light's bake mode. See [BakeMode](#enum-light-bakemode). ### [Color](class_color#class-color) light\_color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_color(value) | | *Getter* | get\_color() | The light's color. An *overbright* color can be used to achieve a result equivalent to increasing the light's [light\_energy](#class-light-property-light-energy). ### [int](class_int#class-int) light\_cull\_mask | | | | --- | --- | | *Default* | `4294967295` | | *Setter* | set\_cull\_mask(value) | | *Getter* | get\_cull\_mask() | The light will affect objects in the selected layers. ### [float](class_float#class-float) light\_energy | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The light's strength multiplier (this is not a physical unit). For [OmniLight](class_omnilight#class-omnilight) and [SpotLight](class_spotlight#class-spotlight), changing this value will only change the light color's intensity, not the light's radius. ### [float](class_float#class-float) light\_indirect\_energy | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Secondary multiplier used with indirect light (light bounces). This works on both [BakedLightmap](class_bakedlightmap#class-bakedlightmap) and [GIProbe](class_giprobe#class-giprobe). ### [bool](class_bool#class-bool) light\_negative | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_negative(value) | | *Getter* | is\_negative() | If `true`, the light's effect is reversed, darkening areas and casting bright shadows. ### [float](class_float#class-float) light\_size | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The size of the light in Godot units. Only considered in baked lightmaps and only if [light\_bake\_mode](#class-light-property-light-bake-mode) is set to [BAKE\_ALL](#class-light-constant-bake-all). Increasing this value will make the shadows appear blurrier. This can be used to simulate area lights to an extent. ### [float](class_float#class-float) light\_specular | | | | --- | --- | | *Default* | `0.5` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The intensity of the specular blob in objects affected by the light. At `0`, the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface. ### [float](class_float#class-float) shadow\_bias | | | | --- | --- | | *Default* | `0.15` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed. ### [Color](class_color#class-color) shadow\_color | | | | --- | --- | | *Default* | `Color( 0, 0, 0, 1 )` | | *Setter* | set\_shadow\_color(value) | | *Getter* | get\_shadow\_color() | The color of shadows cast by this light. ### [float](class_float#class-float) shadow\_contact | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Attempts to reduce [shadow\_bias](#class-light-property-shadow-bias) gap by rendering screen-space contact shadows. This has a performance impact, especially at higher values. **Note:** Contact shadows can look broken, so leaving this property to `0.0` is recommended. ### [bool](class_bool#class-bool) shadow\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_shadow(value) | | *Getter* | has\_shadow() | If `true`, the light will cast shadows. ### [bool](class_bool#class-bool) shadow\_reverse\_cull\_face | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_shadow\_reverse\_cull\_face(value) | | *Getter* | get\_shadow\_reverse\_cull\_face() | If `true`, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double-sided shadows with [GeometryInstance.SHADOW\_CASTING\_SETTING\_DOUBLE\_SIDED](class_geometryinstance#class-geometryinstance-constant-shadow-casting-setting-double-sided). Method Descriptions ------------------- ### [float](class_float#class-float) get\_param ( [Param](#enum-light-param) param ) const Returns the value of the specified [Param](#enum-light-param) parameter. ### void set\_param ( [Param](#enum-light-param) param, [float](class_float#class-float) value ) Sets the value of the specified [Param](#enum-light-param) parameter. godot VisualScriptResourcePath VisualScriptResourcePath ======================== **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [path](#class-visualscriptresourcepath-property-path) | `""` | Property Descriptions --------------------- ### [String](class_string#class-string) path | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_resource\_path(value) | | *Getter* | get\_resource\_path() | godot UPNPDevice UPNPDevice ========== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Universal Plug and Play (UPnP) device. Description ----------- Universal Plug and Play (UPnP) device. See [UPNP](class_upnp#class-upnp) for UPnP discovery and utility functions. Provides low-level access to UPNP control commands. Allows to manage port mappings (port forwarding) and to query network information of the device (like local and external IP address and status). Note that methods on this class are synchronous and block the calling thread. Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [description\_url](#class-upnpdevice-property-description-url) | `""` | | [String](class_string#class-string) | [igd\_control\_url](#class-upnpdevice-property-igd-control-url) | `""` | | [String](class_string#class-string) | [igd\_our\_addr](#class-upnpdevice-property-igd-our-addr) | `""` | | [String](class_string#class-string) | [igd\_service\_type](#class-upnpdevice-property-igd-service-type) | `""` | | [IGDStatus](#enum-upnpdevice-igdstatus) | [igd\_status](#class-upnpdevice-property-igd-status) | `9` | | [String](class_string#class-string) | [service\_type](#class-upnpdevice-property-service-type) | `""` | Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [add\_port\_mapping](#class-upnpdevice-method-add-port-mapping) **(** [int](class_int#class-int) port, [int](class_int#class-int) port\_internal=0, [String](class_string#class-string) desc="", [String](class_string#class-string) proto="UDP", [int](class_int#class-int) duration=0 **)** const | | [int](class_int#class-int) | [delete\_port\_mapping](#class-upnpdevice-method-delete-port-mapping) **(** [int](class_int#class-int) port, [String](class_string#class-string) proto="UDP" **)** const | | [bool](class_bool#class-bool) | [is\_valid\_gateway](#class-upnpdevice-method-is-valid-gateway) **(** **)** const | | [String](class_string#class-string) | [query\_external\_address](#class-upnpdevice-method-query-external-address) **(** **)** const | Enumerations ------------ enum **IGDStatus**: * **IGD\_STATUS\_OK** = **0** --- OK. * **IGD\_STATUS\_HTTP\_ERROR** = **1** --- HTTP error. * **IGD\_STATUS\_HTTP\_EMPTY** = **2** --- Empty HTTP response. * **IGD\_STATUS\_NO\_URLS** = **3** --- Returned response contained no URLs. * **IGD\_STATUS\_NO\_IGD** = **4** --- Not a valid IGD. * **IGD\_STATUS\_DISCONNECTED** = **5** --- Disconnected. * **IGD\_STATUS\_UNKNOWN\_DEVICE** = **6** --- Unknown device. * **IGD\_STATUS\_INVALID\_CONTROL** = **7** --- Invalid control. * **IGD\_STATUS\_MALLOC\_ERROR** = **8** --- Memory allocation error. * **IGD\_STATUS\_UNKNOWN\_ERROR** = **9** --- Unknown error. Property Descriptions --------------------- ### [String](class_string#class-string) description\_url | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_description\_url(value) | | *Getter* | get\_description\_url() | URL to the device description. ### [String](class_string#class-string) igd\_control\_url | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_igd\_control\_url(value) | | *Getter* | get\_igd\_control\_url() | IDG control URL. ### [String](class_string#class-string) igd\_our\_addr | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_igd\_our\_addr(value) | | *Getter* | get\_igd\_our\_addr() | Address of the local machine in the network connecting it to this `UPNPDevice`. ### [String](class_string#class-string) igd\_service\_type | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_igd\_service\_type(value) | | *Getter* | get\_igd\_service\_type() | IGD service type. ### [IGDStatus](#enum-upnpdevice-igdstatus) igd\_status | | | | --- | --- | | *Default* | `9` | | *Setter* | set\_igd\_status(value) | | *Getter* | get\_igd\_status() | IGD status. See [IGDStatus](#enum-upnpdevice-igdstatus). ### [String](class_string#class-string) service\_type | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_service\_type(value) | | *Getter* | get\_service\_type() | Service type. Method Descriptions ------------------- ### [int](class_int#class-int) add\_port\_mapping ( [int](class_int#class-int) port, [int](class_int#class-int) port\_internal=0, [String](class_string#class-string) desc="", [String](class_string#class-string) proto="UDP", [int](class_int#class-int) duration=0 ) const Adds a port mapping to forward the given external port on this `UPNPDevice` for the given protocol to the local machine. See [UPNP.add\_port\_mapping](class_upnp#class-upnp-method-add-port-mapping). ### [int](class_int#class-int) delete\_port\_mapping ( [int](class_int#class-int) port, [String](class_string#class-string) proto="UDP" ) const Deletes the port mapping identified by the given port and protocol combination on this device. See [UPNP.delete\_port\_mapping](class_upnp#class-upnp-method-delete-port-mapping). ### [bool](class_bool#class-bool) is\_valid\_gateway ( ) const Returns `true` if this is a valid IGD (InternetGatewayDevice) which potentially supports port forwarding. ### [String](class_string#class-string) query\_external\_address ( ) const Returns the external IP address of this `UPNPDevice` or an empty string.
programming_docs
godot Time Time ==== **Inherits:** [Object](class_object#class-object) Time singleton for working with time. Description ----------- The Time singleton allows converting time between various formats and also getting time information from the system. This class conforms with as many of the ISO 8601 standards as possible. All dates follow the Proleptic Gregorian calendar. As such, the day before `1582-10-15` is `1582-10-14`, not `1582-10-04`. The year before 1 AD (aka 1 BC) is number `0`, with the year before that (2 BC) being `-1`, etc. Conversion methods assume "the same timezone", and do not handle timezone conversions or DST automatically. Leap seconds are also not handled, they must be done manually if desired. Suffixes such as "Z" are not handled, you need to strip them away manually. When getting time information from the system, the time can either be in the local timezone or UTC depending on the `utc` parameter. However, the [get\_unix\_time\_from\_system](#class-time-method-get-unix-time-from-system) method always returns the time in UTC. **Important:** The `_from_system` methods use the system clock that the user can manually set. **Never use** this method for precise time calculation since its results are subject to automatic adjustments by the user or the operating system. **Always use** [get\_ticks\_usec](#class-time-method-get-ticks-usec) or [get\_ticks\_msec](#class-time-method-get-ticks-msec) for precise time calculation instead, since they are guaranteed to be monotonic (i.e. never decrease). Methods ------- | | | | --- | --- | | [Dictionary](class_dictionary#class-dictionary) | [get\_date\_dict\_from\_system](#class-time-method-get-date-dict-from-system) **(** [bool](class_bool#class-bool) utc=false **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_date\_dict\_from\_unix\_time](#class-time-method-get-date-dict-from-unix-time) **(** [int](class_int#class-int) unix\_time\_val **)** const | | [String](class_string#class-string) | [get\_date\_string\_from\_system](#class-time-method-get-date-string-from-system) **(** [bool](class_bool#class-bool) utc=false **)** const | | [String](class_string#class-string) | [get\_date\_string\_from\_unix\_time](#class-time-method-get-date-string-from-unix-time) **(** [int](class_int#class-int) unix\_time\_val **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_datetime\_dict\_from\_datetime\_string](#class-time-method-get-datetime-dict-from-datetime-string) **(** [String](class_string#class-string) datetime, [bool](class_bool#class-bool) weekday **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_datetime\_dict\_from\_system](#class-time-method-get-datetime-dict-from-system) **(** [bool](class_bool#class-bool) utc=false **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_datetime\_dict\_from\_unix\_time](#class-time-method-get-datetime-dict-from-unix-time) **(** [int](class_int#class-int) unix\_time\_val **)** const | | [String](class_string#class-string) | [get\_datetime\_string\_from\_datetime\_dict](#class-time-method-get-datetime-string-from-datetime-dict) **(** [Dictionary](class_dictionary#class-dictionary) datetime, [bool](class_bool#class-bool) use\_space **)** const | | [String](class_string#class-string) | [get\_datetime\_string\_from\_system](#class-time-method-get-datetime-string-from-system) **(** [bool](class_bool#class-bool) utc=false, [bool](class_bool#class-bool) use\_space=false **)** const | | [String](class_string#class-string) | [get\_datetime\_string\_from\_unix\_time](#class-time-method-get-datetime-string-from-unix-time) **(** [int](class_int#class-int) unix\_time\_val, [bool](class_bool#class-bool) use\_space=false **)** const | | [String](class_string#class-string) | [get\_offset\_string\_from\_offset\_minutes](#class-time-method-get-offset-string-from-offset-minutes) **(** [int](class_int#class-int) offset\_minutes **)** const | | [int](class_int#class-int) | [get\_ticks\_msec](#class-time-method-get-ticks-msec) **(** **)** const | | [int](class_int#class-int) | [get\_ticks\_usec](#class-time-method-get-ticks-usec) **(** **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_time\_dict\_from\_system](#class-time-method-get-time-dict-from-system) **(** [bool](class_bool#class-bool) utc=false **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_time\_dict\_from\_unix\_time](#class-time-method-get-time-dict-from-unix-time) **(** [int](class_int#class-int) unix\_time\_val **)** const | | [String](class_string#class-string) | [get\_time\_string\_from\_system](#class-time-method-get-time-string-from-system) **(** [bool](class_bool#class-bool) utc=false **)** const | | [String](class_string#class-string) | [get\_time\_string\_from\_unix\_time](#class-time-method-get-time-string-from-unix-time) **(** [int](class_int#class-int) unix\_time\_val **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_time\_zone\_from\_system](#class-time-method-get-time-zone-from-system) **(** **)** const | | [int](class_int#class-int) | [get\_unix\_time\_from\_datetime\_dict](#class-time-method-get-unix-time-from-datetime-dict) **(** [Dictionary](class_dictionary#class-dictionary) datetime **)** const | | [int](class_int#class-int) | [get\_unix\_time\_from\_datetime\_string](#class-time-method-get-unix-time-from-datetime-string) **(** [String](class_string#class-string) datetime **)** const | | [float](class_float#class-float) | [get\_unix\_time\_from\_system](#class-time-method-get-unix-time-from-system) **(** **)** const | Enumerations ------------ enum **Month**: * **MONTH\_JANUARY** = **1** --- The month of January, represented numerically as `01`. * **MONTH\_FEBRUARY** = **2** --- The month of February, represented numerically as `02`. * **MONTH\_MARCH** = **3** --- The month of March, represented numerically as `03`. * **MONTH\_APRIL** = **4** --- The month of April, represented numerically as `04`. * **MONTH\_MAY** = **5** --- The month of May, represented numerically as `05`. * **MONTH\_JUNE** = **6** --- The month of June, represented numerically as `06`. * **MONTH\_JULY** = **7** --- The month of July, represented numerically as `07`. * **MONTH\_AUGUST** = **8** --- The month of August, represented numerically as `08`. * **MONTH\_SEPTEMBER** = **9** --- The month of September, represented numerically as `09`. * **MONTH\_OCTOBER** = **10** --- The month of October, represented numerically as `10`. * **MONTH\_NOVEMBER** = **11** --- The month of November, represented numerically as `11`. * **MONTH\_DECEMBER** = **12** --- The month of December, represented numerically as `12`. enum **Weekday**: * **WEEKDAY\_SUNDAY** = **0** --- The day of the week Sunday, represented numerically as `0`. * **WEEKDAY\_MONDAY** = **1** --- The day of the week Monday, represented numerically as `1`. * **WEEKDAY\_TUESDAY** = **2** --- The day of the week Tuesday, represented numerically as `2`. * **WEEKDAY\_WEDNESDAY** = **3** --- The day of the week Wednesday, represented numerically as `3`. * **WEEKDAY\_THURSDAY** = **4** --- The day of the week Thursday, represented numerically as `4`. * **WEEKDAY\_FRIDAY** = **5** --- The day of the week Friday, represented numerically as `5`. * **WEEKDAY\_SATURDAY** = **6** --- The day of the week Saturday, represented numerically as `6`. Method Descriptions ------------------- ### [Dictionary](class_dictionary#class-dictionary) get\_date\_dict\_from\_system ( [bool](class_bool#class-bool) utc=false ) const Returns the current date as a dictionary of keys: `year`, `month`, `day`, `weekday`, and `dst` (Daylight Savings Time). The returned values are in the system's local time when `utc` is false, otherwise they are in UTC. ### [Dictionary](class_dictionary#class-dictionary) get\_date\_dict\_from\_unix\_time ( [int](class_int#class-int) unix\_time\_val ) const Converts the given Unix timestamp to a dictionary of keys: `year`, `month`, `day`, and `weekday`. ### [String](class_string#class-string) get\_date\_string\_from\_system ( [bool](class_bool#class-bool) utc=false ) const Returns the current date as an ISO 8601 date string (YYYY-MM-DD). The returned values are in the system's local time when `utc` is false, otherwise they are in UTC. ### [String](class_string#class-string) get\_date\_string\_from\_unix\_time ( [int](class_int#class-int) unix\_time\_val ) const Converts the given Unix timestamp to an ISO 8601 date string (YYYY-MM-DD). ### [Dictionary](class_dictionary#class-dictionary) get\_datetime\_dict\_from\_datetime\_string ( [String](class_string#class-string) datetime, [bool](class_bool#class-bool) weekday ) const Converts the given ISO 8601 date and time string (YYYY-MM-DDTHH:MM:SS) to a dictionary of keys: `year`, `month`, `day`, `weekday`, `hour`, `minute`, and `second`. If `weekday` is false, then the `weekday` entry is excluded (the calculation is relatively expensive). **Note:** Any decimal fraction in the time string will be ignored silently. ### [Dictionary](class_dictionary#class-dictionary) get\_datetime\_dict\_from\_system ( [bool](class_bool#class-bool) utc=false ) const Returns the current date as a dictionary of keys: `year`, `month`, `day`, `weekday`, `hour`, `minute`, and `second`. ### [Dictionary](class_dictionary#class-dictionary) get\_datetime\_dict\_from\_unix\_time ( [int](class_int#class-int) unix\_time\_val ) const Converts the given Unix timestamp to a dictionary of keys: `year`, `month`, `day`, and `weekday`. The returned Dictionary's values will be the same as the [get\_datetime\_dict\_from\_system](#class-time-method-get-datetime-dict-from-system) if the Unix timestamp is the current time, with the exception of Daylight Savings Time as it cannot be determined from the epoch. ### [String](class_string#class-string) get\_datetime\_string\_from\_datetime\_dict ( [Dictionary](class_dictionary#class-dictionary) datetime, [bool](class_bool#class-bool) use\_space ) const Converts the given dictionary of keys to an ISO 8601 date and time string (YYYY-MM-DDTHH:MM:SS). The given dictionary can be populated with the following keys: `year`, `month`, `day`, `hour`, `minute`, and `second`. Any other entries (including `dst`) are ignored. If the dictionary is empty, `0` is returned. If some keys are omitted, they default to the equivalent values for the Unix epoch timestamp 0 (1970-01-01 at 00:00:00). If `use_space` is true, use a space instead of the letter T in the middle. ### [String](class_string#class-string) get\_datetime\_string\_from\_system ( [bool](class_bool#class-bool) utc=false, [bool](class_bool#class-bool) use\_space=false ) const Returns the current date and time as an ISO 8601 date and time string (YYYY-MM-DDTHH:MM:SS). The returned values are in the system's local time when `utc` is false, otherwise they are in UTC. If `use_space` is true, use a space instead of the letter T in the middle. ### [String](class_string#class-string) get\_datetime\_string\_from\_unix\_time ( [int](class_int#class-int) unix\_time\_val, [bool](class_bool#class-bool) use\_space=false ) const Converts the given Unix timestamp to an ISO 8601 date and time string (YYYY-MM-DDTHH:MM:SS). If `use_space` is true, use a space instead of the letter T in the middle. ### [String](class_string#class-string) get\_offset\_string\_from\_offset\_minutes ( [int](class_int#class-int) offset\_minutes ) const Converts the given timezone offset in minutes to a timezone offset string. For example, -480 returns "-08:00", 345 returns "+05:45", and 0 returns "+00:00". ### [int](class_int#class-int) get\_ticks\_msec ( ) const Returns the amount of time passed in milliseconds since the engine started. Will always be positive or 0 and uses a 64-bit value (it will wrap after roughly 500 million years). ### [int](class_int#class-int) get\_ticks\_usec ( ) const Returns the amount of time passed in microseconds since the engine started. Will always be positive or 0 and uses a 64-bit value (it will wrap after roughly half a million years). ### [Dictionary](class_dictionary#class-dictionary) get\_time\_dict\_from\_system ( [bool](class_bool#class-bool) utc=false ) const Returns the current time as a dictionary of keys: `hour`, `minute`, and `second`. The returned values are in the system's local time when `utc` is false, otherwise they are in UTC. ### [Dictionary](class_dictionary#class-dictionary) get\_time\_dict\_from\_unix\_time ( [int](class_int#class-int) unix\_time\_val ) const Converts the given time to a dictionary of keys: `hour`, `minute`, and `second`. ### [String](class_string#class-string) get\_time\_string\_from\_system ( [bool](class_bool#class-bool) utc=false ) const Returns the current time as an ISO 8601 time string (HH:MM:SS). The returned values are in the system's local time when `utc` is false, otherwise they are in UTC. ### [String](class_string#class-string) get\_time\_string\_from\_unix\_time ( [int](class_int#class-int) unix\_time\_val ) const Converts the given Unix timestamp to an ISO 8601 time string (HH:MM:SS). ### [Dictionary](class_dictionary#class-dictionary) get\_time\_zone\_from\_system ( ) const Returns the current time zone as a dictionary of keys: `bias` and `name`. The `bias` value is the offset from UTC in minutes, since not all time zones are multiples of an hour from UTC. ### [int](class_int#class-int) get\_unix\_time\_from\_datetime\_dict ( [Dictionary](class_dictionary#class-dictionary) datetime ) const Converts a dictionary of time values to a Unix timestamp. The given dictionary can be populated with the following keys: `year`, `month`, `day`, `hour`, `minute`, and `second`. Any other entries (including `dst`) are ignored. If the dictionary is empty, `0` is returned. If some keys are omitted, they default to the equivalent values for the Unix epoch timestamp 0 (1970-01-01 at 00:00:00). You can pass the output from [get\_datetime\_dict\_from\_unix\_time](#class-time-method-get-datetime-dict-from-unix-time) directly into this function and get the same as what was put in. **Note:** Unix timestamps are often in UTC. This method does not do any timezone conversion, so the timestamp will be in the same timezone as the given datetime dictionary. ### [int](class_int#class-int) get\_unix\_time\_from\_datetime\_string ( [String](class_string#class-string) datetime ) const Converts the given ISO 8601 date and/or time string to a Unix timestamp. The string can contain a date only, a time only, or both. **Note:** Unix timestamps are often in UTC. This method does not do any timezone conversion, so the timestamp will be in the same timezone as the given datetime string. **Note:** Any decimal fraction in the time string will be ignored silently. ### [float](class_float#class-float) get\_unix\_time\_from\_system ( ) const Returns the current Unix timestamp in seconds based on the system time in UTC. This method is implemented by the operating system and always returns the time in UTC. **Note:** Unlike other methods that use integer timestamps, this method returns the timestamp as a [float](class_float#class-float) for sub-second precision. godot CircleShape2D CircleShape2D ============= **Inherits:** [Shape2D](class_shape2d#class-shape2d) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Circular shape for 2D collisions. Description ----------- Circular shape for 2D collisions. This shape is useful for modeling balls or small characters and its collision detection with everything else is very fast. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [radius](#class-circleshape2d-property-radius) | `10.0` | Property Descriptions --------------------- ### [float](class_float#class-float) radius | | | | --- | --- | | *Default* | `10.0` | | *Setter* | set\_radius(value) | | *Getter* | get\_radius() | The circle's radius. godot JSONParseResult JSONParseResult =============== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Data class wrapper for decoded JSON. Description ----------- Returned by [JSON.parse](class_json#class-json-method-parse), `JSONParseResult` contains the decoded JSON or error information if the JSON source wasn't successfully parsed. You can check if the JSON source was successfully parsed with `if json_result.error == OK`. Properties ---------- | | | | | --- | --- | --- | | [Error](class_%40globalscope#enum-globalscope-error) | [error](#class-jsonparseresult-property-error) | | | [int](class_int#class-int) | [error\_line](#class-jsonparseresult-property-error-line) | `-1` | | [String](class_string#class-string) | [error\_string](#class-jsonparseresult-property-error-string) | `""` | | [Variant](class_variant#class-variant) | [result](#class-jsonparseresult-property-result) | | Property Descriptions --------------------- ### [Error](class_%40globalscope#enum-globalscope-error) error | | | | --- | --- | | *Setter* | set\_error(value) | | *Getter* | get\_error() | The error type if the JSON source was not successfully parsed. See the [Error](class_%40globalscope#enum-globalscope-error) constants. ### [int](class_int#class-int) error\_line | | | | --- | --- | | *Default* | `-1` | | *Setter* | set\_error\_line(value) | | *Getter* | get\_error\_line() | The line number where the error occurred if the JSON source was not successfully parsed. ### [String](class_string#class-string) error\_string | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_error\_string(value) | | *Getter* | get\_error\_string() | The error message if the JSON source was not successfully parsed. See the [Error](class_%40globalscope#enum-globalscope-error) constants. ### [Variant](class_variant#class-variant) result | | | | --- | --- | | *Setter* | set\_result(value) | | *Getter* | get\_result() | A [Variant](class_variant#class-variant) containing the parsed JSON. Use [@GDScript.typeof](class_%40gdscript#class-gdscript-method-typeof) or the `is` keyword to check if it is what you expect. For example, if the JSON source starts with curly braces (`{}`), a [Dictionary](class_dictionary#class-dictionary) will be returned. If the JSON source starts with brackets (`[]`), an [Array](class_array#class-array) will be returned. **Note:** The JSON specification does not define integer or float types, but only a *number* type. Therefore, parsing a JSON text will convert all numerical values to [float](class_float#class-float) types. **Note:** JSON objects do not preserve key order like Godot dictionaries, thus, you should not rely on keys being in a certain order if a dictionary is constructed from JSON. In contrast, JSON arrays retain the order of their elements: ``` var p = JSON.parse('["hello", "world", "!"]') if typeof(p.result) == TYPE_ARRAY: print(p.result[0]) # Prints "hello" else: push_error("Unexpected results.") ``` godot AStar2D AStar2D ======= **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) AStar class representation that uses 2D vectors as edges. Description ----------- This is a wrapper for the [AStar](class_astar#class-astar) class which uses 2D vectors instead of 3D vectors. Methods ------- | | | | --- | --- | | [float](class_float#class-float) | [\_compute\_cost](#class-astar2d-method-compute-cost) **(** [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id **)** virtual | | [float](class_float#class-float) | [\_estimate\_cost](#class-astar2d-method-estimate-cost) **(** [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id **)** virtual | | void | [add\_point](#class-astar2d-method-add-point) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) position, [float](class_float#class-float) weight\_scale=1.0 **)** | | [bool](class_bool#class-bool) | [are\_points\_connected](#class-astar2d-method-are-points-connected) **(** [int](class_int#class-int) id, [int](class_int#class-int) to\_id, [bool](class_bool#class-bool) bidirectional=true **)** const | | void | [clear](#class-astar2d-method-clear) **(** **)** | | void | [connect\_points](#class-astar2d-method-connect-points) **(** [int](class_int#class-int) id, [int](class_int#class-int) to\_id, [bool](class_bool#class-bool) bidirectional=true **)** | | void | [disconnect\_points](#class-astar2d-method-disconnect-points) **(** [int](class_int#class-int) id, [int](class_int#class-int) to\_id, [bool](class_bool#class-bool) bidirectional=true **)** | | [int](class_int#class-int) | [get\_available\_point\_id](#class-astar2d-method-get-available-point-id) **(** **)** const | | [int](class_int#class-int) | [get\_closest\_point](#class-astar2d-method-get-closest-point) **(** [Vector2](class_vector2#class-vector2) to\_position, [bool](class_bool#class-bool) include\_disabled=false **)** const | | [Vector2](class_vector2#class-vector2) | [get\_closest\_position\_in\_segment](#class-astar2d-method-get-closest-position-in-segment) **(** [Vector2](class_vector2#class-vector2) to\_position **)** const | | [PoolIntArray](class_poolintarray#class-poolintarray) | [get\_id\_path](#class-astar2d-method-get-id-path) **(** [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id **)** | | [int](class_int#class-int) | [get\_point\_capacity](#class-astar2d-method-get-point-capacity) **(** **)** const | | [PoolIntArray](class_poolintarray#class-poolintarray) | [get\_point\_connections](#class-astar2d-method-get-point-connections) **(** [int](class_int#class-int) id **)** | | [int](class_int#class-int) | [get\_point\_count](#class-astar2d-method-get-point-count) **(** **)** const | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [get\_point\_path](#class-astar2d-method-get-point-path) **(** [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id **)** | | [Vector2](class_vector2#class-vector2) | [get\_point\_position](#class-astar2d-method-get-point-position) **(** [int](class_int#class-int) id **)** const | | [float](class_float#class-float) | [get\_point\_weight\_scale](#class-astar2d-method-get-point-weight-scale) **(** [int](class_int#class-int) id **)** const | | [Array](class_array#class-array) | [get\_points](#class-astar2d-method-get-points) **(** **)** | | [bool](class_bool#class-bool) | [has\_point](#class-astar2d-method-has-point) **(** [int](class_int#class-int) id **)** const | | [bool](class_bool#class-bool) | [is\_point\_disabled](#class-astar2d-method-is-point-disabled) **(** [int](class_int#class-int) id **)** const | | void | [remove\_point](#class-astar2d-method-remove-point) **(** [int](class_int#class-int) id **)** | | void | [reserve\_space](#class-astar2d-method-reserve-space) **(** [int](class_int#class-int) num\_nodes **)** | | void | [set\_point\_disabled](#class-astar2d-method-set-point-disabled) **(** [int](class_int#class-int) id, [bool](class_bool#class-bool) disabled=true **)** | | void | [set\_point\_position](#class-astar2d-method-set-point-position) **(** [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) position **)** | | void | [set\_point\_weight\_scale](#class-astar2d-method-set-point-weight-scale) **(** [int](class_int#class-int) id, [float](class_float#class-float) weight\_scale **)** | Method Descriptions ------------------- ### [float](class_float#class-float) \_compute\_cost ( [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id ) virtual Called when computing the cost between two connected points. Note that this function is hidden in the default `AStar2D` class. ### [float](class_float#class-float) \_estimate\_cost ( [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id ) virtual Called when estimating the cost between a point and the path's ending point. Note that this function is hidden in the default `AStar2D` class. ### void add\_point ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) position, [float](class_float#class-float) weight\_scale=1.0 ) Adds a new point at the given position with the given identifier. The `id` must be 0 or larger, and the `weight_scale` must be 0.0 or greater. The `weight_scale` is multiplied by the result of [\_compute\_cost](#class-astar2d-method-compute-cost) when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower `weight_scale`s to form a path. ``` var astar = AStar2D.new() astar.add_point(1, Vector2(1, 0), 4) # Adds the point (1, 0) with weight_scale 4 and id 1 ``` If there already exists a point for the given `id`, its position and weight scale are updated to the given values. ### [bool](class_bool#class-bool) are\_points\_connected ( [int](class_int#class-int) id, [int](class_int#class-int) to\_id, [bool](class_bool#class-bool) bidirectional=true ) const Returns whether there is a connection/segment between the given points. If `bidirectional` is `false`, returns whether movement from `id` to `to_id` is possible through this segment. ### void clear ( ) Clears all the points and segments. ### void connect\_points ( [int](class_int#class-int) id, [int](class_int#class-int) to\_id, [bool](class_bool#class-bool) bidirectional=true ) Creates a segment between the given points. If `bidirectional` is `false`, only movement from `id` to `to_id` is allowed, not the reverse direction. ``` var astar = AStar2D.new() astar.add_point(1, Vector2(1, 1)) astar.add_point(2, Vector2(0, 5)) astar.connect_points(1, 2, false) ``` ### void disconnect\_points ( [int](class_int#class-int) id, [int](class_int#class-int) to\_id, [bool](class_bool#class-bool) bidirectional=true ) Deletes the segment between the given points. If `bidirectional` is `false`, only movement from `id` to `to_id` is prevented, and a unidirectional segment possibly remains. ### [int](class_int#class-int) get\_available\_point\_id ( ) const Returns the next available point ID with no point associated to it. ### [int](class_int#class-int) get\_closest\_point ( [Vector2](class_vector2#class-vector2) to\_position, [bool](class_bool#class-bool) include\_disabled=false ) const Returns the ID of the closest point to `to_position`, optionally taking disabled points into account. Returns `-1` if there are no points in the points pool. **Note:** If several points are the closest to `to_position`, the one with the smallest ID will be returned, ensuring a deterministic result. ### [Vector2](class_vector2#class-vector2) get\_closest\_position\_in\_segment ( [Vector2](class_vector2#class-vector2) to\_position ) const Returns the closest position to `to_position` that resides inside a segment between two connected points. ``` var astar = AStar2D.new() astar.add_point(1, Vector2(0, 0)) astar.add_point(2, Vector2(0, 5)) astar.connect_points(1, 2) var res = astar.get_closest_position_in_segment(Vector2(3, 3)) # Returns (0, 3) ``` The result is in the segment that goes from `y = 0` to `y = 5`. It's the closest position in the segment to the given point. ### [PoolIntArray](class_poolintarray#class-poolintarray) get\_id\_path ( [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id ) Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. ``` var astar = AStar2D.new() astar.add_point(1, Vector2(0, 0)) astar.add_point(2, Vector2(0, 1), 1) # Default weight is 1 astar.add_point(3, Vector2(1, 1)) astar.add_point(4, Vector2(2, 0)) astar.connect_points(1, 2, false) astar.connect_points(2, 3, false) astar.connect_points(4, 3, false) astar.connect_points(1, 4, false) var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] ``` If you change the 2nd point's weight to 3, then the result will be `[1, 4, 3]` instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. ### [int](class_int#class-int) get\_point\_capacity ( ) const Returns the capacity of the structure backing the points, useful in conjunction with `reserve_space`. ### [PoolIntArray](class_poolintarray#class-poolintarray) get\_point\_connections ( [int](class_int#class-int) id ) Returns an array with the IDs of the points that form the connection with the given point. ``` var astar = AStar2D.new() astar.add_point(1, Vector2(0, 0)) astar.add_point(2, Vector2(0, 1)) astar.add_point(3, Vector2(1, 1)) astar.add_point(4, Vector2(2, 0)) astar.connect_points(1, 2, true) astar.connect_points(1, 3, true) var neighbors = astar.get_point_connections(1) # Returns [2, 3] ``` ### [int](class_int#class-int) get\_point\_count ( ) const Returns the number of points currently in the points pool. ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) get\_point\_path ( [int](class_int#class-int) from\_id, [int](class_int#class-int) to\_id ) Returns an array with the points that are in the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. **Note:** This method is not thread-safe. If called from a [Thread](class_thread#class-thread), it will return an empty [PoolVector2Array](class_poolvector2array#class-poolvector2array) and will print an error message. ### [Vector2](class_vector2#class-vector2) get\_point\_position ( [int](class_int#class-int) id ) const Returns the position of the point associated with the given `id`. ### [float](class_float#class-float) get\_point\_weight\_scale ( [int](class_int#class-int) id ) const Returns the weight scale of the point associated with the given `id`. ### [Array](class_array#class-array) get\_points ( ) Returns an array of all points. ### [bool](class_bool#class-bool) has\_point ( [int](class_int#class-int) id ) const Returns whether a point associated with the given `id` exists. ### [bool](class_bool#class-bool) is\_point\_disabled ( [int](class_int#class-int) id ) const Returns whether a point is disabled or not for pathfinding. By default, all points are enabled. ### void remove\_point ( [int](class_int#class-int) id ) Removes the point associated with the given `id` from the points pool. ### void reserve\_space ( [int](class_int#class-int) num\_nodes ) Reserves space internally for `num_nodes` points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity. ### void set\_point\_disabled ( [int](class_int#class-int) id, [bool](class_bool#class-bool) disabled=true ) Disables or enables the specified point for pathfinding. Useful for making a temporary obstacle. ### void set\_point\_position ( [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) position ) Sets the `position` for the point with the given `id`. ### void set\_point\_weight\_scale ( [int](class_int#class-int) id, [float](class_float#class-float) weight\_scale ) Sets the `weight_scale` for the point with the given `id`. The `weight_scale` is multiplied by the result of [\_compute\_cost](#class-astar2d-method-compute-cost) when determining the overall cost of traveling across a segment from a neighboring point to this point.
programming_docs
godot PhysicsServer PhysicsServer ============= **Inherits:** [Object](class_object#class-object) Server interface for low-level physics access. Description ----------- PhysicsServer is the server responsible for all 3D physics. It can create many kinds of physics objects, but does not insert them on the node tree. Methods ------- | | | | --- | --- | | void | [area\_add\_shape](#class-physicsserver-method-area-add-shape) **(** [RID](class_rid#class-rid) area, [RID](class_rid#class-rid) shape, [Transform](class_transform#class-transform) transform=Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ), [bool](class_bool#class-bool) disabled=false **)** | | void | [area\_attach\_object\_instance\_id](#class-physicsserver-method-area-attach-object-instance-id) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) id **)** | | void | [area\_clear\_shapes](#class-physicsserver-method-area-clear-shapes) **(** [RID](class_rid#class-rid) area **)** | | [RID](class_rid#class-rid) | [area\_create](#class-physicsserver-method-area-create) **(** **)** | | [int](class_int#class-int) | [area\_get\_object\_instance\_id](#class-physicsserver-method-area-get-object-instance-id) **(** [RID](class_rid#class-rid) area **)** const | | [Variant](class_variant#class-variant) | [area\_get\_param](#class-physicsserver-method-area-get-param) **(** [RID](class_rid#class-rid) area, [AreaParameter](#enum-physicsserver-areaparameter) param **)** const | | [RID](class_rid#class-rid) | [area\_get\_shape](#class-physicsserver-method-area-get-shape) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx **)** const | | [int](class_int#class-int) | [area\_get\_shape\_count](#class-physicsserver-method-area-get-shape-count) **(** [RID](class_rid#class-rid) area **)** const | | [Transform](class_transform#class-transform) | [area\_get\_shape\_transform](#class-physicsserver-method-area-get-shape-transform) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx **)** const | | [RID](class_rid#class-rid) | [area\_get\_space](#class-physicsserver-method-area-get-space) **(** [RID](class_rid#class-rid) area **)** const | | [AreaSpaceOverrideMode](#enum-physicsserver-areaspaceoverridemode) | [area\_get\_space\_override\_mode](#class-physicsserver-method-area-get-space-override-mode) **(** [RID](class_rid#class-rid) area **)** const | | [Transform](class_transform#class-transform) | [area\_get\_transform](#class-physicsserver-method-area-get-transform) **(** [RID](class_rid#class-rid) area **)** const | | [bool](class_bool#class-bool) | [area\_is\_ray\_pickable](#class-physicsserver-method-area-is-ray-pickable) **(** [RID](class_rid#class-rid) area **)** const | | void | [area\_remove\_shape](#class-physicsserver-method-area-remove-shape) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx **)** | | void | [area\_set\_area\_monitor\_callback](#class-physicsserver-method-area-set-area-monitor-callback) **(** [RID](class_rid#class-rid) area, [Object](class_object#class-object) receiver, [String](class_string#class-string) method **)** | | void | [area\_set\_collision\_layer](#class-physicsserver-method-area-set-collision-layer) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) layer **)** | | void | [area\_set\_collision\_mask](#class-physicsserver-method-area-set-collision-mask) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) mask **)** | | void | [area\_set\_monitor\_callback](#class-physicsserver-method-area-set-monitor-callback) **(** [RID](class_rid#class-rid) area, [Object](class_object#class-object) receiver, [String](class_string#class-string) method **)** | | void | [area\_set\_monitorable](#class-physicsserver-method-area-set-monitorable) **(** [RID](class_rid#class-rid) area, [bool](class_bool#class-bool) monitorable **)** | | void | [area\_set\_param](#class-physicsserver-method-area-set-param) **(** [RID](class_rid#class-rid) area, [AreaParameter](#enum-physicsserver-areaparameter) param, [Variant](class_variant#class-variant) value **)** | | void | [area\_set\_ray\_pickable](#class-physicsserver-method-area-set-ray-pickable) **(** [RID](class_rid#class-rid) area, [bool](class_bool#class-bool) enable **)** | | void | [area\_set\_shape](#class-physicsserver-method-area-set-shape) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx, [RID](class_rid#class-rid) shape **)** | | void | [area\_set\_shape\_disabled](#class-physicsserver-method-area-set-shape-disabled) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx, [bool](class_bool#class-bool) disabled **)** | | void | [area\_set\_shape\_transform](#class-physicsserver-method-area-set-shape-transform) **(** [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx, [Transform](class_transform#class-transform) transform **)** | | void | [area\_set\_space](#class-physicsserver-method-area-set-space) **(** [RID](class_rid#class-rid) area, [RID](class_rid#class-rid) space **)** | | void | [area\_set\_space\_override\_mode](#class-physicsserver-method-area-set-space-override-mode) **(** [RID](class_rid#class-rid) area, [AreaSpaceOverrideMode](#enum-physicsserver-areaspaceoverridemode) mode **)** | | void | [area\_set\_transform](#class-physicsserver-method-area-set-transform) **(** [RID](class_rid#class-rid) area, [Transform](class_transform#class-transform) transform **)** | | void | [body\_add\_central\_force](#class-physicsserver-method-body-add-central-force) **(** [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) force **)** | | void | [body\_add\_collision\_exception](#class-physicsserver-method-body-add-collision-exception) **(** [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) excepted\_body **)** | | void | [body\_add\_force](#class-physicsserver-method-body-add-force) **(** [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) force, [Vector3](class_vector3#class-vector3) position **)** | | void | [body\_add\_shape](#class-physicsserver-method-body-add-shape) **(** [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) shape, [Transform](class_transform#class-transform) transform=Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ), [bool](class_bool#class-bool) disabled=false **)** | | void | [body\_add\_torque](#class-physicsserver-method-body-add-torque) **(** [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) torque **)** | | void | [body\_apply\_central\_impulse](#class-physicsserver-method-body-apply-central-impulse) **(** [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) impulse **)** | | void | [body\_apply\_impulse](#class-physicsserver-method-body-apply-impulse) **(** [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) position, [Vector3](class_vector3#class-vector3) impulse **)** | | void | [body\_apply\_torque\_impulse](#class-physicsserver-method-body-apply-torque-impulse) **(** [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) impulse **)** | | void | [body\_attach\_object\_instance\_id](#class-physicsserver-method-body-attach-object-instance-id) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) id **)** | | void | [body\_clear\_shapes](#class-physicsserver-method-body-clear-shapes) **(** [RID](class_rid#class-rid) body **)** | | [RID](class_rid#class-rid) | [body\_create](#class-physicsserver-method-body-create) **(** [BodyMode](#enum-physicsserver-bodymode) mode=2, [bool](class_bool#class-bool) init\_sleeping=false **)** | | [int](class_int#class-int) | [body\_get\_collision\_layer](#class-physicsserver-method-body-get-collision-layer) **(** [RID](class_rid#class-rid) body **)** const | | [int](class_int#class-int) | [body\_get\_collision\_mask](#class-physicsserver-method-body-get-collision-mask) **(** [RID](class_rid#class-rid) body **)** const | | [PhysicsDirectBodyState](class_physicsdirectbodystate#class-physicsdirectbodystate) | [body\_get\_direct\_state](#class-physicsserver-method-body-get-direct-state) **(** [RID](class_rid#class-rid) body **)** | | [float](class_float#class-float) | [body\_get\_kinematic\_safe\_margin](#class-physicsserver-method-body-get-kinematic-safe-margin) **(** [RID](class_rid#class-rid) body **)** const | | [int](class_int#class-int) | [body\_get\_max\_contacts\_reported](#class-physicsserver-method-body-get-max-contacts-reported) **(** [RID](class_rid#class-rid) body **)** const | | [BodyMode](#enum-physicsserver-bodymode) | [body\_get\_mode](#class-physicsserver-method-body-get-mode) **(** [RID](class_rid#class-rid) body **)** const | | [int](class_int#class-int) | [body\_get\_object\_instance\_id](#class-physicsserver-method-body-get-object-instance-id) **(** [RID](class_rid#class-rid) body **)** const | | [float](class_float#class-float) | [body\_get\_param](#class-physicsserver-method-body-get-param) **(** [RID](class_rid#class-rid) body, [BodyParameter](#enum-physicsserver-bodyparameter) param **)** const | | [RID](class_rid#class-rid) | [body\_get\_shape](#class-physicsserver-method-body-get-shape) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx **)** const | | [int](class_int#class-int) | [body\_get\_shape\_count](#class-physicsserver-method-body-get-shape-count) **(** [RID](class_rid#class-rid) body **)** const | | [Transform](class_transform#class-transform) | [body\_get\_shape\_transform](#class-physicsserver-method-body-get-shape-transform) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx **)** const | | [RID](class_rid#class-rid) | [body\_get\_space](#class-physicsserver-method-body-get-space) **(** [RID](class_rid#class-rid) body **)** const | | [Variant](class_variant#class-variant) | [body\_get\_state](#class-physicsserver-method-body-get-state) **(** [RID](class_rid#class-rid) body, [BodyState](#enum-physicsserver-bodystate) state **)** const | | [bool](class_bool#class-bool) | [body\_is\_axis\_locked](#class-physicsserver-method-body-is-axis-locked) **(** [RID](class_rid#class-rid) body, [BodyAxis](#enum-physicsserver-bodyaxis) axis **)** const | | [bool](class_bool#class-bool) | [body\_is\_continuous\_collision\_detection\_enabled](#class-physicsserver-method-body-is-continuous-collision-detection-enabled) **(** [RID](class_rid#class-rid) body **)** const | | [bool](class_bool#class-bool) | [body\_is\_omitting\_force\_integration](#class-physicsserver-method-body-is-omitting-force-integration) **(** [RID](class_rid#class-rid) body **)** const | | [bool](class_bool#class-bool) | [body\_is\_ray\_pickable](#class-physicsserver-method-body-is-ray-pickable) **(** [RID](class_rid#class-rid) body **)** const | | void | [body\_remove\_collision\_exception](#class-physicsserver-method-body-remove-collision-exception) **(** [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) excepted\_body **)** | | void | [body\_remove\_shape](#class-physicsserver-method-body-remove-shape) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx **)** | | void | [body\_set\_axis\_lock](#class-physicsserver-method-body-set-axis-lock) **(** [RID](class_rid#class-rid) body, [BodyAxis](#enum-physicsserver-bodyaxis) axis, [bool](class_bool#class-bool) lock **)** | | void | [body\_set\_axis\_velocity](#class-physicsserver-method-body-set-axis-velocity) **(** [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) axis\_velocity **)** | | void | [body\_set\_collision\_layer](#class-physicsserver-method-body-set-collision-layer) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) layer **)** | | void | [body\_set\_collision\_mask](#class-physicsserver-method-body-set-collision-mask) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) mask **)** | | void | [body\_set\_enable\_continuous\_collision\_detection](#class-physicsserver-method-body-set-enable-continuous-collision-detection) **(** [RID](class_rid#class-rid) body, [bool](class_bool#class-bool) enable **)** | | void | [body\_set\_force\_integration\_callback](#class-physicsserver-method-body-set-force-integration-callback) **(** [RID](class_rid#class-rid) body, [Object](class_object#class-object) receiver, [String](class_string#class-string) method, [Variant](class_variant#class-variant) userdata=null **)** | | void | [body\_set\_kinematic\_safe\_margin](#class-physicsserver-method-body-set-kinematic-safe-margin) **(** [RID](class_rid#class-rid) body, [float](class_float#class-float) margin **)** | | void | [body\_set\_max\_contacts\_reported](#class-physicsserver-method-body-set-max-contacts-reported) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) amount **)** | | void | [body\_set\_mode](#class-physicsserver-method-body-set-mode) **(** [RID](class_rid#class-rid) body, [BodyMode](#enum-physicsserver-bodymode) mode **)** | | void | [body\_set\_omit\_force\_integration](#class-physicsserver-method-body-set-omit-force-integration) **(** [RID](class_rid#class-rid) body, [bool](class_bool#class-bool) enable **)** | | void | [body\_set\_param](#class-physicsserver-method-body-set-param) **(** [RID](class_rid#class-rid) body, [BodyParameter](#enum-physicsserver-bodyparameter) param, [float](class_float#class-float) value **)** | | void | [body\_set\_ray\_pickable](#class-physicsserver-method-body-set-ray-pickable) **(** [RID](class_rid#class-rid) body, [bool](class_bool#class-bool) enable **)** | | void | [body\_set\_shape](#class-physicsserver-method-body-set-shape) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [RID](class_rid#class-rid) shape **)** | | void | [body\_set\_shape\_disabled](#class-physicsserver-method-body-set-shape-disabled) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [bool](class_bool#class-bool) disabled **)** | | void | [body\_set\_shape\_transform](#class-physicsserver-method-body-set-shape-transform) **(** [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [Transform](class_transform#class-transform) transform **)** | | void | [body\_set\_space](#class-physicsserver-method-body-set-space) **(** [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) space **)** | | void | [body\_set\_state](#class-physicsserver-method-body-set-state) **(** [RID](class_rid#class-rid) body, [BodyState](#enum-physicsserver-bodystate) state, [Variant](class_variant#class-variant) value **)** | | [bool](class_bool#class-bool) | [body\_test\_motion](#class-physicsserver-method-body-test-motion) **(** [RID](class_rid#class-rid) body, [Transform](class_transform#class-transform) from, [Vector3](class_vector3#class-vector3) motion, [bool](class_bool#class-bool) infinite\_inertia, [PhysicsTestMotionResult](class_physicstestmotionresult#class-physicstestmotionresult) result=null, [bool](class_bool#class-bool) exclude\_raycast\_shapes=true, [Array](class_array#class-array) exclude=[ ] **)** | | [float](class_float#class-float) | [cone\_twist\_joint\_get\_param](#class-physicsserver-method-cone-twist-joint-get-param) **(** [RID](class_rid#class-rid) joint, [ConeTwistJointParam](#enum-physicsserver-conetwistjointparam) param **)** const | | void | [cone\_twist\_joint\_set\_param](#class-physicsserver-method-cone-twist-joint-set-param) **(** [RID](class_rid#class-rid) joint, [ConeTwistJointParam](#enum-physicsserver-conetwistjointparam) param, [float](class_float#class-float) value **)** | | void | [free\_rid](#class-physicsserver-method-free-rid) **(** [RID](class_rid#class-rid) rid **)** | | [bool](class_bool#class-bool) | [generic\_6dof\_joint\_get\_flag](#class-physicsserver-method-generic-6dof-joint-get-flag) **(** [RID](class_rid#class-rid) joint, Vector3.Axis axis, [G6DOFJointAxisFlag](#enum-physicsserver-g6dofjointaxisflag) flag **)** | | [float](class_float#class-float) | [generic\_6dof\_joint\_get\_param](#class-physicsserver-method-generic-6dof-joint-get-param) **(** [RID](class_rid#class-rid) joint, Vector3.Axis axis, [G6DOFJointAxisParam](#enum-physicsserver-g6dofjointaxisparam) param **)** | | void | [generic\_6dof\_joint\_set\_flag](#class-physicsserver-method-generic-6dof-joint-set-flag) **(** [RID](class_rid#class-rid) joint, Vector3.Axis axis, [G6DOFJointAxisFlag](#enum-physicsserver-g6dofjointaxisflag) flag, [bool](class_bool#class-bool) enable **)** | | void | [generic\_6dof\_joint\_set\_param](#class-physicsserver-method-generic-6dof-joint-set-param) **(** [RID](class_rid#class-rid) joint, Vector3.Axis axis, [G6DOFJointAxisParam](#enum-physicsserver-g6dofjointaxisparam) param, [float](class_float#class-float) value **)** | | [int](class_int#class-int) | [get\_process\_info](#class-physicsserver-method-get-process-info) **(** [ProcessInfo](#enum-physicsserver-processinfo) process\_info **)** | | [bool](class_bool#class-bool) | [hinge\_joint\_get\_flag](#class-physicsserver-method-hinge-joint-get-flag) **(** [RID](class_rid#class-rid) joint, [HingeJointFlag](#enum-physicsserver-hingejointflag) flag **)** const | | [float](class_float#class-float) | [hinge\_joint\_get\_param](#class-physicsserver-method-hinge-joint-get-param) **(** [RID](class_rid#class-rid) joint, [HingeJointParam](#enum-physicsserver-hingejointparam) param **)** const | | void | [hinge\_joint\_set\_flag](#class-physicsserver-method-hinge-joint-set-flag) **(** [RID](class_rid#class-rid) joint, [HingeJointFlag](#enum-physicsserver-hingejointflag) flag, [bool](class_bool#class-bool) enabled **)** | | void | [hinge\_joint\_set\_param](#class-physicsserver-method-hinge-joint-set-param) **(** [RID](class_rid#class-rid) joint, [HingeJointParam](#enum-physicsserver-hingejointparam) param, [float](class_float#class-float) value **)** | | [RID](class_rid#class-rid) | [joint\_create\_cone\_twist](#class-physicsserver-method-joint-create-cone-twist) **(** [RID](class_rid#class-rid) body\_A, [Transform](class_transform#class-transform) local\_ref\_A, [RID](class_rid#class-rid) body\_B, [Transform](class_transform#class-transform) local\_ref\_B **)** | | [RID](class_rid#class-rid) | [joint\_create\_generic\_6dof](#class-physicsserver-method-joint-create-generic-6dof) **(** [RID](class_rid#class-rid) body\_A, [Transform](class_transform#class-transform) local\_ref\_A, [RID](class_rid#class-rid) body\_B, [Transform](class_transform#class-transform) local\_ref\_B **)** | | [RID](class_rid#class-rid) | [joint\_create\_hinge](#class-physicsserver-method-joint-create-hinge) **(** [RID](class_rid#class-rid) body\_A, [Transform](class_transform#class-transform) hinge\_A, [RID](class_rid#class-rid) body\_B, [Transform](class_transform#class-transform) hinge\_B **)** | | [RID](class_rid#class-rid) | [joint\_create\_pin](#class-physicsserver-method-joint-create-pin) **(** [RID](class_rid#class-rid) body\_A, [Vector3](class_vector3#class-vector3) local\_A, [RID](class_rid#class-rid) body\_B, [Vector3](class_vector3#class-vector3) local\_B **)** | | [RID](class_rid#class-rid) | [joint\_create\_slider](#class-physicsserver-method-joint-create-slider) **(** [RID](class_rid#class-rid) body\_A, [Transform](class_transform#class-transform) local\_ref\_A, [RID](class_rid#class-rid) body\_B, [Transform](class_transform#class-transform) local\_ref\_B **)** | | [int](class_int#class-int) | [joint\_get\_solver\_priority](#class-physicsserver-method-joint-get-solver-priority) **(** [RID](class_rid#class-rid) joint **)** const | | [JointType](#enum-physicsserver-jointtype) | [joint\_get\_type](#class-physicsserver-method-joint-get-type) **(** [RID](class_rid#class-rid) joint **)** const | | void | [joint\_set\_solver\_priority](#class-physicsserver-method-joint-set-solver-priority) **(** [RID](class_rid#class-rid) joint, [int](class_int#class-int) priority **)** | | [Vector3](class_vector3#class-vector3) | [pin\_joint\_get\_local\_a](#class-physicsserver-method-pin-joint-get-local-a) **(** [RID](class_rid#class-rid) joint **)** const | | [Vector3](class_vector3#class-vector3) | [pin\_joint\_get\_local\_b](#class-physicsserver-method-pin-joint-get-local-b) **(** [RID](class_rid#class-rid) joint **)** const | | [float](class_float#class-float) | [pin\_joint\_get\_param](#class-physicsserver-method-pin-joint-get-param) **(** [RID](class_rid#class-rid) joint, [PinJointParam](#enum-physicsserver-pinjointparam) param **)** const | | void | [pin\_joint\_set\_local\_a](#class-physicsserver-method-pin-joint-set-local-a) **(** [RID](class_rid#class-rid) joint, [Vector3](class_vector3#class-vector3) local\_A **)** | | void | [pin\_joint\_set\_local\_b](#class-physicsserver-method-pin-joint-set-local-b) **(** [RID](class_rid#class-rid) joint, [Vector3](class_vector3#class-vector3) local\_B **)** | | void | [pin\_joint\_set\_param](#class-physicsserver-method-pin-joint-set-param) **(** [RID](class_rid#class-rid) joint, [PinJointParam](#enum-physicsserver-pinjointparam) param, [float](class_float#class-float) value **)** | | void | [set\_active](#class-physicsserver-method-set-active) **(** [bool](class_bool#class-bool) active **)** | | void | [set\_collision\_iterations](#class-physicsserver-method-set-collision-iterations) **(** [int](class_int#class-int) iterations **)** | | [RID](class_rid#class-rid) | [shape\_create](#class-physicsserver-method-shape-create) **(** [ShapeType](#enum-physicsserver-shapetype) type **)** | | [Variant](class_variant#class-variant) | [shape\_get\_data](#class-physicsserver-method-shape-get-data) **(** [RID](class_rid#class-rid) shape **)** const | | [ShapeType](#enum-physicsserver-shapetype) | [shape\_get\_type](#class-physicsserver-method-shape-get-type) **(** [RID](class_rid#class-rid) shape **)** const | | void | [shape\_set\_data](#class-physicsserver-method-shape-set-data) **(** [RID](class_rid#class-rid) shape, [Variant](class_variant#class-variant) data **)** | | [float](class_float#class-float) | [slider\_joint\_get\_param](#class-physicsserver-method-slider-joint-get-param) **(** [RID](class_rid#class-rid) joint, [SliderJointParam](#enum-physicsserver-sliderjointparam) param **)** const | | void | [slider\_joint\_set\_param](#class-physicsserver-method-slider-joint-set-param) **(** [RID](class_rid#class-rid) joint, [SliderJointParam](#enum-physicsserver-sliderjointparam) param, [float](class_float#class-float) value **)** | | [RID](class_rid#class-rid) | [space\_create](#class-physicsserver-method-space-create) **(** **)** | | [PhysicsDirectSpaceState](class_physicsdirectspacestate#class-physicsdirectspacestate) | [space\_get\_direct\_state](#class-physicsserver-method-space-get-direct-state) **(** [RID](class_rid#class-rid) space **)** | | [float](class_float#class-float) | [space\_get\_param](#class-physicsserver-method-space-get-param) **(** [RID](class_rid#class-rid) space, [SpaceParameter](#enum-physicsserver-spaceparameter) param **)** const | | [bool](class_bool#class-bool) | [space\_is\_active](#class-physicsserver-method-space-is-active) **(** [RID](class_rid#class-rid) space **)** const | | void | [space\_set\_active](#class-physicsserver-method-space-set-active) **(** [RID](class_rid#class-rid) space, [bool](class_bool#class-bool) active **)** | | void | [space\_set\_param](#class-physicsserver-method-space-set-param) **(** [RID](class_rid#class-rid) space, [SpaceParameter](#enum-physicsserver-spaceparameter) param, [float](class_float#class-float) value **)** | Enumerations ------------ enum **JointType**: * **JOINT\_PIN** = **0** --- The [Joint](class_joint#class-joint) is a [PinJoint](class_pinjoint#class-pinjoint). * **JOINT\_HINGE** = **1** --- The [Joint](class_joint#class-joint) is a [HingeJoint](class_hingejoint#class-hingejoint). * **JOINT\_SLIDER** = **2** --- The [Joint](class_joint#class-joint) is a [SliderJoint](class_sliderjoint#class-sliderjoint). * **JOINT\_CONE\_TWIST** = **3** --- The [Joint](class_joint#class-joint) is a [ConeTwistJoint](class_conetwistjoint#class-conetwistjoint). * **JOINT\_6DOF** = **4** --- The [Joint](class_joint#class-joint) is a [Generic6DOFJoint](class_generic6dofjoint#class-generic6dofjoint). enum **PinJointParam**: * **PIN\_JOINT\_BIAS** = **0** --- The strength with which the pinned objects try to stay in positional relation to each other. The higher, the stronger. * **PIN\_JOINT\_DAMPING** = **1** --- The strength with which the pinned objects try to stay in velocity relation to each other. The higher, the stronger. * **PIN\_JOINT\_IMPULSE\_CLAMP** = **2** --- If above 0, this value is the maximum value for an impulse that this Joint puts on its ends. enum **HingeJointParam**: * **HINGE\_JOINT\_BIAS** = **0** --- The speed with which the two bodies get pulled together when they move in different directions. * **HINGE\_JOINT\_LIMIT\_UPPER** = **1** --- The maximum rotation across the Hinge. * **HINGE\_JOINT\_LIMIT\_LOWER** = **2** --- The minimum rotation across the Hinge. * **HINGE\_JOINT\_LIMIT\_BIAS** = **3** --- The speed with which the rotation across the axis perpendicular to the hinge gets corrected. * **HINGE\_JOINT\_LIMIT\_SOFTNESS** = **4** * **HINGE\_JOINT\_LIMIT\_RELAXATION** = **5** --- The lower this value, the more the rotation gets slowed down. * **HINGE\_JOINT\_MOTOR\_TARGET\_VELOCITY** = **6** --- Target speed for the motor. * **HINGE\_JOINT\_MOTOR\_MAX\_IMPULSE** = **7** --- Maximum acceleration for the motor. enum **HingeJointFlag**: * **HINGE\_JOINT\_FLAG\_USE\_LIMIT** = **0** --- If `true`, the Hinge has a maximum and a minimum rotation. * **HINGE\_JOINT\_FLAG\_ENABLE\_MOTOR** = **1** --- If `true`, a motor turns the Hinge. enum **SliderJointParam**: * **SLIDER\_JOINT\_LINEAR\_LIMIT\_UPPER** = **0** --- The maximum difference between the pivot points on their X axis before damping happens. * **SLIDER\_JOINT\_LINEAR\_LIMIT\_LOWER** = **1** --- The minimum difference between the pivot points on their X axis before damping happens. * **SLIDER\_JOINT\_LINEAR\_LIMIT\_SOFTNESS** = **2** --- A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. * **SLIDER\_JOINT\_LINEAR\_LIMIT\_RESTITUTION** = **3** --- The amount of restitution once the limits are surpassed. The lower, the more velocityenergy gets lost. * **SLIDER\_JOINT\_LINEAR\_LIMIT\_DAMPING** = **4** --- The amount of damping once the slider limits are surpassed. * **SLIDER\_JOINT\_LINEAR\_MOTION\_SOFTNESS** = **5** --- A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. * **SLIDER\_JOINT\_LINEAR\_MOTION\_RESTITUTION** = **6** --- The amount of restitution inside the slider limits. * **SLIDER\_JOINT\_LINEAR\_MOTION\_DAMPING** = **7** --- The amount of damping inside the slider limits. * **SLIDER\_JOINT\_LINEAR\_ORTHOGONAL\_SOFTNESS** = **8** --- A factor applied to the movement across axes orthogonal to the slider. * **SLIDER\_JOINT\_LINEAR\_ORTHOGONAL\_RESTITUTION** = **9** --- The amount of restitution when movement is across axes orthogonal to the slider. * **SLIDER\_JOINT\_LINEAR\_ORTHOGONAL\_DAMPING** = **10** --- The amount of damping when movement is across axes orthogonal to the slider. * **SLIDER\_JOINT\_ANGULAR\_LIMIT\_UPPER** = **11** --- The upper limit of rotation in the slider. * **SLIDER\_JOINT\_ANGULAR\_LIMIT\_LOWER** = **12** --- The lower limit of rotation in the slider. * **SLIDER\_JOINT\_ANGULAR\_LIMIT\_SOFTNESS** = **13** --- A factor applied to the all rotation once the limit is surpassed. * **SLIDER\_JOINT\_ANGULAR\_LIMIT\_RESTITUTION** = **14** --- The amount of restitution of the rotation when the limit is surpassed. * **SLIDER\_JOINT\_ANGULAR\_LIMIT\_DAMPING** = **15** --- The amount of damping of the rotation when the limit is surpassed. * **SLIDER\_JOINT\_ANGULAR\_MOTION\_SOFTNESS** = **16** --- A factor that gets applied to the all rotation in the limits. * **SLIDER\_JOINT\_ANGULAR\_MOTION\_RESTITUTION** = **17** --- The amount of restitution of the rotation in the limits. * **SLIDER\_JOINT\_ANGULAR\_MOTION\_DAMPING** = **18** --- The amount of damping of the rotation in the limits. * **SLIDER\_JOINT\_ANGULAR\_ORTHOGONAL\_SOFTNESS** = **19** --- A factor that gets applied to the all rotation across axes orthogonal to the slider. * **SLIDER\_JOINT\_ANGULAR\_ORTHOGONAL\_RESTITUTION** = **20** --- The amount of restitution of the rotation across axes orthogonal to the slider. * **SLIDER\_JOINT\_ANGULAR\_ORTHOGONAL\_DAMPING** = **21** --- The amount of damping of the rotation across axes orthogonal to the slider. * **SLIDER\_JOINT\_MAX** = **22** --- Represents the size of the [SliderJointParam](#enum-physicsserver-sliderjointparam) enum. enum **ConeTwistJointParam**: * **CONE\_TWIST\_JOINT\_SWING\_SPAN** = **0** --- Swing is rotation from side to side, around the axis perpendicular to the twist axis. The swing span defines, how much rotation will not get corrected along the swing axis. Could be defined as looseness in the [ConeTwistJoint](class_conetwistjoint#class-conetwistjoint). If below 0.05, this behavior is locked. * **CONE\_TWIST\_JOINT\_TWIST\_SPAN** = **1** --- Twist is the rotation around the twist axis, this value defined how far the joint can twist. Twist is locked if below 0.05. * **CONE\_TWIST\_JOINT\_BIAS** = **2** --- The speed with which the swing or twist will take place. The higher, the faster. * **CONE\_TWIST\_JOINT\_SOFTNESS** = **3** --- The ease with which the Joint twists, if it's too low, it takes more force to twist the joint. * **CONE\_TWIST\_JOINT\_RELAXATION** = **4** --- Defines, how fast the swing- and twist-speed-difference on both sides gets synced. enum **G6DOFJointAxisParam**: * **G6DOF\_JOINT\_LINEAR\_LOWER\_LIMIT** = **0** --- The minimum difference between the pivot points' axes. * **G6DOF\_JOINT\_LINEAR\_UPPER\_LIMIT** = **1** --- The maximum difference between the pivot points' axes. * **G6DOF\_JOINT\_LINEAR\_LIMIT\_SOFTNESS** = **2** --- A factor that gets applied to the movement across the axes. The lower, the slower the movement. * **G6DOF\_JOINT\_LINEAR\_RESTITUTION** = **3** --- The amount of restitution on the axes movement. The lower, the more velocity-energy gets lost. * **G6DOF\_JOINT\_LINEAR\_DAMPING** = **4** --- The amount of damping that happens at the linear motion across the axes. * **G6DOF\_JOINT\_LINEAR\_MOTOR\_TARGET\_VELOCITY** = **5** --- The velocity that the joint's linear motor will attempt to reach. * **G6DOF\_JOINT\_LINEAR\_MOTOR\_FORCE\_LIMIT** = **6** --- The maximum force that the linear motor can apply while trying to reach the target velocity. * **G6DOF\_JOINT\_ANGULAR\_LOWER\_LIMIT** = **10** --- The minimum rotation in negative direction to break loose and rotate around the axes. * **G6DOF\_JOINT\_ANGULAR\_UPPER\_LIMIT** = **11** --- The minimum rotation in positive direction to break loose and rotate around the axes. * **G6DOF\_JOINT\_ANGULAR\_LIMIT\_SOFTNESS** = **12** --- A factor that gets multiplied onto all rotations across the axes. * **G6DOF\_JOINT\_ANGULAR\_DAMPING** = **13** --- The amount of rotational damping across the axes. The lower, the more dampening occurs. * **G6DOF\_JOINT\_ANGULAR\_RESTITUTION** = **14** --- The amount of rotational restitution across the axes. The lower, the more restitution occurs. * **G6DOF\_JOINT\_ANGULAR\_FORCE\_LIMIT** = **15** --- The maximum amount of force that can occur, when rotating around the axes. * **G6DOF\_JOINT\_ANGULAR\_ERP** = **16** --- When correcting the crossing of limits in rotation across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. * **G6DOF\_JOINT\_ANGULAR\_MOTOR\_TARGET\_VELOCITY** = **17** --- Target speed for the motor at the axes. * **G6DOF\_JOINT\_ANGULAR\_MOTOR\_FORCE\_LIMIT** = **18** --- Maximum acceleration for the motor at the axes. enum **G6DOFJointAxisFlag**: * **G6DOF\_JOINT\_FLAG\_ENABLE\_LINEAR\_LIMIT** = **0** --- If set, linear motion is possible within the given limits. * **G6DOF\_JOINT\_FLAG\_ENABLE\_ANGULAR\_LIMIT** = **1** --- If set, rotational motion is possible. * **G6DOF\_JOINT\_FLAG\_ENABLE\_MOTOR** = **4** --- If set, there is a rotational motor across these axes. * **G6DOF\_JOINT\_FLAG\_ENABLE\_LINEAR\_MOTOR** = **5** --- If set, there is a linear motor on this axis that targets a specific velocity. enum **ShapeType**: * **SHAPE\_PLANE** = **0** --- The [Shape](class_shape#class-shape) is a [PlaneShape](class_planeshape#class-planeshape). * **SHAPE\_RAY** = **1** --- The [Shape](class_shape#class-shape) is a [RayShape](class_rayshape#class-rayshape). * **SHAPE\_SPHERE** = **2** --- The [Shape](class_shape#class-shape) is a [SphereShape](class_sphereshape#class-sphereshape). * **SHAPE\_BOX** = **3** --- The [Shape](class_shape#class-shape) is a [BoxShape](class_boxshape#class-boxshape). * **SHAPE\_CAPSULE** = **4** --- The [Shape](class_shape#class-shape) is a [CapsuleShape](class_capsuleshape#class-capsuleshape). * **SHAPE\_CYLINDER** = **5** --- The [Shape](class_shape#class-shape) is a [CylinderShape](class_cylindershape#class-cylindershape). * **SHAPE\_CONVEX\_POLYGON** = **6** --- The [Shape](class_shape#class-shape) is a [ConvexPolygonShape](class_convexpolygonshape#class-convexpolygonshape). * **SHAPE\_CONCAVE\_POLYGON** = **7** --- The [Shape](class_shape#class-shape) is a [ConcavePolygonShape](class_concavepolygonshape#class-concavepolygonshape). * **SHAPE\_HEIGHTMAP** = **8** --- The [Shape](class_shape#class-shape) is a [HeightMapShape](class_heightmapshape#class-heightmapshape). * **SHAPE\_CUSTOM** = **9** --- This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. enum **AreaParameter**: * **AREA\_PARAM\_GRAVITY** = **0** --- Constant to set/get gravity strength in an area. * **AREA\_PARAM\_GRAVITY\_VECTOR** = **1** --- Constant to set/get gravity vector/center in an area. * **AREA\_PARAM\_GRAVITY\_IS\_POINT** = **2** --- Constant to set/get whether the gravity vector of an area is a direction, or a center point. * **AREA\_PARAM\_GRAVITY\_DISTANCE\_SCALE** = **3** --- Constant to set/get the falloff factor for point gravity of an area. The greater this value is, the faster the strength of gravity decreases with the square of distance. * **AREA\_PARAM\_GRAVITY\_POINT\_ATTENUATION** = **4** --- This constant was used to set/get the falloff factor for point gravity. It has been superseded by [AREA\_PARAM\_GRAVITY\_DISTANCE\_SCALE](#class-physicsserver-constant-area-param-gravity-distance-scale). * **AREA\_PARAM\_LINEAR\_DAMP** = **5** --- Constant to set/get the linear dampening factor of an area. * **AREA\_PARAM\_ANGULAR\_DAMP** = **6** --- Constant to set/get the angular dampening factor of an area. * **AREA\_PARAM\_PRIORITY** = **7** --- Constant to set/get the priority (order of processing) of an area. enum **AreaSpaceOverrideMode**: * **AREA\_SPACE\_OVERRIDE\_DISABLED** = **0** --- This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. * **AREA\_SPACE\_OVERRIDE\_COMBINE** = **1** --- This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. * **AREA\_SPACE\_OVERRIDE\_COMBINE\_REPLACE** = **2** --- This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. * **AREA\_SPACE\_OVERRIDE\_REPLACE** = **3** --- This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. * **AREA\_SPACE\_OVERRIDE\_REPLACE\_COMBINE** = **4** --- This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. enum **BodyMode**: * **BODY\_MODE\_STATIC** = **0** --- Constant for static bodies. * **BODY\_MODE\_KINEMATIC** = **1** --- Constant for kinematic bodies. * **BODY\_MODE\_RIGID** = **2** --- Constant for rigid bodies. * **BODY\_MODE\_CHARACTER** = **3** --- Constant for rigid bodies in character mode. In this mode, a body can not rotate, and only its linear velocity is affected by physics. enum **BodyParameter**: * **BODY\_PARAM\_BOUNCE** = **0** --- Constant to set/get a body's bounce factor. * **BODY\_PARAM\_FRICTION** = **1** --- Constant to set/get a body's friction. * **BODY\_PARAM\_MASS** = **2** --- Constant to set/get a body's mass. * **BODY\_PARAM\_GRAVITY\_SCALE** = **3** --- Constant to set/get a body's gravity multiplier. * **BODY\_PARAM\_LINEAR\_DAMP** = **4** --- Constant to set/get a body's linear dampening factor. * **BODY\_PARAM\_ANGULAR\_DAMP** = **5** --- Constant to set/get a body's angular dampening factor. * **BODY\_PARAM\_MAX** = **6** --- Represents the size of the [BodyParameter](#enum-physicsserver-bodyparameter) enum. enum **BodyState**: * **BODY\_STATE\_TRANSFORM** = **0** --- Constant to set/get the current transform matrix of the body. * **BODY\_STATE\_LINEAR\_VELOCITY** = **1** --- Constant to set/get the current linear velocity of the body. * **BODY\_STATE\_ANGULAR\_VELOCITY** = **2** --- Constant to set/get the current angular velocity of the body. * **BODY\_STATE\_SLEEPING** = **3** --- Constant to sleep/wake up a body, or to get whether it is sleeping. * **BODY\_STATE\_CAN\_SLEEP** = **4** --- Constant to set/get whether the body can sleep. enum **AreaBodyStatus**: * **AREA\_BODY\_ADDED** = **0** --- The value of the first parameter and area callback function receives, when an object enters one of its shapes. * **AREA\_BODY\_REMOVED** = **1** --- The value of the first parameter and area callback function receives, when an object exits one of its shapes. enum **ProcessInfo**: * **INFO\_ACTIVE\_OBJECTS** = **0** --- Constant to get the number of objects that are not sleeping. * **INFO\_COLLISION\_PAIRS** = **1** --- Constant to get the number of possible collisions. * **INFO\_ISLAND\_COUNT** = **2** --- Constant to get the number of space regions where a collision could occur. enum **SpaceParameter**: * **SPACE\_PARAM\_CONTACT\_RECYCLE\_RADIUS** = **0** --- Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. * **SPACE\_PARAM\_CONTACT\_MAX\_SEPARATION** = **1** --- Constant to set/get the maximum distance a shape can be from another before they are considered separated. * **SPACE\_PARAM\_BODY\_MAX\_ALLOWED\_PENETRATION** = **2** --- Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. * **SPACE\_PARAM\_BODY\_LINEAR\_VELOCITY\_SLEEP\_THRESHOLD** = **3** --- Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. * **SPACE\_PARAM\_BODY\_ANGULAR\_VELOCITY\_SLEEP\_THRESHOLD** = **4** --- Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. * **SPACE\_PARAM\_BODY\_TIME\_TO\_SLEEP** = **5** --- Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. * **SPACE\_PARAM\_BODY\_ANGULAR\_VELOCITY\_DAMP\_RATIO** = **6** * **SPACE\_PARAM\_CONSTRAINT\_DEFAULT\_BIAS** = **7** --- Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision. enum **BodyAxis**: * **BODY\_AXIS\_LINEAR\_X** = **1** * **BODY\_AXIS\_LINEAR\_Y** = **2** * **BODY\_AXIS\_LINEAR\_Z** = **4** * **BODY\_AXIS\_ANGULAR\_X** = **8** * **BODY\_AXIS\_ANGULAR\_Y** = **16** * **BODY\_AXIS\_ANGULAR\_Z** = **32** Method Descriptions ------------------- ### void area\_add\_shape ( [RID](class_rid#class-rid) area, [RID](class_rid#class-rid) shape, [Transform](class_transform#class-transform) transform=Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ), [bool](class_bool#class-bool) disabled=false ) Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. ### void area\_attach\_object\_instance\_id ( [RID](class_rid#class-rid) area, [int](class_int#class-int) id ) Assigns the area to a descendant of [Object](class_object#class-object), so it can exist in the node tree. ### void area\_clear\_shapes ( [RID](class_rid#class-rid) area ) Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later. ### [RID](class_rid#class-rid) area\_create ( ) Creates an [Area](class_area#class-area). ### [int](class_int#class-int) area\_get\_object\_instance\_id ( [RID](class_rid#class-rid) area ) const Gets the instance ID of the object the area is assigned to. ### [Variant](class_variant#class-variant) area\_get\_param ( [RID](class_rid#class-rid) area, [AreaParameter](#enum-physicsserver-areaparameter) param ) const Returns an area parameter value. A list of available parameters is on the [AreaParameter](#enum-physicsserver-areaparameter) constants. ### [RID](class_rid#class-rid) area\_get\_shape ( [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx ) const Returns the [RID](class_rid#class-rid) of the nth shape of an area. ### [int](class_int#class-int) area\_get\_shape\_count ( [RID](class_rid#class-rid) area ) const Returns the number of shapes assigned to an area. ### [Transform](class_transform#class-transform) area\_get\_shape\_transform ( [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx ) const Returns the transform matrix of a shape within an area. ### [RID](class_rid#class-rid) area\_get\_space ( [RID](class_rid#class-rid) area ) const Returns the space assigned to the area. ### [AreaSpaceOverrideMode](#enum-physicsserver-areaspaceoverridemode) area\_get\_space\_override\_mode ( [RID](class_rid#class-rid) area ) const Returns the space override mode for the area. ### [Transform](class_transform#class-transform) area\_get\_transform ( [RID](class_rid#class-rid) area ) const Returns the transform matrix for an area. ### [bool](class_bool#class-bool) area\_is\_ray\_pickable ( [RID](class_rid#class-rid) area ) const If `true`, area collides with rays. ### void area\_remove\_shape ( [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx ) Removes a shape from an area. It does not delete the shape, so it can be reassigned later. ### void area\_set\_area\_monitor\_callback ( [RID](class_rid#class-rid) area, [Object](class_object#class-object) receiver, [String](class_string#class-string) method ) ### void area\_set\_collision\_layer ( [RID](class_rid#class-rid) area, [int](class_int#class-int) layer ) Assigns the area to one or many physics layers. ### void area\_set\_collision\_mask ( [RID](class_rid#class-rid) area, [int](class_int#class-int) mask ) Sets which physics layers the area will monitor. ### void area\_set\_monitor\_callback ( [RID](class_rid#class-rid) area, [Object](class_object#class-object) receiver, [String](class_string#class-string) method ) Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters: 1: [AREA\_BODY\_ADDED](#class-physicsserver-constant-area-body-added) or [AREA\_BODY\_REMOVED](#class-physicsserver-constant-area-body-removed), depending on whether the object entered or exited the area. 2: [RID](class_rid#class-rid) of the object that entered/exited the area. 3: Instance ID of the object that entered/exited the area. 4: The shape index of the object that entered/exited the area. 5: The shape index of the area where the object entered/exited. ### void area\_set\_monitorable ( [RID](class_rid#class-rid) area, [bool](class_bool#class-bool) monitorable ) ### void area\_set\_param ( [RID](class_rid#class-rid) area, [AreaParameter](#enum-physicsserver-areaparameter) param, [Variant](class_variant#class-variant) value ) Sets the value for an area parameter. A list of available parameters is on the [AreaParameter](#enum-physicsserver-areaparameter) constants. ### void area\_set\_ray\_pickable ( [RID](class_rid#class-rid) area, [bool](class_bool#class-bool) enable ) Sets object pickable with rays. ### void area\_set\_shape ( [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx, [RID](class_rid#class-rid) shape ) Substitutes a given area shape by another. The old shape is selected by its index, the new one by its [RID](class_rid#class-rid). ### void area\_set\_shape\_disabled ( [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx, [bool](class_bool#class-bool) disabled ) ### void area\_set\_shape\_transform ( [RID](class_rid#class-rid) area, [int](class_int#class-int) shape\_idx, [Transform](class_transform#class-transform) transform ) Sets the transform matrix for an area shape. ### void area\_set\_space ( [RID](class_rid#class-rid) area, [RID](class_rid#class-rid) space ) Assigns a space to the area. ### void area\_set\_space\_override\_mode ( [RID](class_rid#class-rid) area, [AreaSpaceOverrideMode](#enum-physicsserver-areaspaceoverridemode) mode ) Sets the space override mode for the area. The modes are described in the [AreaSpaceOverrideMode](#enum-physicsserver-areaspaceoverridemode) constants. ### void area\_set\_transform ( [RID](class_rid#class-rid) area, [Transform](class_transform#class-transform) transform ) Sets the transform matrix for an area. ### void body\_add\_central\_force ( [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) force ) ### void body\_add\_collision\_exception ( [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) excepted\_body ) Adds a body to the list of bodies exempt from collisions. ### void body\_add\_force ( [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) force, [Vector3](class_vector3#class-vector3) position ) ### void body\_add\_shape ( [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) shape, [Transform](class_transform#class-transform) transform=Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ), [bool](class_bool#class-bool) disabled=false ) Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. ### void body\_add\_torque ( [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) torque ) ### void body\_apply\_central\_impulse ( [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) impulse ) ### void body\_apply\_impulse ( [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) position, [Vector3](class_vector3#class-vector3) impulse ) Gives the body a push at a `position` in the direction of the `impulse`. ### void body\_apply\_torque\_impulse ( [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) impulse ) Gives the body a push to rotate it. ### void body\_attach\_object\_instance\_id ( [RID](class_rid#class-rid) body, [int](class_int#class-int) id ) Assigns the area to a descendant of [Object](class_object#class-object), so it can exist in the node tree. ### void body\_clear\_shapes ( [RID](class_rid#class-rid) body ) Removes all shapes from a body. ### [RID](class_rid#class-rid) body\_create ( [BodyMode](#enum-physicsserver-bodymode) mode=2, [bool](class_bool#class-bool) init\_sleeping=false ) Creates a physics body. The first parameter can be any value from [BodyMode](#enum-physicsserver-bodymode) constants, for the type of body created. Additionally, the body can be created in sleeping state to save processing time. ### [int](class_int#class-int) body\_get\_collision\_layer ( [RID](class_rid#class-rid) body ) const Returns the physics layer or layers a body belongs to. ### [int](class_int#class-int) body\_get\_collision\_mask ( [RID](class_rid#class-rid) body ) const Returns the physics layer or layers a body can collide with. ### [PhysicsDirectBodyState](class_physicsdirectbodystate#class-physicsdirectbodystate) body\_get\_direct\_state ( [RID](class_rid#class-rid) body ) Returns the [PhysicsDirectBodyState](class_physicsdirectbodystate#class-physicsdirectbodystate) of the body. Returns `null` if the body is destroyed or removed from the physics space. ### [float](class_float#class-float) body\_get\_kinematic\_safe\_margin ( [RID](class_rid#class-rid) body ) const ### [int](class_int#class-int) body\_get\_max\_contacts\_reported ( [RID](class_rid#class-rid) body ) const Returns the maximum contacts that can be reported. See [body\_set\_max\_contacts\_reported](#class-physicsserver-method-body-set-max-contacts-reported). ### [BodyMode](#enum-physicsserver-bodymode) body\_get\_mode ( [RID](class_rid#class-rid) body ) const Returns the body mode. ### [int](class_int#class-int) body\_get\_object\_instance\_id ( [RID](class_rid#class-rid) body ) const Gets the instance ID of the object the area is assigned to. ### [float](class_float#class-float) body\_get\_param ( [RID](class_rid#class-rid) body, [BodyParameter](#enum-physicsserver-bodyparameter) param ) const Returns the value of a body parameter. A list of available parameters is on the [BodyParameter](#enum-physicsserver-bodyparameter) constants. ### [RID](class_rid#class-rid) body\_get\_shape ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx ) const Returns the [RID](class_rid#class-rid) of the nth shape of a body. ### [int](class_int#class-int) body\_get\_shape\_count ( [RID](class_rid#class-rid) body ) const Returns the number of shapes assigned to a body. ### [Transform](class_transform#class-transform) body\_get\_shape\_transform ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx ) const Returns the transform matrix of a body shape. ### [RID](class_rid#class-rid) body\_get\_space ( [RID](class_rid#class-rid) body ) const Returns the [RID](class_rid#class-rid) of the space assigned to a body. ### [Variant](class_variant#class-variant) body\_get\_state ( [RID](class_rid#class-rid) body, [BodyState](#enum-physicsserver-bodystate) state ) const Returns a body state. ### [bool](class_bool#class-bool) body\_is\_axis\_locked ( [RID](class_rid#class-rid) body, [BodyAxis](#enum-physicsserver-bodyaxis) axis ) const ### [bool](class_bool#class-bool) body\_is\_continuous\_collision\_detection\_enabled ( [RID](class_rid#class-rid) body ) const If `true`, the continuous collision detection mode is enabled. ### [bool](class_bool#class-bool) body\_is\_omitting\_force\_integration ( [RID](class_rid#class-rid) body ) const Returns whether a body uses a callback function to calculate its own physics (see [body\_set\_force\_integration\_callback](#class-physicsserver-method-body-set-force-integration-callback)). ### [bool](class_bool#class-bool) body\_is\_ray\_pickable ( [RID](class_rid#class-rid) body ) const If `true`, the body can be detected by rays. ### void body\_remove\_collision\_exception ( [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) excepted\_body ) Removes a body from the list of bodies exempt from collisions. Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. ### void body\_remove\_shape ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx ) Removes a shape from a body. The shape is not deleted, so it can be reused afterwards. ### void body\_set\_axis\_lock ( [RID](class_rid#class-rid) body, [BodyAxis](#enum-physicsserver-bodyaxis) axis, [bool](class_bool#class-bool) lock ) ### void body\_set\_axis\_velocity ( [RID](class_rid#class-rid) body, [Vector3](class_vector3#class-vector3) axis\_velocity ) Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. ### void body\_set\_collision\_layer ( [RID](class_rid#class-rid) body, [int](class_int#class-int) layer ) Sets the physics layer or layers a body belongs to. ### void body\_set\_collision\_mask ( [RID](class_rid#class-rid) body, [int](class_int#class-int) mask ) Sets the physics layer or layers a body can collide with. ### void body\_set\_enable\_continuous\_collision\_detection ( [RID](class_rid#class-rid) body, [bool](class_bool#class-bool) enable ) If `true`, the continuous collision detection mode is enabled. Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. ### void body\_set\_force\_integration\_callback ( [RID](class_rid#class-rid) body, [Object](class_object#class-object) receiver, [String](class_string#class-string) method, [Variant](class_variant#class-variant) userdata=null ) Sets the function used to calculate physics for an object, if that object allows it (see [body\_set\_omit\_force\_integration](#class-physicsserver-method-body-set-omit-force-integration)). ### void body\_set\_kinematic\_safe\_margin ( [RID](class_rid#class-rid) body, [float](class_float#class-float) margin ) ### void body\_set\_max\_contacts\_reported ( [RID](class_rid#class-rid) body, [int](class_int#class-int) amount ) Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0. ### void body\_set\_mode ( [RID](class_rid#class-rid) body, [BodyMode](#enum-physicsserver-bodymode) mode ) Sets the body mode, from one of the [BodyMode](#enum-physicsserver-bodymode) constants. ### void body\_set\_omit\_force\_integration ( [RID](class_rid#class-rid) body, [bool](class_bool#class-bool) enable ) Sets whether a body uses a callback function to calculate its own physics (see [body\_set\_force\_integration\_callback](#class-physicsserver-method-body-set-force-integration-callback)). ### void body\_set\_param ( [RID](class_rid#class-rid) body, [BodyParameter](#enum-physicsserver-bodyparameter) param, [float](class_float#class-float) value ) Sets a body parameter. A list of available parameters is on the [BodyParameter](#enum-physicsserver-bodyparameter) constants. ### void body\_set\_ray\_pickable ( [RID](class_rid#class-rid) body, [bool](class_bool#class-bool) enable ) Sets the body pickable with rays if `enabled` is set. ### void body\_set\_shape ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [RID](class_rid#class-rid) shape ) Substitutes a given body shape by another. The old shape is selected by its index, the new one by its [RID](class_rid#class-rid). ### void body\_set\_shape\_disabled ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [bool](class_bool#class-bool) disabled ) ### void body\_set\_shape\_transform ( [RID](class_rid#class-rid) body, [int](class_int#class-int) shape\_idx, [Transform](class_transform#class-transform) transform ) Sets the transform matrix for a body shape. ### void body\_set\_space ( [RID](class_rid#class-rid) body, [RID](class_rid#class-rid) space ) Assigns a space to the body (see [space\_create](#class-physicsserver-method-space-create)). ### void body\_set\_state ( [RID](class_rid#class-rid) body, [BodyState](#enum-physicsserver-bodystate) state, [Variant](class_variant#class-variant) value ) Sets a body state (see [BodyState](#enum-physicsserver-bodystate) constants). ### [bool](class_bool#class-bool) body\_test\_motion ( [RID](class_rid#class-rid) body, [Transform](class_transform#class-transform) from, [Vector3](class_vector3#class-vector3) motion, [bool](class_bool#class-bool) infinite\_inertia, [PhysicsTestMotionResult](class_physicstestmotionresult#class-physicstestmotionresult) result=null, [bool](class_bool#class-bool) exclude\_raycast\_shapes=true, [Array](class_array#class-array) exclude=[ ] ) Returns `true` if a collision would result from moving in the given direction from a given point in space. [PhysicsTestMotionResult](class_physicstestmotionresult#class-physicstestmotionresult) can be passed to return additional information in. ### [float](class_float#class-float) cone\_twist\_joint\_get\_param ( [RID](class_rid#class-rid) joint, [ConeTwistJointParam](#enum-physicsserver-conetwistjointparam) param ) const Gets a cone\_twist\_joint parameter (see [ConeTwistJointParam](#enum-physicsserver-conetwistjointparam) constants). ### void cone\_twist\_joint\_set\_param ( [RID](class_rid#class-rid) joint, [ConeTwistJointParam](#enum-physicsserver-conetwistjointparam) param, [float](class_float#class-float) value ) Sets a cone\_twist\_joint parameter (see [ConeTwistJointParam](#enum-physicsserver-conetwistjointparam) constants). ### void free\_rid ( [RID](class_rid#class-rid) rid ) Destroys any of the objects created by PhysicsServer. If the [RID](class_rid#class-rid) passed is not one of the objects that can be created by PhysicsServer, an error will be sent to the console. ### [bool](class_bool#class-bool) generic\_6dof\_joint\_get\_flag ( [RID](class_rid#class-rid) joint, Vector3.Axis axis, [G6DOFJointAxisFlag](#enum-physicsserver-g6dofjointaxisflag) flag ) Gets a generic\_6\_DOF\_joint flag (see [G6DOFJointAxisFlag](#enum-physicsserver-g6dofjointaxisflag) constants). ### [float](class_float#class-float) generic\_6dof\_joint\_get\_param ( [RID](class_rid#class-rid) joint, Vector3.Axis axis, [G6DOFJointAxisParam](#enum-physicsserver-g6dofjointaxisparam) param ) Gets a generic\_6\_DOF\_joint parameter (see [G6DOFJointAxisParam](#enum-physicsserver-g6dofjointaxisparam) constants). ### void generic\_6dof\_joint\_set\_flag ( [RID](class_rid#class-rid) joint, Vector3.Axis axis, [G6DOFJointAxisFlag](#enum-physicsserver-g6dofjointaxisflag) flag, [bool](class_bool#class-bool) enable ) Sets a generic\_6\_DOF\_joint flag (see [G6DOFJointAxisFlag](#enum-physicsserver-g6dofjointaxisflag) constants). ### void generic\_6dof\_joint\_set\_param ( [RID](class_rid#class-rid) joint, Vector3.Axis axis, [G6DOFJointAxisParam](#enum-physicsserver-g6dofjointaxisparam) param, [float](class_float#class-float) value ) Sets a generic\_6\_DOF\_joint parameter (see [G6DOFJointAxisParam](#enum-physicsserver-g6dofjointaxisparam) constants). ### [int](class_int#class-int) get\_process\_info ( [ProcessInfo](#enum-physicsserver-processinfo) process\_info ) Returns information about the current state of the 3D physics engine. See [ProcessInfo](#enum-physicsserver-processinfo) for a list of available states. Only implemented for Godot Physics. ### [bool](class_bool#class-bool) hinge\_joint\_get\_flag ( [RID](class_rid#class-rid) joint, [HingeJointFlag](#enum-physicsserver-hingejointflag) flag ) const Gets a hinge\_joint flag (see [HingeJointFlag](#enum-physicsserver-hingejointflag) constants). ### [float](class_float#class-float) hinge\_joint\_get\_param ( [RID](class_rid#class-rid) joint, [HingeJointParam](#enum-physicsserver-hingejointparam) param ) const Gets a hinge\_joint parameter (see [HingeJointParam](#enum-physicsserver-hingejointparam)). ### void hinge\_joint\_set\_flag ( [RID](class_rid#class-rid) joint, [HingeJointFlag](#enum-physicsserver-hingejointflag) flag, [bool](class_bool#class-bool) enabled ) Sets a hinge\_joint flag (see [HingeJointFlag](#enum-physicsserver-hingejointflag) constants). ### void hinge\_joint\_set\_param ( [RID](class_rid#class-rid) joint, [HingeJointParam](#enum-physicsserver-hingejointparam) param, [float](class_float#class-float) value ) Sets a hinge\_joint parameter (see [HingeJointParam](#enum-physicsserver-hingejointparam) constants). ### [RID](class_rid#class-rid) joint\_create\_cone\_twist ( [RID](class_rid#class-rid) body\_A, [Transform](class_transform#class-transform) local\_ref\_A, [RID](class_rid#class-rid) body\_B, [Transform](class_transform#class-transform) local\_ref\_B ) Creates a [ConeTwistJoint](class_conetwistjoint#class-conetwistjoint). ### [RID](class_rid#class-rid) joint\_create\_generic\_6dof ( [RID](class_rid#class-rid) body\_A, [Transform](class_transform#class-transform) local\_ref\_A, [RID](class_rid#class-rid) body\_B, [Transform](class_transform#class-transform) local\_ref\_B ) Creates a [Generic6DOFJoint](class_generic6dofjoint#class-generic6dofjoint). ### [RID](class_rid#class-rid) joint\_create\_hinge ( [RID](class_rid#class-rid) body\_A, [Transform](class_transform#class-transform) hinge\_A, [RID](class_rid#class-rid) body\_B, [Transform](class_transform#class-transform) hinge\_B ) Creates a [HingeJoint](class_hingejoint#class-hingejoint). ### [RID](class_rid#class-rid) joint\_create\_pin ( [RID](class_rid#class-rid) body\_A, [Vector3](class_vector3#class-vector3) local\_A, [RID](class_rid#class-rid) body\_B, [Vector3](class_vector3#class-vector3) local\_B ) Creates a [PinJoint](class_pinjoint#class-pinjoint). ### [RID](class_rid#class-rid) joint\_create\_slider ( [RID](class_rid#class-rid) body\_A, [Transform](class_transform#class-transform) local\_ref\_A, [RID](class_rid#class-rid) body\_B, [Transform](class_transform#class-transform) local\_ref\_B ) Creates a [SliderJoint](class_sliderjoint#class-sliderjoint). ### [int](class_int#class-int) joint\_get\_solver\_priority ( [RID](class_rid#class-rid) joint ) const Gets the priority value of the Joint. ### [JointType](#enum-physicsserver-jointtype) joint\_get\_type ( [RID](class_rid#class-rid) joint ) const Returns the type of the Joint. ### void joint\_set\_solver\_priority ( [RID](class_rid#class-rid) joint, [int](class_int#class-int) priority ) Sets the priority value of the Joint. ### [Vector3](class_vector3#class-vector3) pin\_joint\_get\_local\_a ( [RID](class_rid#class-rid) joint ) const Returns position of the joint in the local space of body a of the joint. ### [Vector3](class_vector3#class-vector3) pin\_joint\_get\_local\_b ( [RID](class_rid#class-rid) joint ) const Returns position of the joint in the local space of body b of the joint. ### [float](class_float#class-float) pin\_joint\_get\_param ( [RID](class_rid#class-rid) joint, [PinJointParam](#enum-physicsserver-pinjointparam) param ) const Gets a pin\_joint parameter (see [PinJointParam](#enum-physicsserver-pinjointparam) constants). ### void pin\_joint\_set\_local\_a ( [RID](class_rid#class-rid) joint, [Vector3](class_vector3#class-vector3) local\_A ) Sets position of the joint in the local space of body a of the joint. ### void pin\_joint\_set\_local\_b ( [RID](class_rid#class-rid) joint, [Vector3](class_vector3#class-vector3) local\_B ) Sets position of the joint in the local space of body b of the joint. ### void pin\_joint\_set\_param ( [RID](class_rid#class-rid) joint, [PinJointParam](#enum-physicsserver-pinjointparam) param, [float](class_float#class-float) value ) Sets a pin\_joint parameter (see [PinJointParam](#enum-physicsserver-pinjointparam) constants). ### void set\_active ( [bool](class_bool#class-bool) active ) Activates or deactivates the 3D physics engine. ### void set\_collision\_iterations ( [int](class_int#class-int) iterations ) Sets the amount of iterations for calculating velocities of colliding bodies. The greater the amount of iterations, the more accurate the collisions will be. However, a greater amount of iterations requires more CPU power, which can decrease performance. The default value is `8`. **Note:** Only has an effect when using the GodotPhysics engine, not the default Bullet physics engine. ### [RID](class_rid#class-rid) shape\_create ( [ShapeType](#enum-physicsserver-shapetype) type ) Creates a shape of a type from [ShapeType](#enum-physicsserver-shapetype). Does not assign it to a body or an area. To do so, you must use [area\_set\_shape](#class-physicsserver-method-area-set-shape) or [body\_set\_shape](#class-physicsserver-method-body-set-shape). ### [Variant](class_variant#class-variant) shape\_get\_data ( [RID](class_rid#class-rid) shape ) const Returns the shape data. ### [ShapeType](#enum-physicsserver-shapetype) shape\_get\_type ( [RID](class_rid#class-rid) shape ) const Returns the type of shape (see [ShapeType](#enum-physicsserver-shapetype) constants). ### void shape\_set\_data ( [RID](class_rid#class-rid) shape, [Variant](class_variant#class-variant) data ) Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created [shape\_get\_type](#class-physicsserver-method-shape-get-type). ### [float](class_float#class-float) slider\_joint\_get\_param ( [RID](class_rid#class-rid) joint, [SliderJointParam](#enum-physicsserver-sliderjointparam) param ) const Gets a slider\_joint parameter (see [SliderJointParam](#enum-physicsserver-sliderjointparam) constants). ### void slider\_joint\_set\_param ( [RID](class_rid#class-rid) joint, [SliderJointParam](#enum-physicsserver-sliderjointparam) param, [float](class_float#class-float) value ) Gets a slider\_joint parameter (see [SliderJointParam](#enum-physicsserver-sliderjointparam) constants). ### [RID](class_rid#class-rid) space\_create ( ) Creates a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with [area\_set\_space](#class-physicsserver-method-area-set-space), or to a body with [body\_set\_space](#class-physicsserver-method-body-set-space). ### [PhysicsDirectSpaceState](class_physicsdirectspacestate#class-physicsdirectspacestate) space\_get\_direct\_state ( [RID](class_rid#class-rid) space ) Returns the state of a space, a [PhysicsDirectSpaceState](class_physicsdirectspacestate#class-physicsdirectspacestate). This object can be used to make collision/intersection queries. ### [float](class_float#class-float) space\_get\_param ( [RID](class_rid#class-rid) space, [SpaceParameter](#enum-physicsserver-spaceparameter) param ) const Returns the value of a space parameter. ### [bool](class_bool#class-bool) space\_is\_active ( [RID](class_rid#class-rid) space ) const Returns whether the space is active. ### void space\_set\_active ( [RID](class_rid#class-rid) space, [bool](class_bool#class-bool) active ) Marks a space as active. It will not have an effect, unless it is assigned to an area or body. ### void space\_set\_param ( [RID](class_rid#class-rid) space, [SpaceParameter](#enum-physicsserver-spaceparameter) param, [float](class_float#class-float) value ) Sets the value for a space parameter. A list of available parameters is on the [SpaceParameter](#enum-physicsserver-spaceparameter) constants.
programming_docs
godot ColorPicker ColorPicker =========== **Inherits:** [BoxContainer](class_boxcontainer#class-boxcontainer) **<** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Color picker control. Description ----------- Displays a color picker widget. Useful for selecting a color from an RGB/RGBA colorspace. **Note:** This control is the color picker widget itself. You can use a [ColorPickerButton](class_colorpickerbutton#class-colorpickerbutton) instead if you need a button that brings up a `ColorPicker` in a pop-up. Tutorials --------- * [Tween Demo](https://godotengine.org/asset-library/asset/146) Properties ---------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [color](#class-colorpicker-property-color) | `Color( 1, 1, 1, 1 )` | | [bool](class_bool#class-bool) | [deferred\_mode](#class-colorpicker-property-deferred-mode) | `false` | | [bool](class_bool#class-bool) | [edit\_alpha](#class-colorpicker-property-edit-alpha) | `true` | | [bool](class_bool#class-bool) | [hsv\_mode](#class-colorpicker-property-hsv-mode) | `false` | | [bool](class_bool#class-bool) | [presets\_enabled](#class-colorpicker-property-presets-enabled) | `true` | | [bool](class_bool#class-bool) | [presets\_visible](#class-colorpicker-property-presets-visible) | `true` | | [bool](class_bool#class-bool) | [raw\_mode](#class-colorpicker-property-raw-mode) | `false` | Methods ------- | | | | --- | --- | | void | [add\_preset](#class-colorpicker-method-add-preset) **(** [Color](class_color#class-color) color **)** | | void | [erase\_preset](#class-colorpicker-method-erase-preset) **(** [Color](class_color#class-color) color **)** | | [PoolColorArray](class_poolcolorarray#class-poolcolorarray) | [get\_presets](#class-colorpicker-method-get-presets) **(** **)** const | Theme Properties ---------------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [h\_width](#class-colorpicker-theme-constant-h-width) | `30` | | [int](class_int#class-int) | [label\_width](#class-colorpicker-theme-constant-label-width) | `10` | | [int](class_int#class-int) | [margin](#class-colorpicker-theme-constant-margin) | `4` | | [int](class_int#class-int) | [sv\_height](#class-colorpicker-theme-constant-sv-height) | `256` | | [int](class_int#class-int) | [sv\_width](#class-colorpicker-theme-constant-sv-width) | `256` | | [Texture](class_texture#class-texture) | [add\_preset](#class-colorpicker-theme-icon-add-preset) | | | [Texture](class_texture#class-texture) | [color\_hue](#class-colorpicker-theme-icon-color-hue) | | | [Texture](class_texture#class-texture) | [color\_sample](#class-colorpicker-theme-icon-color-sample) | | | [Texture](class_texture#class-texture) | [overbright\_indicator](#class-colorpicker-theme-icon-overbright-indicator) | | | [Texture](class_texture#class-texture) | [preset\_bg](#class-colorpicker-theme-icon-preset-bg) | | | [Texture](class_texture#class-texture) | [screen\_picker](#class-colorpicker-theme-icon-screen-picker) | | Signals ------- ### color\_changed ( [Color](class_color#class-color) color ) Emitted when the color is changed. ### preset\_added ( [Color](class_color#class-color) color ) Emitted when a preset is added. ### preset\_removed ( [Color](class_color#class-color) color ) Emitted when a preset is removed. Property Descriptions --------------------- ### [Color](class_color#class-color) color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_pick\_color(value) | | *Getter* | get\_pick\_color() | The currently selected color. ### [bool](class_bool#class-bool) deferred\_mode | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_deferred\_mode(value) | | *Getter* | is\_deferred\_mode() | If `true`, the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues). ### [bool](class_bool#class-bool) edit\_alpha | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_edit\_alpha(value) | | *Getter* | is\_editing\_alpha() | If `true`, shows an alpha channel slider (opacity). ### [bool](class_bool#class-bool) hsv\_mode | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_hsv\_mode(value) | | *Getter* | is\_hsv\_mode() | If `true`, allows editing the color with Hue/Saturation/Value sliders. **Note:** Cannot be enabled if raw mode is on. ### [bool](class_bool#class-bool) presets\_enabled | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_presets\_enabled(value) | | *Getter* | are\_presets\_enabled() | If `true`, the "add preset" button is enabled. ### [bool](class_bool#class-bool) presets\_visible | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_presets\_visible(value) | | *Getter* | are\_presets\_visible() | If `true`, saved color presets are visible. ### [bool](class_bool#class-bool) raw\_mode | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_raw\_mode(value) | | *Getter* | is\_raw\_mode() | If `true`, allows the color R, G, B component values to go beyond 1.0, which can be used for certain special operations that require it (like tinting without darkening or rendering sprites in HDR). **Note:** Cannot be enabled if HSV mode is on. Method Descriptions ------------------- ### void add\_preset ( [Color](class_color#class-color) color ) Adds the given color to a list of color presets. The presets are displayed in the color picker and the user will be able to select them. **Note:** The presets list is only for *this* color picker. ### void erase\_preset ( [Color](class_color#class-color) color ) Removes the given color from the list of color presets of this color picker. ### [PoolColorArray](class_poolcolorarray#class-poolcolorarray) get\_presets ( ) const Returns the list of colors in the presets of the color picker. Theme Property Descriptions --------------------------- ### [int](class_int#class-int) h\_width | | | | --- | --- | | *Default* | `30` | The width of the hue selection slider. ### [int](class_int#class-int) label\_width | | | | --- | --- | | *Default* | `10` | ### [int](class_int#class-int) margin | | | | --- | --- | | *Default* | `4` | The margin around the `ColorPicker`. ### [int](class_int#class-int) sv\_height | | | | --- | --- | | *Default* | `256` | The height of the saturation-value selection box. ### [int](class_int#class-int) sv\_width | | | | --- | --- | | *Default* | `256` | The width of the saturation-value selection box. ### [Texture](class_texture#class-texture) add\_preset The icon for the "Add Preset" button. ### [Texture](class_texture#class-texture) color\_hue Custom texture for the hue selection slider on the right. ### [Texture](class_texture#class-texture) color\_sample ### [Texture](class_texture#class-texture) overbright\_indicator The indicator used to signalize that the color value is outside the 0-1 range. ### [Texture](class_texture#class-texture) preset\_bg ### [Texture](class_texture#class-texture) screen\_picker The icon for the screen color picker button. godot JavaScriptObject JavaScriptObject ================ **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A wrapper class for native JavaScript objects. Description ----------- JavaScriptObject is used to interact with JavaScript objects retrieved or created via [JavaScript.get\_interface](class_javascript#class-javascript-method-get-interface), [JavaScript.create\_object](class_javascript#class-javascript-method-create-object), or [JavaScript.create\_callback](class_javascript#class-javascript-method-create-callback). Example: ``` extends Node var _my_js_callback = JavaScript.create_callback(self, "myCallback") # This reference must be kept var console = JavaScript.get_interface("console") func _init(): var buf = JavaScript.create_object("ArrayBuffer", 10) # new ArrayBuffer(10) print(buf) # prints [JavaScriptObject:OBJECT_ID] var uint8arr = JavaScript.create_object("Uint8Array", buf) # new Uint8Array(buf) uint8arr[1] = 255 prints(uint8arr[1], uint8arr.byteLength) # prints 255 10 console.log(uint8arr) # prints in browser console "Uint8Array(10) [ 0, 255, 0, 0, 0, 0, 0, 0, 0, 0 ]" # Equivalent of JavaScript: Array.from(uint8arr).forEach(myCallback) JavaScript.get_interface("Array").from(uint8arr).forEach(_my_js_callback) func myCallback(args): # Will be called with the parameters passed to the "forEach" callback # [0, 0, [JavaScriptObject:1173]] # [255, 1, [JavaScriptObject:1173]] # ... # [0, 9, [JavaScriptObject:1180]] print(args) ``` **Note:** Only available in the HTML5 platform. godot ARVRController ARVRController ============== **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) A spatial node representing a spatially-tracked controller. Description ----------- This is a helper spatial node that is linked to the tracking of controllers. It also offers several handy passthroughs to the state of buttons and such on the controllers. Controllers are linked by their ID. You can create controller nodes before the controllers are available. If your game always uses two controllers (one for each hand), you can predefine the controllers with ID 1 and 2; they will become active as soon as the controllers are identified. If you expect additional controllers to be used, you should react to the signals and add ARVRController nodes to your scene. The position of the controller node is automatically updated by the [ARVRServer](class_arvrserver#class-arvrserver). This makes this node ideal to add child nodes to visualize the controller. Tutorials --------- * [XR (AR/VR)](https://docs.godotengine.org/en/3.5/tutorials/vr/index.html) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [controller\_id](#class-arvrcontroller-property-controller-id) | `1` | | [float](class_float#class-float) | [rumble](#class-arvrcontroller-property-rumble) | `0.0` | Methods ------- | | | | --- | --- | | [String](class_string#class-string) | [get\_controller\_name](#class-arvrcontroller-method-get-controller-name) **(** **)** const | | [TrackerHand](class_arvrpositionaltracker#enum-arvrpositionaltracker-trackerhand) | [get\_hand](#class-arvrcontroller-method-get-hand) **(** **)** const | | [bool](class_bool#class-bool) | [get\_is\_active](#class-arvrcontroller-method-get-is-active) **(** **)** const | | [float](class_float#class-float) | [get\_joystick\_axis](#class-arvrcontroller-method-get-joystick-axis) **(** [int](class_int#class-int) axis **)** const | | [int](class_int#class-int) | [get\_joystick\_id](#class-arvrcontroller-method-get-joystick-id) **(** **)** const | | [Mesh](class_mesh#class-mesh) | [get\_mesh](#class-arvrcontroller-method-get-mesh) **(** **)** const | | [int](class_int#class-int) | [is\_button\_pressed](#class-arvrcontroller-method-is-button-pressed) **(** [int](class_int#class-int) button **)** const | Signals ------- ### button\_pressed ( [int](class_int#class-int) button ) Emitted when a button on this controller is pressed. ### button\_release ( [int](class_int#class-int) button ) Emitted when a button on this controller is released. ### mesh\_updated ( [Mesh](class_mesh#class-mesh) mesh ) Emitted when the mesh associated with the controller changes or when one becomes available. Generally speaking this will be a static mesh after becoming available. Property Descriptions --------------------- ### [int](class_int#class-int) controller\_id | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_controller\_id(value) | | *Getter* | get\_controller\_id() | The controller's ID. A controller ID of 0 is unbound and will always result in an inactive node. Controller ID 1 is reserved for the first controller that identifies itself as the left-hand controller and ID 2 is reserved for the first controller that identifies itself as the right-hand controller. For any other controller that the [ARVRServer](class_arvrserver#class-arvrserver) detects, we continue with controller ID 3. When a controller is turned off, its slot is freed. This ensures controllers will keep the same ID even when controllers with lower IDs are turned off. ### [float](class_float#class-float) rumble | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_rumble(value) | | *Getter* | get\_rumble() | The degree to which the controller vibrates. Ranges from `0.0` to `1.0`. If changed, updates [ARVRPositionalTracker.rumble](class_arvrpositionaltracker#class-arvrpositionaltracker-property-rumble) accordingly. This is a useful property to animate if you want the controller to vibrate for a limited duration. Method Descriptions ------------------- ### [String](class_string#class-string) get\_controller\_name ( ) const If active, returns the name of the associated controller if provided by the AR/VR SDK used. ### [TrackerHand](class_arvrpositionaltracker#enum-arvrpositionaltracker-trackerhand) get\_hand ( ) const Returns the hand holding this controller, if known. See [TrackerHand](class_arvrpositionaltracker#enum-arvrpositionaltracker-trackerhand). ### [bool](class_bool#class-bool) get\_is\_active ( ) const Returns `true` if the bound controller is active. ARVR systems attempt to track active controllers. ### [float](class_float#class-float) get\_joystick\_axis ( [int](class_int#class-int) axis ) const Returns the value of the given axis for things like triggers, touchpads, etc. that are embedded into the controller. ### [int](class_int#class-int) get\_joystick\_id ( ) const Returns the ID of the joystick object bound to this. Every controller tracked by the [ARVRServer](class_arvrserver#class-arvrserver) that has buttons and axis will also be registered as a joystick within Godot. This means that all the normal joystick tracking and input mapping will work for buttons and axis found on the AR/VR controllers. This ID is purely offered as information so you can link up the controller with its joystick entry. ### [Mesh](class_mesh#class-mesh) get\_mesh ( ) const If provided by the [ARVRInterface](class_arvrinterface#class-arvrinterface), this returns a mesh associated with the controller. This can be used to visualize the controller. ### [int](class_int#class-int) is\_button\_pressed ( [int](class_int#class-int) button ) const Returns `true` if the button at index `button` is pressed. See [JoystickList](class_%40globalscope#enum-globalscope-joysticklist), in particular the `JOY_VR_*` constants. godot AnimationNodeTransition AnimationNodeTransition ======================= **Inherits:** [AnimationNode](class_animationnode#class-animationnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A generic animation transition node for [AnimationTree](class_animationtree#class-animationtree). Description ----------- Simple state machine for cases which don't require a more advanced [AnimationNodeStateMachine](class_animationnodestatemachine#class-animationnodestatemachine). Animations can be connected to the inputs and transition times can be specified. Tutorials --------- * [AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html) * [3D Platformer Demo](https://godotengine.org/asset-library/asset/125) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [input\_count](#class-animationnodetransition-property-input-count) | `0` | | [float](class_float#class-float) | [xfade\_time](#class-animationnodetransition-property-xfade-time) | `0.0` | Methods ------- | | | | --- | --- | | [String](class_string#class-string) | [get\_input\_caption](#class-animationnodetransition-method-get-input-caption) **(** [int](class_int#class-int) input **)** const | | [bool](class_bool#class-bool) | [is\_input\_set\_as\_auto\_advance](#class-animationnodetransition-method-is-input-set-as-auto-advance) **(** [int](class_int#class-int) input **)** const | | void | [set\_input\_as\_auto\_advance](#class-animationnodetransition-method-set-input-as-auto-advance) **(** [int](class_int#class-int) input, [bool](class_bool#class-bool) enable **)** | | void | [set\_input\_caption](#class-animationnodetransition-method-set-input-caption) **(** [int](class_int#class-int) input, [String](class_string#class-string) caption **)** | Property Descriptions --------------------- ### [int](class_int#class-int) input\_count | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_enabled\_inputs(value) | | *Getter* | get\_enabled\_inputs() | The number of available input ports for this node. ### [float](class_float#class-float) xfade\_time | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_cross\_fade\_time(value) | | *Getter* | get\_cross\_fade\_time() | Cross-fading time (in seconds) between each animation connected to the inputs. Method Descriptions ------------------- ### [String](class_string#class-string) get\_input\_caption ( [int](class_int#class-int) input ) const ### [bool](class_bool#class-bool) is\_input\_set\_as\_auto\_advance ( [int](class_int#class-int) input ) const ### void set\_input\_as\_auto\_advance ( [int](class_int#class-int) input, [bool](class_bool#class-bool) enable ) ### void set\_input\_caption ( [int](class_int#class-int) input, [String](class_string#class-string) caption ) godot Vector3 Vector3 ======= Vector used for 3D math. Description ----------- 3-element structure that can be used to represent positions in 3D space or any other triplet of numeric values. **Note:** In a boolean context, a Vector3 will evaluate to `false` if it's equal to `Vector3(0, 0, 0)`. Otherwise, a Vector3 will always evaluate to `true`. Tutorials --------- * [Math tutorial index](https://docs.godotengine.org/en/3.5/tutorials/math/index.html) * [Vector math](https://docs.godotengine.org/en/3.5/tutorials/math/vector_math.html) * [Advanced vector math](https://docs.godotengine.org/en/3.5/tutorials/math/vectors_advanced.html) * [3Blue1Brown Essence of Linear Algebra](https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab) * [Matrix Transform Demo](https://godotengine.org/asset-library/asset/584) * [All 3D Demos](https://github.com/godotengine/godot-demo-projects/tree/master/3d) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [x](#class-vector3-property-x) | `0.0` | | [float](class_float#class-float) | [y](#class-vector3-property-y) | `0.0` | | [float](class_float#class-float) | [z](#class-vector3-property-z) | `0.0` | Methods ------- | | | | --- | --- | | [Vector3](#class-vector3) | [Vector3](#class-vector3-method-vector3) **(** [float](class_float#class-float) x, [float](class_float#class-float) y, [float](class_float#class-float) z **)** | | [Vector3](#class-vector3) | [abs](#class-vector3-method-abs) **(** **)** | | [float](class_float#class-float) | [angle\_to](#class-vector3-method-angle-to) **(** [Vector3](#class-vector3) to **)** | | [Vector3](#class-vector3) | [bounce](#class-vector3-method-bounce) **(** [Vector3](#class-vector3) n **)** | | [Vector3](#class-vector3) | [ceil](#class-vector3-method-ceil) **(** **)** | | [Vector3](#class-vector3) | [cross](#class-vector3-method-cross) **(** [Vector3](#class-vector3) b **)** | | [Vector3](#class-vector3) | [cubic\_interpolate](#class-vector3-method-cubic-interpolate) **(** [Vector3](#class-vector3) b, [Vector3](#class-vector3) pre\_a, [Vector3](#class-vector3) post\_b, [float](class_float#class-float) weight **)** | | [Vector3](#class-vector3) | [direction\_to](#class-vector3-method-direction-to) **(** [Vector3](#class-vector3) b **)** | | [float](class_float#class-float) | [distance\_squared\_to](#class-vector3-method-distance-squared-to) **(** [Vector3](#class-vector3) b **)** | | [float](class_float#class-float) | [distance\_to](#class-vector3-method-distance-to) **(** [Vector3](#class-vector3) b **)** | | [float](class_float#class-float) | [dot](#class-vector3-method-dot) **(** [Vector3](#class-vector3) b **)** | | [Vector3](#class-vector3) | [floor](#class-vector3-method-floor) **(** **)** | | [Vector3](#class-vector3) | [inverse](#class-vector3-method-inverse) **(** **)** | | [bool](class_bool#class-bool) | [is\_equal\_approx](#class-vector3-method-is-equal-approx) **(** [Vector3](#class-vector3) v **)** | | [bool](class_bool#class-bool) | [is\_normalized](#class-vector3-method-is-normalized) **(** **)** | | [float](class_float#class-float) | [length](#class-vector3-method-length) **(** **)** | | [float](class_float#class-float) | [length\_squared](#class-vector3-method-length-squared) **(** **)** | | [Vector3](#class-vector3) | [limit\_length](#class-vector3-method-limit-length) **(** [float](class_float#class-float) length=1.0 **)** | | [Vector3](#class-vector3) | [linear\_interpolate](#class-vector3-method-linear-interpolate) **(** [Vector3](#class-vector3) to, [float](class_float#class-float) weight **)** | | [int](class_int#class-int) | [max\_axis](#class-vector3-method-max-axis) **(** **)** | | [int](class_int#class-int) | [min\_axis](#class-vector3-method-min-axis) **(** **)** | | [Vector3](#class-vector3) | [move\_toward](#class-vector3-method-move-toward) **(** [Vector3](#class-vector3) to, [float](class_float#class-float) delta **)** | | [Vector3](#class-vector3) | [normalized](#class-vector3-method-normalized) **(** **)** | | [Basis](class_basis#class-basis) | [outer](#class-vector3-method-outer) **(** [Vector3](#class-vector3) b **)** | | [Vector3](#class-vector3) | [posmod](#class-vector3-method-posmod) **(** [float](class_float#class-float) mod **)** | | [Vector3](#class-vector3) | [posmodv](#class-vector3-method-posmodv) **(** [Vector3](#class-vector3) modv **)** | | [Vector3](#class-vector3) | [project](#class-vector3-method-project) **(** [Vector3](#class-vector3) b **)** | | [Vector3](#class-vector3) | [reflect](#class-vector3-method-reflect) **(** [Vector3](#class-vector3) n **)** | | [Vector3](#class-vector3) | [rotated](#class-vector3-method-rotated) **(** [Vector3](#class-vector3) axis, [float](class_float#class-float) angle **)** | | [Vector3](#class-vector3) | [round](#class-vector3-method-round) **(** **)** | | [Vector3](#class-vector3) | [sign](#class-vector3-method-sign) **(** **)** | | [float](class_float#class-float) | [signed\_angle\_to](#class-vector3-method-signed-angle-to) **(** [Vector3](#class-vector3) to, [Vector3](#class-vector3) axis **)** | | [Vector3](#class-vector3) | [slerp](#class-vector3-method-slerp) **(** [Vector3](#class-vector3) to, [float](class_float#class-float) weight **)** | | [Vector3](#class-vector3) | [slide](#class-vector3-method-slide) **(** [Vector3](#class-vector3) n **)** | | [Vector3](#class-vector3) | [snapped](#class-vector3-method-snapped) **(** [Vector3](#class-vector3) by **)** | | [Basis](class_basis#class-basis) | [to\_diagonal\_matrix](#class-vector3-method-to-diagonal-matrix) **(** **)** | Constants --------- * **AXIS\_X** = **0** --- Enumerated value for the X axis. Returned by [max\_axis](#class-vector3-method-max-axis) and [min\_axis](#class-vector3-method-min-axis). * **AXIS\_Y** = **1** --- Enumerated value for the Y axis. Returned by [max\_axis](#class-vector3-method-max-axis) and [min\_axis](#class-vector3-method-min-axis). * **AXIS\_Z** = **2** --- Enumerated value for the Z axis. Returned by [max\_axis](#class-vector3-method-max-axis) and [min\_axis](#class-vector3-method-min-axis). * **ZERO** = **Vector3( 0, 0, 0 )** --- Zero vector, a vector with all components set to `0`. * **ONE** = **Vector3( 1, 1, 1 )** --- One vector, a vector with all components set to `1`. * **INF** = **Vector3( inf, inf, inf )** --- Infinity vector, a vector with all components set to [@GDScript.INF](class_%40gdscript#class-gdscript-constant-inf). * **LEFT** = **Vector3( -1, 0, 0 )** --- Left unit vector. Represents the local direction of left, and the global direction of west. * **RIGHT** = **Vector3( 1, 0, 0 )** --- Right unit vector. Represents the local direction of right, and the global direction of east. * **UP** = **Vector3( 0, 1, 0 )** --- Up unit vector. * **DOWN** = **Vector3( 0, -1, 0 )** --- Down unit vector. * **FORWARD** = **Vector3( 0, 0, -1 )** --- Forward unit vector. Represents the local direction of forward, and the global direction of north. * **BACK** = **Vector3( 0, 0, 1 )** --- Back unit vector. Represents the local direction of back, and the global direction of south. Property Descriptions --------------------- ### [float](class_float#class-float) x | | | | --- | --- | | *Default* | `0.0` | The vector's X component. Also accessible by using the index position `[0]`. ### [float](class_float#class-float) y | | | | --- | --- | | *Default* | `0.0` | The vector's Y component. Also accessible by using the index position `[1]`. ### [float](class_float#class-float) z | | | | --- | --- | | *Default* | `0.0` | The vector's Z component. Also accessible by using the index position `[2]`. Method Descriptions ------------------- ### [Vector3](#class-vector3) Vector3 ( [float](class_float#class-float) x, [float](class_float#class-float) y, [float](class_float#class-float) z ) Returns a Vector3 with the given components. ### [Vector3](#class-vector3) abs ( ) Returns a new vector with all components in absolute values (i.e. positive). ### [float](class_float#class-float) angle\_to ( [Vector3](#class-vector3) to ) Returns the unsigned minimum angle to the given vector, in radians. ### [Vector3](#class-vector3) bounce ( [Vector3](#class-vector3) n ) Returns the vector "bounced off" from a plane defined by the given normal. ### [Vector3](#class-vector3) ceil ( ) Returns a new vector with all components rounded up (towards positive infinity). ### [Vector3](#class-vector3) cross ( [Vector3](#class-vector3) b ) Returns the cross product of this vector and `b`. ### [Vector3](#class-vector3) cubic\_interpolate ( [Vector3](#class-vector3) b, [Vector3](#class-vector3) pre\_a, [Vector3](#class-vector3) post\_b, [float](class_float#class-float) weight ) Performs a cubic interpolation between this vector and `b` using `pre_a` and `post_b` as handles, and returns the result at position `weight`. `weight` is on the range of 0.0 to 1.0, representing the amount of interpolation. ### [Vector3](#class-vector3) direction\_to ( [Vector3](#class-vector3) b ) Returns the normalized vector pointing from this vector to `b`. This is equivalent to using `(b - a).normalized()`. ### [float](class_float#class-float) distance\_squared\_to ( [Vector3](#class-vector3) b ) Returns the squared distance between this vector and `b`. This method runs faster than [distance\_to](#class-vector3-method-distance-to), so prefer it if you need to compare vectors or need the squared distance for some formula. ### [float](class_float#class-float) distance\_to ( [Vector3](#class-vector3) b ) Returns the distance between this vector and `b`. ### [float](class_float#class-float) dot ( [Vector3](#class-vector3) b ) Returns the dot product of this vector and `b`. This can be used to compare the angle between two vectors. For example, this can be used to determine whether an enemy is facing the player. The dot product will be `0` for a straight angle (90 degrees), greater than 0 for angles narrower than 90 degrees and lower than 0 for angles wider than 90 degrees. When using unit (normalized) vectors, the result will always be between `-1.0` (180 degree angle) when the vectors are facing opposite directions, and `1.0` (0 degree angle) when the vectors are aligned. **Note:** `a.dot(b)` is equivalent to `b.dot(a)`. ### [Vector3](#class-vector3) floor ( ) Returns a new vector with all components rounded down (towards negative infinity). ### [Vector3](#class-vector3) inverse ( ) Returns the inverse of the vector. This is the same as `Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )`. ### [bool](class_bool#class-bool) is\_equal\_approx ( [Vector3](#class-vector3) v ) Returns `true` if this vector and `v` are approximately equal, by running [@GDScript.is\_equal\_approx](class_%40gdscript#class-gdscript-method-is-equal-approx) on each component. ### [bool](class_bool#class-bool) is\_normalized ( ) Returns `true` if the vector is normalized, `false` otherwise. ### [float](class_float#class-float) length ( ) Returns the length (magnitude) of this vector. ### [float](class_float#class-float) length\_squared ( ) Returns the squared length (squared magnitude) of this vector. This method runs faster than [length](#class-vector3-method-length), so prefer it if you need to compare vectors or need the squared distance for some formula. ### [Vector3](#class-vector3) limit\_length ( [float](class_float#class-float) length=1.0 ) Returns the vector with a maximum length by limiting its length to `length`. ### [Vector3](#class-vector3) linear\_interpolate ( [Vector3](#class-vector3) to, [float](class_float#class-float) weight ) Returns the result of the linear interpolation between this vector and `to` by amount `t`. `weight` is on the range of 0.0 to 1.0, representing the amount of interpolation. ### [int](class_int#class-int) max\_axis ( ) Returns the axis of the vector's largest value. See `AXIS_*` constants. If all components are equal, this method returns [AXIS\_X](#class-vector3-constant-axis-x). ### [int](class_int#class-int) min\_axis ( ) Returns the axis of the vector's smallest value. See `AXIS_*` constants. If all components are equal, this method returns [AXIS\_Z](#class-vector3-constant-axis-z). ### [Vector3](#class-vector3) move\_toward ( [Vector3](#class-vector3) to, [float](class_float#class-float) delta ) Returns a new vector moved toward `to` by the fixed `delta` amount. Will not go past the final value. ### [Vector3](#class-vector3) normalized ( ) Returns the vector scaled to unit length. Equivalent to `v / v.length()`. ### [Basis](class_basis#class-basis) outer ( [Vector3](#class-vector3) b ) Returns the outer product with `b`. ### [Vector3](#class-vector3) posmod ( [float](class_float#class-float) mod ) Returns a vector composed of the [@GDScript.fposmod](class_%40gdscript#class-gdscript-method-fposmod) of this vector's components and `mod`. ### [Vector3](#class-vector3) posmodv ( [Vector3](#class-vector3) modv ) Returns a vector composed of the [@GDScript.fposmod](class_%40gdscript#class-gdscript-method-fposmod) of this vector's components and `modv`'s components. ### [Vector3](#class-vector3) project ( [Vector3](#class-vector3) b ) Returns this vector projected onto the vector `b`. ### [Vector3](#class-vector3) reflect ( [Vector3](#class-vector3) n ) Returns this vector reflected from a plane defined by the given normal. ### [Vector3](#class-vector3) rotated ( [Vector3](#class-vector3) axis, [float](class_float#class-float) angle ) Rotates this vector around a given axis by `angle` (in radians). The axis must be a normalized vector. ### [Vector3](#class-vector3) round ( ) Returns a new vector with all components rounded to the nearest integer, with halfway cases rounded away from zero. ### [Vector3](#class-vector3) sign ( ) Returns a new vector with each component set to one or negative one, depending on the signs of the components. If a component is zero, it returns positive one. ### [float](class_float#class-float) signed\_angle\_to ( [Vector3](#class-vector3) to, [Vector3](#class-vector3) axis ) Returns the signed angle to the given vector, in radians. The sign of the angle is positive in a counter-clockwise direction and negative in a clockwise direction when viewed from the side specified by the `axis`. ### [Vector3](#class-vector3) slerp ( [Vector3](#class-vector3) to, [float](class_float#class-float) weight ) Returns the result of spherical linear interpolation between this vector and `to`, by amount `weight`. `weight` is on the range of 0.0 to 1.0, representing the amount of interpolation. **Note:** Both vectors must be normalized. ### [Vector3](#class-vector3) slide ( [Vector3](#class-vector3) n ) Returns this vector slid along a plane defined by the given normal. ### [Vector3](#class-vector3) snapped ( [Vector3](#class-vector3) by ) Returns this vector with each component snapped to the nearest multiple of `step`. This can also be used to round to an arbitrary number of decimals. ### [Basis](class_basis#class-basis) to\_diagonal\_matrix ( ) Returns a diagonal matrix with the vector as main diagonal. This is equivalent to a Basis with no rotation or shearing and this vector's components set as the scale.
programming_docs
godot CylinderShape CylinderShape ============= **Inherits:** [Shape](class_shape#class-shape) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Cylinder shape for collisions. Description ----------- Cylinder shape for collisions. Tutorials --------- * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) * [3D Physics Tests Demo](https://godotengine.org/asset-library/asset/675) * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [height](#class-cylindershape-property-height) | `2.0` | | [float](class_float#class-float) | [radius](#class-cylindershape-property-radius) | `1.0` | Property Descriptions --------------------- ### [float](class_float#class-float) height | | | | --- | --- | | *Default* | `2.0` | | *Setter* | set\_height(value) | | *Getter* | get\_height() | The cylinder's height. ### [float](class_float#class-float) radius | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_radius(value) | | *Getter* | get\_radius() | The cylinder's radius. godot VideoStreamWebm VideoStreamWebm =============== **Inherits:** [VideoStream](class_videostream#class-videostream) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) [VideoStream](class_videostream#class-videostream) resource for WebM videos. Description ----------- [VideoStream](class_videostream#class-videostream) resource handling the [WebM](https://www.webmproject.org/) video format with `.webm` extension. Both the VP8 and VP9 codecs are supported. The VP8 and VP9 codecs are more efficient than [VideoStreamTheora](class_videostreamtheora#class-videostreamtheora), but they require more CPU resources to decode (especially VP9). Both the VP8 and VP9 codecs are decoded on the CPU. **Note:** Alpha channel (also known as transparency) is not supported. The video will always appear to have a black background, even if it originally contains an alpha channel. **Note:** There are known bugs and performance issues with WebM video playback in Godot. If you run into problems, try using the Ogg Theora format instead: [VideoStreamTheora](class_videostreamtheora#class-videostreamtheora) Methods ------- | | | | --- | --- | | [String](class_string#class-string) | [get\_file](#class-videostreamwebm-method-get-file) **(** **)** | | void | [set\_file](#class-videostreamwebm-method-set-file) **(** [String](class_string#class-string) file **)** | Method Descriptions ------------------- ### [String](class_string#class-string) get\_file ( ) Returns the WebM video file handled by this `VideoStreamWebm`. ### void set\_file ( [String](class_string#class-string) file ) Sets the WebM video file that this `VideoStreamWebm` resource handles. The `file` name should have the `.webm` extension. godot AudioEffectSpectrumAnalyzer AudioEffectSpectrumAnalyzer =========================== **Inherits:** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Audio effect that can be used for real-time audio visualizations. Description ----------- This audio effect does not affect sound output, but can be used for real-time audio visualizations. See also [AudioStreamGenerator](class_audiostreamgenerator#class-audiostreamgenerator) for procedurally generating sounds. Tutorials --------- * [Audio Spectrum Demo](https://godotengine.org/asset-library/asset/528) * [Godot 3.2 will get new audio features](https://godotengine.org/article/godot-32-will-get-new-audio-features) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [buffer\_length](#class-audioeffectspectrumanalyzer-property-buffer-length) | `2.0` | | [FFT\_Size](#enum-audioeffectspectrumanalyzer-fft-size) | [fft\_size](#class-audioeffectspectrumanalyzer-property-fft-size) | `2` | | [float](class_float#class-float) | [tap\_back\_pos](#class-audioeffectspectrumanalyzer-property-tap-back-pos) | `0.01` | Enumerations ------------ enum **FFT\_Size**: * **FFT\_SIZE\_256** = **0** --- Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time. * **FFT\_SIZE\_512** = **1** --- Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time. * **FFT\_SIZE\_1024** = **2** --- Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time. * **FFT\_SIZE\_2048** = **3** --- Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time. * **FFT\_SIZE\_4096** = **4** --- Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time. * **FFT\_SIZE\_MAX** = **5** --- Represents the size of the [FFT\_Size](#enum-audioeffectspectrumanalyzer-fft-size) enum. Property Descriptions --------------------- ### [float](class_float#class-float) buffer\_length | | | | --- | --- | | *Default* | `2.0` | | *Setter* | set\_buffer\_length(value) | | *Getter* | get\_buffer\_length() | The length of the buffer to keep (in seconds). Higher values keep data around for longer, but require more memory. ### [FFT\_Size](#enum-audioeffectspectrumanalyzer-fft-size) fft\_size | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_fft\_size(value) | | *Getter* | get\_fft\_size() | The size of the [Fast Fourier transform](https://en.wikipedia.org/wiki/Fast_Fourier_transform) buffer. Higher values smooth out the spectrum analysis over time, but have greater latency. The effects of this higher latency are especially noticeable with sudden amplitude changes. ### [float](class_float#class-float) tap\_back\_pos | | | | --- | --- | | *Default* | `0.01` | | *Setter* | set\_tap\_back\_pos(value) | | *Getter* | get\_tap\_back\_pos() | godot SkeletonIK SkeletonIK ========== **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) SkeletonIK is used to place the end bone of a [Skeleton](class_skeleton#class-skeleton) bone chain at a certain point in 3D by rotating all bones in the chain accordingly. Description ----------- SkeletonIK is used to place the end bone of a [Skeleton](class_skeleton#class-skeleton) bone chain at a certain point in 3D by rotating all bones in the chain accordingly. A typical scenario for IK in games is to place a characters feet on the ground or a characters hands on a currently hold object. SkeletonIK uses FabrikInverseKinematic internally to solve the bone chain and applies the results to the [Skeleton](class_skeleton#class-skeleton) `bones_global_pose_override` property for all affected bones in the chain. If fully applied this overwrites any bone transform from [Animation](class_animation#class-animation)s or bone custom poses set by users. The applied amount can be controlled with the `interpolation` property. ``` # Apply IK effect automatically on every new frame (not the current) skeleton_ik_node.start() # Apply IK effect only on the current frame skeleton_ik_node.start(true) # Stop IK effect and reset bones_global_pose_override on Skeleton skeleton_ik_node.stop() # Apply full IK effect skeleton_ik_node.set_interpolation(1.0) # Apply half IK effect skeleton_ik_node.set_interpolation(0.5) # Apply zero IK effect (a value at or below 0.01 also removes bones_global_pose_override on Skeleton) skeleton_ik_node.set_interpolation(0.0) ``` Tutorials --------- * [3D Inverse Kinematics Demo](https://godotengine.org/asset-library/asset/523) Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [interpolation](#class-skeletonik-property-interpolation) | `1.0` | | [Vector3](class_vector3#class-vector3) | [magnet](#class-skeletonik-property-magnet) | `Vector3( 0, 0, 0 )` | | [int](class_int#class-int) | [max\_iterations](#class-skeletonik-property-max-iterations) | `10` | | [float](class_float#class-float) | [min\_distance](#class-skeletonik-property-min-distance) | `0.01` | | [bool](class_bool#class-bool) | [override\_tip\_basis](#class-skeletonik-property-override-tip-basis) | `true` | | [String](class_string#class-string) | [root\_bone](#class-skeletonik-property-root-bone) | `""` | | [Transform](class_transform#class-transform) | [target](#class-skeletonik-property-target) | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | | [NodePath](class_nodepath#class-nodepath) | [target\_node](#class-skeletonik-property-target-node) | `NodePath("")` | | [String](class_string#class-string) | [tip\_bone](#class-skeletonik-property-tip-bone) | `""` | | [bool](class_bool#class-bool) | [use\_magnet](#class-skeletonik-property-use-magnet) | `false` | Methods ------- | | | | --- | --- | | [Skeleton](class_skeleton#class-skeleton) | [get\_parent\_skeleton](#class-skeletonik-method-get-parent-skeleton) **(** **)** const | | [bool](class_bool#class-bool) | [is\_running](#class-skeletonik-method-is-running) **(** **)** | | void | [start](#class-skeletonik-method-start) **(** [bool](class_bool#class-bool) one\_time=false **)** | | void | [stop](#class-skeletonik-method-stop) **(** **)** | Property Descriptions --------------------- ### [float](class_float#class-float) interpolation | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_interpolation(value) | | *Getter* | get\_interpolation() | Interpolation value for how much the IK results are applied to the current skeleton bone chain. A value of `1.0` will overwrite all skeleton bone transforms completely while a value of `0.0` will visually disable the SkeletonIK. A value at or below `0.01` also calls [Skeleton.clear\_bones\_global\_pose\_override](class_skeleton#class-skeleton-method-clear-bones-global-pose-override). ### [Vector3](class_vector3#class-vector3) magnet | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_magnet\_position(value) | | *Getter* | get\_magnet\_position() | Secondary target position (first is [target](#class-skeletonik-property-target) property or [target\_node](#class-skeletonik-property-target-node)) for the IK chain. Use magnet position (pole target) to control the bending of the IK chain. Only works if the bone chain has more than 2 bones. The middle chain bone position will be linearly interpolated with the magnet position. ### [int](class_int#class-int) max\_iterations | | | | --- | --- | | *Default* | `10` | | *Setter* | set\_max\_iterations(value) | | *Getter* | get\_max\_iterations() | Number of iteration loops used by the IK solver to produce more accurate (and elegant) bone chain results. ### [float](class_float#class-float) min\_distance | | | | --- | --- | | *Default* | `0.01` | | *Setter* | set\_min\_distance(value) | | *Getter* | get\_min\_distance() | The minimum distance between bone and goal target. If the distance is below this value, the IK solver stops further iterations. ### [bool](class_bool#class-bool) override\_tip\_basis | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_override\_tip\_basis(value) | | *Getter* | is\_override\_tip\_basis() | If `true` overwrites the rotation of the tip bone with the rotation of the [target](#class-skeletonik-property-target) (or [target\_node](#class-skeletonik-property-target-node) if defined). ### [String](class_string#class-string) root\_bone | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_root\_bone(value) | | *Getter* | get\_root\_bone() | The name of the current root bone, the first bone in the IK chain. ### [Transform](class_transform#class-transform) target | | | | --- | --- | | *Default* | `Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )` | | *Setter* | set\_target\_transform(value) | | *Getter* | get\_target\_transform() | First target of the IK chain where the tip bone is placed and, if [override\_tip\_basis](#class-skeletonik-property-override-tip-basis) is `true`, how the tip bone is rotated. If a [target\_node](#class-skeletonik-property-target-node) path is available the nodes transform is used instead and this property is ignored. ### [NodePath](class_nodepath#class-nodepath) target\_node | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_target\_node(value) | | *Getter* | get\_target\_node() | Target node [NodePath](class_nodepath#class-nodepath) for the IK chain. If available, the node's current [Transform](class_transform#class-transform) is used instead of the [target](#class-skeletonik-property-target) property. ### [String](class_string#class-string) tip\_bone | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_tip\_bone(value) | | *Getter* | get\_tip\_bone() | The name of the current tip bone, the last bone in the IK chain placed at the [target](#class-skeletonik-property-target) transform (or [target\_node](#class-skeletonik-property-target-node) if defined). ### [bool](class_bool#class-bool) use\_magnet | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_magnet(value) | | *Getter* | is\_using\_magnet() | If `true`, instructs the IK solver to consider the secondary magnet target (pole target) when calculating the bone chain. Use the magnet position (pole target) to control the bending of the IK chain. Method Descriptions ------------------- ### [Skeleton](class_skeleton#class-skeleton) get\_parent\_skeleton ( ) const Returns the parent [Skeleton](class_skeleton#class-skeleton) Node that was present when SkeletonIK entered the [SceneTree](class_scenetree#class-scenetree). Returns null if the parent node was not a [Skeleton](class_skeleton#class-skeleton) Node when SkeletonIK entered the [SceneTree](class_scenetree#class-scenetree). ### [bool](class_bool#class-bool) is\_running ( ) Returns `true` if SkeletonIK is applying IK effects on continues frames to the [Skeleton](class_skeleton#class-skeleton) bones. Returns `false` if SkeletonIK is stopped or [start](#class-skeletonik-method-start) was used with the `one_time` parameter set to `true`. ### void start ( [bool](class_bool#class-bool) one\_time=false ) Starts applying IK effects on each frame to the [Skeleton](class_skeleton#class-skeleton) bones but will only take effect starting on the next frame. If `one_time` is `true`, this will take effect immediately but also reset on the next frame. ### void stop ( ) Stops applying IK effects on each frame to the [Skeleton](class_skeleton#class-skeleton) bones and also calls [Skeleton.clear\_bones\_global\_pose\_override](class_skeleton#class-skeleton-method-clear-bones-global-pose-override) to remove existing overrides on all bones. godot AudioEffectBandLimitFilter AudioEffectBandLimitFilter ========================== **Inherits:** [AudioEffectFilter](class_audioeffectfilter#class-audioeffectfilter) **<** [AudioEffect](class_audioeffect#class-audioeffect) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Adds a band limit filter to the audio bus. Description ----------- Limits the frequencies in a range around the [AudioEffectFilter.cutoff\_hz](class_audioeffectfilter#class-audioeffectfilter-property-cutoff-hz) and allows frequencies outside of this range to pass. godot FlowContainer FlowContainer ============= **Inherits:** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [HFlowContainer](class_hflowcontainer#class-hflowcontainer), [VFlowContainer](class_vflowcontainer#class-vflowcontainer) Base class for flow containers. Description ----------- Arranges child [Control](class_control#class-control) nodes vertically or horizontally in a left-to-right or top-to-bottom flow. A line is filled with [Control](class_control#class-control) nodes until no more fit on the same line, similar to text in an autowrapped label. Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [get\_line\_count](#class-flowcontainer-method-get-line-count) **(** **)** const | Method Descriptions ------------------- ### [int](class_int#class-int) get\_line\_count ( ) const Returns the current line count. godot Camera2D Camera2D ======== **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Camera node for 2D scenes. Description ----------- Camera node for 2D scenes. It forces the screen (current layer) to scroll following this node. This makes it easier (and faster) to program scrollable scenes than manually changing the position of [CanvasItem](class_canvasitem#class-canvasitem)-based nodes. This node is intended to be a simple helper to get things going quickly, but more functionality may be desired to change how the camera works. To make your own custom camera node, inherit it from [Node2D](class_node2d#class-node2d) and change the transform of the canvas by setting [Viewport.canvas\_transform](class_viewport#class-viewport-property-canvas-transform) in [Viewport](class_viewport#class-viewport) (you can obtain the current [Viewport](class_viewport#class-viewport) by using [Node.get\_viewport](class_node#class-node-method-get-viewport)). Note that the `Camera2D` node's `position` doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use [get\_camera\_screen\_center](#class-camera2d-method-get-camera-screen-center) to get the real position. Tutorials --------- * [2D Platformer Demo](https://godotengine.org/asset-library/asset/120) * [2D Isometric Demo](https://godotengine.org/asset-library/asset/112) * [2D HDR Demo](https://godotengine.org/asset-library/asset/110) Properties ---------- | | | | | --- | --- | --- | | [AnchorMode](#enum-camera2d-anchormode) | [anchor\_mode](#class-camera2d-property-anchor-mode) | `1` | | [bool](class_bool#class-bool) | [current](#class-camera2d-property-current) | `false` | | [Node](class_node#class-node) | [custom\_viewport](#class-camera2d-property-custom-viewport) | | | [float](class_float#class-float) | [drag\_margin\_bottom](#class-camera2d-property-drag-margin-bottom) | `0.2` | | [bool](class_bool#class-bool) | [drag\_margin\_h\_enabled](#class-camera2d-property-drag-margin-h-enabled) | `false` | | [float](class_float#class-float) | [drag\_margin\_left](#class-camera2d-property-drag-margin-left) | `0.2` | | [float](class_float#class-float) | [drag\_margin\_right](#class-camera2d-property-drag-margin-right) | `0.2` | | [float](class_float#class-float) | [drag\_margin\_top](#class-camera2d-property-drag-margin-top) | `0.2` | | [bool](class_bool#class-bool) | [drag\_margin\_v\_enabled](#class-camera2d-property-drag-margin-v-enabled) | `false` | | [bool](class_bool#class-bool) | [editor\_draw\_drag\_margin](#class-camera2d-property-editor-draw-drag-margin) | `false` | | [bool](class_bool#class-bool) | [editor\_draw\_limits](#class-camera2d-property-editor-draw-limits) | `false` | | [bool](class_bool#class-bool) | [editor\_draw\_screen](#class-camera2d-property-editor-draw-screen) | `true` | | [int](class_int#class-int) | [limit\_bottom](#class-camera2d-property-limit-bottom) | `10000000` | | [int](class_int#class-int) | [limit\_left](#class-camera2d-property-limit-left) | `-10000000` | | [int](class_int#class-int) | [limit\_right](#class-camera2d-property-limit-right) | `10000000` | | [bool](class_bool#class-bool) | [limit\_smoothed](#class-camera2d-property-limit-smoothed) | `false` | | [int](class_int#class-int) | [limit\_top](#class-camera2d-property-limit-top) | `-10000000` | | [Vector2](class_vector2#class-vector2) | [offset](#class-camera2d-property-offset) | `Vector2( 0, 0 )` | | [float](class_float#class-float) | [offset\_h](#class-camera2d-property-offset-h) | `0.0` | | [float](class_float#class-float) | [offset\_v](#class-camera2d-property-offset-v) | `0.0` | | [Camera2DProcessMode](#enum-camera2d-camera2dprocessmode) | [process\_mode](#class-camera2d-property-process-mode) | `1` | | [bool](class_bool#class-bool) | [rotating](#class-camera2d-property-rotating) | `false` | | [bool](class_bool#class-bool) | [smoothing\_enabled](#class-camera2d-property-smoothing-enabled) | `false` | | [float](class_float#class-float) | [smoothing\_speed](#class-camera2d-property-smoothing-speed) | `5.0` | | [Vector2](class_vector2#class-vector2) | [zoom](#class-camera2d-property-zoom) | `Vector2( 1, 1 )` | Methods ------- | | | | --- | --- | | void | [align](#class-camera2d-method-align) **(** **)** | | void | [clear\_current](#class-camera2d-method-clear-current) **(** **)** | | void | [force\_update\_scroll](#class-camera2d-method-force-update-scroll) **(** **)** | | [Vector2](class_vector2#class-vector2) | [get\_camera\_position](#class-camera2d-method-get-camera-position) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_camera\_screen\_center](#class-camera2d-method-get-camera-screen-center) **(** **)** const | | [float](class_float#class-float) | [get\_drag\_margin](#class-camera2d-method-get-drag-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin **)** const | | [int](class_int#class-int) | [get\_limit](#class-camera2d-method-get-limit) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin **)** const | | void | [make\_current](#class-camera2d-method-make-current) **(** **)** | | void | [reset\_smoothing](#class-camera2d-method-reset-smoothing) **(** **)** | | void | [set\_drag\_margin](#class-camera2d-method-set-drag-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) drag\_margin **)** | | void | [set\_limit](#class-camera2d-method-set-limit) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin, [int](class_int#class-int) limit **)** | Enumerations ------------ enum **AnchorMode**: * **ANCHOR\_MODE\_FIXED\_TOP\_LEFT** = **0** --- The camera's position is fixed so that the top-left corner is always at the origin. * **ANCHOR\_MODE\_DRAG\_CENTER** = **1** --- The camera's position takes into account vertical/horizontal offsets and the screen size. enum **Camera2DProcessMode**: * **CAMERA2D\_PROCESS\_PHYSICS** = **0** --- The camera updates with the `_physics_process` callback. * **CAMERA2D\_PROCESS\_IDLE** = **1** --- The camera updates with the `_process` callback. Property Descriptions --------------------- ### [AnchorMode](#enum-camera2d-anchormode) anchor\_mode | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_anchor\_mode(value) | | *Getter* | get\_anchor\_mode() | The Camera2D's anchor point. See [AnchorMode](#enum-camera2d-anchormode) constants. ### [bool](class_bool#class-bool) current | | | | --- | --- | | *Default* | `false` | | *Getter* | is\_current() | If `true`, the camera is the active camera for the current scene. Only one camera can be current, so setting a different camera `current` will disable this one. ### [Node](class_node#class-node) custom\_viewport | | | | --- | --- | | *Setter* | set\_custom\_viewport(value) | | *Getter* | get\_custom\_viewport() | The custom [Viewport](class_viewport#class-viewport) node attached to the `Camera2D`. If `null` or not a [Viewport](class_viewport#class-viewport), uses the default viewport instead. ### [float](class_float#class-float) drag\_margin\_bottom | | | | --- | --- | | *Default* | `0.2` | | *Setter* | set\_drag\_margin(value) | | *Getter* | get\_drag\_margin() | Bottom margin needed to drag the camera. A value of `1` makes the camera move only when reaching the edge of the screen. ### [bool](class_bool#class-bool) drag\_margin\_h\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_h\_drag\_enabled(value) | | *Getter* | is\_h\_drag\_enabled() | If `true`, the camera only moves when reaching the horizontal drag margins. If `false`, the camera moves horizontally regardless of margins. ### [float](class_float#class-float) drag\_margin\_left | | | | --- | --- | | *Default* | `0.2` | | *Setter* | set\_drag\_margin(value) | | *Getter* | get\_drag\_margin() | Left margin needed to drag the camera. A value of `1` makes the camera move only when reaching the edge of the screen. ### [float](class_float#class-float) drag\_margin\_right | | | | --- | --- | | *Default* | `0.2` | | *Setter* | set\_drag\_margin(value) | | *Getter* | get\_drag\_margin() | Right margin needed to drag the camera. A value of `1` makes the camera move only when reaching the edge of the screen. ### [float](class_float#class-float) drag\_margin\_top | | | | --- | --- | | *Default* | `0.2` | | *Setter* | set\_drag\_margin(value) | | *Getter* | get\_drag\_margin() | Top margin needed to drag the camera. A value of `1` makes the camera move only when reaching the edge of the screen. ### [bool](class_bool#class-bool) drag\_margin\_v\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_v\_drag\_enabled(value) | | *Getter* | is\_v\_drag\_enabled() | If `true`, the camera only moves when reaching the vertical drag margins. If `false`, the camera moves vertically regardless of margins. ### [bool](class_bool#class-bool) editor\_draw\_drag\_margin | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_margin\_drawing\_enabled(value) | | *Getter* | is\_margin\_drawing\_enabled() | If `true`, draws the camera's drag margin rectangle in the editor. ### [bool](class_bool#class-bool) editor\_draw\_limits | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_limit\_drawing\_enabled(value) | | *Getter* | is\_limit\_drawing\_enabled() | If `true`, draws the camera's limits rectangle in the editor. ### [bool](class_bool#class-bool) editor\_draw\_screen | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_screen\_drawing\_enabled(value) | | *Getter* | is\_screen\_drawing\_enabled() | If `true`, draws the camera's screen rectangle in the editor. ### [int](class_int#class-int) limit\_bottom | | | | --- | --- | | *Default* | `10000000` | | *Setter* | set\_limit(value) | | *Getter* | get\_limit() | Bottom scroll limit in pixels. The camera stops moving when reaching this value. ### [int](class_int#class-int) limit\_left | | | | --- | --- | | *Default* | `-10000000` | | *Setter* | set\_limit(value) | | *Getter* | get\_limit() | Left scroll limit in pixels. The camera stops moving when reaching this value. ### [int](class_int#class-int) limit\_right | | | | --- | --- | | *Default* | `10000000` | | *Setter* | set\_limit(value) | | *Getter* | get\_limit() | Right scroll limit in pixels. The camera stops moving when reaching this value. ### [bool](class_bool#class-bool) limit\_smoothed | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_limit\_smoothing\_enabled(value) | | *Getter* | is\_limit\_smoothing\_enabled() | If `true`, the camera smoothly stops when reaches its limits. This property has no effect if [smoothing\_enabled](#class-camera2d-property-smoothing-enabled) is `false`. **Note:** To immediately update the camera's position to be within limits without smoothing, even with this setting enabled, invoke [reset\_smoothing](#class-camera2d-method-reset-smoothing). ### [int](class_int#class-int) limit\_top | | | | --- | --- | | *Default* | `-10000000` | | *Setter* | set\_limit(value) | | *Getter* | get\_limit() | Top scroll limit in pixels. The camera stops moving when reaching this value. ### [Vector2](class_vector2#class-vector2) offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_offset(value) | | *Getter* | get\_offset() | The camera's offset, useful for looking around or camera shake animations. ### [float](class_float#class-float) offset\_h | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_h\_offset(value) | | *Getter* | get\_h\_offset() | The horizontal offset of the camera, relative to the drag margins. **Note:** Offset H is used only to force offset relative to margins. It's not updated in any way if drag margins are enabled and can be used to set initial offset. ### [float](class_float#class-float) offset\_v | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_v\_offset(value) | | *Getter* | get\_v\_offset() | The vertical offset of the camera, relative to the drag margins. **Note:** Used the same as [offset\_h](#class-camera2d-property-offset-h). ### [Camera2DProcessMode](#enum-camera2d-camera2dprocessmode) process\_mode | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_process\_mode(value) | | *Getter* | get\_process\_mode() | The camera's process callback. See [Camera2DProcessMode](#enum-camera2d-camera2dprocessmode). ### [bool](class_bool#class-bool) rotating | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_rotating(value) | | *Getter* | is\_rotating() | If `true`, the camera view rotates with the target. ### [bool](class_bool#class-bool) smoothing\_enabled | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_enable\_follow\_smoothing(value) | | *Getter* | is\_follow\_smoothing\_enabled() | If `true`, the camera smoothly moves towards the target at [smoothing\_speed](#class-camera2d-property-smoothing-speed). ### [float](class_float#class-float) smoothing\_speed | | | | --- | --- | | *Default* | `5.0` | | *Setter* | set\_follow\_smoothing(value) | | *Getter* | get\_follow\_smoothing() | Speed in pixels per second of the camera's smoothing effect when [smoothing\_enabled](#class-camera2d-property-smoothing-enabled) is `true`. ### [Vector2](class_vector2#class-vector2) zoom | | | | --- | --- | | *Default* | `Vector2( 1, 1 )` | | *Setter* | set\_zoom(value) | | *Getter* | get\_zoom() | The camera's zoom relative to the viewport. Values larger than `Vector2(1, 1)` zoom out and smaller values zoom in. For an example, use `Vector2(0.5, 0.5)` for a 2× zoom-in, and `Vector2(4, 4)` for a 4× zoom-out. Method Descriptions ------------------- ### void align ( ) Aligns the camera to the tracked node. ### void clear\_current ( ) Removes any `Camera2D` from the ancestor [Viewport](class_viewport#class-viewport)'s internal currently-assigned camera. ### void force\_update\_scroll ( ) Forces the camera to update scroll immediately. ### [Vector2](class_vector2#class-vector2) get\_camera\_position ( ) const Returns the camera's `position` (the tracked point the camera attempts to follow), relative to the origin. **Note:** The returned value is not the same as [Node2D.position](class_node2d#class-node2d-property-position) or [Node2D.global\_position](class_node2d#class-node2d-property-global-position), as it is affected by the `drag` properties. ### [Vector2](class_vector2#class-vector2) get\_camera\_screen\_center ( ) const Returns the location of the `Camera2D`'s screen-center, relative to the origin. **Note:** The real `position` of the camera may be different, see [get\_camera\_position](#class-camera2d-method-get-camera-position). ### [float](class_float#class-float) get\_drag\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin ) const Returns the specified margin. See also [drag\_margin\_bottom](#class-camera2d-property-drag-margin-bottom), [drag\_margin\_top](#class-camera2d-property-drag-margin-top), [drag\_margin\_left](#class-camera2d-property-drag-margin-left), and [drag\_margin\_right](#class-camera2d-property-drag-margin-right). ### [int](class_int#class-int) get\_limit ( [Margin](class_%40globalscope#enum-globalscope-margin) margin ) const Returns the specified camera limit. See also [limit\_bottom](#class-camera2d-property-limit-bottom), [limit\_top](#class-camera2d-property-limit-top), [limit\_left](#class-camera2d-property-limit-left), and [limit\_right](#class-camera2d-property-limit-right). ### void make\_current ( ) Make this the current 2D camera for the scene (viewport and layer), in case there are many cameras in the scene. ### void reset\_smoothing ( ) Sets the camera's position immediately to its current smoothing destination. This method has no effect if [smoothing\_enabled](#class-camera2d-property-smoothing-enabled) is `false`. ### void set\_drag\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) drag\_margin ) Sets the specified margin. See also [drag\_margin\_bottom](#class-camera2d-property-drag-margin-bottom), [drag\_margin\_top](#class-camera2d-property-drag-margin-top), [drag\_margin\_left](#class-camera2d-property-drag-margin-left), and [drag\_margin\_right](#class-camera2d-property-drag-margin-right). ### void set\_limit ( [Margin](class_%40globalscope#enum-globalscope-margin) margin, [int](class_int#class-int) limit ) Sets the specified camera limit. See also [limit\_bottom](#class-camera2d-property-limit-bottom), [limit\_top](#class-camera2d-property-limit-top), [limit\_left](#class-camera2d-property-limit-left), and [limit\_right](#class-camera2d-property-limit-right).
programming_docs
godot SpatialVelocityTracker SpatialVelocityTracker ====================== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [track\_physics\_step](#class-spatialvelocitytracker-property-track-physics-step) | `false` | Methods ------- | | | | --- | --- | | [Vector3](class_vector3#class-vector3) | [get\_tracked\_linear\_velocity](#class-spatialvelocitytracker-method-get-tracked-linear-velocity) **(** **)** const | | void | [reset](#class-spatialvelocitytracker-method-reset) **(** [Vector3](class_vector3#class-vector3) position **)** | | void | [update\_position](#class-spatialvelocitytracker-method-update-position) **(** [Vector3](class_vector3#class-vector3) position **)** | Property Descriptions --------------------- ### [bool](class_bool#class-bool) track\_physics\_step | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_track\_physics\_step(value) | | *Getter* | is\_tracking\_physics\_step() | Method Descriptions ------------------- ### [Vector3](class_vector3#class-vector3) get\_tracked\_linear\_velocity ( ) const ### void reset ( [Vector3](class_vector3#class-vector3) position ) ### void update\_position ( [Vector3](class_vector3#class-vector3) position ) godot VisualShaderNodeTransformDecompose VisualShaderNodeTransformDecompose ================================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Decomposes a [Transform](class_transform#class-transform) into four [Vector3](class_vector3#class-vector3)s within the visual shader graph. Description ----------- Takes a 4x4 transform matrix and decomposes it into four `vec3` values, one from each row of the matrix. godot Object Object ====== **Inherited By:** [ARVRServer](class_arvrserver#class-arvrserver), [AudioServer](class_audioserver#class-audioserver), [CameraServer](class_cameraserver#class-cameraserver), [ClassDB](class_classdb#class-classdb), [EditorFileSystemDirectory](class_editorfilesystemdirectory#class-editorfilesystemdirectory), [EditorSelection](class_editorselection#class-editorselection), [EditorVCSInterface](class_editorvcsinterface#class-editorvcsinterface), [Engine](class_engine#class-engine), [Geometry](class_geometry#class-geometry), [GodotSharp](class_godotsharp#class-godotsharp), [IP](class_ip#class-ip), [Input](class_input#class-input), [InputMap](class_inputmap#class-inputmap), [JNISingleton](class_jnisingleton#class-jnisingleton), [JSON](class_json#class-json), [JSONRPC](class_jsonrpc#class-jsonrpc), [JavaClassWrapper](class_javaclasswrapper#class-javaclasswrapper), [JavaScript](class_javascript#class-javascript), [MainLoop](class_mainloop#class-mainloop), [Marshalls](class_marshalls#class-marshalls), [Navigation2DServer](class_navigation2dserver#class-navigation2dserver), [NavigationMeshGenerator](class_navigationmeshgenerator#class-navigationmeshgenerator), [NavigationServer](class_navigationserver#class-navigationserver), [Node](class_node#class-node), [OS](class_os#class-os), [Performance](class_performance#class-performance), [Physics2DDirectBodyState](class_physics2ddirectbodystate#class-physics2ddirectbodystate), [Physics2DDirectSpaceState](class_physics2ddirectspacestate#class-physics2ddirectspacestate), [Physics2DServer](class_physics2dserver#class-physics2dserver), [PhysicsDirectBodyState](class_physicsdirectbodystate#class-physicsdirectbodystate), [PhysicsDirectSpaceState](class_physicsdirectspacestate#class-physicsdirectspacestate), [PhysicsServer](class_physicsserver#class-physicsserver), [ProjectSettings](class_projectsettings#class-projectsettings), [Reference](class_reference#class-reference), [ResourceLoader](class_resourceloader#class-resourceloader), [ResourceSaver](class_resourcesaver#class-resourcesaver), [Time](class_time#class-time), [TranslationServer](class_translationserver#class-translationserver), [TreeItem](class_treeitem#class-treeitem), [UndoRedo](class_undoredo#class-undoredo), [VisualScriptEditor](class_visualscripteditor#class-visualscripteditor), [VisualServer](class_visualserver#class-visualserver) Base class for all non-built-in types. Description ----------- Every class which is not a built-in type inherits from this class. You can construct Objects from scripting languages, using `Object.new()` in GDScript, `new Object` in C#, or the "Construct Object" node in VisualScript. Objects do not manage memory. If a class inherits from Object, you will have to delete instances of it manually. To do so, call the [free](#class-object-method-free) method from your script or delete the instance from C++. Some classes that extend Object add memory management. This is the case of [Reference](class_reference#class-reference), which counts references and deletes itself automatically when no longer referenced. [Node](class_node#class-node), another fundamental type, deletes all its children when freed from memory. Objects export properties, which are mainly useful for storage and editing, but not really so much in programming. Properties are exported in [\_get\_property\_list](#class-object-method-get-property-list) and handled in [\_get](#class-object-method-get) and [\_set](#class-object-method-set). However, scripting languages and C++ have simpler means to export them. Property membership can be tested directly in GDScript using `in`: ``` var n = Node2D.new() print("position" in n) # Prints "True". print("other_property" in n) # Prints "False". ``` The `in` operator will evaluate to `true` as long as the key exists, even if the value is `null`. Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See [\_notification](#class-object-method-notification). **Note:** Unlike references to a [Reference](class_reference#class-reference), references to an Object stored in a variable can become invalid without warning. Therefore, it's recommended to use [Reference](class_reference#class-reference) for data classes instead of `Object`. **Note:** Due to a bug, you can't create a "plain" Object using `Object.new()`. Instead, use `ClassDB.instance("Object")`. This bug only applies to Object itself, not any of its descendents like [Reference](class_reference#class-reference). Tutorials --------- * [When and how to avoid using nodes for everything](https://docs.godotengine.org/en/3.5/tutorials/best_practices/node_alternatives.html) * [Advanced exports using \_get\_property\_list()](https://docs.godotengine.org/en/3.5/tutorials/scripting/gdscript/gdscript_exports.html#advanced-exports) Methods ------- | | | | --- | --- | | [Variant](class_variant#class-variant) | [\_get](#class-object-method-get) **(** [String](class_string#class-string) property **)** virtual | | [Array](class_array#class-array) | [\_get\_property\_list](#class-object-method-get-property-list) **(** **)** virtual | | void | [\_init](#class-object-method-init) **(** **)** virtual | | void | [\_notification](#class-object-method-notification) **(** [int](class_int#class-int) what **)** virtual | | [bool](class_bool#class-bool) | [\_set](#class-object-method-set) **(** [String](class_string#class-string) property, [Variant](class_variant#class-variant) value **)** virtual | | [String](class_string#class-string) | [\_to\_string](#class-object-method-to-string) **(** **)** virtual | | void | [add\_user\_signal](#class-object-method-add-user-signal) **(** [String](class_string#class-string) signal, [Array](class_array#class-array) arguments=[ ] **)** | | [Variant](class_variant#class-variant) | [call](#class-object-method-call) **(** [String](class_string#class-string) method, ... **)** vararg | | void | [call\_deferred](#class-object-method-call-deferred) **(** [String](class_string#class-string) method, ... **)** vararg | | [Variant](class_variant#class-variant) | [callv](#class-object-method-callv) **(** [String](class_string#class-string) method, [Array](class_array#class-array) arg\_array **)** | | [bool](class_bool#class-bool) | [can\_translate\_messages](#class-object-method-can-translate-messages) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [connect](#class-object-method-connect) **(** [String](class_string#class-string) signal, [Object](#class-object) target, [String](class_string#class-string) method, [Array](class_array#class-array) binds=[ ], [int](class_int#class-int) flags=0 **)** | | void | [disconnect](#class-object-method-disconnect) **(** [String](class_string#class-string) signal, [Object](#class-object) target, [String](class_string#class-string) method **)** | | void | [emit\_signal](#class-object-method-emit-signal) **(** [String](class_string#class-string) signal, ... **)** vararg | | void | [free](#class-object-method-free) **(** **)** | | [Variant](class_variant#class-variant) | [get](#id1) **(** [String](class_string#class-string) property **)** const | | [String](class_string#class-string) | [get\_class](#class-object-method-get-class) **(** **)** const | | [Array](class_array#class-array) | [get\_incoming\_connections](#class-object-method-get-incoming-connections) **(** **)** const | | [Variant](class_variant#class-variant) | [get\_indexed](#class-object-method-get-indexed) **(** [NodePath](class_nodepath#class-nodepath) property **)** const | | [int](class_int#class-int) | [get\_instance\_id](#class-object-method-get-instance-id) **(** **)** const | | [Variant](class_variant#class-variant) | [get\_meta](#class-object-method-get-meta) **(** [String](class_string#class-string) name, [Variant](class_variant#class-variant) default=null **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_meta\_list](#class-object-method-get-meta-list) **(** **)** const | | [Array](class_array#class-array) | [get\_method\_list](#class-object-method-get-method-list) **(** **)** const | | [Array](class_array#class-array) | [get\_property\_list](#id2) **(** **)** const | | [Reference](class_reference#class-reference) | [get\_script](#class-object-method-get-script) **(** **)** const | | [Array](class_array#class-array) | [get\_signal\_connection\_list](#class-object-method-get-signal-connection-list) **(** [String](class_string#class-string) signal **)** const | | [Array](class_array#class-array) | [get\_signal\_list](#class-object-method-get-signal-list) **(** **)** const | | [bool](class_bool#class-bool) | [has\_meta](#class-object-method-has-meta) **(** [String](class_string#class-string) name **)** const | | [bool](class_bool#class-bool) | [has\_method](#class-object-method-has-method) **(** [String](class_string#class-string) method **)** const | | [bool](class_bool#class-bool) | [has\_signal](#class-object-method-has-signal) **(** [String](class_string#class-string) signal **)** const | | [bool](class_bool#class-bool) | [has\_user\_signal](#class-object-method-has-user-signal) **(** [String](class_string#class-string) signal **)** const | | [bool](class_bool#class-bool) | [is\_blocking\_signals](#class-object-method-is-blocking-signals) **(** **)** const | | [bool](class_bool#class-bool) | [is\_class](#class-object-method-is-class) **(** [String](class_string#class-string) class **)** const | | [bool](class_bool#class-bool) | [is\_connected](#class-object-method-is-connected) **(** [String](class_string#class-string) signal, [Object](#class-object) target, [String](class_string#class-string) method **)** const | | [bool](class_bool#class-bool) | [is\_queued\_for\_deletion](#class-object-method-is-queued-for-deletion) **(** **)** const | | void | [notification](#id3) **(** [int](class_int#class-int) what, [bool](class_bool#class-bool) reversed=false **)** | | void | [property\_list\_changed\_notify](#class-object-method-property-list-changed-notify) **(** **)** | | void | [remove\_meta](#class-object-method-remove-meta) **(** [String](class_string#class-string) name **)** | | void | [set](#id4) **(** [String](class_string#class-string) property, [Variant](class_variant#class-variant) value **)** | | void | [set\_block\_signals](#class-object-method-set-block-signals) **(** [bool](class_bool#class-bool) enable **)** | | void | [set\_deferred](#class-object-method-set-deferred) **(** [String](class_string#class-string) property, [Variant](class_variant#class-variant) value **)** | | void | [set\_indexed](#class-object-method-set-indexed) **(** [NodePath](class_nodepath#class-nodepath) property, [Variant](class_variant#class-variant) value **)** | | void | [set\_message\_translation](#class-object-method-set-message-translation) **(** [bool](class_bool#class-bool) enable **)** | | void | [set\_meta](#class-object-method-set-meta) **(** [String](class_string#class-string) name, [Variant](class_variant#class-variant) value **)** | | void | [set\_script](#class-object-method-set-script) **(** [Reference](class_reference#class-reference) script **)** | | [String](class_string#class-string) | [to\_string](#id5) **(** **)** | | [String](class_string#class-string) | [tr](#class-object-method-tr) **(** [String](class_string#class-string) message **)** const | Signals ------- ### script\_changed ( ) Emitted whenever the object's script is changed. Enumerations ------------ enum **ConnectFlags**: * **CONNECT\_DEFERRED** = **1** --- Connects a signal in deferred mode. This way, signal emissions are stored in a queue, then set on idle time. * **CONNECT\_PERSIST** = **2** --- Persisting connections are saved when the object is serialized to file. * **CONNECT\_ONESHOT** = **4** --- One-shot connections disconnect themselves after emission. * **CONNECT\_REFERENCE\_COUNTED** = **8** --- Connect a signal as reference-counted. This means that a given signal can be connected several times to the same target, and will only be fully disconnected once no references are left. Constants --------- * **NOTIFICATION\_POSTINITIALIZE** = **0** --- Called right when the object is initialized. Not available in script. * **NOTIFICATION\_PREDELETE** = **1** --- Called before the object is about to be deleted. Method Descriptions ------------------- ### [Variant](class_variant#class-variant) \_get ( [String](class_string#class-string) property ) virtual Virtual method which can be overridden to customize the return value of [get](#id1). Returns the given property. Returns `null` if the `property` does not exist. ### [Array](class_array#class-array) \_get\_property\_list ( ) virtual Virtual method which can be overridden to customize the return value of [get\_property\_list](#id2). Returns the object's property list as an [Array](class_array#class-array) of dictionaries. Each property's [Dictionary](class_dictionary#class-dictionary) must contain at least `name: String` and `type: int` (see [Variant.Type](class_%40globalscope#enum-globalscope-variant-type)) entries. Optionally, it can also include `hint: int` (see [PropertyHint](class_%40globalscope#enum-globalscope-propertyhint)), `hint_string: String`, and `usage: int` (see [PropertyUsageFlags](class_%40globalscope#enum-globalscope-propertyusageflags)). ### void \_init ( ) virtual Called when the object is initialized in memory. Can be defined to take in parameters, that are passed in when constructing. **Note:** If [\_init](#class-object-method-init) is defined with required parameters, then explicit construction is the only valid means of creating an Object of the class. If any other means (such as [PackedScene.instance](class_packedscene#class-packedscene-method-instance)) is used, then initialization will fail. ### void \_notification ( [int](class_int#class-int) what ) virtual Called whenever the object receives a notification, which is identified in `what` by a constant. The base `Object` has two constants [NOTIFICATION\_POSTINITIALIZE](#class-object-constant-notification-postinitialize) and [NOTIFICATION\_PREDELETE](#class-object-constant-notification-predelete), but subclasses such as [Node](class_node#class-node) define a lot more notifications which are also received by this method. ### [bool](class_bool#class-bool) \_set ( [String](class_string#class-string) property, [Variant](class_variant#class-variant) value ) virtual Virtual method which can be overridden to customize the return value of [set](#id4). Sets a property. Returns `true` if the `property` exists. ### [String](class_string#class-string) \_to\_string ( ) virtual Virtual method which can be overridden to customize the return value of [to\_string](#id5), and thus the object's representation where it is converted to a string, e.g. with `print(obj)`. Returns a [String](class_string#class-string) representing the object. If not overridden, defaults to `"[ClassName:RID]"`. ### void add\_user\_signal ( [String](class_string#class-string) signal, [Array](class_array#class-array) arguments=[ ] ) Adds a user-defined `signal`. Arguments are optional, but can be added as an [Array](class_array#class-array) of dictionaries, each containing `name: String` and `type: int` (see [Variant.Type](class_%40globalscope#enum-globalscope-variant-type)) entries. ### [Variant](class_variant#class-variant) call ( [String](class_string#class-string) method, ... ) vararg Calls the `method` on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: ``` call("set", "position", Vector2(42.0, 0.0)) ``` **Note:** In C#, the method name must be specified as snake\_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase). ### void call\_deferred ( [String](class_string#class-string) method, ... ) vararg Calls the `method` on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: ``` call_deferred("set", "position", Vector2(42.0, 0.0)) ``` **Note:** In C#, the method name must be specified as snake\_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase). ### [Variant](class_variant#class-variant) callv ( [String](class_string#class-string) method, [Array](class_array#class-array) arg\_array ) Calls the `method` on the object and returns the result. Contrarily to [call](#class-object-method-call), this method does not support a variable number of arguments but expects all parameters to be via a single [Array](class_array#class-array). ``` callv("set", [ "position", Vector2(42.0, 0.0) ]) ``` ### [bool](class_bool#class-bool) can\_translate\_messages ( ) const Returns `true` if the object can translate strings. See [set\_message\_translation](#class-object-method-set-message-translation) and [tr](#class-object-method-tr). ### [Error](class_%40globalscope#enum-globalscope-error) connect ( [String](class_string#class-string) signal, [Object](#class-object) target, [String](class_string#class-string) method, [Array](class_array#class-array) binds=[ ], [int](class_int#class-int) flags=0 ) Connects a `signal` to a `method` on a `target` object. Pass optional `binds` to the call as an [Array](class_array#class-array) of parameters. These parameters will be passed to the method after any parameter used in the call to [emit\_signal](#class-object-method-emit-signal). Use `flags` to set deferred or one-shot connections. See [ConnectFlags](#enum-object-connectflags) constants. A `signal` can only be connected once to a `method`. It will print an error if already connected, unless the signal was connected with [CONNECT\_REFERENCE\_COUNTED](#class-object-constant-connect-reference-counted). To avoid this, first, use [is\_connected](#class-object-method-is-connected) to check for existing connections. If the `target` is destroyed in the game's lifecycle, the connection will be lost. Examples: ``` connect("pressed", self, "_on_Button_pressed") # BaseButton signal connect("text_entered", self, "_on_LineEdit_text_entered") # LineEdit signal connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # User-defined signal ``` An example of the relationship between `binds` passed to [connect](#class-object-method-connect) and parameters used when calling [emit\_signal](#class-object-method-emit-signal): ``` connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # weapon_type and damage are passed last emit_signal("hit", "Dark lord", 5) # "Dark lord" and 5 are passed first func _on_Player_hit(hit_by, level, weapon_type, damage): print("Hit by %s (lvl %d) with weapon %s for %d damage" % [hit_by, level, weapon_type, damage]) ``` ### void disconnect ( [String](class_string#class-string) signal, [Object](#class-object) target, [String](class_string#class-string) method ) Disconnects a `signal` from a `method` on the given `target`. If you try to disconnect a connection that does not exist, the method will print an error. Use [is\_connected](#class-object-method-is-connected) to ensure that the connection exists. ### void emit\_signal ( [String](class_string#class-string) signal, ... ) vararg Emits the given `signal`. The signal must exist, so it should be a built-in signal of this class or one of its parent classes, or a user-defined signal. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: ``` emit_signal("hit", weapon_type, damage) emit_signal("game_over") ``` ### void free ( ) Deletes the object from memory immediately. For [Node](class_node#class-node)s, you may want to use [Node.queue\_free](class_node#class-node-method-queue-free) to queue the node for safe deletion at the end of the current frame. **Important:** If you have a variable pointing to an object, it will *not* be assigned to `null` once the object is freed. Instead, it will point to a *previously freed instance* and you should validate it with [@GDScript.is\_instance\_valid](class_%40gdscript#class-gdscript-method-is-instance-valid) before attempting to call its methods or access its properties. ### [Variant](class_variant#class-variant) get ( [String](class_string#class-string) property ) const Returns the [Variant](class_variant#class-variant) value of the given `property`. If the `property` doesn't exist, this will return `null`. **Note:** In C#, the property name must be specified as snake\_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase). ### [String](class_string#class-string) get\_class ( ) const Returns the object's class as a [String](class_string#class-string). See also [is\_class](#class-object-method-is-class). **Note:** [get\_class](#class-object-method-get-class) does not take `class_name` declarations into account. If the object has a `class_name` defined, the base class name will be returned instead. ### [Array](class_array#class-array) get\_incoming\_connections ( ) const Returns an [Array](class_array#class-array) of dictionaries with information about signals that are connected to the object. Each [Dictionary](class_dictionary#class-dictionary) contains three String entries: * `source` is a reference to the signal emitter. * `signal_name` is the name of the connected signal. * `method_name` is the name of the method to which the signal is connected. ### [Variant](class_variant#class-variant) get\_indexed ( [NodePath](class_nodepath#class-nodepath) property ) const Gets the object's property indexed by the given [NodePath](class_nodepath#class-nodepath). The node path should be relative to the current object and can use the colon character (`:`) to access nested properties. Examples: `"position:x"` or `"material:next_pass:blend_mode"`. **Note:** Even though the method takes [NodePath](class_nodepath#class-nodepath) argument, it doesn't support actual paths to [Node](class_node#class-node)s in the scene tree, only colon-separated sub-property paths. For the purpose of nodes, use [Node.get\_node\_and\_resource](class_node#class-node-method-get-node-and-resource) instead. ### [int](class_int#class-int) get\_instance\_id ( ) const Returns the object's unique instance ID. This ID can be saved in [EncodedObjectAsID](class_encodedobjectasid#class-encodedobjectasid), and can be used to retrieve the object instance with [@GDScript.instance\_from\_id](class_%40gdscript#class-gdscript-method-instance-from-id). ### [Variant](class_variant#class-variant) get\_meta ( [String](class_string#class-string) name, [Variant](class_variant#class-variant) default=null ) const Returns the object's metadata entry for the given `name`. Throws error if the entry does not exist, unless `default` is not `null` (in which case the default value will be returned). ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_meta\_list ( ) const Returns the object's metadata as a [PoolStringArray](class_poolstringarray#class-poolstringarray). ### [Array](class_array#class-array) get\_method\_list ( ) const Returns the object's methods and their signatures as an [Array](class_array#class-array). ### [Array](class_array#class-array) get\_property\_list ( ) const Returns the object's property list as an [Array](class_array#class-array) of dictionaries. Each property's [Dictionary](class_dictionary#class-dictionary) contain at least `name: String` and `type: int` (see [Variant.Type](class_%40globalscope#enum-globalscope-variant-type)) entries. Optionally, it can also include `hint: int` (see [PropertyHint](class_%40globalscope#enum-globalscope-propertyhint)), `hint_string: String`, and `usage: int` (see [PropertyUsageFlags](class_%40globalscope#enum-globalscope-propertyusageflags)). ### [Reference](class_reference#class-reference) get\_script ( ) const Returns the object's [Script](class_script#class-script) instance, or `null` if none is assigned. ### [Array](class_array#class-array) get\_signal\_connection\_list ( [String](class_string#class-string) signal ) const Returns an [Array](class_array#class-array) of connections for the given `signal`. ### [Array](class_array#class-array) get\_signal\_list ( ) const Returns the list of signals as an [Array](class_array#class-array) of dictionaries. ### [bool](class_bool#class-bool) has\_meta ( [String](class_string#class-string) name ) const Returns `true` if a metadata entry is found with the given `name`. ### [bool](class_bool#class-bool) has\_method ( [String](class_string#class-string) method ) const Returns `true` if the object contains the given `method`. ### [bool](class_bool#class-bool) has\_signal ( [String](class_string#class-string) signal ) const Returns `true` if the given `signal` exists. ### [bool](class_bool#class-bool) has\_user\_signal ( [String](class_string#class-string) signal ) const Returns `true` if the given user-defined `signal` exists. Only signals added using [add\_user\_signal](#class-object-method-add-user-signal) are taken into account. ### [bool](class_bool#class-bool) is\_blocking\_signals ( ) const Returns `true` if signal emission blocking is enabled. ### [bool](class_bool#class-bool) is\_class ( [String](class_string#class-string) class ) const Returns `true` if the object inherits from the given `class`. See also [get\_class](#class-object-method-get-class). **Note:** [is\_class](#class-object-method-is-class) does not take `class_name` declarations into account. If the object has a `class_name` defined, [is\_class](#class-object-method-is-class) will return `false` for that name. ### [bool](class_bool#class-bool) is\_connected ( [String](class_string#class-string) signal, [Object](#class-object) target, [String](class_string#class-string) method ) const Returns `true` if a connection exists for a given `signal`, `target`, and `method`. ### [bool](class_bool#class-bool) is\_queued\_for\_deletion ( ) const Returns `true` if the [Node.queue\_free](class_node#class-node-method-queue-free) method was called for the object. ### void notification ( [int](class_int#class-int) what, [bool](class_bool#class-bool) reversed=false ) Send a given notification to the object, which will also trigger a call to the [\_notification](#class-object-method-notification) method of all classes that the object inherits from. If `reversed` is `true`, [\_notification](#class-object-method-notification) is called first on the object's own class, and then up to its successive parent classes. If `reversed` is `false`, [\_notification](#class-object-method-notification) is called first on the highest ancestor (`Object` itself), and then down to its successive inheriting classes. ### void property\_list\_changed\_notify ( ) Notify the editor that the property list has changed, so that editor plugins can take the new values into account. Does nothing on export builds. ### void remove\_meta ( [String](class_string#class-string) name ) Removes a given entry from the object's metadata. See also [set\_meta](#class-object-method-set-meta). ### void set ( [String](class_string#class-string) property, [Variant](class_variant#class-variant) value ) Assigns a new value to the given property. If the `property` does not exist or the given value's type doesn't match, nothing will happen. **Note:** In C#, the property name must be specified as snake\_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase). ### void set\_block\_signals ( [bool](class_bool#class-bool) enable ) If set to `true`, signal emission is blocked. ### void set\_deferred ( [String](class_string#class-string) property, [Variant](class_variant#class-variant) value ) Assigns a new value to the given property, after the current frame's physics step. This is equivalent to calling [set](#id4) via [call\_deferred](#class-object-method-call-deferred), i.e. `call_deferred("set", property, value)`. **Note:** In C#, the property name must be specified as snake\_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase). ### void set\_indexed ( [NodePath](class_nodepath#class-nodepath) property, [Variant](class_variant#class-variant) value ) Assigns a new value to the property identified by the [NodePath](class_nodepath#class-nodepath). The node path should be relative to the current object and can use the colon character (`:`) to access nested properties. Example: ``` set_indexed("position", Vector2(42, 0)) set_indexed("position:y", -10) print(position) # (42, -10) ``` ### void set\_message\_translation ( [bool](class_bool#class-bool) enable ) Defines whether the object can translate strings (with calls to [tr](#class-object-method-tr)). Enabled by default. ### void set\_meta ( [String](class_string#class-string) name, [Variant](class_variant#class-variant) value ) Adds, changes or removes a given entry in the object's metadata. Metadata are serialized and can take any [Variant](class_variant#class-variant) value. To remove a given entry from the object's metadata, use [remove\_meta](#class-object-method-remove-meta). Metadata is also removed if its value is set to `null`. This means you can also use `set_meta("name", null)` to remove metadata for `"name"`. ### void set\_script ( [Reference](class_reference#class-reference) script ) Assigns a script to the object. Each object can have a single script assigned to it, which are used to extend its functionality. If the object already had a script, the previous script instance will be freed and its variables and state will be lost. The new script's [\_init](#class-object-method-init) method will be called. ### [String](class_string#class-string) to\_string ( ) Returns a [String](class_string#class-string) representing the object. If not overridden, defaults to `"[ClassName:RID]"`. Override the method [\_to\_string](#class-object-method-to-string) to customize the [String](class_string#class-string) representation. ### [String](class_string#class-string) tr ( [String](class_string#class-string) message ) const Translates a message using translation catalogs configured in the Project Settings. Only works if message translation is enabled (which it is by default), otherwise it returns the `message` unchanged. See [set\_message\_translation](#class-object-method-set-message-translation).
programming_docs
godot AnimationTree AnimationTree ============= **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) A node to be used for advanced animation transitions in an [AnimationPlayer](class_animationplayer#class-animationplayer). Description ----------- A node to be used for advanced animation transitions in an [AnimationPlayer](class_animationplayer#class-animationplayer). **Note:** When linked with an [AnimationPlayer](class_animationplayer#class-animationplayer), several properties and methods of the corresponding [AnimationPlayer](class_animationplayer#class-animationplayer) will not function as expected. Playback and transitions should be handled using only the `AnimationTree` and its constituent [AnimationNode](class_animationnode#class-animationnode)(s). The [AnimationPlayer](class_animationplayer#class-animationplayer) node should be used solely for adding, deleting, and editing animations. Tutorials --------- * [Using AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [active](#class-animationtree-property-active) | `false` | | [NodePath](class_nodepath#class-nodepath) | [anim\_player](#class-animationtree-property-anim-player) | `NodePath("")` | | [AnimationProcessMode](#enum-animationtree-animationprocessmode) | [process\_mode](#class-animationtree-property-process-mode) | `1` | | [NodePath](class_nodepath#class-nodepath) | [root\_motion\_track](#class-animationtree-property-root-motion-track) | `NodePath("")` | | [AnimationNode](class_animationnode#class-animationnode) | [tree\_root](#class-animationtree-property-tree-root) | | Methods ------- | | | | --- | --- | | void | [advance](#class-animationtree-method-advance) **(** [float](class_float#class-float) delta **)** | | [Transform](class_transform#class-transform) | [get\_root\_motion\_transform](#class-animationtree-method-get-root-motion-transform) **(** **)** const | | void | [rename\_parameter](#class-animationtree-method-rename-parameter) **(** [String](class_string#class-string) old\_name, [String](class_string#class-string) new\_name **)** | Enumerations ------------ enum **AnimationProcessMode**: * **ANIMATION\_PROCESS\_PHYSICS** = **0** --- The animations will progress during the physics frame (i.e. [Node.\_physics\_process](class_node#class-node-method-physics-process)). * **ANIMATION\_PROCESS\_IDLE** = **1** --- The animations will progress during the idle frame (i.e. [Node.\_process](class_node#class-node-method-process)). * **ANIMATION\_PROCESS\_MANUAL** = **2** --- The animations will only progress manually (see [advance](#class-animationtree-method-advance)). Property Descriptions --------------------- ### [bool](class_bool#class-bool) active | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_active(value) | | *Getter* | is\_active() | If `true`, the `AnimationTree` will be processing. ### [NodePath](class_nodepath#class-nodepath) anim\_player | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_animation\_player(value) | | *Getter* | get\_animation\_player() | The path to the [AnimationPlayer](class_animationplayer#class-animationplayer) used for animating. ### [AnimationProcessMode](#enum-animationtree-animationprocessmode) process\_mode | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_process\_mode(value) | | *Getter* | get\_process\_mode() | The process mode of this `AnimationTree`. See [AnimationProcessMode](#enum-animationtree-animationprocessmode) for available modes. ### [NodePath](class_nodepath#class-nodepath) root\_motion\_track | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_root\_motion\_track(value) | | *Getter* | get\_root\_motion\_track() | The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by `":"`. For example, `"character/skeleton:ankle"` or `"character/mesh:transform/local"`. If the track has type [Animation.TYPE\_TRANSFORM](class_animation#class-animation-constant-type-transform), the transformation will be cancelled visually, and the animation will appear to stay in place. See also [get\_root\_motion\_transform](#class-animationtree-method-get-root-motion-transform) and [RootMotionView](class_rootmotionview#class-rootmotionview). ### [AnimationNode](class_animationnode#class-animationnode) tree\_root | | | | --- | --- | | *Setter* | set\_tree\_root(value) | | *Getter* | get\_tree\_root() | The root animation node of this `AnimationTree`. See [AnimationNode](class_animationnode#class-animationnode). Method Descriptions ------------------- ### void advance ( [float](class_float#class-float) delta ) Manually advance the animations by the specified time (in seconds). ### [Transform](class_transform#class-transform) get\_root\_motion\_transform ( ) const Retrieve the motion of the [root\_motion\_track](#class-animationtree-property-root-motion-track) as a [Transform](class_transform#class-transform) that can be used elsewhere. If [root\_motion\_track](#class-animationtree-property-root-motion-track) is not a path to a track of type [Animation.TYPE\_TRANSFORM](class_animation#class-animation-constant-type-transform), returns an identity transformation. See also [root\_motion\_track](#class-animationtree-property-root-motion-track) and [RootMotionView](class_rootmotionview#class-rootmotionview). ### void rename\_parameter ( [String](class_string#class-string) old\_name, [String](class_string#class-string) new\_name ) godot VisualScriptOperator VisualScriptOperator ==================== **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A Visual Script node that performs an operation on two values. Description ----------- **Input Ports:** * Data (variant): `A` * Data (variant): `B` **Output Ports:** * Data (variant): `result` Properties ---------- | | | | | --- | --- | --- | | [Variant.Operator](class_%40globalscope#enum-globalscope-variant-operator) | [operator](#class-visualscriptoperator-property-operator) | `6` | | [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) | [type](#class-visualscriptoperator-property-type) | `0` | Property Descriptions --------------------- ### [Variant.Operator](class_%40globalscope#enum-globalscope-variant-operator) operator | | | | --- | --- | | *Default* | `6` | | *Setter* | set\_operator(value) | | *Getter* | get\_operator() | The operation to be performed. See [Variant.Operator](class_%40globalscope#enum-globalscope-variant-operator) for available options. ### [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_typed(value) | | *Getter* | get\_typed() | The type of the values for this operation. See [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) for available options. godot VisualShader VisualShader ============ **Inherits:** [Shader](class_shader#class-shader) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A custom shader program with a visual editor. Description ----------- This class allows you to define a custom shader program that can be used for various materials to render objects. The visual shader editor creates the shader. Properties ---------- | | | | | --- | --- | --- | | [Vector2](class_vector2#class-vector2) | [graph\_offset](#class-visualshader-property-graph-offset) | `Vector2( 0, 0 )` | Methods ------- | | | | --- | --- | | void | [add\_node](#class-visualshader-method-add-node) **(** [Type](#enum-visualshader-type) type, [VisualShaderNode](class_visualshadernode#class-visualshadernode) node, [Vector2](class_vector2#class-vector2) position, [int](class_int#class-int) id **)** | | [bool](class_bool#class-bool) | [can\_connect\_nodes](#class-visualshader-method-can-connect-nodes) **(** [Type](#enum-visualshader-type) type, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [connect\_nodes](#class-visualshader-method-connect-nodes) **(** [Type](#enum-visualshader-type) type, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port **)** | | void | [connect\_nodes\_forced](#class-visualshader-method-connect-nodes-forced) **(** [Type](#enum-visualshader-type) type, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port **)** | | void | [disconnect\_nodes](#class-visualshader-method-disconnect-nodes) **(** [Type](#enum-visualshader-type) type, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port **)** | | [VisualShaderNode](class_visualshadernode#class-visualshadernode) | [get\_node](#class-visualshader-method-get-node) **(** [Type](#enum-visualshader-type) type, [int](class_int#class-int) id **)** const | | [Array](class_array#class-array) | [get\_node\_connections](#class-visualshader-method-get-node-connections) **(** [Type](#enum-visualshader-type) type **)** const | | [PoolIntArray](class_poolintarray#class-poolintarray) | [get\_node\_list](#class-visualshader-method-get-node-list) **(** [Type](#enum-visualshader-type) type **)** const | | [Vector2](class_vector2#class-vector2) | [get\_node\_position](#class-visualshader-method-get-node-position) **(** [Type](#enum-visualshader-type) type, [int](class_int#class-int) id **)** const | | [int](class_int#class-int) | [get\_valid\_node\_id](#class-visualshader-method-get-valid-node-id) **(** [Type](#enum-visualshader-type) type **)** const | | [bool](class_bool#class-bool) | [is\_node\_connection](#class-visualshader-method-is-node-connection) **(** [Type](#enum-visualshader-type) type, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port **)** const | | void | [remove\_node](#class-visualshader-method-remove-node) **(** [Type](#enum-visualshader-type) type, [int](class_int#class-int) id **)** | | void | [set\_mode](#class-visualshader-method-set-mode) **(** [Mode](class_shader#enum-shader-mode) mode **)** | | void | [set\_node\_position](#class-visualshader-method-set-node-position) **(** [Type](#enum-visualshader-type) type, [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) position **)** | Enumerations ------------ enum **Type**: * **TYPE\_VERTEX** = **0** --- A vertex shader, operating on vertices. * **TYPE\_FRAGMENT** = **1** --- A fragment shader, operating on fragments (pixels). * **TYPE\_LIGHT** = **2** --- A shader for light calculations. * **TYPE\_MAX** = **3** --- Represents the size of the [Type](#enum-visualshader-type) enum. Constants --------- * **NODE\_ID\_INVALID** = **-1** * **NODE\_ID\_OUTPUT** = **0** Property Descriptions --------------------- ### [Vector2](class_vector2#class-vector2) graph\_offset | | | | --- | --- | | *Default* | `Vector2( 0, 0 )` | | *Setter* | set\_graph\_offset(value) | | *Getter* | get\_graph\_offset() | The offset vector of the whole graph. Method Descriptions ------------------- ### void add\_node ( [Type](#enum-visualshader-type) type, [VisualShaderNode](class_visualshadernode#class-visualshadernode) node, [Vector2](class_vector2#class-vector2) position, [int](class_int#class-int) id ) Adds the specified node to the shader. ### [bool](class_bool#class-bool) can\_connect\_nodes ( [Type](#enum-visualshader-type) type, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port ) const Returns `true` if the specified nodes and ports can be connected together. ### [Error](class_%40globalscope#enum-globalscope-error) connect\_nodes ( [Type](#enum-visualshader-type) type, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port ) Connects the specified nodes and ports. ### void connect\_nodes\_forced ( [Type](#enum-visualshader-type) type, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port ) Connects the specified nodes and ports, even if they can't be connected. Such connection is invalid and will not function properly. ### void disconnect\_nodes ( [Type](#enum-visualshader-type) type, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port ) Connects the specified nodes and ports. ### [VisualShaderNode](class_visualshadernode#class-visualshadernode) get\_node ( [Type](#enum-visualshader-type) type, [int](class_int#class-int) id ) const Returns the shader node instance with specified `type` and `id`. ### [Array](class_array#class-array) get\_node\_connections ( [Type](#enum-visualshader-type) type ) const Returns the list of connected nodes with the specified type. ### [PoolIntArray](class_poolintarray#class-poolintarray) get\_node\_list ( [Type](#enum-visualshader-type) type ) const Returns the list of all nodes in the shader with the specified type. ### [Vector2](class_vector2#class-vector2) get\_node\_position ( [Type](#enum-visualshader-type) type, [int](class_int#class-int) id ) const Returns the position of the specified node within the shader graph. ### [int](class_int#class-int) get\_valid\_node\_id ( [Type](#enum-visualshader-type) type ) const ### [bool](class_bool#class-bool) is\_node\_connection ( [Type](#enum-visualshader-type) type, [int](class_int#class-int) from\_node, [int](class_int#class-int) from\_port, [int](class_int#class-int) to\_node, [int](class_int#class-int) to\_port ) const Returns `true` if the specified node and port connection exist. ### void remove\_node ( [Type](#enum-visualshader-type) type, [int](class_int#class-int) id ) Removes the specified node from the shader. ### void set\_mode ( [Mode](class_shader#enum-shader-mode) mode ) Sets the mode of this shader. ### void set\_node\_position ( [Type](#enum-visualshader-type) type, [int](class_int#class-int) id, [Vector2](class_vector2#class-vector2) position ) Sets the position of the specified node. godot AudioStreamPlaybackResampled AudioStreamPlaybackResampled ============================ **Inherits:** [AudioStreamPlayback](class_audiostreamplayback#class-audiostreamplayback) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [AudioStreamGeneratorPlayback](class_audiostreamgeneratorplayback#class-audiostreamgeneratorplayback) godot MeshInstance MeshInstance ============ **Inherits:** [GeometryInstance](class_geometryinstance#class-geometryinstance) **<** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [SoftBody](class_softbody#class-softbody) Node that instances meshes into a scenario. Description ----------- MeshInstance is a node that takes a [Mesh](class_mesh#class-mesh) resource and adds it to the current scenario by creating an instance of it. This is the class most often used to get 3D geometry rendered and can be used to instance a single [Mesh](class_mesh#class-mesh) in many places. This allows reusing geometry, which can save on resources. When a [Mesh](class_mesh#class-mesh) has to be instanced more than thousands of times at close proximity, consider using a [MultiMesh](class_multimesh#class-multimesh) in a [MultiMeshInstance](class_multimeshinstance#class-multimeshinstance) instead. Tutorials --------- * [3D Material Testers Demo](https://godotengine.org/asset-library/asset/123) * [3D Kinematic Character Demo](https://godotengine.org/asset-library/asset/126) * [3D Platformer Demo](https://godotengine.org/asset-library/asset/125) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) Properties ---------- | | | | | --- | --- | --- | | [Mesh](class_mesh#class-mesh) | [mesh](#class-meshinstance-property-mesh) | | | [NodePath](class_nodepath#class-nodepath) | [skeleton](#class-meshinstance-property-skeleton) | `NodePath("..")` | | [Skin](class_skin#class-skin) | [skin](#class-meshinstance-property-skin) | | | [bool](class_bool#class-bool) | [software\_skinning\_transform\_normals](#class-meshinstance-property-software-skinning-transform-normals) | `true` | Methods ------- | | | | --- | --- | | void | [create\_convex\_collision](#class-meshinstance-method-create-convex-collision) **(** [bool](class_bool#class-bool) clean=true, [bool](class_bool#class-bool) simplify=false **)** | | void | [create\_debug\_tangents](#class-meshinstance-method-create-debug-tangents) **(** **)** | | void | [create\_multiple\_convex\_collisions](#class-meshinstance-method-create-multiple-convex-collisions) **(** **)** | | void | [create\_trimesh\_collision](#class-meshinstance-method-create-trimesh-collision) **(** **)** | | [Material](class_material#class-material) | [get\_active\_material](#class-meshinstance-method-get-active-material) **(** [int](class_int#class-int) surface **)** const | | [Material](class_material#class-material) | [get\_surface\_material](#class-meshinstance-method-get-surface-material) **(** [int](class_int#class-int) surface **)** const | | [int](class_int#class-int) | [get\_surface\_material\_count](#class-meshinstance-method-get-surface-material-count) **(** **)** const | | [bool](class_bool#class-bool) | [is\_mergeable\_with](#class-meshinstance-method-is-mergeable-with) **(** [Node](class_node#class-node) other\_mesh\_instance **)** const | | [bool](class_bool#class-bool) | [merge\_meshes](#class-meshinstance-method-merge-meshes) **(** [Array](class_array#class-array) mesh\_instances=[ ], [bool](class_bool#class-bool) use\_global\_space=false, [bool](class_bool#class-bool) check\_compatibility=true **)** | | void | [set\_surface\_material](#class-meshinstance-method-set-surface-material) **(** [int](class_int#class-int) surface, [Material](class_material#class-material) material **)** | Property Descriptions --------------------- ### [Mesh](class_mesh#class-mesh) mesh | | | | --- | --- | | *Setter* | set\_mesh(value) | | *Getter* | get\_mesh() | The [Mesh](class_mesh#class-mesh) resource for the instance. ### [NodePath](class_nodepath#class-nodepath) skeleton | | | | --- | --- | | *Default* | `NodePath("..")` | | *Setter* | set\_skeleton\_path(value) | | *Getter* | get\_skeleton\_path() | [NodePath](class_nodepath#class-nodepath) to the [Skeleton](class_skeleton#class-skeleton) associated with the instance. ### [Skin](class_skin#class-skin) skin | | | | --- | --- | | *Setter* | set\_skin(value) | | *Getter* | get\_skin() | Sets the skin to be used by this instance. ### [bool](class_bool#class-bool) software\_skinning\_transform\_normals | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_software\_skinning\_transform\_normals(value) | | *Getter* | is\_software\_skinning\_transform\_normals\_enabled() | If `true`, normals are transformed when software skinning is used. Set to `false` when normals are not needed for better performance. See [ProjectSettings.rendering/quality/skinning/software\_skinning\_fallback](class_projectsettings#class-projectsettings-property-rendering-quality-skinning-software-skinning-fallback) for details about how software skinning is enabled. Method Descriptions ------------------- ### void create\_convex\_collision ( [bool](class_bool#class-bool) clean=true, [bool](class_bool#class-bool) simplify=false ) This helper creates a [StaticBody](class_staticbody#class-staticbody) child node with a [ConvexPolygonShape](class_convexpolygonshape#class-convexpolygonshape) collision shape calculated from the mesh geometry. It's mainly used for testing. If `clean` is `true` (default), duplicate and interior vertices are removed automatically. You can set it to `false` to make the process faster if not needed. If `simplify` is `true`, the geometry can be further simplified to reduce the amount of vertices. Disabled by default. ### void create\_debug\_tangents ( ) This helper creates a `MeshInstance` child node with gizmos at every vertex calculated from the mesh geometry. It's mainly used for testing. ### void create\_multiple\_convex\_collisions ( ) This helper creates a [StaticBody](class_staticbody#class-staticbody) child node with multiple [ConvexPolygonShape](class_convexpolygonshape#class-convexpolygonshape) collision shapes calculated from the mesh geometry via convex decomposition. It's mainly used for testing. ### void create\_trimesh\_collision ( ) This helper creates a [StaticBody](class_staticbody#class-staticbody) child node with a [ConcavePolygonShape](class_concavepolygonshape#class-concavepolygonshape) collision shape calculated from the mesh geometry. It's mainly used for testing. ### [Material](class_material#class-material) get\_active\_material ( [int](class_int#class-int) surface ) const Returns the [Material](class_material#class-material) that will be used by the [Mesh](class_mesh#class-mesh) when drawing. This can return the [GeometryInstance.material\_override](class_geometryinstance#class-geometryinstance-property-material-override), the surface override [Material](class_material#class-material) defined in this `MeshInstance`, or the surface [Material](class_material#class-material) defined in the [Mesh](class_mesh#class-mesh). For example, if [GeometryInstance.material\_override](class_geometryinstance#class-geometryinstance-property-material-override) is used, all surfaces will return the override material. ### [Material](class_material#class-material) get\_surface\_material ( [int](class_int#class-int) surface ) const Returns the override [Material](class_material#class-material) for a surface of the [Mesh](class_mesh#class-mesh) resource. **Note:** This function only returns *override* materials associated with this `MeshInstance`. Consider using [get\_active\_material](#class-meshinstance-method-get-active-material) or [Mesh.surface\_get\_material](class_mesh#class-mesh-method-surface-get-material) to get materials associated with the [Mesh](class_mesh#class-mesh) resource. ### [int](class_int#class-int) get\_surface\_material\_count ( ) const Returns the number of surface override materials. ### [bool](class_bool#class-bool) is\_mergeable\_with ( [Node](class_node#class-node) other\_mesh\_instance ) const Returns `true` if this `MeshInstance` can be merged with the specified `other_mesh_instance`, using the [merge\_meshes](#class-meshinstance-method-merge-meshes) function. In order to be mergeable, properties of the `MeshInstance` must match, and each surface must match, in terms of material, attributes and vertex format. ### [bool](class_bool#class-bool) merge\_meshes ( [Array](class_array#class-array) mesh\_instances=[ ], [bool](class_bool#class-bool) use\_global\_space=false, [bool](class_bool#class-bool) check\_compatibility=true ) This function can merge together the data from several source `MeshInstance`s into a single destination `MeshInstance` (the MeshInstance the function is called from). This is primarily useful for improving performance by reducing the number of drawcalls and [Node](class_node#class-node)s. Merging should only be attempted for simple meshes that do not contain animation. The final vertices can either be returned in global space, or in local space relative to the destination `MeshInstance` global transform (the destination Node must be inside the [SceneTree](class_scenetree#class-scenetree) for local space to work). The function will make a final check for compatibility between the `MeshInstance`s by default, this should always be used unless you have previously checked for compatibility using [is\_mergeable\_with](#class-meshinstance-method-is-mergeable-with). If the compatibility check is omitted and the meshes are merged, you may see rendering errors. **Note:** The requirements for similarity between meshes are quite stringent. They can be checked using the [is\_mergeable\_with](#class-meshinstance-method-is-mergeable-with) function prior to calling [merge\_meshes](#class-meshinstance-method-merge-meshes). Also note that any initial data in the destination `MeshInstance` data will be discarded. ### void set\_surface\_material ( [int](class_int#class-int) surface, [Material](class_material#class-material) material ) Sets the override [Material](class_material#class-material) for the specified surface of the [Mesh](class_mesh#class-mesh) resource. This material is associated with this `MeshInstance` rather than with the [Mesh](class_mesh#class-mesh) resource.
programming_docs
godot VisualShaderNodeVectorRefract VisualShaderNodeVectorRefract ============================= **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Returns the [Vector3](class_vector3#class-vector3) that points in the direction of refraction. For use within the visual shader graph. Description ----------- Translated to `refract(I, N, eta)` in the shader language, where `I` is the incident vector, `N` is the normal vector and `eta` is the ratio of the indices of the refraction. godot ResourcePreloader ResourcePreloader ================= **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) Resource Preloader Node. Description ----------- This node is used to preload sub-resources inside a scene, so when the scene is loaded, all the resources are ready to use and can be retrieved from the preloader. GDScript has a simplified [@GDScript.preload](class_%40gdscript#class-gdscript-method-preload) built-in method which can be used in most situations, leaving the use of `ResourcePreloader` for more advanced scenarios. Methods ------- | | | | --- | --- | | void | [add\_resource](#class-resourcepreloader-method-add-resource) **(** [String](class_string#class-string) name, [Resource](class_resource#class-resource) resource **)** | | [Resource](class_resource#class-resource) | [get\_resource](#class-resourcepreloader-method-get-resource) **(** [String](class_string#class-string) name **)** const | | [PoolStringArray](class_poolstringarray#class-poolstringarray) | [get\_resource\_list](#class-resourcepreloader-method-get-resource-list) **(** **)** const | | [bool](class_bool#class-bool) | [has\_resource](#class-resourcepreloader-method-has-resource) **(** [String](class_string#class-string) name **)** const | | void | [remove\_resource](#class-resourcepreloader-method-remove-resource) **(** [String](class_string#class-string) name **)** | | void | [rename\_resource](#class-resourcepreloader-method-rename-resource) **(** [String](class_string#class-string) name, [String](class_string#class-string) newname **)** | Method Descriptions ------------------- ### void add\_resource ( [String](class_string#class-string) name, [Resource](class_resource#class-resource) resource ) Adds a resource to the preloader with the given `name`. If a resource with the given `name` already exists, the new resource will be renamed to "`name` N" where N is an incrementing number starting from 2. ### [Resource](class_resource#class-resource) get\_resource ( [String](class_string#class-string) name ) const Returns the resource associated to `name`. ### [PoolStringArray](class_poolstringarray#class-poolstringarray) get\_resource\_list ( ) const Returns the list of resources inside the preloader. ### [bool](class_bool#class-bool) has\_resource ( [String](class_string#class-string) name ) const Returns `true` if the preloader contains a resource associated to `name`. ### void remove\_resource ( [String](class_string#class-string) name ) Removes the resource associated to `name` from the preloader. ### void rename\_resource ( [String](class_string#class-string) name, [String](class_string#class-string) newname ) Renames a resource inside the preloader from `name` to `newname`. godot JavaScript JavaScript ========== **Inherits:** [Object](class_object#class-object) Singleton that connects the engine with the browser's JavaScript context in HTML5 export. Description ----------- The JavaScript singleton is implemented only in the HTML5 export. It's used to access the browser's JavaScript context. This allows interaction with embedding pages or calling third-party JavaScript APIs. **Note:** This singleton can be disabled at build-time to improve security. By default, the JavaScript singleton is enabled. Official export templates also have the JavaScript singleton enabled. See [Compiling for the Web](https://docs.godotengine.org/en/3.5/development/compiling/compiling_for_web.html) in the documentation for more information. Tutorials --------- * [#calling-javascript-from-script](https://docs.godotengine.org/en/3.5/tutorials/export/exporting_for_web.html#calling-javascript-from-script) in [Exporting for the Web](https://docs.godotengine.org/en/3.5/tutorials/export/exporting_for_web.html) Methods ------- | | | | --- | --- | | [JavaScriptObject](class_javascriptobject#class-javascriptobject) | [create\_callback](#class-javascript-method-create-callback) **(** [Object](class_object#class-object) object, [String](class_string#class-string) method **)** | | [Variant](class_variant#class-variant) | [create\_object](#class-javascript-method-create-object) **(** [String](class_string#class-string) object, ... **)** vararg | | void | [download\_buffer](#class-javascript-method-download-buffer) **(** [PoolByteArray](class_poolbytearray#class-poolbytearray) buffer, [String](class_string#class-string) name, [String](class_string#class-string) mime="application/octet-stream" **)** | | [Variant](class_variant#class-variant) | [eval](#class-javascript-method-eval) **(** [String](class_string#class-string) code, [bool](class_bool#class-bool) use\_global\_execution\_context=false **)** | | [JavaScriptObject](class_javascriptobject#class-javascriptobject) | [get\_interface](#class-javascript-method-get-interface) **(** [String](class_string#class-string) interface **)** | | [bool](class_bool#class-bool) | [pwa\_needs\_update](#class-javascript-method-pwa-needs-update) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [pwa\_update](#class-javascript-method-pwa-update) **(** **)** | Signals ------- ### pwa\_update\_available ( ) Emitted when an update for this progressive web app has been detected but is waiting to be activated because a previous version is active. See [pwa\_update](#class-javascript-method-pwa-update) to force the update to take place immediately. Method Descriptions ------------------- ### [JavaScriptObject](class_javascriptobject#class-javascriptobject) create\_callback ( [Object](class_object#class-object) object, [String](class_string#class-string) method ) Creates a reference to a script function that can be used as a callback by JavaScript. The reference must be kept until the callback happens, or it won't be called at all. See [JavaScriptObject](class_javascriptobject#class-javascriptobject) for usage. ### [Variant](class_variant#class-variant) create\_object ( [String](class_string#class-string) object, ... ) vararg Creates a new JavaScript object using the `new` constructor. The `object` must a valid property of the JavaScript `window`. See [JavaScriptObject](class_javascriptobject#class-javascriptobject) for usage. ### void download\_buffer ( [PoolByteArray](class_poolbytearray#class-poolbytearray) buffer, [String](class_string#class-string) name, [String](class_string#class-string) mime="application/octet-stream" ) Prompts the user to download a file containing the specified `buffer`. The file will have the given `name` and `mime` type. **Note:** The browser may override the [MIME type](https://en.wikipedia.org/wiki/Media_type) provided based on the file `name`'s extension. **Note:** Browsers might block the download if [download\_buffer](#class-javascript-method-download-buffer) is not being called from a user interaction (e.g. button click). **Note:** Browsers might ask the user for permission or block the download if multiple download requests are made in a quick succession. ### [Variant](class_variant#class-variant) eval ( [String](class_string#class-string) code, [bool](class_bool#class-bool) use\_global\_execution\_context=false ) Execute the string `code` as JavaScript code within the browser window. This is a call to the actual global JavaScript function `eval()`. If `use_global_execution_context` is `true`, the code will be evaluated in the global execution context. Otherwise, it is evaluated in the execution context of a function within the engine's runtime environment. ### [JavaScriptObject](class_javascriptobject#class-javascriptobject) get\_interface ( [String](class_string#class-string) interface ) Returns an interface to a JavaScript object that can be used by scripts. The `interface` must be a valid property of the JavaScript `window`. The callback must accept a single [Array](class_array#class-array) argument, which will contain the JavaScript `arguments`. See [JavaScriptObject](class_javascriptobject#class-javascriptobject) for usage. ### [bool](class_bool#class-bool) pwa\_needs\_update ( ) const Returns `true` if a new version of the progressive web app is waiting to be activated. **Note:** Only relevant when exported as a Progressive Web App. ### [Error](class_%40globalscope#enum-globalscope-error) pwa\_update ( ) Performs the live update of the progressive web app. Forcing the new version to be installed and the page to be reloaded. **Note:** Your application will be **reloaded in all browser tabs**. **Note:** Only relevant when exported as a Progressive Web App and [pwa\_needs\_update](#class-javascript-method-pwa-needs-update) returns `true`. godot AnimatedSprite3D AnimatedSprite3D ================ **Inherits:** [SpriteBase3D](class_spritebase3d#class-spritebase3d) **<** [GeometryInstance](class_geometryinstance#class-geometryinstance) **<** [VisualInstance](class_visualinstance#class-visualinstance) **<** [CullInstance](class_cullinstance#class-cullinstance) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) 2D sprite node in 3D world, that can use multiple 2D textures for animation. Description ----------- Animations are created using a [SpriteFrames](class_spriteframes#class-spriteframes) resource, which can be configured in the editor via the SpriteFrames panel. Tutorials --------- * [2D Sprite animation (also applies to 3D)](https://docs.godotengine.org/en/3.5/tutorials/2d/2d_sprite_animation.html) Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [animation](#class-animatedsprite3d-property-animation) | `"default"` | | [int](class_int#class-int) | [frame](#class-animatedsprite3d-property-frame) | `0` | | [SpriteFrames](class_spriteframes#class-spriteframes) | [frames](#class-animatedsprite3d-property-frames) | | | [bool](class_bool#class-bool) | [playing](#class-animatedsprite3d-property-playing) | `false` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [is\_playing](#class-animatedsprite3d-method-is-playing) **(** **)** const | | void | [play](#class-animatedsprite3d-method-play) **(** [String](class_string#class-string) anim="" **)** | | void | [stop](#class-animatedsprite3d-method-stop) **(** **)** | Signals ------- ### animation\_finished ( ) Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn. ### frame\_changed ( ) Emitted when [frame](#class-animatedsprite3d-property-frame) changed. Property Descriptions --------------------- ### [String](class_string#class-string) animation | | | | --- | --- | | *Default* | `"default"` | | *Setter* | set\_animation(value) | | *Getter* | get\_animation() | The current animation from the `frames` resource. If this value changes, the `frame` counter is reset. ### [int](class_int#class-int) frame | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_frame(value) | | *Getter* | get\_frame() | The displayed animation frame's index. ### [SpriteFrames](class_spriteframes#class-spriteframes) frames | | | | --- | --- | | *Setter* | set\_sprite\_frames(value) | | *Getter* | get\_sprite\_frames() | The [SpriteFrames](class_spriteframes#class-spriteframes) resource containing the animation(s). ### [bool](class_bool#class-bool) playing | | | | --- | --- | | *Default* | `false` | If `true`, the [animation](#class-animatedsprite3d-property-animation) is currently playing. Method Descriptions ------------------- ### [bool](class_bool#class-bool) is\_playing ( ) const Returns `true` if an animation is currently being played. ### void play ( [String](class_string#class-string) anim="" ) Plays the animation named `anim`. If no `anim` is provided, the current animation is played. ### void stop ( ) Stops the current animation (does not reset the frame counter). godot VideoStreamGDNative VideoStreamGDNative =================== **Inherits:** [VideoStream](class_videostream#class-videostream) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) [VideoStream](class_videostream#class-videostream) resource for video formats implemented via GDNative. Description ----------- [VideoStream](class_videostream#class-videostream) resource for video formats implemented via GDNative. It can be used via [godot-videodecoder](https://github.com/KidRigger/godot-videodecoder) which uses the [FFmpeg](https://ffmpeg.org) library. Methods ------- | | | | --- | --- | | [String](class_string#class-string) | [get\_file](#class-videostreamgdnative-method-get-file) **(** **)** | | void | [set\_file](#class-videostreamgdnative-method-set-file) **(** [String](class_string#class-string) file **)** | Method Descriptions ------------------- ### [String](class_string#class-string) get\_file ( ) Returns the video file handled by this `VideoStreamGDNative`. ### void set\_file ( [String](class_string#class-string) file ) Sets the video file that this `VideoStreamGDNative` resource handles. The supported extensions depend on the GDNative plugins used to expose video formats. godot SliderJoint SliderJoint =========== **Inherits:** [Joint](class_joint#class-joint) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Slider between two PhysicsBodies in 3D. Description ----------- Slides across the X axis of the pivot object. See also [Generic6DOFJoint](class_generic6dofjoint#class-generic6dofjoint). Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [angular\_limit/damping](#class-sliderjoint-property-angular-limit-damping) | `0.0` | | [float](class_float#class-float) | [angular\_limit/lower\_angle](#class-sliderjoint-property-angular-limit-lower-angle) | `0.0` | | [float](class_float#class-float) | [angular\_limit/restitution](#class-sliderjoint-property-angular-limit-restitution) | `0.7` | | [float](class_float#class-float) | [angular\_limit/softness](#class-sliderjoint-property-angular-limit-softness) | `1.0` | | [float](class_float#class-float) | [angular\_limit/upper\_angle](#class-sliderjoint-property-angular-limit-upper-angle) | `0.0` | | [float](class_float#class-float) | [angular\_motion/damping](#class-sliderjoint-property-angular-motion-damping) | `1.0` | | [float](class_float#class-float) | [angular\_motion/restitution](#class-sliderjoint-property-angular-motion-restitution) | `0.7` | | [float](class_float#class-float) | [angular\_motion/softness](#class-sliderjoint-property-angular-motion-softness) | `1.0` | | [float](class_float#class-float) | [angular\_ortho/damping](#class-sliderjoint-property-angular-ortho-damping) | `1.0` | | [float](class_float#class-float) | [angular\_ortho/restitution](#class-sliderjoint-property-angular-ortho-restitution) | `0.7` | | [float](class_float#class-float) | [angular\_ortho/softness](#class-sliderjoint-property-angular-ortho-softness) | `1.0` | | [float](class_float#class-float) | [linear\_limit/damping](#class-sliderjoint-property-linear-limit-damping) | `1.0` | | [float](class_float#class-float) | [linear\_limit/lower\_distance](#class-sliderjoint-property-linear-limit-lower-distance) | `-1.0` | | [float](class_float#class-float) | [linear\_limit/restitution](#class-sliderjoint-property-linear-limit-restitution) | `0.7` | | [float](class_float#class-float) | [linear\_limit/softness](#class-sliderjoint-property-linear-limit-softness) | `1.0` | | [float](class_float#class-float) | [linear\_limit/upper\_distance](#class-sliderjoint-property-linear-limit-upper-distance) | `1.0` | | [float](class_float#class-float) | [linear\_motion/damping](#class-sliderjoint-property-linear-motion-damping) | `0.0` | | [float](class_float#class-float) | [linear\_motion/restitution](#class-sliderjoint-property-linear-motion-restitution) | `0.7` | | [float](class_float#class-float) | [linear\_motion/softness](#class-sliderjoint-property-linear-motion-softness) | `1.0` | | [float](class_float#class-float) | [linear\_ortho/damping](#class-sliderjoint-property-linear-ortho-damping) | `1.0` | | [float](class_float#class-float) | [linear\_ortho/restitution](#class-sliderjoint-property-linear-ortho-restitution) | `0.7` | | [float](class_float#class-float) | [linear\_ortho/softness](#class-sliderjoint-property-linear-ortho-softness) | `1.0` | Methods ------- | | | | --- | --- | | [float](class_float#class-float) | [get\_param](#class-sliderjoint-method-get-param) **(** [Param](#enum-sliderjoint-param) param **)** const | | void | [set\_param](#class-sliderjoint-method-set-param) **(** [Param](#enum-sliderjoint-param) param, [float](class_float#class-float) value **)** | Enumerations ------------ enum **Param**: * **PARAM\_LINEAR\_LIMIT\_UPPER** = **0** --- The maximum difference between the pivot points on their X axis before damping happens. * **PARAM\_LINEAR\_LIMIT\_LOWER** = **1** --- The minimum difference between the pivot points on their X axis before damping happens. * **PARAM\_LINEAR\_LIMIT\_SOFTNESS** = **2** --- A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. * **PARAM\_LINEAR\_LIMIT\_RESTITUTION** = **3** --- The amount of restitution once the limits are surpassed. The lower, the more velocityenergy gets lost. * **PARAM\_LINEAR\_LIMIT\_DAMPING** = **4** --- The amount of damping once the slider limits are surpassed. * **PARAM\_LINEAR\_MOTION\_SOFTNESS** = **5** --- A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. * **PARAM\_LINEAR\_MOTION\_RESTITUTION** = **6** --- The amount of restitution inside the slider limits. * **PARAM\_LINEAR\_MOTION\_DAMPING** = **7** --- The amount of damping inside the slider limits. * **PARAM\_LINEAR\_ORTHOGONAL\_SOFTNESS** = **8** --- A factor applied to the movement across axes orthogonal to the slider. * **PARAM\_LINEAR\_ORTHOGONAL\_RESTITUTION** = **9** --- The amount of restitution when movement is across axes orthogonal to the slider. * **PARAM\_LINEAR\_ORTHOGONAL\_DAMPING** = **10** --- The amount of damping when movement is across axes orthogonal to the slider. * **PARAM\_ANGULAR\_LIMIT\_UPPER** = **11** --- The upper limit of rotation in the slider. * **PARAM\_ANGULAR\_LIMIT\_LOWER** = **12** --- The lower limit of rotation in the slider. * **PARAM\_ANGULAR\_LIMIT\_SOFTNESS** = **13** --- A factor applied to the all rotation once the limit is surpassed. * **PARAM\_ANGULAR\_LIMIT\_RESTITUTION** = **14** --- The amount of restitution of the rotation when the limit is surpassed. * **PARAM\_ANGULAR\_LIMIT\_DAMPING** = **15** --- The amount of damping of the rotation when the limit is surpassed. * **PARAM\_ANGULAR\_MOTION\_SOFTNESS** = **16** --- A factor applied to the all rotation in the limits. * **PARAM\_ANGULAR\_MOTION\_RESTITUTION** = **17** --- The amount of restitution of the rotation in the limits. * **PARAM\_ANGULAR\_MOTION\_DAMPING** = **18** --- The amount of damping of the rotation in the limits. * **PARAM\_ANGULAR\_ORTHOGONAL\_SOFTNESS** = **19** --- A factor applied to the all rotation across axes orthogonal to the slider. * **PARAM\_ANGULAR\_ORTHOGONAL\_RESTITUTION** = **20** --- The amount of restitution of the rotation across axes orthogonal to the slider. * **PARAM\_ANGULAR\_ORTHOGONAL\_DAMPING** = **21** --- The amount of damping of the rotation across axes orthogonal to the slider. * **PARAM\_MAX** = **22** --- Represents the size of the [Param](#enum-sliderjoint-param) enum. Property Descriptions --------------------- ### [float](class_float#class-float) angular\_limit/damping | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The amount of damping of the rotation when the limit is surpassed. A lower damping value allows a rotation initiated by body A to travel to body B slower. ### [float](class_float#class-float) angular\_limit/lower\_angle | | | | --- | --- | | *Default* | `0.0` | The lower limit of rotation in the slider. ### [float](class_float#class-float) angular\_limit/restitution | | | | --- | --- | | *Default* | `0.7` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The amount of restitution of the rotation when the limit is surpassed. Does not affect damping. ### [float](class_float#class-float) angular\_limit/softness | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | A factor applied to the all rotation once the limit is surpassed. Makes all rotation slower when between 0 and 1. ### [float](class_float#class-float) angular\_limit/upper\_angle | | | | --- | --- | | *Default* | `0.0` | The upper limit of rotation in the slider. ### [float](class_float#class-float) angular\_motion/damping | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The amount of damping of the rotation in the limits. ### [float](class_float#class-float) angular\_motion/restitution | | | | --- | --- | | *Default* | `0.7` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The amount of restitution of the rotation in the limits. ### [float](class_float#class-float) angular\_motion/softness | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | A factor applied to the all rotation in the limits. ### [float](class_float#class-float) angular\_ortho/damping | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The amount of damping of the rotation across axes orthogonal to the slider. ### [float](class_float#class-float) angular\_ortho/restitution | | | | --- | --- | | *Default* | `0.7` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The amount of restitution of the rotation across axes orthogonal to the slider. ### [float](class_float#class-float) angular\_ortho/softness | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | A factor applied to the all rotation across axes orthogonal to the slider. ### [float](class_float#class-float) linear\_limit/damping | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The amount of damping that happens once the limit defined by [linear\_limit/lower\_distance](#class-sliderjoint-property-linear-limit-lower-distance) and [linear\_limit/upper\_distance](#class-sliderjoint-property-linear-limit-upper-distance) is surpassed. ### [float](class_float#class-float) linear\_limit/lower\_distance | | | | --- | --- | | *Default* | `-1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The minimum difference between the pivot points on their X axis before damping happens. ### [float](class_float#class-float) linear\_limit/restitution | | | | --- | --- | | *Default* | `0.7` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The amount of restitution once the limits are surpassed. The lower, the more velocity-energy gets lost. ### [float](class_float#class-float) linear\_limit/softness | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. ### [float](class_float#class-float) linear\_limit/upper\_distance | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The maximum difference between the pivot points on their X axis before damping happens. ### [float](class_float#class-float) linear\_motion/damping | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The amount of damping inside the slider limits. ### [float](class_float#class-float) linear\_motion/restitution | | | | --- | --- | | *Default* | `0.7` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The amount of restitution inside the slider limits. ### [float](class_float#class-float) linear\_motion/softness | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. ### [float](class_float#class-float) linear\_ortho/damping | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The amount of damping when movement is across axes orthogonal to the slider. ### [float](class_float#class-float) linear\_ortho/restitution | | | | --- | --- | | *Default* | `0.7` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The amount of restitution when movement is across axes orthogonal to the slider. ### [float](class_float#class-float) linear\_ortho/softness | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | A factor applied to the movement across axes orthogonal to the slider. Method Descriptions ------------------- ### [float](class_float#class-float) get\_param ( [Param](#enum-sliderjoint-param) param ) const ### void set\_param ( [Param](#enum-sliderjoint-param) param, [float](class_float#class-float) value )
programming_docs
godot Marshalls Marshalls ========= **Inherits:** [Object](class_object#class-object) Data transformation (marshalling) and encoding helpers. Description ----------- Provides data transformation and encoding utility functions. Methods ------- | | | | --- | --- | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [base64\_to\_raw](#class-marshalls-method-base64-to-raw) **(** [String](class_string#class-string) base64\_str **)** | | [String](class_string#class-string) | [base64\_to\_utf8](#class-marshalls-method-base64-to-utf8) **(** [String](class_string#class-string) base64\_str **)** | | [Variant](class_variant#class-variant) | [base64\_to\_variant](#class-marshalls-method-base64-to-variant) **(** [String](class_string#class-string) base64\_str, [bool](class_bool#class-bool) allow\_objects=false **)** | | [String](class_string#class-string) | [raw\_to\_base64](#class-marshalls-method-raw-to-base64) **(** [PoolByteArray](class_poolbytearray#class-poolbytearray) array **)** | | [String](class_string#class-string) | [utf8\_to\_base64](#class-marshalls-method-utf8-to-base64) **(** [String](class_string#class-string) utf8\_str **)** | | [String](class_string#class-string) | [variant\_to\_base64](#class-marshalls-method-variant-to-base64) **(** [Variant](class_variant#class-variant) variant, [bool](class_bool#class-bool) full\_objects=false **)** | Method Descriptions ------------------- ### [PoolByteArray](class_poolbytearray#class-poolbytearray) base64\_to\_raw ( [String](class_string#class-string) base64\_str ) Returns a decoded [PoolByteArray](class_poolbytearray#class-poolbytearray) corresponding to the Base64-encoded string `base64_str`. ### [String](class_string#class-string) base64\_to\_utf8 ( [String](class_string#class-string) base64\_str ) Returns a decoded string corresponding to the Base64-encoded string `base64_str`. ### [Variant](class_variant#class-variant) base64\_to\_variant ( [String](class_string#class-string) base64\_str, [bool](class_bool#class-bool) allow\_objects=false ) Returns a decoded [Variant](class_variant#class-variant) corresponding to the Base64-encoded string `base64_str`. If `allow_objects` is `true`, decoding objects is allowed. **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. ### [String](class_string#class-string) raw\_to\_base64 ( [PoolByteArray](class_poolbytearray#class-poolbytearray) array ) Returns a Base64-encoded string of a given [PoolByteArray](class_poolbytearray#class-poolbytearray). ### [String](class_string#class-string) utf8\_to\_base64 ( [String](class_string#class-string) utf8\_str ) Returns a Base64-encoded string of the UTF-8 string `utf8_str`. ### [String](class_string#class-string) variant\_to\_base64 ( [Variant](class_variant#class-variant) variant, [bool](class_bool#class-bool) full\_objects=false ) Returns a Base64-encoded string of the [Variant](class_variant#class-variant) `variant`. If `full_objects` is `true`, encoding objects is allowed (and can potentially include code). godot VisualShaderNodeTransformCompose VisualShaderNodeTransformCompose ================================ **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Composes a [Transform](class_transform#class-transform) from four [Vector3](class_vector3#class-vector3)s within the visual shader graph. Description ----------- Creates a 4x4 transform matrix using four vectors of type `vec3`. Each vector is one row in the matrix and the last column is a `vec4(0, 0, 0, 1)`. godot float float ===== Float built-in type. Description ----------- The `float` built-in type is a 64-bit double-precision floating-point number, equivalent to `double` in C++. This type has 14 reliable decimal digits of precision. The `float` type can be stored in [Variant](class_variant#class-variant), which is the generic type used by the engine. The maximum value of `float` is approximately `1.79769e308`, and the minimum is approximately `-1.79769e308`. Most methods and properties in the engine use 32-bit single-precision floating-point numbers instead, equivalent to `float` in C++, which have 6 reliable decimal digits of precision. For data structures such as [Vector2](class_vector2#class-vector2) and [Vector3](class_vector3#class-vector3), Godot uses 32-bit floating-point numbers. Math done using the `float` type is not guaranteed to be exact or deterministic, and will often result in small errors. You should usually use the [@GDScript.is\_equal\_approx](class_%40gdscript#class-gdscript-method-is-equal-approx) and [@GDScript.is\_zero\_approx](class_%40gdscript#class-gdscript-method-is-zero-approx) methods instead of `==` to compare `float` values for equality. Tutorials --------- * [Wikipedia: Double-precision floating-point format](https://en.wikipedia.org/wiki/Double-precision_floating-point_format) * [Wikipedia: Single-precision floating-point format](https://en.wikipedia.org/wiki/Single-precision_floating-point_format) Methods ------- | | | | --- | --- | | [float](#class-float) | [float](#class-float-method-float) **(** [bool](class_bool#class-bool) from **)** | | [float](#class-float) | [float](#class-float-method-float) **(** [int](class_int#class-int) from **)** | | [float](#class-float) | [float](#class-float-method-float) **(** [String](class_string#class-string) from **)** | Method Descriptions ------------------- ### [float](#class-float) float ( [bool](class_bool#class-bool) from ) Cast a [bool](class_bool#class-bool) value to a floating-point value, `float(true)` will be equal to 1.0 and `float(false)` will be equal to 0.0. * [float](#class-float) **float** **(** [int](class_int#class-int) from **)** Cast an [int](class_int#class-int) value to a floating-point value, `float(1)` will be equal to 1.0. * [float](#class-float) **float** **(** [String](class_string#class-string) from **)** Cast a [String](class_string#class-string) value to a floating-point value. This method accepts float value strings like `"1.23"` and exponential notation strings for its parameter so calling `float("1e3")` will return 1000.0 and calling `float("1e-3")` will return 0.001. Calling this method with an invalid float string will return 0. This method stops parsing at the first invalid character and will return the parsed result so far, so calling `float("1a3")` will return 1 while calling `float("1e3a2")` will return 1000.0. godot PacketPeer PacketPeer ========== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer), [PacketPeerDTLS](class_packetpeerdtls#class-packetpeerdtls), [PacketPeerGDNative](class_packetpeergdnative#class-packetpeergdnative), [PacketPeerStream](class_packetpeerstream#class-packetpeerstream), [PacketPeerUDP](class_packetpeerudp#class-packetpeerudp), [WebRTCDataChannel](class_webrtcdatachannel#class-webrtcdatachannel), [WebSocketPeer](class_websocketpeer#class-websocketpeer) Abstraction and base class for packet-based protocols. Description ----------- PacketPeer is an abstraction and base class for packet-based protocols (such as UDP). It provides an API for sending and receiving packets both as raw data or variables. This makes it easy to transfer data over a protocol, without having to encode data as low-level bytes or having to worry about network ordering. Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [allow\_object\_decoding](#class-packetpeer-property-allow-object-decoding) | `false` | | [int](class_int#class-int) | [encode\_buffer\_max\_size](#class-packetpeer-property-encode-buffer-max-size) | `8388608` | Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [get\_available\_packet\_count](#class-packetpeer-method-get-available-packet-count) **(** **)** const | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [get\_packet](#class-packetpeer-method-get-packet) **(** **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [get\_packet\_error](#class-packetpeer-method-get-packet-error) **(** **)** const | | [Variant](class_variant#class-variant) | [get\_var](#class-packetpeer-method-get-var) **(** [bool](class_bool#class-bool) allow\_objects=false **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [put\_packet](#class-packetpeer-method-put-packet) **(** [PoolByteArray](class_poolbytearray#class-poolbytearray) buffer **)** | | [Error](class_%40globalscope#enum-globalscope-error) | [put\_var](#class-packetpeer-method-put-var) **(** [Variant](class_variant#class-variant) var, [bool](class_bool#class-bool) full\_objects=false **)** | Property Descriptions --------------------- ### [bool](class_bool#class-bool) allow\_object\_decoding | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_allow\_object\_decoding(value) | | *Getter* | is\_object\_decoding\_allowed() | *Deprecated.* Use `get_var` and `put_var` parameters instead. If `true`, the PacketPeer will allow encoding and decoding of object via [get\_var](#class-packetpeer-method-get-var) and [put\_var](#class-packetpeer-method-put-var). **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. ### [int](class_int#class-int) encode\_buffer\_max\_size | | | | --- | --- | | *Default* | `8388608` | | *Setter* | set\_encode\_buffer\_max\_size(value) | | *Getter* | get\_encode\_buffer\_max\_size() | Maximum buffer size allowed when encoding [Variant](class_variant#class-variant)s. Raise this value to support heavier memory allocations. The [put\_var](#class-packetpeer-method-put-var) method allocates memory on the stack, and the buffer used will grow automatically to the closest power of two to match the size of the [Variant](class_variant#class-variant). If the [Variant](class_variant#class-variant) is bigger than `encode_buffer_max_size`, the method will error out with [@GlobalScope.ERR\_OUT\_OF\_MEMORY](class_%40globalscope#class-globalscope-constant-err-out-of-memory). Method Descriptions ------------------- ### [int](class_int#class-int) get\_available\_packet\_count ( ) const Returns the number of packets currently available in the ring-buffer. ### [PoolByteArray](class_poolbytearray#class-poolbytearray) get\_packet ( ) Gets a raw packet. ### [Error](class_%40globalscope#enum-globalscope-error) get\_packet\_error ( ) const Returns the error state of the last packet received (via [get\_packet](#class-packetpeer-method-get-packet) and [get\_var](#class-packetpeer-method-get-var)). ### [Variant](class_variant#class-variant) get\_var ( [bool](class_bool#class-bool) allow\_objects=false ) Gets a Variant. If `allow_objects` (or [allow\_object\_decoding](#class-packetpeer-property-allow-object-decoding)) is `true`, decoding objects is allowed. **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. ### [Error](class_%40globalscope#enum-globalscope-error) put\_packet ( [PoolByteArray](class_poolbytearray#class-poolbytearray) buffer ) Sends a raw packet. ### [Error](class_%40globalscope#enum-globalscope-error) put\_var ( [Variant](class_variant#class-variant) var, [bool](class_bool#class-bool) full\_objects=false ) Sends a [Variant](class_variant#class-variant) as a packet. If `full_objects` (or [allow\_object\_decoding](#class-packetpeer-property-allow-object-decoding)) is `true`, encoding objects is allowed (and can potentially include code). godot RID RID === Handle for a [Resource](class_resource#class-resource)'s unique ID. Description ----------- The RID type is used to access the unique integer ID of a resource. They are opaque, which means they do not grant access to the associated resource by themselves. They are used by and with the low-level Server classes such as [VisualServer](class_visualserver#class-visualserver). Methods ------- | | | | --- | --- | | [RID](#class-rid) | [RID](#class-rid-method-rid) **(** [Object](class_object#class-object) from **)** | | [int](class_int#class-int) | [get\_id](#class-rid-method-get-id) **(** **)** | Method Descriptions ------------------- ### [RID](#class-rid) RID ( [Object](class_object#class-object) from ) Creates a new RID instance with the ID of a given resource. When not handed a valid resource, silently stores the unused ID 0. ### [int](class_int#class-int) get\_id ( ) Returns the ID of the referenced resource. godot SplitContainer SplitContainer ============== **Inherits:** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [HSplitContainer](class_hsplitcontainer#class-hsplitcontainer), [VSplitContainer](class_vsplitcontainer#class-vsplitcontainer) Container for splitting and adjusting. Description ----------- Container for splitting two [Control](class_control#class-control)s vertically or horizontally, with a grabber that allows adjusting the split offset or ratio. Tutorials --------- * [GUI containers](https://docs.godotengine.org/en/3.5/tutorials/ui/gui_containers.html) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [collapsed](#class-splitcontainer-property-collapsed) | `false` | | [DraggerVisibility](#enum-splitcontainer-draggervisibility) | [dragger\_visibility](#class-splitcontainer-property-dragger-visibility) | `0` | | [int](class_int#class-int) | [split\_offset](#class-splitcontainer-property-split-offset) | `0` | Methods ------- | | | | --- | --- | | void | [clamp\_split\_offset](#class-splitcontainer-method-clamp-split-offset) **(** **)** | Signals ------- ### dragged ( [int](class_int#class-int) offset ) Emitted when the dragger is dragged by user. Enumerations ------------ enum **DraggerVisibility**: * **DRAGGER\_VISIBLE** = **0** --- The split dragger is visible when the cursor hovers it. * **DRAGGER\_HIDDEN** = **1** --- The split dragger is never visible. * **DRAGGER\_HIDDEN\_COLLAPSED** = **2** --- The split dragger is never visible and its space collapsed. Property Descriptions --------------------- ### [bool](class_bool#class-bool) collapsed | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_collapsed(value) | | *Getter* | is\_collapsed() | If `true`, the area of the first [Control](class_control#class-control) will be collapsed and the dragger will be disabled. ### [DraggerVisibility](#enum-splitcontainer-draggervisibility) dragger\_visibility | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_dragger\_visibility(value) | | *Getter* | get\_dragger\_visibility() | Determines the dragger's visibility. See [DraggerVisibility](#enum-splitcontainer-draggervisibility) for details. ### [int](class_int#class-int) split\_offset | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_split\_offset(value) | | *Getter* | get\_split\_offset() | The initial offset of the splitting between the two [Control](class_control#class-control)s, with `0` being at the end of the first [Control](class_control#class-control). Method Descriptions ------------------- ### void clamp\_split\_offset ( ) Clamps the [split\_offset](#class-splitcontainer-property-split-offset) value to not go outside the currently possible minimal and maximum values. godot VScrollBar VScrollBar ========== **Inherits:** [ScrollBar](class_scrollbar#class-scrollbar) **<** [Range](class_range#class-range) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Vertical scroll bar. Description ----------- Vertical version of [ScrollBar](class_scrollbar#class-scrollbar), which goes from top (min) to bottom (max). Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | size\_flags\_horizontal | `0` (overrides [Control](class_control#class-control-property-size-flags-horizontal)) | | [int](class_int#class-int) | size\_flags\_vertical | `1` (overrides [Control](class_control#class-control-property-size-flags-vertical)) | Theme Properties ---------------- | | | | --- | --- | | [Texture](class_texture#class-texture) | [decrement](#class-vscrollbar-theme-icon-decrement) | | [Texture](class_texture#class-texture) | [decrement\_highlight](#class-vscrollbar-theme-icon-decrement-highlight) | | [Texture](class_texture#class-texture) | [decrement\_pressed](#class-vscrollbar-theme-icon-decrement-pressed) | | [Texture](class_texture#class-texture) | [increment](#class-vscrollbar-theme-icon-increment) | | [Texture](class_texture#class-texture) | [increment\_highlight](#class-vscrollbar-theme-icon-increment-highlight) | | [Texture](class_texture#class-texture) | [increment\_pressed](#class-vscrollbar-theme-icon-increment-pressed) | | [StyleBox](class_stylebox#class-stylebox) | [grabber](#class-vscrollbar-theme-style-grabber) | | [StyleBox](class_stylebox#class-stylebox) | [grabber\_highlight](#class-vscrollbar-theme-style-grabber-highlight) | | [StyleBox](class_stylebox#class-stylebox) | [grabber\_pressed](#class-vscrollbar-theme-style-grabber-pressed) | | [StyleBox](class_stylebox#class-stylebox) | [scroll](#class-vscrollbar-theme-style-scroll) | | [StyleBox](class_stylebox#class-stylebox) | [scroll\_focus](#class-vscrollbar-theme-style-scroll-focus) | Theme Property Descriptions --------------------------- ### [Texture](class_texture#class-texture) decrement Icon used as a button to scroll the [ScrollBar](class_scrollbar#class-scrollbar) up. Supports custom step using the [ScrollBar.custom\_step](class_scrollbar#class-scrollbar-property-custom-step) property. ### [Texture](class_texture#class-texture) decrement\_highlight Displayed when the mouse cursor hovers over the decrement button. ### [Texture](class_texture#class-texture) decrement\_pressed Displayed when the decrement button is being pressed. ### [Texture](class_texture#class-texture) increment Icon used as a button to scroll the [ScrollBar](class_scrollbar#class-scrollbar) down. Supports custom step using the [ScrollBar.custom\_step](class_scrollbar#class-scrollbar-property-custom-step) property. ### [Texture](class_texture#class-texture) increment\_highlight Displayed when the mouse cursor hovers over the increment button. ### [Texture](class_texture#class-texture) increment\_pressed Displayed when the increment button is being pressed. ### [StyleBox](class_stylebox#class-stylebox) grabber Used as texture for the grabber, the draggable element representing current scroll. ### [StyleBox](class_stylebox#class-stylebox) grabber\_highlight Used when the mouse hovers over the grabber. ### [StyleBox](class_stylebox#class-stylebox) grabber\_pressed Used when the grabber is being dragged. ### [StyleBox](class_stylebox#class-stylebox) scroll Used as background of this [ScrollBar](class_scrollbar#class-scrollbar). ### [StyleBox](class_stylebox#class-stylebox) scroll\_focus Used as background when the [ScrollBar](class_scrollbar#class-scrollbar) has the GUI focus.
programming_docs
godot Portal Portal ====== **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Portal nodes are used to enable visibility between [Room](class_room#class-room)s. Description ----------- `Portal`s are a special type of [MeshInstance](class_meshinstance#class-meshinstance) that allow the portal culling system to 'see' from one room to the next. They often correspond to doors and windows in level geometry. By only allowing [Camera](class_camera#class-camera)s to see through portals, this allows the system to cull out all the objects in rooms that cannot be seen through portals. This is a form of **occlusion culling**, and can greatly increase performance. There are some limitations to the form of portals: They must be single sided convex polygons, and usually you would orientate their front faces **outward** from the [Room](class_room#class-room) they are placed in. The vertices should be positioned on a single plane (although their positioning does not have to be perfect). There is no need to place an opposite portal in an adjacent room, links are made two-way automatically. Properties ---------- | | | | | --- | --- | --- | | [NodePath](class_nodepath#class-nodepath) | [linked\_room](#class-portal-property-linked-room) | `NodePath("")` | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [points](#class-portal-property-points) | `PoolVector2Array( 1, -1, 1, 1, -1, 1, -1, -1 )` | | [bool](class_bool#class-bool) | [portal\_active](#class-portal-property-portal-active) | `true` | | [float](class_float#class-float) | [portal\_margin](#class-portal-property-portal-margin) | `1.0` | | [bool](class_bool#class-bool) | [two\_way](#class-portal-property-two-way) | `true` | | [bool](class_bool#class-bool) | [use\_default\_margin](#class-portal-property-use-default-margin) | `true` | Methods ------- | | | | --- | --- | | void | [set\_point](#class-portal-method-set-point) **(** [int](class_int#class-int) index, [Vector2](class_vector2#class-vector2) position **)** | Property Descriptions --------------------- ### [NodePath](class_nodepath#class-nodepath) linked\_room | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_linked\_room(value) | | *Getter* | get\_linked\_room() | This is a shortcut for setting the linked [Room](class_room#class-room) in the name of the `Portal` (the name is used during conversion). ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) points | | | | --- | --- | | *Default* | `PoolVector2Array( 1, -1, 1, 1, -1, 1, -1, -1 )` | | *Setter* | set\_points(value) | | *Getter* | get\_points() | The points defining the shape of the `Portal` polygon (which should be convex). These are defined in 2D, with `0,0` being the origin of the `Portal` node's [Spatial.global\_transform](class_spatial#class-spatial-property-global-transform). **Note:** These raw points are sanitized for winding order internally. ### [bool](class_bool#class-bool) portal\_active | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_portal\_active(value) | | *Getter* | get\_portal\_active() | Visibility through `Portal`s can be turned on and off at runtime - this is useful for having closable doors. ### [float](class_float#class-float) portal\_margin | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_portal\_margin(value) | | *Getter* | get\_portal\_margin() | Some objects are so big that they may be present in more than one [Room](class_room#class-room) ('sprawling'). As we often don't want objects that \*just\* breach the edges to be assigned to neighbouring rooms, you can assign an extra margin through the `Portal` to allow objects to breach without sprawling. ### [bool](class_bool#class-bool) two\_way | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_two\_way(value) | | *Getter* | is\_two\_way() | Portals default to being two way - see through in both directions, however you can make them one way, visible from the source room only. ### [bool](class_bool#class-bool) use\_default\_margin | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_use\_default\_margin(value) | | *Getter* | get\_use\_default\_margin() | In most cases you will want to use the default `Portal` margin in your portals (this is set in the [RoomManager](class_roommanager#class-roommanager)). If you want to override this default, set this value to `false`, and the local [portal\_margin](#class-portal-property-portal-margin) will take effect. Method Descriptions ------------------- ### void set\_point ( [int](class_int#class-int) index, [Vector2](class_vector2#class-vector2) position ) Sets individual points. Primarily for use by the editor. godot CenterContainer CenterContainer =============== **Inherits:** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Keeps children controls centered. Description ----------- CenterContainer keeps children controls centered. This container keeps all children to their minimum size, in the center. Tutorials --------- * [GUI containers](https://docs.godotengine.org/en/3.5/tutorials/ui/gui_containers.html) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [use\_top\_left](#class-centercontainer-property-use-top-left) | `false` | Property Descriptions --------------------- ### [bool](class_bool#class-bool) use\_top\_left | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_top\_left(value) | | *Getter* | is\_using\_top\_left() | If `true`, centers children relative to the `CenterContainer`'s top left corner. godot VisualScriptYield VisualScriptYield ================= **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A Visual Script node used to pause a function execution. Description ----------- `VisualScriptYield` will pause the function call and return [VisualScriptFunctionState](class_visualscriptfunctionstate#class-visualscriptfunctionstate), which can be used to resume the function. Properties ---------- | | | | | --- | --- | --- | | [YieldMode](#enum-visualscriptyield-yieldmode) | [mode](#class-visualscriptyield-property-mode) | `1` | | [float](class_float#class-float) | [wait\_time](#class-visualscriptyield-property-wait-time) | | Enumerations ------------ enum **YieldMode**: * **YIELD\_FRAME** = **1** --- Yields during an idle frame. * **YIELD\_PHYSICS\_FRAME** = **2** --- Yields during a physics frame. * **YIELD\_WAIT** = **3** --- Yields a function and waits the given time. Property Descriptions --------------------- ### [YieldMode](#enum-visualscriptyield-yieldmode) mode | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_yield\_mode(value) | | *Getter* | get\_yield\_mode() | The mode to use for yielding. See [YieldMode](#enum-visualscriptyield-yieldmode) for available options. ### [float](class_float#class-float) wait\_time | | | | --- | --- | | *Setter* | set\_wait\_time(value) | | *Getter* | get\_wait\_time() | The time to wait when [mode](#class-visualscriptyield-property-mode) is set to [YIELD\_WAIT](#class-visualscriptyield-constant-yield-wait). godot Joint2D Joint2D ======= **Inherits:** [Node2D](class_node2d#class-node2d) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [DampedSpringJoint2D](class_dampedspringjoint2d#class-dampedspringjoint2d), [GrooveJoint2D](class_groovejoint2d#class-groovejoint2d), [PinJoint2D](class_pinjoint2d#class-pinjoint2d) Base node for all joint constraints in 2D physics. Description ----------- Base node for all joint constraints in 2D physics. Joints take 2 bodies and apply a custom constraint. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [bias](#class-joint2d-property-bias) | `0.0` | | [bool](class_bool#class-bool) | [disable\_collision](#class-joint2d-property-disable-collision) | `true` | | [NodePath](class_nodepath#class-nodepath) | [node\_a](#class-joint2d-property-node-a) | `NodePath("")` | | [NodePath](class_nodepath#class-nodepath) | [node\_b](#class-joint2d-property-node-b) | `NodePath("")` | Property Descriptions --------------------- ### [float](class_float#class-float) bias | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_bias(value) | | *Getter* | get\_bias() | When [node\_a](#class-joint2d-property-node-a) and [node\_b](#class-joint2d-property-node-b) move in different directions the `bias` controls how fast the joint pulls them back to their original position. The lower the `bias` the more the two bodies can pull on the joint. ### [bool](class_bool#class-bool) disable\_collision | | | | --- | --- | | *Default* | `true` | | *Setter* | set\_exclude\_nodes\_from\_collision(value) | | *Getter* | get\_exclude\_nodes\_from\_collision() | If `true`, [node\_a](#class-joint2d-property-node-a) and [node\_b](#class-joint2d-property-node-b) can not collide. ### [NodePath](class_nodepath#class-nodepath) node\_a | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_node\_a(value) | | *Getter* | get\_node\_a() | The first body attached to the joint. Must derive from [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d). ### [NodePath](class_nodepath#class-nodepath) node\_b | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_node\_b(value) | | *Getter* | get\_node\_b() | The second body attached to the joint. Must derive from [PhysicsBody2D](class_physicsbody2d#class-physicsbody2d). godot KinematicBody KinematicBody ============= **Inherits:** [PhysicsBody](class_physicsbody#class-physicsbody) **<** [CollisionObject](class_collisionobject#class-collisionobject) **<** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Kinematic body 3D node. Description ----------- Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a character or a rigid body, these are the same as a static body. However, they have two main uses: **Simulated motion:** When these bodies are moved manually, either from code or from an [AnimationPlayer](class_animationplayer#class-animationplayer) (with [AnimationPlayer.playback\_process\_mode](class_animationplayer#class-animationplayer-property-playback-process-mode) set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). **Kinematic characters:** KinematicBody also has an API for moving objects (the [move\_and\_collide](#class-kinematicbody-method-move-and-collide) and [move\_and\_slide](#class-kinematicbody-method-move-and-slide) methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but don't require advanced physics. Tutorials --------- * [Kinematic character (2D)](https://docs.godotengine.org/en/3.5/tutorials/physics/kinematic_character_2d.html) * [3D Kinematic Character Demo](https://godotengine.org/asset-library/asset/126) * [3D Platformer Demo](https://godotengine.org/asset-library/asset/125) * [3D Voxel Demo](https://godotengine.org/asset-library/asset/676) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [axis\_lock\_motion\_x](#class-kinematicbody-property-axis-lock-motion-x) | `false` | | [bool](class_bool#class-bool) | [axis\_lock\_motion\_y](#class-kinematicbody-property-axis-lock-motion-y) | `false` | | [bool](class_bool#class-bool) | [axis\_lock\_motion\_z](#class-kinematicbody-property-axis-lock-motion-z) | `false` | | [float](class_float#class-float) | [collision/safe\_margin](#class-kinematicbody-property-collision-safe-margin) | `0.001` | | [bool](class_bool#class-bool) | [motion/sync\_to\_physics](#class-kinematicbody-property-motion-sync-to-physics) | `false` | | [bool](class_bool#class-bool) | [move\_lock\_x](#class-kinematicbody-property-move-lock-x) | `false` | | [bool](class_bool#class-bool) | [move\_lock\_y](#class-kinematicbody-property-move-lock-y) | `false` | | [bool](class_bool#class-bool) | [move\_lock\_z](#class-kinematicbody-property-move-lock-z) | `false` | | [MovingPlatformApplyVelocityOnLeave](#enum-kinematicbody-movingplatformapplyvelocityonleave) | [moving\_platform\_apply\_velocity\_on\_leave](#class-kinematicbody-property-moving-platform-apply-velocity-on-leave) | `0` | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [get\_axis\_lock](#class-kinematicbody-method-get-axis-lock) **(** [BodyAxis](class_physicsserver#enum-physicsserver-bodyaxis) axis **)** const | | [float](class_float#class-float) | [get\_floor\_angle](#class-kinematicbody-method-get-floor-angle) **(** [Vector3](class_vector3#class-vector3) up\_direction=Vector3( 0, 1, 0 ) **)** const | | [Vector3](class_vector3#class-vector3) | [get\_floor\_normal](#class-kinematicbody-method-get-floor-normal) **(** **)** const | | [Vector3](class_vector3#class-vector3) | [get\_floor\_velocity](#class-kinematicbody-method-get-floor-velocity) **(** **)** const | | [KinematicCollision](class_kinematiccollision#class-kinematiccollision) | [get\_last\_slide\_collision](#class-kinematicbody-method-get-last-slide-collision) **(** **)** | | [KinematicCollision](class_kinematiccollision#class-kinematiccollision) | [get\_slide\_collision](#class-kinematicbody-method-get-slide-collision) **(** [int](class_int#class-int) slide\_idx **)** | | [int](class_int#class-int) | [get\_slide\_count](#class-kinematicbody-method-get-slide-count) **(** **)** const | | [bool](class_bool#class-bool) | [is\_on\_ceiling](#class-kinematicbody-method-is-on-ceiling) **(** **)** const | | [bool](class_bool#class-bool) | [is\_on\_floor](#class-kinematicbody-method-is-on-floor) **(** **)** const | | [bool](class_bool#class-bool) | [is\_on\_wall](#class-kinematicbody-method-is-on-wall) **(** **)** const | | [KinematicCollision](class_kinematiccollision#class-kinematiccollision) | [move\_and\_collide](#class-kinematicbody-method-move-and-collide) **(** [Vector3](class_vector3#class-vector3) rel\_vec, [bool](class_bool#class-bool) infinite\_inertia=true, [bool](class_bool#class-bool) exclude\_raycast\_shapes=true, [bool](class_bool#class-bool) test\_only=false **)** | | [Vector3](class_vector3#class-vector3) | [move\_and\_slide](#class-kinematicbody-method-move-and-slide) **(** [Vector3](class_vector3#class-vector3) linear\_velocity, [Vector3](class_vector3#class-vector3) up\_direction=Vector3( 0, 0, 0 ), [bool](class_bool#class-bool) stop\_on\_slope=false, [int](class_int#class-int) max\_slides=4, [float](class_float#class-float) floor\_max\_angle=0.785398, [bool](class_bool#class-bool) infinite\_inertia=true **)** | | [Vector3](class_vector3#class-vector3) | [move\_and\_slide\_with\_snap](#class-kinematicbody-method-move-and-slide-with-snap) **(** [Vector3](class_vector3#class-vector3) linear\_velocity, [Vector3](class_vector3#class-vector3) snap, [Vector3](class_vector3#class-vector3) up\_direction=Vector3( 0, 0, 0 ), [bool](class_bool#class-bool) stop\_on\_slope=false, [int](class_int#class-int) max\_slides=4, [float](class_float#class-float) floor\_max\_angle=0.785398, [bool](class_bool#class-bool) infinite\_inertia=true **)** | | void | [set\_axis\_lock](#class-kinematicbody-method-set-axis-lock) **(** [BodyAxis](class_physicsserver#enum-physicsserver-bodyaxis) axis, [bool](class_bool#class-bool) lock **)** | | [bool](class_bool#class-bool) | [test\_move](#class-kinematicbody-method-test-move) **(** [Transform](class_transform#class-transform) from, [Vector3](class_vector3#class-vector3) rel\_vec, [bool](class_bool#class-bool) infinite\_inertia=true **)** | Enumerations ------------ enum **MovingPlatformApplyVelocityOnLeave**: * **PLATFORM\_VEL\_ON\_LEAVE\_ALWAYS** = **0** --- Add the last platform velocity when you leave a moving platform. * **PLATFORM\_VEL\_ON\_LEAVE\_UPWARD\_ONLY** = **1** --- Add the last platform velocity when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. * **PLATFORM\_VEL\_ON\_LEAVE\_NEVER** = **2** --- Do nothing when leaving a platform. Property Descriptions --------------------- ### [bool](class_bool#class-bool) axis\_lock\_motion\_x | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_axis\_lock(value) | | *Getter* | get\_axis\_lock() | Lock the body's X axis movement. ### [bool](class_bool#class-bool) axis\_lock\_motion\_y | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_axis\_lock(value) | | *Getter* | get\_axis\_lock() | Lock the body's Y axis movement. ### [bool](class_bool#class-bool) axis\_lock\_motion\_z | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_axis\_lock(value) | | *Getter* | get\_axis\_lock() | Lock the body's Z axis movement. ### [float](class_float#class-float) collision/safe\_margin | | | | --- | --- | | *Default* | `0.001` | | *Setter* | set\_safe\_margin(value) | | *Getter* | get\_safe\_margin() | Extra margin used for collision recovery in motion functions (see [move\_and\_collide](#class-kinematicbody-method-move-and-collide), [move\_and\_slide](#class-kinematicbody-method-move-and-slide), [move\_and\_slide\_with\_snap](#class-kinematicbody-method-move-and-slide-with-snap)). If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors. A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of kinematic bodies. ### [bool](class_bool#class-bool) motion/sync\_to\_physics | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_sync\_to\_physics(value) | | *Getter* | is\_sync\_to\_physics\_enabled() | If `true`, the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer](class_animationplayer#class-animationplayer), for example on moving platforms. Do **not** use together with [move\_and\_slide](#class-kinematicbody-method-move-and-slide) or [move\_and\_collide](#class-kinematicbody-method-move-and-collide) functions. ### [bool](class_bool#class-bool) move\_lock\_x | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_axis\_lock(value) | | *Getter* | get\_axis\_lock() | Lock the body's X axis movement. Deprecated alias for [axis\_lock\_motion\_x](#class-kinematicbody-property-axis-lock-motion-x). ### [bool](class_bool#class-bool) move\_lock\_y | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_axis\_lock(value) | | *Getter* | get\_axis\_lock() | Lock the body's Y axis movement. Deprecated alias for [axis\_lock\_motion\_y](#class-kinematicbody-property-axis-lock-motion-y). ### [bool](class_bool#class-bool) move\_lock\_z | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_axis\_lock(value) | | *Getter* | get\_axis\_lock() | Lock the body's Z axis movement. Deprecated alias for [axis\_lock\_motion\_z](#class-kinematicbody-property-axis-lock-motion-z). ### [MovingPlatformApplyVelocityOnLeave](#enum-kinematicbody-movingplatformapplyvelocityonleave) moving\_platform\_apply\_velocity\_on\_leave | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_moving\_platform\_apply\_velocity\_on\_leave(value) | | *Getter* | get\_moving\_platform\_apply\_velocity\_on\_leave() | Sets the behavior to apply when you leave a moving platform. By default, to be physically accurate, when you leave the last platform velocity is applied. See [MovingPlatformApplyVelocityOnLeave](#enum-kinematicbody-movingplatformapplyvelocityonleave) constants for available behavior. Method Descriptions ------------------- ### [bool](class_bool#class-bool) get\_axis\_lock ( [BodyAxis](class_physicsserver#enum-physicsserver-bodyaxis) axis ) const Returns `true` if the specified `axis` is locked. See also [move\_lock\_x](#class-kinematicbody-property-move-lock-x), [move\_lock\_y](#class-kinematicbody-property-move-lock-y) and [move\_lock\_z](#class-kinematicbody-property-move-lock-z). ### [float](class_float#class-float) get\_floor\_angle ( [Vector3](class_vector3#class-vector3) up\_direction=Vector3( 0, 1, 0 ) ) const Returns the floor's collision angle at the last collision point according to `up_direction`, which is `Vector3.UP` by default. This value is always positive and only valid after calling [move\_and\_slide](#class-kinematicbody-method-move-and-slide) and when [is\_on\_floor](#class-kinematicbody-method-is-on-floor) returns `true`. ### [Vector3](class_vector3#class-vector3) get\_floor\_normal ( ) const Returns the surface normal of the floor at the last collision point. Only valid after calling [move\_and\_slide](#class-kinematicbody-method-move-and-slide) or [move\_and\_slide\_with\_snap](#class-kinematicbody-method-move-and-slide-with-snap) and when [is\_on\_floor](#class-kinematicbody-method-is-on-floor) returns `true`. ### [Vector3](class_vector3#class-vector3) get\_floor\_velocity ( ) const Returns the linear velocity of the floor at the last collision point. Only valid after calling [move\_and\_slide](#class-kinematicbody-method-move-and-slide) or [move\_and\_slide\_with\_snap](#class-kinematicbody-method-move-and-slide-with-snap) and when [is\_on\_floor](#class-kinematicbody-method-is-on-floor) returns `true`. ### [KinematicCollision](class_kinematiccollision#class-kinematiccollision) get\_last\_slide\_collision ( ) Returns a [KinematicCollision](class_kinematiccollision#class-kinematiccollision), which contains information about the latest collision that occurred during the last call to [move\_and\_slide](#class-kinematicbody-method-move-and-slide). ### [KinematicCollision](class_kinematiccollision#class-kinematiccollision) get\_slide\_collision ( [int](class_int#class-int) slide\_idx ) Returns a [KinematicCollision](class_kinematiccollision#class-kinematiccollision), which contains information about a collision that occurred during the last call to [move\_and\_slide](#class-kinematicbody-method-move-and-slide) or [move\_and\_slide\_with\_snap](#class-kinematicbody-method-move-and-slide-with-snap). Since the body can collide several times in a single call to [move\_and\_slide](#class-kinematicbody-method-move-and-slide), you must specify the index of the collision in the range 0 to ([get\_slide\_count](#class-kinematicbody-method-get-slide-count) - 1). ### [int](class_int#class-int) get\_slide\_count ( ) const Returns the number of times the body collided and changed direction during the last call to [move\_and\_slide](#class-kinematicbody-method-move-and-slide) or [move\_and\_slide\_with\_snap](#class-kinematicbody-method-move-and-slide-with-snap). ### [bool](class_bool#class-bool) is\_on\_ceiling ( ) const Returns `true` if the body collided with the ceiling on the last call of [move\_and\_slide](#class-kinematicbody-method-move-and-slide) or [move\_and\_slide\_with\_snap](#class-kinematicbody-method-move-and-slide-with-snap). Otherwise, returns `false`. ### [bool](class_bool#class-bool) is\_on\_floor ( ) const Returns `true` if the body collided with the floor on the last call of [move\_and\_slide](#class-kinematicbody-method-move-and-slide) or [move\_and\_slide\_with\_snap](#class-kinematicbody-method-move-and-slide-with-snap). Otherwise, returns `false`. ### [bool](class_bool#class-bool) is\_on\_wall ( ) const Returns `true` if the body collided with a wall on the last call of [move\_and\_slide](#class-kinematicbody-method-move-and-slide) or [move\_and\_slide\_with\_snap](#class-kinematicbody-method-move-and-slide-with-snap). Otherwise, returns `false`. ### [KinematicCollision](class_kinematiccollision#class-kinematiccollision) move\_and\_collide ( [Vector3](class_vector3#class-vector3) rel\_vec, [bool](class_bool#class-bool) infinite\_inertia=true, [bool](class_bool#class-bool) exclude\_raycast\_shapes=true, [bool](class_bool#class-bool) test\_only=false ) Moves the body along the vector `rel_vec`. The body will stop if it collides. Returns a [KinematicCollision](class_kinematiccollision#class-kinematiccollision), which contains information about the collision when stopped, or when touching another body along the motion. If `test_only` is `true`, the body does not move but the would-be collision information is given. ### [Vector3](class_vector3#class-vector3) move\_and\_slide ( [Vector3](class_vector3#class-vector3) linear\_velocity, [Vector3](class_vector3#class-vector3) up\_direction=Vector3( 0, 0, 0 ), [bool](class_bool#class-bool) stop\_on\_slope=false, [int](class_int#class-int) max\_slides=4, [float](class_float#class-float) floor\_max\_angle=0.785398, [bool](class_bool#class-bool) infinite\_inertia=true ) Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a `KinematicBody` or [RigidBody](class_rigidbody#class-rigidbody), it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. This method should be used in [Node.\_physics\_process](class_node#class-node-method-physics-process) (or in a method called by [Node.\_physics\_process](class_node#class-node-method-physics-process)), as it uses the physics step's `delta` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed. `linear_velocity` is the velocity vector (typically meters per second). Unlike in [move\_and\_collide](#class-kinematicbody-method-move-and-collide), you should *not* multiply it by `delta` — the physics engine handles applying the velocity. `up_direction` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of `Vector3(0, 0, 0)`, everything is considered a wall. If `stop_on_slope` is `true`, body will not slide on slopes when you include gravity in `linear_velocity` and the body is standing still. If the body collides, it will change direction a maximum of `max_slides` times before it stops. `floor_max_angle` is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees. If `infinite_inertia` is `true`, body will be able to push [RigidBody](class_rigidbody#class-rigidbody) nodes, but it won't also detect any collisions with them. If `false`, it will interact with [RigidBody](class_rigidbody#class-rigidbody) nodes like with [StaticBody](class_staticbody#class-staticbody). Returns the `linear_velocity` vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use [get\_slide\_collision](#class-kinematicbody-method-get-slide-collision). When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. ### [Vector3](class_vector3#class-vector3) move\_and\_slide\_with\_snap ( [Vector3](class_vector3#class-vector3) linear\_velocity, [Vector3](class_vector3#class-vector3) snap, [Vector3](class_vector3#class-vector3) up\_direction=Vector3( 0, 0, 0 ), [bool](class_bool#class-bool) stop\_on\_slope=false, [int](class_int#class-int) max\_slides=4, [float](class_float#class-float) floor\_max\_angle=0.785398, [bool](class_bool#class-bool) infinite\_inertia=true ) Moves the body while keeping it attached to slopes. Similar to [move\_and\_slide](#class-kinematicbody-method-move-and-slide). As long as the `snap` vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting `snap` to `(0, 0, 0)` or by using [move\_and\_slide](#class-kinematicbody-method-move-and-slide) instead. ### void set\_axis\_lock ( [BodyAxis](class_physicsserver#enum-physicsserver-bodyaxis) axis, [bool](class_bool#class-bool) lock ) Locks or unlocks the specified `axis` depending on the value of `lock`. See also [move\_lock\_x](#class-kinematicbody-property-move-lock-x), [move\_lock\_y](#class-kinematicbody-property-move-lock-y) and [move\_lock\_z](#class-kinematicbody-property-move-lock-z). ### [bool](class_bool#class-bool) test\_move ( [Transform](class_transform#class-transform) from, [Vector3](class_vector3#class-vector3) rel\_vec, [bool](class_bool#class-bool) infinite\_inertia=true ) Checks for collisions without moving the body. Virtually sets the node's position, scale and rotation to that of the given [Transform](class_transform#class-transform), then tries to move the body along the vector `rel_vec`. Returns `true` if a collision would stop the body from moving along the whole path. Use [move\_and\_collide](#class-kinematicbody-method-move-and-collide) instead for detecting collision with touching bodies.
programming_docs
godot VisualScriptYieldSignal VisualScriptYieldSignal ======================= **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A Visual Script node yielding for a signal. Description ----------- `VisualScriptYieldSignal` will pause the function execution until the provided signal is emitted. Properties ---------- | | | | | --- | --- | --- | | [String](class_string#class-string) | [base\_type](#class-visualscriptyieldsignal-property-base-type) | `"Object"` | | [CallMode](#enum-visualscriptyieldsignal-callmode) | [call\_mode](#class-visualscriptyieldsignal-property-call-mode) | `0` | | [NodePath](class_nodepath#class-nodepath) | [node\_path](#class-visualscriptyieldsignal-property-node-path) | | | [String](class_string#class-string) | [signal](#class-visualscriptyieldsignal-property-signal) | `""` | Enumerations ------------ enum **CallMode**: * **CALL\_MODE\_SELF** = **0** --- A signal from this [Object](class_object#class-object) will be used. * **CALL\_MODE\_NODE\_PATH** = **1** --- A signal from the given [Node](class_node#class-node) in the scene tree will be used. * **CALL\_MODE\_INSTANCE** = **2** --- A signal from an instanced node with the given type will be used. Property Descriptions --------------------- ### [String](class_string#class-string) base\_type | | | | --- | --- | | *Default* | `"Object"` | | *Setter* | set\_base\_type(value) | | *Getter* | get\_base\_type() | The base type to be used when [call\_mode](#class-visualscriptyieldsignal-property-call-mode) is set to [CALL\_MODE\_INSTANCE](#class-visualscriptyieldsignal-constant-call-mode-instance). ### [CallMode](#enum-visualscriptyieldsignal-callmode) call\_mode | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_call\_mode(value) | | *Getter* | get\_call\_mode() | `call_mode` determines the target object to wait for the signal emission. See [CallMode](#enum-visualscriptyieldsignal-callmode) for options. ### [NodePath](class_nodepath#class-nodepath) node\_path | | | | --- | --- | | *Setter* | set\_base\_path(value) | | *Getter* | get\_base\_path() | The node path to use when [call\_mode](#class-visualscriptyieldsignal-property-call-mode) is set to [CALL\_MODE\_NODE\_PATH](#class-visualscriptyieldsignal-constant-call-mode-node-path). ### [String](class_string#class-string) signal | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_signal(value) | | *Getter* | get\_signal() | The signal name to be waited for. godot VisualScriptConstructor VisualScriptConstructor ======================= **Inherits:** [VisualScriptNode](class_visualscriptnode#class-visualscriptnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A Visual Script node which calls a base type constructor. Description ----------- A Visual Script node which calls a base type constructor. It can be used for type conversion as well. Methods ------- | | | | --- | --- | | [Dictionary](class_dictionary#class-dictionary) | [get\_constructor](#class-visualscriptconstructor-method-get-constructor) **(** **)** const | | [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) | [get\_constructor\_type](#class-visualscriptconstructor-method-get-constructor-type) **(** **)** const | | void | [set\_constructor](#class-visualscriptconstructor-method-set-constructor) **(** [Dictionary](class_dictionary#class-dictionary) constructor **)** | | void | [set\_constructor\_type](#class-visualscriptconstructor-method-set-constructor-type) **(** [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type **)** | Method Descriptions ------------------- ### [Dictionary](class_dictionary#class-dictionary) get\_constructor ( ) const ### [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) get\_constructor\_type ( ) const ### void set\_constructor ( [Dictionary](class_dictionary#class-dictionary) constructor ) ### void set\_constructor\_type ( [Variant.Type](class_%40globalscope#enum-globalscope-variant-type) type ) godot PhysicsDirectBodyState PhysicsDirectBodyState ====================== **Inherits:** [Object](class_object#class-object) Direct access object to a physics body in the [PhysicsServer](class_physicsserver#class-physicsserver). Description ----------- Provides direct access to a physics body in the [PhysicsServer](class_physicsserver#class-physicsserver), allowing safe changes to physics properties. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. See [RigidBody.\_integrate\_forces](class_rigidbody#class-rigidbody-method-integrate-forces). Tutorials --------- * [Physics introduction](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html) * [Ray-casting](https://docs.godotengine.org/en/3.5/tutorials/physics/ray-casting.html) Properties ---------- | | | | --- | --- | | [Vector3](class_vector3#class-vector3) | [angular\_velocity](#class-physicsdirectbodystate-property-angular-velocity) | | [Vector3](class_vector3#class-vector3) | [center\_of\_mass](#class-physicsdirectbodystate-property-center-of-mass) | | [Vector3](class_vector3#class-vector3) | [inverse\_inertia](#class-physicsdirectbodystate-property-inverse-inertia) | | [float](class_float#class-float) | [inverse\_mass](#class-physicsdirectbodystate-property-inverse-mass) | | [Vector3](class_vector3#class-vector3) | [linear\_velocity](#class-physicsdirectbodystate-property-linear-velocity) | | [Basis](class_basis#class-basis) | [principal\_inertia\_axes](#class-physicsdirectbodystate-property-principal-inertia-axes) | | [bool](class_bool#class-bool) | [sleeping](#class-physicsdirectbodystate-property-sleeping) | | [float](class_float#class-float) | [step](#class-physicsdirectbodystate-property-step) | | [float](class_float#class-float) | [total\_angular\_damp](#class-physicsdirectbodystate-property-total-angular-damp) | | [Vector3](class_vector3#class-vector3) | [total\_gravity](#class-physicsdirectbodystate-property-total-gravity) | | [float](class_float#class-float) | [total\_linear\_damp](#class-physicsdirectbodystate-property-total-linear-damp) | | [Transform](class_transform#class-transform) | [transform](#class-physicsdirectbodystate-property-transform) | Methods ------- | | | | --- | --- | | void | [add\_central\_force](#class-physicsdirectbodystate-method-add-central-force) **(** [Vector3](class_vector3#class-vector3) force **)** | | void | [add\_force](#class-physicsdirectbodystate-method-add-force) **(** [Vector3](class_vector3#class-vector3) force, [Vector3](class_vector3#class-vector3) position **)** | | void | [add\_torque](#class-physicsdirectbodystate-method-add-torque) **(** [Vector3](class_vector3#class-vector3) torque **)** | | void | [apply\_central\_impulse](#class-physicsdirectbodystate-method-apply-central-impulse) **(** [Vector3](class_vector3#class-vector3) j **)** | | void | [apply\_impulse](#class-physicsdirectbodystate-method-apply-impulse) **(** [Vector3](class_vector3#class-vector3) position, [Vector3](class_vector3#class-vector3) j **)** | | void | [apply\_torque\_impulse](#class-physicsdirectbodystate-method-apply-torque-impulse) **(** [Vector3](class_vector3#class-vector3) j **)** | | [RID](class_rid#class-rid) | [get\_contact\_collider](#class-physicsdirectbodystate-method-get-contact-collider) **(** [int](class_int#class-int) contact\_idx **)** const | | [int](class_int#class-int) | [get\_contact\_collider\_id](#class-physicsdirectbodystate-method-get-contact-collider-id) **(** [int](class_int#class-int) contact\_idx **)** const | | [Object](class_object#class-object) | [get\_contact\_collider\_object](#class-physicsdirectbodystate-method-get-contact-collider-object) **(** [int](class_int#class-int) contact\_idx **)** const | | [Vector3](class_vector3#class-vector3) | [get\_contact\_collider\_position](#class-physicsdirectbodystate-method-get-contact-collider-position) **(** [int](class_int#class-int) contact\_idx **)** const | | [int](class_int#class-int) | [get\_contact\_collider\_shape](#class-physicsdirectbodystate-method-get-contact-collider-shape) **(** [int](class_int#class-int) contact\_idx **)** const | | [Vector3](class_vector3#class-vector3) | [get\_contact\_collider\_velocity\_at\_position](#class-physicsdirectbodystate-method-get-contact-collider-velocity-at-position) **(** [int](class_int#class-int) contact\_idx **)** const | | [int](class_int#class-int) | [get\_contact\_count](#class-physicsdirectbodystate-method-get-contact-count) **(** **)** const | | [float](class_float#class-float) | [get\_contact\_impulse](#class-physicsdirectbodystate-method-get-contact-impulse) **(** [int](class_int#class-int) contact\_idx **)** const | | [Vector3](class_vector3#class-vector3) | [get\_contact\_local\_normal](#class-physicsdirectbodystate-method-get-contact-local-normal) **(** [int](class_int#class-int) contact\_idx **)** const | | [Vector3](class_vector3#class-vector3) | [get\_contact\_local\_position](#class-physicsdirectbodystate-method-get-contact-local-position) **(** [int](class_int#class-int) contact\_idx **)** const | | [int](class_int#class-int) | [get\_contact\_local\_shape](#class-physicsdirectbodystate-method-get-contact-local-shape) **(** [int](class_int#class-int) contact\_idx **)** const | | [PhysicsDirectSpaceState](class_physicsdirectspacestate#class-physicsdirectspacestate) | [get\_space\_state](#class-physicsdirectbodystate-method-get-space-state) **(** **)** | | [Vector3](class_vector3#class-vector3) | [get\_velocity\_at\_local\_position](#class-physicsdirectbodystate-method-get-velocity-at-local-position) **(** [Vector3](class_vector3#class-vector3) local\_position **)** const | | void | [integrate\_forces](#class-physicsdirectbodystate-method-integrate-forces) **(** **)** | Property Descriptions --------------------- ### [Vector3](class_vector3#class-vector3) angular\_velocity | | | | --- | --- | | *Setter* | set\_angular\_velocity(value) | | *Getter* | get\_angular\_velocity() | The body's rotational velocity in axis-angle format. The magnitude of the vector is the rotation rate in *radians* per second. ### [Vector3](class_vector3#class-vector3) center\_of\_mass | | | | --- | --- | | *Getter* | get\_center\_of\_mass() | ### [Vector3](class_vector3#class-vector3) inverse\_inertia | | | | --- | --- | | *Getter* | get\_inverse\_inertia() | The inverse of the inertia of the body. ### [float](class_float#class-float) inverse\_mass | | | | --- | --- | | *Getter* | get\_inverse\_mass() | The inverse of the mass of the body. ### [Vector3](class_vector3#class-vector3) linear\_velocity | | | | --- | --- | | *Setter* | set\_linear\_velocity(value) | | *Getter* | get\_linear\_velocity() | The body's linear velocity in units per second. ### [Basis](class_basis#class-basis) principal\_inertia\_axes | | | | --- | --- | | *Getter* | get\_principal\_inertia\_axes() | ### [bool](class_bool#class-bool) sleeping | | | | --- | --- | | *Setter* | set\_sleep\_state(value) | | *Getter* | is\_sleeping() | If `true`, this body is currently sleeping (not active). ### [float](class_float#class-float) step | | | | --- | --- | | *Getter* | get\_step() | The timestep (delta) used for the simulation. ### [float](class_float#class-float) total\_angular\_damp | | | | --- | --- | | *Getter* | get\_total\_angular\_damp() | The rate at which the body stops rotating, if there are not any other forces moving it. ### [Vector3](class_vector3#class-vector3) total\_gravity | | | | --- | --- | | *Getter* | get\_total\_gravity() | The total gravity vector being currently applied to this body. ### [float](class_float#class-float) total\_linear\_damp | | | | --- | --- | | *Getter* | get\_total\_linear\_damp() | The rate at which the body stops moving, if there are not any other forces moving it. ### [Transform](class_transform#class-transform) transform | | | | --- | --- | | *Setter* | set\_transform(value) | | *Getter* | get\_transform() | The body's transformation matrix. Method Descriptions ------------------- ### void add\_central\_force ( [Vector3](class_vector3#class-vector3) force ) Adds a constant directional force without affecting rotation. This is equivalent to `add_force(force, Vector3(0,0,0))`. ### void add\_force ( [Vector3](class_vector3#class-vector3) force, [Vector3](class_vector3#class-vector3) position ) Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. ### void add\_torque ( [Vector3](class_vector3#class-vector3) torque ) Adds a constant rotational force without affecting position. ### void apply\_central\_impulse ( [Vector3](class_vector3#class-vector3) j ) Applies a single directional impulse without affecting rotation. This is equivalent to `apply_impulse(Vector3(0, 0, 0), impulse)`. ### void apply\_impulse ( [Vector3](class_vector3#class-vector3) position, [Vector3](class_vector3#class-vector3) j ) Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin. ### void apply\_torque\_impulse ( [Vector3](class_vector3#class-vector3) j ) Apply a torque impulse (which will be affected by the body mass and shape). This will rotate the body around the vector `j` passed as parameter. ### [RID](class_rid#class-rid) get\_contact\_collider ( [int](class_int#class-int) contact\_idx ) const Returns the collider's [RID](class_rid#class-rid). ### [int](class_int#class-int) get\_contact\_collider\_id ( [int](class_int#class-int) contact\_idx ) const Returns the collider's object id. ### [Object](class_object#class-object) get\_contact\_collider\_object ( [int](class_int#class-int) contact\_idx ) const Returns the collider object. ### [Vector3](class_vector3#class-vector3) get\_contact\_collider\_position ( [int](class_int#class-int) contact\_idx ) const Returns the contact position in the collider. ### [int](class_int#class-int) get\_contact\_collider\_shape ( [int](class_int#class-int) contact\_idx ) const Returns the collider's shape index. ### [Vector3](class_vector3#class-vector3) get\_contact\_collider\_velocity\_at\_position ( [int](class_int#class-int) contact\_idx ) const Returns the linear velocity vector at the collider's contact point. ### [int](class_int#class-int) get\_contact\_count ( ) const Returns the number of contacts this body has with other bodies. **Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See [RigidBody.contact\_monitor](class_rigidbody#class-rigidbody-property-contact-monitor). ### [float](class_float#class-float) get\_contact\_impulse ( [int](class_int#class-int) contact\_idx ) const Impulse created by the contact. Only implemented for Bullet physics. ### [Vector3](class_vector3#class-vector3) get\_contact\_local\_normal ( [int](class_int#class-int) contact\_idx ) const Returns the local normal at the contact point. ### [Vector3](class_vector3#class-vector3) get\_contact\_local\_position ( [int](class_int#class-int) contact\_idx ) const Returns the local position of the contact point. ### [int](class_int#class-int) get\_contact\_local\_shape ( [int](class_int#class-int) contact\_idx ) const Returns the local shape index of the collision. ### [PhysicsDirectSpaceState](class_physicsdirectspacestate#class-physicsdirectspacestate) get\_space\_state ( ) Returns the current state of the space, useful for queries. ### [Vector3](class_vector3#class-vector3) get\_velocity\_at\_local\_position ( [Vector3](class_vector3#class-vector3) local\_position ) const Returns the body's velocity at the given relative position, including both translation and rotation. ### void integrate\_forces ( ) Calls the built-in force integration code. godot Sky Sky === **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [PanoramaSky](class_panoramasky#class-panoramasky), [ProceduralSky](class_proceduralsky#class-proceduralsky) The base class for [PanoramaSky](class_panoramasky#class-panoramasky) and [ProceduralSky](class_proceduralsky#class-proceduralsky). Description ----------- The base class for [PanoramaSky](class_panoramasky#class-panoramasky) and [ProceduralSky](class_proceduralsky#class-proceduralsky). Properties ---------- | | | | | --- | --- | --- | | [RadianceSize](#enum-sky-radiancesize) | [radiance\_size](#class-sky-property-radiance-size) | `2` | Enumerations ------------ enum **RadianceSize**: * **RADIANCE\_SIZE\_32** = **0** --- Radiance texture size is 32×32 pixels. * **RADIANCE\_SIZE\_64** = **1** --- Radiance texture size is 64×64 pixels. * **RADIANCE\_SIZE\_128** = **2** --- Radiance texture size is 128×128 pixels. * **RADIANCE\_SIZE\_256** = **3** --- Radiance texture size is 256×256 pixels. * **RADIANCE\_SIZE\_512** = **4** --- Radiance texture size is 512×512 pixels. * **RADIANCE\_SIZE\_1024** = **5** --- Radiance texture size is 1024×1024 pixels. **Note:** [RADIANCE\_SIZE\_1024](#class-sky-constant-radiance-size-1024) is not exposed in the inspector as it is known to cause GPU hangs on certain systems. * **RADIANCE\_SIZE\_2048** = **6** --- Radiance texture size is 2048×2048 pixels. **Note:** [RADIANCE\_SIZE\_2048](#class-sky-constant-radiance-size-2048) is not exposed in the inspector as it is known to cause GPU hangs on certain systems. * **RADIANCE\_SIZE\_MAX** = **7** --- Represents the size of the [RadianceSize](#enum-sky-radiancesize) enum. Property Descriptions --------------------- ### [RadianceSize](#enum-sky-radiancesize) radiance\_size | | | | --- | --- | | *Default* | `2` | | *Setter* | set\_radiance\_size(value) | | *Getter* | get\_radiance\_size() | The `Sky`'s radiance map size. The higher the radiance map size, the more detailed the lighting from the `Sky` will be. See [RadianceSize](#enum-sky-radiancesize) constants for values. **Note:** You will only benefit from high radiance sizes if you have perfectly sharp reflective surfaces in your project and are not using [ReflectionProbe](class_reflectionprobe#class-reflectionprobe)s or [GIProbe](class_giprobe#class-giprobe)s. For most projects, keeping [radiance\_size](#class-sky-property-radiance-size) to the default value is the best compromise between visuals and performance. Be careful when using high radiance size values as these can cause crashes on low-end GPUs. godot MultiplayerPeerGDNative MultiplayerPeerGDNative ======================= **Inherits:** [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer) **<** [PacketPeer](class_packetpeer#class-packetpeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | refuse\_new\_connections | `true` (overrides [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-property-refuse-new-connections)) | | [TransferMode](class_networkedmultiplayerpeer#enum-networkedmultiplayerpeer-transfermode) | transfer\_mode | `0` (overrides [NetworkedMultiplayerPeer](class_networkedmultiplayerpeer#class-networkedmultiplayerpeer-property-transfer-mode)) |
programming_docs
godot SceneTreeTimer SceneTreeTimer ============== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) One-shot timer. Description ----------- A one-shot timer managed by the scene tree, which emits [timeout](#class-scenetreetimer-signal-timeout) on completion. See also [SceneTree.create\_timer](class_scenetree#class-scenetree-method-create-timer). As opposed to [Timer](class_timer#class-timer), it does not require the instantiation of a node. Commonly used to create a one-shot delay timer as in the following example: ``` func some_function(): print("Timer started.") yield(get_tree().create_timer(1.0), "timeout") print("Timer ended.") ``` The timer will be dereferenced after its time elapses. To preserve the timer, you can keep a reference to it. See [Reference](class_reference#class-reference). Properties ---------- | | | | --- | --- | | [float](class_float#class-float) | [time\_left](#class-scenetreetimer-property-time-left) | Signals ------- ### timeout ( ) Emitted when the timer reaches 0. Property Descriptions --------------------- ### [float](class_float#class-float) time\_left | | | | --- | --- | | *Setter* | set\_time\_left(value) | | *Getter* | get\_time\_left() | The time remaining (in seconds). godot WebRTCDataChannel WebRTCDataChannel ================= **Inherits:** [PacketPeer](class_packetpeer#class-packetpeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [WebRTCDataChannelGDNative](class_webrtcdatachannelgdnative#class-webrtcdatachannelgdnative) Properties ---------- | | | | | --- | --- | --- | | [WriteMode](#enum-webrtcdatachannel-writemode) | [write\_mode](#class-webrtcdatachannel-property-write-mode) | `1` | Methods ------- | | | | --- | --- | | void | [close](#class-webrtcdatachannel-method-close) **(** **)** | | [int](class_int#class-int) | [get\_buffered\_amount](#class-webrtcdatachannel-method-get-buffered-amount) **(** **)** const | | [int](class_int#class-int) | [get\_id](#class-webrtcdatachannel-method-get-id) **(** **)** const | | [String](class_string#class-string) | [get\_label](#class-webrtcdatachannel-method-get-label) **(** **)** const | | [int](class_int#class-int) | [get\_max\_packet\_life\_time](#class-webrtcdatachannel-method-get-max-packet-life-time) **(** **)** const | | [int](class_int#class-int) | [get\_max\_retransmits](#class-webrtcdatachannel-method-get-max-retransmits) **(** **)** const | | [String](class_string#class-string) | [get\_protocol](#class-webrtcdatachannel-method-get-protocol) **(** **)** const | | [ChannelState](#enum-webrtcdatachannel-channelstate) | [get\_ready\_state](#class-webrtcdatachannel-method-get-ready-state) **(** **)** const | | [bool](class_bool#class-bool) | [is\_negotiated](#class-webrtcdatachannel-method-is-negotiated) **(** **)** const | | [bool](class_bool#class-bool) | [is\_ordered](#class-webrtcdatachannel-method-is-ordered) **(** **)** const | | [Error](class_%40globalscope#enum-globalscope-error) | [poll](#class-webrtcdatachannel-method-poll) **(** **)** | | [bool](class_bool#class-bool) | [was\_string\_packet](#class-webrtcdatachannel-method-was-string-packet) **(** **)** const | Enumerations ------------ enum **WriteMode**: * **WRITE\_MODE\_TEXT** = **0** --- Tells the channel to send data over this channel as text. An external peer (non-Godot) would receive this as a string. * **WRITE\_MODE\_BINARY** = **1** --- Tells the channel to send data over this channel as binary. An external peer (non-Godot) would receive this as array buffer or blob. enum **ChannelState**: * **STATE\_CONNECTING** = **0** --- The channel was created, but it's still trying to connect. * **STATE\_OPEN** = **1** --- The channel is currently open, and data can flow over it. * **STATE\_CLOSING** = **2** --- The channel is being closed, no new messages will be accepted, but those already in queue will be flushed. * **STATE\_CLOSED** = **3** --- The channel was closed, or connection failed. Property Descriptions --------------------- ### [WriteMode](#enum-webrtcdatachannel-writemode) write\_mode | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_write\_mode(value) | | *Getter* | get\_write\_mode() | The transfer mode to use when sending outgoing packet. Either text or binary. Method Descriptions ------------------- ### void close ( ) Closes this data channel, notifying the other peer. ### [int](class_int#class-int) get\_buffered\_amount ( ) const Returns the number of bytes currently queued to be sent over this channel. ### [int](class_int#class-int) get\_id ( ) const Returns the id assigned to this channel during creation (or auto-assigned during negotiation). If the channel is not negotiated out-of-band the id will only be available after the connection is established (will return `65535` until then). ### [String](class_string#class-string) get\_label ( ) const Returns the label assigned to this channel during creation. ### [int](class_int#class-int) get\_max\_packet\_life\_time ( ) const Returns the `maxPacketLifeTime` value assigned to this channel during creation. Will be `65535` if not specified. ### [int](class_int#class-int) get\_max\_retransmits ( ) const Returns the `maxRetransmits` value assigned to this channel during creation. Will be `65535` if not specified. ### [String](class_string#class-string) get\_protocol ( ) const Returns the sub-protocol assigned to this channel during creation. An empty string if not specified. ### [ChannelState](#enum-webrtcdatachannel-channelstate) get\_ready\_state ( ) const Returns the current state of this channel, see [ChannelState](#enum-webrtcdatachannel-channelstate). ### [bool](class_bool#class-bool) is\_negotiated ( ) const Returns `true` if this channel was created with out-of-band configuration. ### [bool](class_bool#class-bool) is\_ordered ( ) const Returns `true` if this channel was created with ordering enabled (default). ### [Error](class_%40globalscope#enum-globalscope-error) poll ( ) Reserved, but not used for now. ### [bool](class_bool#class-bool) was\_string\_packet ( ) const Returns `true` if the last received packet was transferred as text. See [write\_mode](#class-webrtcdatachannel-property-write-mode). godot PlaneMesh PlaneMesh ========= **Inherits:** [PrimitiveMesh](class_primitivemesh#class-primitivemesh) **<** [Mesh](class_mesh#class-mesh) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Class representing a planar [PrimitiveMesh](class_primitivemesh#class-primitivemesh). Description ----------- Class representing a planar [PrimitiveMesh](class_primitivemesh#class-primitivemesh). This flat mesh does not have a thickness. By default, this mesh is aligned on the X and Z axes; this default rotation isn't suited for use with billboarded materials. For billboarded materials, use [QuadMesh](class_quadmesh#class-quadmesh) instead. **Note:** When using a large textured `PlaneMesh` (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase [subdivide\_depth](#class-planemesh-property-subdivide-depth) and [subdivide\_width](#class-planemesh-property-subdivide-width) until you no longer notice UV jittering. Properties ---------- | | | | | --- | --- | --- | | [Vector3](class_vector3#class-vector3) | [center\_offset](#class-planemesh-property-center-offset) | `Vector3( 0, 0, 0 )` | | [Vector2](class_vector2#class-vector2) | [size](#class-planemesh-property-size) | `Vector2( 2, 2 )` | | [int](class_int#class-int) | [subdivide\_depth](#class-planemesh-property-subdivide-depth) | `0` | | [int](class_int#class-int) | [subdivide\_width](#class-planemesh-property-subdivide-width) | `0` | Property Descriptions --------------------- ### [Vector3](class_vector3#class-vector3) center\_offset | | | | --- | --- | | *Default* | `Vector3( 0, 0, 0 )` | | *Setter* | set\_center\_offset(value) | | *Getter* | get\_center\_offset() | Offset from the origin of the generated plane. Useful for particles. ### [Vector2](class_vector2#class-vector2) size | | | | --- | --- | | *Default* | `Vector2( 2, 2 )` | | *Setter* | set\_size(value) | | *Getter* | get\_size() | Size of the generated plane. ### [int](class_int#class-int) subdivide\_depth | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_subdivide\_depth(value) | | *Getter* | get\_subdivide\_depth() | Number of subdivision along the Z axis. ### [int](class_int#class-int) subdivide\_width | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_subdivide\_width(value) | | *Getter* | get\_subdivide\_width() | Number of subdivision along the X axis. godot PackedDataContainerRef PackedDataContainerRef ====================== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Reference version of [PackedDataContainer](class_packeddatacontainer#class-packeddatacontainer). Methods ------- | | | | --- | --- | | [int](class_int#class-int) | [size](#class-packeddatacontainerref-method-size) **(** **)** const | Method Descriptions ------------------- ### [int](class_int#class-int) size ( ) const godot SpringArm SpringArm ========= **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) A helper node, mostly used in 3rd person cameras. Description ----------- The SpringArm node is a node that casts a ray (or collision shape) along its z axis and moves all its direct children to the collision point, minus a margin. The most common use case for this is to make a 3rd person camera that reacts to collisions in the environment. The SpringArm will either cast a ray, or if a shape is given, it will cast the shape in the direction of its z axis. If you use the SpringArm as a camera controller for your player, you might need to exclude the player's collider from the SpringArm's collision check. Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [collision\_mask](#class-springarm-property-collision-mask) | `1` | | [float](class_float#class-float) | [margin](#class-springarm-property-margin) | `0.01` | | [Shape](class_shape#class-shape) | [shape](#class-springarm-property-shape) | | | [float](class_float#class-float) | [spring\_length](#class-springarm-property-spring-length) | `1.0` | Methods ------- | | | | --- | --- | | void | [add\_excluded\_object](#class-springarm-method-add-excluded-object) **(** [RID](class_rid#class-rid) RID **)** | | void | [clear\_excluded\_objects](#class-springarm-method-clear-excluded-objects) **(** **)** | | [float](class_float#class-float) | [get\_hit\_length](#class-springarm-method-get-hit-length) **(** **)** | | [bool](class_bool#class-bool) | [remove\_excluded\_object](#class-springarm-method-remove-excluded-object) **(** [RID](class_rid#class-rid) RID **)** | Property Descriptions --------------------- ### [int](class_int#class-int) collision\_mask | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_collision\_mask(value) | | *Getter* | get\_collision\_mask() | The layers against which the collision check shall be done. See [Collision layers and masks](https://docs.godotengine.org/en/3.5/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. ### [float](class_float#class-float) margin | | | | --- | --- | | *Default* | `0.01` | | *Setter* | set\_margin(value) | | *Getter* | get\_margin() | When the collision check is made, a candidate length for the SpringArm is given. The margin is then subtracted to this length and the translation is applied to the child objects of the SpringArm. This margin is useful for when the SpringArm has a [Camera](class_camera#class-camera) as a child node: without the margin, the [Camera](class_camera#class-camera) would be placed on the exact point of collision, while with the margin the [Camera](class_camera#class-camera) would be placed close to the point of collision. ### [Shape](class_shape#class-shape) shape | | | | --- | --- | | *Setter* | set\_shape(value) | | *Getter* | get\_shape() | The [Shape](class_shape#class-shape) to use for the SpringArm. When the shape is set, the SpringArm will cast the [Shape](class_shape#class-shape) on its z axis instead of performing a ray cast. ### [float](class_float#class-float) spring\_length | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_length(value) | | *Getter* | get\_length() | The maximum extent of the SpringArm. This is used as a length for both the ray and the shape cast used internally to calculate the desired position of the SpringArm's child nodes. To know more about how to perform a shape cast or a ray cast, please consult the [PhysicsDirectSpaceState](class_physicsdirectspacestate#class-physicsdirectspacestate) documentation. Method Descriptions ------------------- ### void add\_excluded\_object ( [RID](class_rid#class-rid) RID ) Adds the [PhysicsBody](class_physicsbody#class-physicsbody) object with the given [RID](class_rid#class-rid) to the list of [PhysicsBody](class_physicsbody#class-physicsbody) objects excluded from the collision check. ### void clear\_excluded\_objects ( ) Clears the list of [PhysicsBody](class_physicsbody#class-physicsbody) objects excluded from the collision check. ### [float](class_float#class-float) get\_hit\_length ( ) Returns the spring arm's current length. ### [bool](class_bool#class-bool) remove\_excluded\_object ( [RID](class_rid#class-rid) RID ) Removes the given [RID](class_rid#class-rid) from the list of [PhysicsBody](class_physicsbody#class-physicsbody) objects excluded from the collision check. godot Button Button ====== **Inherits:** [BaseButton](class_basebutton#class-basebutton) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [CheckBox](class_checkbox#class-checkbox), [CheckButton](class_checkbutton#class-checkbutton), [ColorPickerButton](class_colorpickerbutton#class-colorpickerbutton), [MenuButton](class_menubutton#class-menubutton), [OptionButton](class_optionbutton#class-optionbutton), [ToolButton](class_toolbutton#class-toolbutton) Standard themed Button. Description ----------- Button is the standard themed button. It can contain text and an icon, and will display them according to the current [Theme](class_theme#class-theme). **Example of creating a button and assigning an action when pressed by code:** ``` func _ready(): var button = Button.new() button.text = "Click me" button.connect("pressed", self, "_button_pressed") add_child(button) func _button_pressed(): print("Hello world!") ``` Buttons (like all Control nodes) can also be created in the editor, but some situations may require creating them from code. See also [BaseButton](class_basebutton#class-basebutton) which contains common properties and methods associated with this node. **Note:** Buttons do not interpret touch input and therefore don't support multitouch, since mouse emulation can only press one button at a given time. Use [TouchScreenButton](class_touchscreenbutton#class-touchscreenbutton) for buttons that trigger gameplay movement or actions, as [TouchScreenButton](class_touchscreenbutton#class-touchscreenbutton) supports multitouch. Tutorials --------- * [2D Dodge The Creeps Demo](https://godotengine.org/asset-library/asset/515) * [OS Test Demo](https://godotengine.org/asset-library/asset/677) Properties ---------- | | | | | --- | --- | --- | | [TextAlign](#enum-button-textalign) | [align](#class-button-property-align) | `1` | | [bool](class_bool#class-bool) | [clip\_text](#class-button-property-clip-text) | `false` | | [bool](class_bool#class-bool) | [expand\_icon](#class-button-property-expand-icon) | `false` | | [bool](class_bool#class-bool) | [flat](#class-button-property-flat) | `false` | | [Texture](class_texture#class-texture) | [icon](#class-button-property-icon) | | | [TextAlign](#enum-button-textalign) | [icon\_align](#class-button-property-icon-align) | `0` | | [String](class_string#class-string) | [text](#class-button-property-text) | `""` | Theme Properties ---------------- | | | | | --- | --- | --- | | [Color](class_color#class-color) | [font\_color](#class-button-theme-color-font-color) | `Color( 0.88, 0.88, 0.88, 1 )` | | [Color](class_color#class-color) | [font\_color\_disabled](#class-button-theme-color-font-color-disabled) | `Color( 0.9, 0.9, 0.9, 0.2 )` | | [Color](class_color#class-color) | [font\_color\_focus](#class-button-theme-color-font-color-focus) | `Color( 0.94, 0.94, 0.94, 1 )` | | [Color](class_color#class-color) | [font\_color\_hover](#class-button-theme-color-font-color-hover) | `Color( 0.94, 0.94, 0.94, 1 )` | | [Color](class_color#class-color) | [font\_color\_pressed](#class-button-theme-color-font-color-pressed) | `Color( 1, 1, 1, 1 )` | | [int](class_int#class-int) | [hseparation](#class-button-theme-constant-hseparation) | `2` | | [Font](class_font#class-font) | [font](#class-button-theme-font-font) | | | [StyleBox](class_stylebox#class-stylebox) | [disabled](#class-button-theme-style-disabled) | | | [StyleBox](class_stylebox#class-stylebox) | [focus](#class-button-theme-style-focus) | | | [StyleBox](class_stylebox#class-stylebox) | [hover](#class-button-theme-style-hover) | | | [StyleBox](class_stylebox#class-stylebox) | [normal](#class-button-theme-style-normal) | | | [StyleBox](class_stylebox#class-stylebox) | [pressed](#class-button-theme-style-pressed) | | Enumerations ------------ enum **TextAlign**: * **ALIGN\_LEFT** = **0** --- Align the text to the left. * **ALIGN\_CENTER** = **1** --- Align the text to the center. * **ALIGN\_RIGHT** = **2** --- Align the text to the right. Property Descriptions --------------------- ### [TextAlign](#enum-button-textalign) align | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_text\_align(value) | | *Getter* | get\_text\_align() | Text alignment policy for the button's text, use one of the [TextAlign](#enum-button-textalign) constants. ### [bool](class_bool#class-bool) clip\_text | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_clip\_text(value) | | *Getter* | get\_clip\_text() | When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text. ### [bool](class_bool#class-bool) expand\_icon | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_expand\_icon(value) | | *Getter* | is\_expand\_icon() | When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect. ### [bool](class_bool#class-bool) flat | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flat(value) | | *Getter* | is\_flat() | Flat buttons don't display decoration. ### [Texture](class_texture#class-texture) icon | | | | --- | --- | | *Setter* | set\_button\_icon(value) | | *Getter* | get\_button\_icon() | Button's icon, if text is present the icon will be placed before the text. To edit margin and spacing of the icon, use `hseparation` theme property of `Button` and `content_margin_*` properties of the used [StyleBox](class_stylebox#class-stylebox)es. ### [TextAlign](#enum-button-textalign) icon\_align | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_icon\_align(value) | | *Getter* | get\_icon\_align() | Specifies if the icon should be aligned to the left, right, or center of a button. Uses the same [TextAlign](#enum-button-textalign) constants as the text alignment. If centered, text will draw on top of the icon. ### [String](class_string#class-string) text | | | | --- | --- | | *Default* | `""` | | *Setter* | set\_text(value) | | *Getter* | get\_text() | The button's text that will be displayed inside the button's area. Theme Property Descriptions --------------------------- ### [Color](class_color#class-color) font\_color | | | | --- | --- | | *Default* | `Color( 0.88, 0.88, 0.88, 1 )` | Default text [Color](class_color#class-color) of the `Button`. ### [Color](class_color#class-color) font\_color\_disabled | | | | --- | --- | | *Default* | `Color( 0.9, 0.9, 0.9, 0.2 )` | Text [Color](class_color#class-color) used when the `Button` is disabled. ### [Color](class_color#class-color) font\_color\_focus | | | | --- | --- | | *Default* | `Color( 0.94, 0.94, 0.94, 1 )` | Text [Color](class_color#class-color) used when the `Button` is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color. ### [Color](class_color#class-color) font\_color\_hover | | | | --- | --- | | *Default* | `Color( 0.94, 0.94, 0.94, 1 )` | Text [Color](class_color#class-color) used when the `Button` is being hovered. ### [Color](class_color#class-color) font\_color\_pressed | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | Text [Color](class_color#class-color) used when the `Button` is being pressed. ### [int](class_int#class-int) hseparation | | | | --- | --- | | *Default* | `2` | The horizontal space between `Button`'s icon and text. ### [Font](class_font#class-font) font [Font](class_font#class-font) of the `Button`'s text. ### [StyleBox](class_stylebox#class-stylebox) disabled [StyleBox](class_stylebox#class-stylebox) used when the `Button` is disabled. ### [StyleBox](class_stylebox#class-stylebox) focus [StyleBox](class_stylebox#class-stylebox) used when the `Button` is focused. It is displayed over the current [StyleBox](class_stylebox#class-stylebox), so using [StyleBoxEmpty](class_styleboxempty#class-styleboxempty) will just disable the focus visual effect. ### [StyleBox](class_stylebox#class-stylebox) hover [StyleBox](class_stylebox#class-stylebox) used when the `Button` is being hovered. ### [StyleBox](class_stylebox#class-stylebox) normal Default [StyleBox](class_stylebox#class-stylebox) for the `Button`. ### [StyleBox](class_stylebox#class-stylebox) pressed [StyleBox](class_stylebox#class-stylebox) used when the `Button` is being pressed.
programming_docs
godot RoomGroup RoomGroup ========= **Inherits:** [Spatial](class_spatial#class-spatial) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Groups [Room](class_room#class-room)s together to allow common functionality. Description ----------- Although [Room](class_room#class-room) behavior can be specified individually, sometimes it is faster and more convenient to write functionality for a group of rooms. `RoomGroup`s should be placed as children of the **room list** (the parent [Node](class_node#class-node) of your [Room](class_room#class-room)s), and [Room](class_room#class-room)s should be placed in turn as children of a `RoomGroup` in order to assign them to the RoomGroup. A `RoomGroup` can for example be used to specify [Room](class_room#class-room)s that are **outside**, and switch on or off a directional light, sky, or rain effect as the player enters / exits the area. `RoomGroup`s receive **gameplay callbacks** when the `gameplay_monitor` is switched on, as `signal`s or `notification`s as they enter and exit the **gameplay area** (see [RoomManager](class_roommanager#class-roommanager) for details). Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [roomgroup\_priority](#class-roomgroup-property-roomgroup-priority) | `0` | Property Descriptions --------------------- ### [int](class_int#class-int) roomgroup\_priority | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_roomgroup\_priority(value) | | *Getter* | get\_roomgroup\_priority() | This priority will be applied to [Room](class_room#class-room)s within the group. The [Room](class_room#class-room) priority allows the use of **internal rooms**, rooms *within* another room or rooms. When the [Camera](class_camera#class-camera) is within more than one room (regular and internal), the higher priority room will take precedence. So with for example, a house inside a terrain 'room', you would make the house higher priority, so that when the camera is within the house, the house is used as the source room, but outside the house, the terrain room would be used instead. godot Separator Separator ========= **Inherits:** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) **Inherited By:** [HSeparator](class_hseparator#class-hseparator), [VSeparator](class_vseparator#class-vseparator) Base class for separators. Description ----------- Separator is a [Control](class_control#class-control) used for separating other controls. It's purely a visual decoration. Horizontal ([HSeparator](class_hseparator#class-hseparator)) and Vertical ([VSeparator](class_vseparator#class-vseparator)) versions are available. godot ViewportTexture ViewportTexture =============== **Inherits:** [Texture](class_texture#class-texture) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Texture which displays the content of a [Viewport](class_viewport#class-viewport). Description ----------- Displays the content of a [Viewport](class_viewport#class-viewport) node as a dynamic [Texture](class_texture#class-texture). This can be used to mix controls, 2D, and 3D elements in the same scene. To create a ViewportTexture in code, use the [Viewport.get\_texture](class_viewport#class-viewport-method-get-texture) method on the target viewport. Tutorials --------- * [GUI in 3D Demo](https://godotengine.org/asset-library/asset/127) * [3D in 2D Demo](https://godotengine.org/asset-library/asset/128) * [2D in 3D Demo](https://godotengine.org/asset-library/asset/129) * [3D Viewport Scaling Demo](https://godotengine.org/asset-library/asset/586) Properties ---------- | | | | | --- | --- | --- | | [int](class_int#class-int) | flags | `0` (overrides [Texture](class_texture#class-texture-property-flags)) | | [bool](class_bool#class-bool) | resource\_local\_to\_scene | `true` (overrides [Resource](class_resource#class-resource-property-resource-local-to-scene)) | | [NodePath](class_nodepath#class-nodepath) | [viewport\_path](#class-viewporttexture-property-viewport-path) | `NodePath("")` | Property Descriptions --------------------- ### [NodePath](class_nodepath#class-nodepath) viewport\_path | | | | --- | --- | | *Default* | `NodePath("")` | | *Setter* | set\_viewport\_path\_in\_scene(value) | | *Getter* | get\_viewport\_path\_in\_scene() | The path to the [Viewport](class_viewport#class-viewport) node to display. This is relative to the scene root, not to the node which uses the texture. godot ConcavePolygonShape2D ConcavePolygonShape2D ===================== **Inherits:** [Shape2D](class_shape2d#class-shape2d) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Concave polygon 2D shape resource for physics. Description ----------- Concave polygon 2D shape resource for physics. It is made out of segments and is optimal for complex polygonal concave collisions. However, it is not advised to use for [RigidBody2D](class_rigidbody2d#class-rigidbody2d) nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions. The main difference between a [ConvexPolygonShape2D](class_convexpolygonshape2d#class-convexpolygonshape2d) and a `ConcavePolygonShape2D` is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection. **Warning:** Using this shape for an [Area2D](class_area2d#class-area2d) (via a [CollisionShape2D](class_collisionshape2d#class-collisionshape2d) node) may give unexpected results: the area will only detect collisions with the segments in the `ConcavePolygonShape2D` (and not with any "inside" of the shape, for example). Properties ---------- | | | | | --- | --- | --- | | [PoolVector2Array](class_poolvector2array#class-poolvector2array) | [segments](#class-concavepolygonshape2d-property-segments) | `PoolVector2Array(  )` | Property Descriptions --------------------- ### [PoolVector2Array](class_poolvector2array#class-poolvector2array) segments | | | | --- | --- | | *Default* | `PoolVector2Array(  )` | | *Setter* | set\_segments(value) | | *Getter* | get\_segments() | The array of points that make up the `ConcavePolygonShape2D`'s line segments. godot AnimationNode AnimationNode ============= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [AnimationNodeAdd2](class_animationnodeadd2#class-animationnodeadd2), [AnimationNodeAdd3](class_animationnodeadd3#class-animationnodeadd3), [AnimationNodeBlend2](class_animationnodeblend2#class-animationnodeblend2), [AnimationNodeBlend3](class_animationnodeblend3#class-animationnodeblend3), [AnimationNodeOneShot](class_animationnodeoneshot#class-animationnodeoneshot), [AnimationNodeOutput](class_animationnodeoutput#class-animationnodeoutput), [AnimationNodeTimeScale](class_animationnodetimescale#class-animationnodetimescale), [AnimationNodeTimeSeek](class_animationnodetimeseek#class-animationnodetimeseek), [AnimationNodeTransition](class_animationnodetransition#class-animationnodetransition), [AnimationRootNode](class_animationrootnode#class-animationrootnode) Base resource for [AnimationTree](class_animationtree#class-animationtree) nodes. Description ----------- Base resource for [AnimationTree](class_animationtree#class-animationtree) nodes. In general, it's not used directly, but you can create custom ones with custom blending formulas. Inherit this when creating nodes mainly for use in [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree), otherwise [AnimationRootNode](class_animationrootnode#class-animationrootnode) should be used instead. Tutorials --------- * [Using AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html) Properties ---------- | | | | --- | --- | | [bool](class_bool#class-bool) | [filter\_enabled](#class-animationnode-property-filter-enabled) | Methods ------- | | | | --- | --- | | void | [add\_input](#class-animationnode-method-add-input) **(** [String](class_string#class-string) name **)** | | void | [blend\_animation](#class-animationnode-method-blend-animation) **(** [String](class_string#class-string) animation, [float](class_float#class-float) time, [float](class_float#class-float) delta, [bool](class_bool#class-bool) seeked, [float](class_float#class-float) blend **)** | | [float](class_float#class-float) | [blend\_input](#class-animationnode-method-blend-input) **(** [int](class_int#class-int) input\_index, [float](class_float#class-float) time, [bool](class_bool#class-bool) seek, [float](class_float#class-float) blend, [FilterAction](#enum-animationnode-filteraction) filter=0, [bool](class_bool#class-bool) optimize=true **)** | | [float](class_float#class-float) | [blend\_node](#class-animationnode-method-blend-node) **(** [String](class_string#class-string) name, [AnimationNode](#class-animationnode) node, [float](class_float#class-float) time, [bool](class_bool#class-bool) seek, [float](class_float#class-float) blend, [FilterAction](#enum-animationnode-filteraction) filter=0, [bool](class_bool#class-bool) optimize=true **)** | | [String](class_string#class-string) | [get\_caption](#class-animationnode-method-get-caption) **(** **)** virtual | | [Object](class_object#class-object) | [get\_child\_by\_name](#class-animationnode-method-get-child-by-name) **(** [String](class_string#class-string) name **)** virtual | | [Dictionary](class_dictionary#class-dictionary) | [get\_child\_nodes](#class-animationnode-method-get-child-nodes) **(** **)** virtual | | [int](class_int#class-int) | [get\_input\_count](#class-animationnode-method-get-input-count) **(** **)** const | | [String](class_string#class-string) | [get\_input\_name](#class-animationnode-method-get-input-name) **(** [int](class_int#class-int) input **)** | | [Variant](class_variant#class-variant) | [get\_parameter](#class-animationnode-method-get-parameter) **(** [String](class_string#class-string) name **)** const | | [Variant](class_variant#class-variant) | [get\_parameter\_default\_value](#class-animationnode-method-get-parameter-default-value) **(** [String](class_string#class-string) name **)** virtual | | [Array](class_array#class-array) | [get\_parameter\_list](#class-animationnode-method-get-parameter-list) **(** **)** virtual | | [bool](class_bool#class-bool) | [has\_filter](#class-animationnode-method-has-filter) **(** **)** virtual | | [bool](class_bool#class-bool) | [is\_path\_filtered](#class-animationnode-method-is-path-filtered) **(** [NodePath](class_nodepath#class-nodepath) path **)** const | | void | [process](#class-animationnode-method-process) **(** [float](class_float#class-float) time, [bool](class_bool#class-bool) seek **)** virtual | | void | [remove\_input](#class-animationnode-method-remove-input) **(** [int](class_int#class-int) index **)** | | void | [set\_filter\_path](#class-animationnode-method-set-filter-path) **(** [NodePath](class_nodepath#class-nodepath) path, [bool](class_bool#class-bool) enable **)** | | void | [set\_parameter](#class-animationnode-method-set-parameter) **(** [String](class_string#class-string) name, [Variant](class_variant#class-variant) value **)** | Signals ------- ### removed\_from\_graph ( ) Emitted when the node was removed from the graph. ### tree\_changed ( ) Emitted by nodes that inherit from this class and that have an internal tree when one of their nodes changes. The nodes that emit this signal are [AnimationNodeBlendSpace1D](class_animationnodeblendspace1d#class-animationnodeblendspace1d), [AnimationNodeBlendSpace2D](class_animationnodeblendspace2d#class-animationnodeblendspace2d), [AnimationNodeStateMachine](class_animationnodestatemachine#class-animationnodestatemachine), and [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). Enumerations ------------ enum **FilterAction**: * **FILTER\_IGNORE** = **0** --- Do not use filtering. * **FILTER\_PASS** = **1** --- Paths matching the filter will be allowed to pass. * **FILTER\_STOP** = **2** --- Paths matching the filter will be discarded. * **FILTER\_BLEND** = **3** --- Paths matching the filter will be blended (by the blend value). Property Descriptions --------------------- ### [bool](class_bool#class-bool) filter\_enabled | | | | --- | --- | | *Setter* | set\_filter\_enabled(value) | | *Getter* | is\_filter\_enabled() | If `true`, filtering is enabled. Method Descriptions ------------------- ### void add\_input ( [String](class_string#class-string) name ) Adds an input to the node. This is only useful for nodes created for use in an [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). ### void blend\_animation ( [String](class_string#class-string) animation, [float](class_float#class-float) time, [float](class_float#class-float) delta, [bool](class_bool#class-bool) seeked, [float](class_float#class-float) blend ) Blend an animation by `blend` amount (name must be valid in the linked [AnimationPlayer](class_animationplayer#class-animationplayer)). A `time` and `delta` may be passed, as well as whether `seek` happened. ### [float](class_float#class-float) blend\_input ( [int](class_int#class-int) input\_index, [float](class_float#class-float) time, [bool](class_bool#class-bool) seek, [float](class_float#class-float) blend, [FilterAction](#enum-animationnode-filteraction) filter=0, [bool](class_bool#class-bool) optimize=true ) Blend an input. This is only useful for nodes created for an [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). The `time` parameter is a relative delta, unless `seek` is `true`, in which case it is absolute. A filter mode may be optionally passed (see [FilterAction](#enum-animationnode-filteraction) for options). ### [float](class_float#class-float) blend\_node ( [String](class_string#class-string) name, [AnimationNode](#class-animationnode) node, [float](class_float#class-float) time, [bool](class_bool#class-bool) seek, [float](class_float#class-float) blend, [FilterAction](#enum-animationnode-filteraction) filter=0, [bool](class_bool#class-bool) optimize=true ) Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from [AnimationRootNode](class_animationrootnode#class-animationrootnode) instead, else editors will not display your node for addition. ### [String](class_string#class-string) get\_caption ( ) virtual When inheriting from [AnimationRootNode](class_animationrootnode#class-animationrootnode), implement this virtual method to override the text caption for this node. ### [Object](class_object#class-object) get\_child\_by\_name ( [String](class_string#class-string) name ) virtual When inheriting from [AnimationRootNode](class_animationrootnode#class-animationrootnode), implement this virtual method to return a child node by its `name`. ### [Dictionary](class_dictionary#class-dictionary) get\_child\_nodes ( ) virtual When inheriting from [AnimationRootNode](class_animationrootnode#class-animationrootnode), implement this virtual method to return all children nodes in order as a `name: node` dictionary. ### [int](class_int#class-int) get\_input\_count ( ) const Amount of inputs in this node, only useful for nodes that go into [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). ### [String](class_string#class-string) get\_input\_name ( [int](class_int#class-int) input ) Gets the name of an input by index. ### [Variant](class_variant#class-variant) get\_parameter ( [String](class_string#class-string) name ) const Gets the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. ### [Variant](class_variant#class-variant) get\_parameter\_default\_value ( [String](class_string#class-string) name ) virtual When inheriting from [AnimationRootNode](class_animationrootnode#class-animationrootnode), implement this virtual method to return the default value of parameter "`name`". Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. ### [Array](class_array#class-array) get\_parameter\_list ( ) virtual When inheriting from [AnimationRootNode](class_animationrootnode#class-animationrootnode), implement this virtual method to return a list of the properties on this node. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to [Object.get\_property\_list](class_object#id2). ### [bool](class_bool#class-bool) has\_filter ( ) virtual When inheriting from [AnimationRootNode](class_animationrootnode#class-animationrootnode), implement this virtual method to return whether the blend tree editor should display filter editing on this node. ### [bool](class_bool#class-bool) is\_path\_filtered ( [NodePath](class_nodepath#class-nodepath) path ) const Returns whether the given path is filtered. ### void process ( [float](class_float#class-float) time, [bool](class_bool#class-bool) seek ) virtual When inheriting from [AnimationRootNode](class_animationrootnode#class-animationrootnode), implement this virtual method to run some code when this node is processed. The `time` parameter is a relative delta, unless `seek` is `true`, in which case it is absolute. Here, call the [blend\_input](#class-animationnode-method-blend-input), [blend\_node](#class-animationnode-method-blend-node) or [blend\_animation](#class-animationnode-method-blend-animation) functions. You can also use [get\_parameter](#class-animationnode-method-get-parameter) and [set\_parameter](#class-animationnode-method-set-parameter) to modify local memory. This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called). ### void remove\_input ( [int](class_int#class-int) index ) Removes an input, call this only when inactive. ### void set\_filter\_path ( [NodePath](class_nodepath#class-nodepath) path, [bool](class_bool#class-bool) enable ) Adds or removes a path for the filter. ### void set\_parameter ( [String](class_string#class-string) name, [Variant](class_variant#class-variant) value ) Sets a custom parameter. These are used as local memory, because resources can be reused across the tree or scenes. godot VSplitContainer VSplitContainer =============== **Inherits:** [SplitContainer](class_splitcontainer#class-splitcontainer) **<** [Container](class_container#class-container) **<** [Control](class_control#class-control) **<** [CanvasItem](class_canvasitem#class-canvasitem) **<** [Node](class_node#class-node) **<** [Object](class_object#class-object) Vertical split container. Description ----------- Vertical split container. See [SplitContainer](class_splitcontainer#class-splitcontainer). This goes from top to bottom. Tutorials --------- * [GUI containers](https://docs.godotengine.org/en/3.5/tutorials/ui/gui_containers.html) Theme Properties ---------------- | | | | | --- | --- | --- | | [int](class_int#class-int) | [autohide](#class-vsplitcontainer-theme-constant-autohide) | `1` | | [int](class_int#class-int) | [separation](#class-vsplitcontainer-theme-constant-separation) | `12` | | [Texture](class_texture#class-texture) | [grabber](#class-vsplitcontainer-theme-icon-grabber) | | | [StyleBox](class_stylebox#class-stylebox) | [bg](#class-vsplitcontainer-theme-style-bg) | | Theme Property Descriptions --------------------------- ### [int](class_int#class-int) autohide | | | | --- | --- | | *Default* | `1` | Boolean value. If 1 (`true`), the grabber will hide automatically when it isn't under the cursor. If 0 (`false`), it's always visible. ### [int](class_int#class-int) separation | | | | --- | --- | | *Default* | `12` | The space between sides of the container. ### [Texture](class_texture#class-texture) grabber The icon used for the grabber drawn in the middle area. ### [StyleBox](class_stylebox#class-stylebox) bg
programming_docs
godot StreamPeerBuffer StreamPeerBuffer ================ **Inherits:** [StreamPeer](class_streampeer#class-streampeer) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Data buffer stream peer. Description ----------- Data buffer stream peer that uses a byte array as the stream. This object can be used to handle binary data from network sessions. To handle binary data stored in files, [File](class_file#class-file) can be used directly. A `StreamPeerBuffer` object keeps an internal cursor which is the offset in bytes to the start of the buffer. Get and put operations are performed at the cursor position and will move the cursor accordingly. Properties ---------- | | | | | --- | --- | --- | | [PoolByteArray](class_poolbytearray#class-poolbytearray) | [data\_array](#class-streampeerbuffer-property-data-array) | `PoolByteArray(  )` | Methods ------- | | | | --- | --- | | void | [clear](#class-streampeerbuffer-method-clear) **(** **)** | | [StreamPeerBuffer](#class-streampeerbuffer) | [duplicate](#class-streampeerbuffer-method-duplicate) **(** **)** const | | [int](class_int#class-int) | [get\_position](#class-streampeerbuffer-method-get-position) **(** **)** const | | [int](class_int#class-int) | [get\_size](#class-streampeerbuffer-method-get-size) **(** **)** const | | void | [resize](#class-streampeerbuffer-method-resize) **(** [int](class_int#class-int) size **)** | | void | [seek](#class-streampeerbuffer-method-seek) **(** [int](class_int#class-int) position **)** | Property Descriptions --------------------- ### [PoolByteArray](class_poolbytearray#class-poolbytearray) data\_array | | | | --- | --- | | *Default* | `PoolByteArray(  )` | | *Setter* | set\_data\_array(value) | | *Getter* | get\_data\_array() | The underlying data buffer. Setting this value resets the cursor. Method Descriptions ------------------- ### void clear ( ) Clears the [data\_array](#class-streampeerbuffer-property-data-array) and resets the cursor. ### [StreamPeerBuffer](#class-streampeerbuffer) duplicate ( ) const Returns a new `StreamPeerBuffer` with the same [data\_array](#class-streampeerbuffer-property-data-array) content. ### [int](class_int#class-int) get\_position ( ) const Returns the current cursor position. ### [int](class_int#class-int) get\_size ( ) const Returns the size of [data\_array](#class-streampeerbuffer-property-data-array). ### void resize ( [int](class_int#class-int) size ) Resizes the [data\_array](#class-streampeerbuffer-property-data-array). This *doesn't* update the cursor. ### void seek ( [int](class_int#class-int) position ) Moves the cursor to the specified position. `position` must be a valid index of [data\_array](#class-streampeerbuffer-property-data-array). godot WebXRInterface WebXRInterface ============== **Inherits:** [ARVRInterface](class_arvrinterface#class-arvrinterface) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) AR/VR interface using WebXR. Description ----------- WebXR is an open standard that allows creating VR and AR applications that run in the web browser. As such, this interface is only available when running in an HTML5 export. WebXR supports a wide range of devices, from the very capable (like Valve Index, HTC Vive, Oculus Rift and Quest) down to the much less capable (like Google Cardboard, Oculus Go, GearVR, or plain smartphones). Since WebXR is based on Javascript, it makes extensive use of callbacks, which means that `WebXRInterface` is forced to use signals, where other AR/VR interfaces would instead use functions that return a result immediately. This makes `WebXRInterface` quite a bit more complicated to initialize than other AR/VR interfaces. Here's the minimum code required to start an immersive VR session: ``` extends Spatial var webxr_interface var vr_supported = false func _ready(): # We assume this node has a button as a child. # This button is for the user to consent to entering immersive VR mode. $Button.connect("pressed", self, "_on_Button_pressed") webxr_interface = ARVRServer.find_interface("WebXR") if webxr_interface: # Map to the standard button/axis ids when possible. webxr_interface.xr_standard_mapping = true # WebXR uses a lot of asynchronous callbacks, so we connect to various # signals in order to receive them. webxr_interface.connect("session_supported", self, "_webxr_session_supported") webxr_interface.connect("session_started", self, "_webxr_session_started") webxr_interface.connect("session_ended", self, "_webxr_session_ended") webxr_interface.connect("session_failed", self, "_webxr_session_failed") # This returns immediately - our _webxr_session_supported() method # (which we connected to the "session_supported" signal above) will # be called sometime later to let us know if it's supported or not. webxr_interface.is_session_supported("immersive-vr") func _webxr_session_supported(session_mode, supported): if session_mode == 'immersive-vr': vr_supported = supported func _on_Button_pressed(): if not vr_supported: OS.alert("Your browser doesn't support VR") return # We want an immersive VR session, as opposed to AR ('immersive-ar') or a # simple 3DoF viewer ('viewer'). webxr_interface.session_mode = 'immersive-vr' # 'bounded-floor' is room scale, 'local-floor' is a standing or sitting # experience (it puts you 1.6m above the ground if you have 3DoF headset), # whereas as 'local' puts you down at the ARVROrigin. # This list means it'll first try to request 'bounded-floor', then # fallback on 'local-floor' and ultimately 'local', if nothing else is # supported. webxr_interface.requested_reference_space_types = 'bounded-floor, local-floor, local' # In order to use 'local-floor' or 'bounded-floor' we must also # mark the features as required or optional. webxr_interface.required_features = 'local-floor' webxr_interface.optional_features = 'bounded-floor' # This will return false if we're unable to even request the session, # however, it can still fail asynchronously later in the process, so we # only know if it's really succeeded or failed when our # _webxr_session_started() or _webxr_session_failed() methods are called. if not webxr_interface.initialize(): OS.alert("Failed to initialize") return func _webxr_session_started(): $Button.visible = false # This tells Godot to start rendering to the headset. get_viewport().arvr = true # This will be the reference space type you ultimately got, out of the # types that you requested above. This is useful if you want the game to # work a little differently in 'bounded-floor' versus 'local-floor'. print ("Reference space type: " + webxr_interface.reference_space_type) func _webxr_session_ended(): $Button.visible = true # If the user exits immersive mode, then we tell Godot to render to the web # page again. get_viewport().arvr = false func _webxr_session_failed(message): OS.alert("Failed to initialize: " + message) ``` There are several ways to handle "controller" input: * Using [ARVRController](class_arvrcontroller#class-arvrcontroller) nodes and their [ARVRController.button\_pressed](class_arvrcontroller#class-arvrcontroller-signal-button-pressed) and [ARVRController.button\_release](class_arvrcontroller#class-arvrcontroller-signal-button-release) signals. This is how controllers are typically handled in AR/VR apps in Godot, however, this will only work with advanced VR controllers like the Oculus Touch or Index controllers, for example. The buttons codes are defined by [Section 3.3 of the WebXR Gamepads Module](https://immersive-web.github.io/webxr-gamepads-module/#xr-standard-gamepad-mapping). * Using [Node.\_unhandled\_input](class_node#class-node-method-unhandled-input) and [InputEventJoypadButton](class_inputeventjoypadbutton#class-inputeventjoypadbutton) or [InputEventJoypadMotion](class_inputeventjoypadmotion#class-inputeventjoypadmotion). This works the same as normal joypads, except the [InputEvent.device](class_inputevent#class-inputevent-property-device) starts at 100, so the left controller is 100 and the right controller is 101, and the button codes are also defined by [Section 3.3 of the WebXR Gamepads Module](https://immersive-web.github.io/webxr-gamepads-module/#xr-standard-gamepad-mapping). * Using the [select](#class-webxrinterface-signal-select), [squeeze](#class-webxrinterface-signal-squeeze) and related signals. This method will work for both advanced VR controllers, and non-traditional "controllers" like a tap on the screen, a spoken voice command or a button press on the device itself. The `controller_id` passed to these signals is the same id as used in [ARVRController.controller\_id](class_arvrcontroller#class-arvrcontroller-property-controller-id). You can use one or all of these methods to allow your game or app to support a wider or narrower set of devices and input methods, or to allow more advanced interactions with more advanced devices. Tutorials --------- * [How to make a VR game for WebXR with Godot](https://www.snopekgames.com/blog/2020/how-make-vr-game-webxr-godot) Properties ---------- | | | | --- | --- | | [PoolVector3Array](class_poolvector3array#class-poolvector3array) | [bounds\_geometry](#class-webxrinterface-property-bounds-geometry) | | [String](class_string#class-string) | [optional\_features](#class-webxrinterface-property-optional-features) | | [String](class_string#class-string) | [reference\_space\_type](#class-webxrinterface-property-reference-space-type) | | [String](class_string#class-string) | [requested\_reference\_space\_types](#class-webxrinterface-property-requested-reference-space-types) | | [String](class_string#class-string) | [required\_features](#class-webxrinterface-property-required-features) | | [String](class_string#class-string) | [session\_mode](#class-webxrinterface-property-session-mode) | | [String](class_string#class-string) | [visibility\_state](#class-webxrinterface-property-visibility-state) | | [bool](class_bool#class-bool) | [xr\_standard\_mapping](#class-webxrinterface-property-xr-standard-mapping) | Methods ------- | | | | --- | --- | | [ARVRPositionalTracker](class_arvrpositionaltracker#class-arvrpositionaltracker) | [get\_controller](#class-webxrinterface-method-get-controller) **(** [int](class_int#class-int) controller\_id **)** const | | [TargetRayMode](#enum-webxrinterface-targetraymode) | [get\_controller\_target\_ray\_mode](#class-webxrinterface-method-get-controller-target-ray-mode) **(** [int](class_int#class-int) controller\_id **)** const | | void | [is\_session\_supported](#class-webxrinterface-method-is-session-supported) **(** [String](class_string#class-string) session\_mode **)** | Signals ------- ### reference\_space\_reset ( ) Emitted to indicate that the reference space has been reset or reconfigured. When (or whether) this is emitted depends on the user's browser or device, but may include when the user has changed the dimensions of their play space (which you may be able to access via [bounds\_geometry](#class-webxrinterface-property-bounds-geometry)) or pressed/held a button to recenter their position. See [WebXR's XRReferenceSpace reset event](https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpace/reset_event) for more information. ### select ( [int](class_int#class-int) controller\_id ) Emitted after one of the "controllers" has finished its "primary action". Use [get\_controller](#class-webxrinterface-method-get-controller) to get more information about the controller. ### selectend ( [int](class_int#class-int) controller\_id ) Emitted when one of the "controllers" has finished its "primary action". Use [get\_controller](#class-webxrinterface-method-get-controller) to get more information about the controller. ### selectstart ( [int](class_int#class-int) controller\_id ) Emitted when one of the "controllers" has started its "primary action". Use [get\_controller](#class-webxrinterface-method-get-controller) to get more information about the controller. ### session\_ended ( ) Emitted when the user ends the WebXR session (which can be done using UI from the browser or device). At this point, you should do `get_viewport().arvr = false` to instruct Godot to resume rendering to the screen. ### session\_failed ( [String](class_string#class-string) message ) Emitted by [ARVRInterface.initialize](class_arvrinterface#class-arvrinterface-method-initialize) if the session fails to start. `message` may optionally contain an error message from WebXR, or an empty string if no message is available. ### session\_started ( ) Emitted by [ARVRInterface.initialize](class_arvrinterface#class-arvrinterface-method-initialize) if the session is successfully started. At this point, it's safe to do `get_viewport().arvr = true` to instruct Godot to start rendering to the AR/VR device. ### session\_supported ( [String](class_string#class-string) session\_mode, [bool](class_bool#class-bool) supported ) Emitted by [is\_session\_supported](#class-webxrinterface-method-is-session-supported) to indicate if the given `session_mode` is supported or not. ### squeeze ( [int](class_int#class-int) controller\_id ) Emitted after one of the "controllers" has finished its "primary squeeze action". Use [get\_controller](#class-webxrinterface-method-get-controller) to get more information about the controller. ### squeezeend ( [int](class_int#class-int) controller\_id ) Emitted when one of the "controllers" has finished its "primary squeeze action". Use [get\_controller](#class-webxrinterface-method-get-controller) to get more information about the controller. ### squeezestart ( [int](class_int#class-int) controller\_id ) Emitted when one of the "controllers" has started its "primary squeeze action". Use [get\_controller](#class-webxrinterface-method-get-controller) to get more information about the controller. ### visibility\_state\_changed ( ) Emitted when [visibility\_state](#class-webxrinterface-property-visibility-state) has changed. Enumerations ------------ enum **TargetRayMode**: * **TARGET\_RAY\_MODE\_UNKNOWN** = **0** --- We don't know the target ray mode. * **TARGET\_RAY\_MODE\_GAZE** = **1** --- Target ray originates at the viewer's eyes and points in the direction they are looking. * **TARGET\_RAY\_MODE\_TRACKED\_POINTER** = **2** --- Target ray from a handheld pointer, most likely a VR touch controller. * **TARGET\_RAY\_MODE\_SCREEN** = **3** --- Target ray from touch screen, mouse or other tactile input device. Property Descriptions --------------------- ### [PoolVector3Array](class_poolvector3array#class-poolvector3array) bounds\_geometry | | | | --- | --- | | *Getter* | get\_bounds\_geometry() | The vertices of a polygon which defines the boundaries of the user's play area. This will only be available if [reference\_space\_type](#class-webxrinterface-property-reference-space-type) is `"bounded-floor"` and only on certain browsers and devices that support it. The [reference\_space\_reset](#class-webxrinterface-signal-reference-space-reset) signal may indicate when this changes. ### [String](class_string#class-string) optional\_features | | | | --- | --- | | *Setter* | set\_optional\_features(value) | | *Getter* | get\_optional\_features() | A comma-seperated list of optional features used by [ARVRInterface.initialize](class_arvrinterface#class-arvrinterface-method-initialize) when setting up the WebXR session. If a user's browser or device doesn't support one of the given features, initialization will continue, but you won't be able to use the requested feature. This doesn't have any effect on the interface when already initialized. Possible values come from [WebXR's XRReferenceSpaceType](https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpaceType). If you want to use a particular reference space type, it must be listed in either [required\_features](#class-webxrinterface-property-required-features) or [optional\_features](#class-webxrinterface-property-optional-features). ### [String](class_string#class-string) reference\_space\_type | | | | --- | --- | | *Getter* | get\_reference\_space\_type() | The reference space type (from the list of requested types set in the [requested\_reference\_space\_types](#class-webxrinterface-property-requested-reference-space-types) property), that was ultimately used by [ARVRInterface.initialize](class_arvrinterface#class-arvrinterface-method-initialize) when setting up the WebXR session. Possible values come from [WebXR's XRReferenceSpaceType](https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpaceType). If you want to use a particular reference space type, it must be listed in either [required\_features](#class-webxrinterface-property-required-features) or [optional\_features](#class-webxrinterface-property-optional-features). ### [String](class_string#class-string) requested\_reference\_space\_types | | | | --- | --- | | *Setter* | set\_requested\_reference\_space\_types(value) | | *Getter* | get\_requested\_reference\_space\_types() | A comma-seperated list of reference space types used by [ARVRInterface.initialize](class_arvrinterface#class-arvrinterface-method-initialize) when setting up the WebXR session. The reference space types are requested in order, and the first on supported by the users device or browser will be used. The [reference\_space\_type](#class-webxrinterface-property-reference-space-type) property contains the reference space type that was ultimately used. This doesn't have any effect on the interface when already initialized. Possible values come from [WebXR's XRReferenceSpaceType](https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpaceType). If you want to use a particular reference space type, it must be listed in either [required\_features](#class-webxrinterface-property-required-features) or [optional\_features](#class-webxrinterface-property-optional-features). ### [String](class_string#class-string) required\_features | | | | --- | --- | | *Setter* | set\_required\_features(value) | | *Getter* | get\_required\_features() | A comma-seperated list of required features used by [ARVRInterface.initialize](class_arvrinterface#class-arvrinterface-method-initialize) when setting up the WebXR session. If a user's browser or device doesn't support one of the given features, initialization will fail and [session\_failed](#class-webxrinterface-signal-session-failed) will be emitted. This doesn't have any effect on the interface when already initialized. Possible values come from [WebXR's XRReferenceSpaceType](https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpaceType). If you want to use a particular reference space type, it must be listed in either [required\_features](#class-webxrinterface-property-required-features) or [optional\_features](#class-webxrinterface-property-optional-features). ### [String](class_string#class-string) session\_mode | | | | --- | --- | | *Setter* | set\_session\_mode(value) | | *Getter* | get\_session\_mode() | The session mode used by [ARVRInterface.initialize](class_arvrinterface#class-arvrinterface-method-initialize) when setting up the WebXR session. This doesn't have any effect on the interface when already initialized. Possible values come from [WebXR's XRSessionMode](https://developer.mozilla.org/en-US/docs/Web/API/XRSessionMode), including: `"immersive-vr"`, `"immersive-ar"`, and `"inline"`. ### [String](class_string#class-string) visibility\_state | | | | --- | --- | | *Getter* | get\_visibility\_state() | Indicates if the WebXR session's imagery is visible to the user. Possible values come from [WebXR's XRVisibilityState](https://developer.mozilla.org/en-US/docs/Web/API/XRVisibilityState), including `"hidden"`, `"visible"`, and `"visible-blurred"`. ### [bool](class_bool#class-bool) xr\_standard\_mapping | | | | --- | --- | | *Setter* | set\_xr\_standard\_mapping(value) | | *Getter* | get\_xr\_standard\_mapping() | If set to true, the button and axes ids will be converted to match the standard ids used by other AR/VR interfaces, when possible. Otherwise, the ids will be passed through unaltered from WebXR. Method Descriptions ------------------- ### [ARVRPositionalTracker](class_arvrpositionaltracker#class-arvrpositionaltracker) get\_controller ( [int](class_int#class-int) controller\_id ) const Gets an [ARVRPositionalTracker](class_arvrpositionaltracker#class-arvrpositionaltracker) for the given `controller_id`. In the context of WebXR, a "controller" can be an advanced VR controller like the Oculus Touch or Index controllers, or even a tap on the screen, a spoken voice command or a button press on the device itself. When a non-traditional controller is used, interpret the position and orientation of the [ARVRPositionalTracker](class_arvrpositionaltracker#class-arvrpositionaltracker) as a ray pointing at the object the user wishes to interact with. Use this method to get information about the controller that triggered one of these signals: * [selectstart](#class-webxrinterface-signal-selectstart) * [select](#class-webxrinterface-signal-select) * [selectend](#class-webxrinterface-signal-selectend) * [squeezestart](#class-webxrinterface-signal-squeezestart) * [squeeze](#class-webxrinterface-signal-squeeze) * [squeezestart](#class-webxrinterface-signal-squeezestart) ### [TargetRayMode](#enum-webxrinterface-targetraymode) get\_controller\_target\_ray\_mode ( [int](class_int#class-int) controller\_id ) const Returns the target ray mode for the given `controller_id`. This can help interpret the input coming from that controller. See [XRInputSource.targetRayMode](https://developer.mozilla.org/en-US/docs/Web/API/XRInputSource/targetRayMode) for more information. ### void is\_session\_supported ( [String](class_string#class-string) session\_mode ) Checks if the given `session_mode` is supported by the user's browser. Possible values come from [WebXR's XRSessionMode](https://developer.mozilla.org/en-US/docs/Web/API/XRSessionMode), including: `"immersive-vr"`, `"immersive-ar"`, and `"inline"`. This method returns nothing, instead it emits the [session\_supported](#class-webxrinterface-signal-session-supported) signal with the result.
programming_docs
godot StyleBox StyleBox ======== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [StyleBoxEmpty](class_styleboxempty#class-styleboxempty), [StyleBoxFlat](class_styleboxflat#class-styleboxflat), [StyleBoxLine](class_styleboxline#class-styleboxline), [StyleBoxTexture](class_styleboxtexture#class-styleboxtexture) Base class for drawing stylized boxes for the UI. Description ----------- StyleBox is [Resource](class_resource#class-resource) that provides an abstract base class for drawing stylized boxes for the UI. StyleBoxes are used for drawing the styles of buttons, line edit backgrounds, tree backgrounds, etc. and also for testing a transparency mask for pointer signals. If mask test fails on a StyleBox assigned as mask to a control, clicks and motion signals will go through it to the one below. **Note:** For children of [Control](class_control#class-control) that have *Theme Properties*, the `focus` `StyleBox` is displayed over the `normal`, `hover` or `pressed` `StyleBox`. This makes the `focus` `StyleBox` more reusable across different nodes. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [content\_margin\_bottom](#class-stylebox-property-content-margin-bottom) | `-1.0` | | [float](class_float#class-float) | [content\_margin\_left](#class-stylebox-property-content-margin-left) | `-1.0` | | [float](class_float#class-float) | [content\_margin\_right](#class-stylebox-property-content-margin-right) | `-1.0` | | [float](class_float#class-float) | [content\_margin\_top](#class-stylebox-property-content-margin-top) | `-1.0` | Methods ------- | | | | --- | --- | | void | [draw](#class-stylebox-method-draw) **(** [RID](class_rid#class-rid) canvas\_item, [Rect2](class_rect2#class-rect2) rect **)** const | | [Vector2](class_vector2#class-vector2) | [get\_center\_size](#class-stylebox-method-get-center-size) **(** **)** const | | [CanvasItem](class_canvasitem#class-canvasitem) | [get\_current\_item\_drawn](#class-stylebox-method-get-current-item-drawn) **(** **)** const | | [float](class_float#class-float) | [get\_default\_margin](#class-stylebox-method-get-default-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin **)** const | | [float](class_float#class-float) | [get\_margin](#class-stylebox-method-get-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin **)** const | | [Vector2](class_vector2#class-vector2) | [get\_minimum\_size](#class-stylebox-method-get-minimum-size) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_offset](#class-stylebox-method-get-offset) **(** **)** const | | void | [set\_default\_margin](#class-stylebox-method-set-default-margin) **(** [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) offset **)** | | [bool](class_bool#class-bool) | [test\_mask](#class-stylebox-method-test-mask) **(** [Vector2](class_vector2#class-vector2) point, [Rect2](class_rect2#class-rect2) rect **)** const | Property Descriptions --------------------- ### [float](class_float#class-float) content\_margin\_bottom | | | | --- | --- | | *Default* | `-1.0` | | *Setter* | set\_default\_margin(value) | | *Getter* | get\_default\_margin() | The bottom margin for the contents of this style box. Increasing this value reduces the space available to the contents from the bottom. If this value is negative, it is ignored and a child-specific margin is used instead. For example for [StyleBoxFlat](class_styleboxflat#class-styleboxflat) the border thickness (if any) is used instead. It is up to the code using this style box to decide what these contents are: for example, a [Button](class_button#class-button) respects this content margin for the textual contents of the button. [get\_margin](#class-stylebox-method-get-margin) should be used to fetch this value as consumer instead of reading these properties directly. This is because it correctly respects negative values and the fallback mentioned above. ### [float](class_float#class-float) content\_margin\_left | | | | --- | --- | | *Default* | `-1.0` | | *Setter* | set\_default\_margin(value) | | *Getter* | get\_default\_margin() | The left margin for the contents of this style box. Increasing this value reduces the space available to the contents from the left. Refer to [content\_margin\_bottom](#class-stylebox-property-content-margin-bottom) for extra considerations. ### [float](class_float#class-float) content\_margin\_right | | | | --- | --- | | *Default* | `-1.0` | | *Setter* | set\_default\_margin(value) | | *Getter* | get\_default\_margin() | The right margin for the contents of this style box. Increasing this value reduces the space available to the contents from the right. Refer to [content\_margin\_bottom](#class-stylebox-property-content-margin-bottom) for extra considerations. ### [float](class_float#class-float) content\_margin\_top | | | | --- | --- | | *Default* | `-1.0` | | *Setter* | set\_default\_margin(value) | | *Getter* | get\_default\_margin() | The top margin for the contents of this style box. Increasing this value reduces the space available to the contents from the top. Refer to [content\_margin\_bottom](#class-stylebox-property-content-margin-bottom) for extra considerations. Method Descriptions ------------------- ### void draw ( [RID](class_rid#class-rid) canvas\_item, [Rect2](class_rect2#class-rect2) rect ) const Draws this stylebox using a canvas item identified by the given [RID](class_rid#class-rid). The [RID](class_rid#class-rid) value can either be the result of [CanvasItem.get\_canvas\_item](class_canvasitem#class-canvasitem-method-get-canvas-item) called on an existing [CanvasItem](class_canvasitem#class-canvasitem)-derived node, or directly from creating a canvas item in the [VisualServer](class_visualserver#class-visualserver) with [VisualServer.canvas\_item\_create](class_visualserver#class-visualserver-method-canvas-item-create). ### [Vector2](class_vector2#class-vector2) get\_center\_size ( ) const Returns the size of this `StyleBox` without the margins. ### [CanvasItem](class_canvasitem#class-canvasitem) get\_current\_item\_drawn ( ) const Returns the [CanvasItem](class_canvasitem#class-canvasitem) that handles its [CanvasItem.NOTIFICATION\_DRAW](class_canvasitem#class-canvasitem-constant-notification-draw) or [CanvasItem.\_draw](class_canvasitem#class-canvasitem-method-draw) callback at this moment. ### [float](class_float#class-float) get\_default\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin ) const Returns the default value of the specified [Margin](class_%40globalscope#enum-globalscope-margin). ### [float](class_float#class-float) get\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin ) const Returns the content margin offset for the specified [Margin](class_%40globalscope#enum-globalscope-margin). Positive values reduce size inwards, unlike [Control](class_control#class-control)'s margin values. ### [Vector2](class_vector2#class-vector2) get\_minimum\_size ( ) const Returns the minimum size that this stylebox can be shrunk to. ### [Vector2](class_vector2#class-vector2) get\_offset ( ) const Returns the "offset" of a stylebox. This helper function returns a value equivalent to `Vector2(style.get_margin(MARGIN_LEFT), style.get_margin(MARGIN_TOP))`. ### void set\_default\_margin ( [Margin](class_%40globalscope#enum-globalscope-margin) margin, [float](class_float#class-float) offset ) Sets the default value of the specified [Margin](class_%40globalscope#enum-globalscope-margin) to given `offset` in pixels. ### [bool](class_bool#class-bool) test\_mask ( [Vector2](class_vector2#class-vector2) point, [Rect2](class_rect2#class-rect2) rect ) const Test a position in a rectangle, return whether it passes the mask test. godot Font Font ==== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) **Inherited By:** [BitmapFont](class_bitmapfont#class-bitmapfont), [DynamicFont](class_dynamicfont#class-dynamicfont) Internationalized font and text drawing support. Description ----------- Font contains a Unicode-compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts. **Note:** If a [DynamicFont](class_dynamicfont#class-dynamicfont) doesn't contain a character used in a string, the character in question will be replaced with codepoint `0xfffd` if it's available in the [DynamicFont](class_dynamicfont#class-dynamicfont). If this replacement character isn't available in the DynamicFont, the character will be hidden without displaying any replacement character in the string. **Note:** If a [BitmapFont](class_bitmapfont#class-bitmapfont) doesn't contain a character used in a string, the character in question will be hidden without displaying any replacement character in the string. **Note:** Unicode characters after `0xffff` (such as most emoji) are *not* supported on Windows. They will display as unknown characters instead. This will be resolved in Godot 4.0. Methods ------- | | | | --- | --- | | void | [draw](#class-font-method-draw) **(** [RID](class_rid#class-rid) canvas\_item, [Vector2](class_vector2#class-vector2) position, [String](class_string#class-string) string, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ), [int](class_int#class-int) clip\_w=-1, [Color](class_color#class-color) outline\_modulate=Color( 1, 1, 1, 1 ) **)** const | | [float](class_float#class-float) | [draw\_char](#class-font-method-draw-char) **(** [RID](class_rid#class-rid) canvas\_item, [Vector2](class_vector2#class-vector2) position, [int](class_int#class-int) char, [int](class_int#class-int) next=-1, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ), [bool](class_bool#class-bool) outline=false **)** const | | [float](class_float#class-float) | [get\_ascent](#class-font-method-get-ascent) **(** **)** const | | [Dictionary](class_dictionary#class-dictionary) | [get\_char\_contours](#class-font-method-get-char-contours) **(** [int](class_int#class-int) char, [int](class_int#class-int) next=0 **)** const | | [Vector2](class_vector2#class-vector2) | [get\_char\_size](#class-font-method-get-char-size) **(** [int](class_int#class-int) char, [int](class_int#class-int) next=0 **)** const | | [RID](class_rid#class-rid) | [get\_char\_texture](#class-font-method-get-char-texture) **(** [int](class_int#class-int) char, [int](class_int#class-int) next=0, [bool](class_bool#class-bool) outline=false **)** const | | [Vector2](class_vector2#class-vector2) | [get\_char\_texture\_size](#class-font-method-get-char-texture-size) **(** [int](class_int#class-int) char, [int](class_int#class-int) next=0, [bool](class_bool#class-bool) outline=false **)** const | | [Vector2](class_vector2#class-vector2) | [get\_char\_tx\_offset](#class-font-method-get-char-tx-offset) **(** [int](class_int#class-int) char, [int](class_int#class-int) next=0, [bool](class_bool#class-bool) outline=false **)** const | | [Vector2](class_vector2#class-vector2) | [get\_char\_tx\_size](#class-font-method-get-char-tx-size) **(** [int](class_int#class-int) char, [int](class_int#class-int) next=0, [bool](class_bool#class-bool) outline=false **)** const | | [Rect2](class_rect2#class-rect2) | [get\_char\_tx\_uv\_rect](#class-font-method-get-char-tx-uv-rect) **(** [int](class_int#class-int) char, [int](class_int#class-int) next=0, [bool](class_bool#class-bool) outline=false **)** const | | [float](class_float#class-float) | [get\_descent](#class-font-method-get-descent) **(** **)** const | | [float](class_float#class-float) | [get\_height](#class-font-method-get-height) **(** **)** const | | [Vector2](class_vector2#class-vector2) | [get\_string\_size](#class-font-method-get-string-size) **(** [String](class_string#class-string) string **)** const | | [Vector2](class_vector2#class-vector2) | [get\_wordwrap\_string\_size](#class-font-method-get-wordwrap-string-size) **(** [String](class_string#class-string) string, [float](class_float#class-float) width **)** const | | [bool](class_bool#class-bool) | [has\_outline](#class-font-method-has-outline) **(** **)** const | | [bool](class_bool#class-bool) | [is\_distance\_field\_hint](#class-font-method-is-distance-field-hint) **(** **)** const | | void | [update\_changes](#class-font-method-update-changes) **(** **)** | Enumerations ------------ enum **ContourPointTag**: * **CONTOUR\_CURVE\_TAG\_ON** = **1** --- Contour point is on the curve. * **CONTOUR\_CURVE\_TAG\_OFF\_CONIC** = **0** --- Contour point isn't on the curve, but serves as a control point for a conic (quadratic) Bézier arc. * **CONTOUR\_CURVE\_TAG\_OFF\_CUBIC** = **2** --- Contour point isn't on the curve, but serves as a control point for a cubic Bézier arc. Method Descriptions ------------------- ### void draw ( [RID](class_rid#class-rid) canvas\_item, [Vector2](class_vector2#class-vector2) position, [String](class_string#class-string) string, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ), [int](class_int#class-int) clip\_w=-1, [Color](class_color#class-color) outline\_modulate=Color( 1, 1, 1, 1 ) ) const Draw `string` into a canvas item using the font at a given position, with `modulate` color, and optionally clipping the width. `position` specifies the baseline, not the top. To draw from the top, *ascent* must be added to the Y axis. See also [CanvasItem.draw\_string](class_canvasitem#class-canvasitem-method-draw-string). ### [float](class_float#class-float) draw\_char ( [RID](class_rid#class-rid) canvas\_item, [Vector2](class_vector2#class-vector2) position, [int](class_int#class-int) char, [int](class_int#class-int) next=-1, [Color](class_color#class-color) modulate=Color( 1, 1, 1, 1 ), [bool](class_bool#class-bool) outline=false ) const Draw character `char` into a canvas item using the font at a given position, with `modulate` color, and optionally kerning if `next` is passed. clipping the width. `position` specifies the baseline, not the top. To draw from the top, *ascent* must be added to the Y axis. The width used by the character is returned, making this function useful for drawing strings character by character. If `outline` is `true`, the outline of the character is drawn instead of the character itself. ### [float](class_float#class-float) get\_ascent ( ) const Returns the font ascent (number of pixels above the baseline). ### [Dictionary](class_dictionary#class-dictionary) get\_char\_contours ( [int](class_int#class-int) char, [int](class_int#class-int) next=0 ) const Returns outline contours of the glyph as a `Dictionary` with the following contents: `points` - [PoolVector3Array](class_poolvector3array#class-poolvector3array), containing outline points. `x` and `y` are point coordinates. `z` is the type of the point, using the [ContourPointTag](#enum-font-contourpointtag) values. `contours` - [PoolIntArray](class_poolintarray#class-poolintarray), containing indices the end points of each contour. `orientation` - [bool](class_bool#class-bool), contour orientation. If `true`, clockwise contours must be filled. ### [Vector2](class_vector2#class-vector2) get\_char\_size ( [int](class_int#class-int) char, [int](class_int#class-int) next=0 ) const Returns the size of a character, optionally taking kerning into account if the next character is provided. Note that the height returned is the font height (see [get\_height](#class-font-method-get-height)) and has no relation to the glyph height. ### [RID](class_rid#class-rid) get\_char\_texture ( [int](class_int#class-int) char, [int](class_int#class-int) next=0, [bool](class_bool#class-bool) outline=false ) const Returns resource id of the cache texture containing the char. ### [Vector2](class_vector2#class-vector2) get\_char\_texture\_size ( [int](class_int#class-int) char, [int](class_int#class-int) next=0, [bool](class_bool#class-bool) outline=false ) const Returns size of the cache texture containing the char. ### [Vector2](class_vector2#class-vector2) get\_char\_tx\_offset ( [int](class_int#class-int) char, [int](class_int#class-int) next=0, [bool](class_bool#class-bool) outline=false ) const Returns char offset from the baseline. ### [Vector2](class_vector2#class-vector2) get\_char\_tx\_size ( [int](class_int#class-int) char, [int](class_int#class-int) next=0, [bool](class_bool#class-bool) outline=false ) const Returns size of the char. ### [Rect2](class_rect2#class-rect2) get\_char\_tx\_uv\_rect ( [int](class_int#class-int) char, [int](class_int#class-int) next=0, [bool](class_bool#class-bool) outline=false ) const Returns rectangle in the cache texture containing the char. ### [float](class_float#class-float) get\_descent ( ) const Returns the font descent (number of pixels below the baseline). ### [float](class_float#class-float) get\_height ( ) const Returns the total font height (ascent plus descent) in pixels. ### [Vector2](class_vector2#class-vector2) get\_string\_size ( [String](class_string#class-string) string ) const Returns the size of a string, taking kerning and advance into account. Note that the height returned is the font height (see [get\_height](#class-font-method-get-height)) and has no relation to the string. ### [Vector2](class_vector2#class-vector2) get\_wordwrap\_string\_size ( [String](class_string#class-string) string, [float](class_float#class-float) width ) const Returns the size that the string would have with word wrapping enabled with a fixed `width`. ### [bool](class_bool#class-bool) has\_outline ( ) const Returns `true` if the font has an outline. ### [bool](class_bool#class-bool) is\_distance\_field\_hint ( ) const ### void update\_changes ( ) After editing a font (changing size, ascent, char rects, etc.). Call this function to propagate changes to controls that might use it. godot VisualShaderNodeVectorScalarMix VisualShaderNodeVectorScalarMix =============================== **Inherits:** [VisualShaderNode](class_visualshadernode#class-visualshadernode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Linearly interpolates between two vectors using a scalar. For use within the visual shader graph. Description ----------- Translates to `mix(a, b, weight)` in the shader language, where `a` and `b` are vectors and `weight` is a scalar. godot AudioStreamPlayer AudioStreamPlayer ================= **Inherits:** [Node](class_node#class-node) **<** [Object](class_object#class-object) Plays back audio non-positionally. Description ----------- Plays an audio stream non-positionally. To play audio positionally, use [AudioStreamPlayer2D](class_audiostreamplayer2d#class-audiostreamplayer2d) or [AudioStreamPlayer3D](class_audiostreamplayer3d#class-audiostreamplayer3d) instead of `AudioStreamPlayer`. Tutorials --------- * [Audio streams](https://docs.godotengine.org/en/3.5/tutorials/audio/audio_streams.html) * [2D Dodge The Creeps Demo](https://godotengine.org/asset-library/asset/515) * [Audio Device Changer Demo](https://godotengine.org/asset-library/asset/525) * [Audio Generator Demo](https://godotengine.org/asset-library/asset/526) * [Audio Mic Record Demo](https://godotengine.org/asset-library/asset/527) * [Audio Spectrum Demo](https://godotengine.org/asset-library/asset/528) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [autoplay](#class-audiostreamplayer-property-autoplay) | `false` | | [String](class_string#class-string) | [bus](#class-audiostreamplayer-property-bus) | `"Master"` | | [MixTarget](#enum-audiostreamplayer-mixtarget) | [mix\_target](#class-audiostreamplayer-property-mix-target) | `0` | | [float](class_float#class-float) | [pitch\_scale](#class-audiostreamplayer-property-pitch-scale) | `1.0` | | [bool](class_bool#class-bool) | [playing](#class-audiostreamplayer-property-playing) | `false` | | [AudioStream](class_audiostream#class-audiostream) | [stream](#class-audiostreamplayer-property-stream) | | | [bool](class_bool#class-bool) | [stream\_paused](#class-audiostreamplayer-property-stream-paused) | `false` | | [float](class_float#class-float) | [volume\_db](#class-audiostreamplayer-property-volume-db) | `0.0` | Methods ------- | | | | --- | --- | | [float](class_float#class-float) | [get\_playback\_position](#class-audiostreamplayer-method-get-playback-position) **(** **)** | | [AudioStreamPlayback](class_audiostreamplayback#class-audiostreamplayback) | [get\_stream\_playback](#class-audiostreamplayer-method-get-stream-playback) **(** **)** | | void | [play](#class-audiostreamplayer-method-play) **(** [float](class_float#class-float) from\_position=0.0 **)** | | void | [seek](#class-audiostreamplayer-method-seek) **(** [float](class_float#class-float) to\_position **)** | | void | [stop](#class-audiostreamplayer-method-stop) **(** **)** | Signals ------- ### finished ( ) Emitted when the audio stops playing. Enumerations ------------ enum **MixTarget**: * **MIX\_TARGET\_STEREO** = **0** --- The audio will be played only on the first channel. * **MIX\_TARGET\_SURROUND** = **1** --- The audio will be played on all surround channels. * **MIX\_TARGET\_CENTER** = **2** --- The audio will be played on the second channel, which is usually the center. Property Descriptions --------------------- ### [bool](class_bool#class-bool) autoplay | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_autoplay(value) | | *Getter* | is\_autoplay\_enabled() | If `true`, audio plays when added to scene tree. ### [String](class_string#class-string) bus | | | | --- | --- | | *Default* | `"Master"` | | *Setter* | set\_bus(value) | | *Getter* | get\_bus() | Bus on which this audio is playing. **Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to `"Master"`. ### [MixTarget](#enum-audiostreamplayer-mixtarget) mix\_target | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_mix\_target(value) | | *Getter* | get\_mix\_target() | If the audio configuration has more than two speakers, this sets the target channels. See [MixTarget](#enum-audiostreamplayer-mixtarget) constants. ### [float](class_float#class-float) pitch\_scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_pitch\_scale(value) | | *Getter* | get\_pitch\_scale() | The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. ### [bool](class_bool#class-bool) playing | | | | --- | --- | | *Default* | `false` | | *Getter* | is\_playing() | If `true`, audio is playing. ### [AudioStream](class_audiostream#class-audiostream) stream | | | | --- | --- | | *Setter* | set\_stream(value) | | *Getter* | get\_stream() | The [AudioStream](class_audiostream#class-audiostream) object to be played. ### [bool](class_bool#class-bool) stream\_paused | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_stream\_paused(value) | | *Getter* | get\_stream\_paused() | If `true`, the playback is paused. You can resume it by setting `stream_paused` to `false`. ### [float](class_float#class-float) volume\_db | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_volume\_db(value) | | *Getter* | get\_volume\_db() | Volume of sound, in dB. Method Descriptions ------------------- ### [float](class_float#class-float) get\_playback\_position ( ) Returns the position in the [AudioStream](class_audiostream#class-audiostream) in seconds. ### [AudioStreamPlayback](class_audiostreamplayback#class-audiostreamplayback) get\_stream\_playback ( ) Returns the [AudioStreamPlayback](class_audiostreamplayback#class-audiostreamplayback) object associated with this `AudioStreamPlayer`. ### void play ( [float](class_float#class-float) from\_position=0.0 ) Plays the audio from the given `from_position`, in seconds. ### void seek ( [float](class_float#class-float) to\_position ) Sets the position from which audio will be played, in seconds. ### void stop ( ) Stops the audio.
programming_docs
godot AnimationNodeBlend2 AnimationNodeBlend2 =================== **Inherits:** [AnimationNode](class_animationnode#class-animationnode) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Blends two animations linearly inside of an [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). Description ----------- A resource to add to an [AnimationNodeBlendTree](class_animationnodeblendtree#class-animationnodeblendtree). Blends two animations linearly based on an amount value in the `[0.0, 1.0]` range. Tutorials --------- * [AnimationTree](https://docs.godotengine.org/en/3.5/tutorials/animation/animation_tree.html) * [3D Platformer Demo](https://godotengine.org/asset-library/asset/125) * [Third Person Shooter Demo](https://godotengine.org/asset-library/asset/678) Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [sync](#class-animationnodeblend2-property-sync) | `false` | Property Descriptions --------------------- ### [bool](class_bool#class-bool) sync | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_use\_sync(value) | | *Getter* | is\_using\_sync() | If `true`, sets the `optimization` to `false` when calling [AnimationNode.blend\_input](class_animationnode#class-animationnode-method-blend-input), forcing the blended animations to update every frame. godot EditorResourceConversionPlugin EditorResourceConversionPlugin ============================== **Inherits:** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Methods ------- | | | | --- | --- | | [Resource](class_resource#class-resource) | [\_convert](#class-editorresourceconversionplugin-method-convert) **(** [Resource](class_resource#class-resource) resource **)** virtual | | [String](class_string#class-string) | [\_converts\_to](#class-editorresourceconversionplugin-method-converts-to) **(** **)** virtual | Method Descriptions ------------------- ### [Resource](class_resource#class-resource) \_convert ( [Resource](class_resource#class-resource) resource ) virtual ### [String](class_string#class-string) \_converts\_to ( ) virtual godot PhysicsMaterial PhysicsMaterial =============== **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) A material for physics properties. Description ----------- Provides a means of modifying the collision properties of a [PhysicsBody](class_physicsbody#class-physicsbody). Properties ---------- | | | | | --- | --- | --- | | [bool](class_bool#class-bool) | [absorbent](#class-physicsmaterial-property-absorbent) | `false` | | [float](class_float#class-float) | [bounce](#class-physicsmaterial-property-bounce) | `0.0` | | [float](class_float#class-float) | [friction](#class-physicsmaterial-property-friction) | `1.0` | | [bool](class_bool#class-bool) | [rough](#class-physicsmaterial-property-rough) | `false` | Property Descriptions --------------------- ### [bool](class_bool#class-bool) absorbent | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_absorbent(value) | | *Getter* | is\_absorbent() | If `true`, subtracts the bounciness from the colliding object's bounciness instead of adding it. ### [float](class_float#class-float) bounce | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_bounce(value) | | *Getter* | get\_bounce() | The body's bounciness. Values range from `0` (no bounce) to `1` (full bounciness). ### [float](class_float#class-float) friction | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_friction(value) | | *Getter* | get\_friction() | The body's friction. Values range from `0` (frictionless) to `1` (maximum friction). ### [bool](class_bool#class-bool) rough | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_rough(value) | | *Getter* | is\_rough() | If `true`, the physics engine will use the friction of the object marked as "rough" when two objects collide. If `false`, the physics engine will use the lowest friction of all colliding objects instead. If `true` for both colliding objects, the physics engine will use the highest friction. godot World2D World2D ======= **Inherits:** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Class that has everything pertaining to a 2D world. Description ----------- Class that has everything pertaining to a 2D world. A physics space, a visual scenario, a navigation map and a sound space. 2D nodes register their resources into the current 2D world. Tutorials --------- * [Ray-casting](https://docs.godotengine.org/en/3.5/tutorials/physics/ray-casting.html) Properties ---------- | | | | --- | --- | | [RID](class_rid#class-rid) | [canvas](#class-world2d-property-canvas) | | [Physics2DDirectSpaceState](class_physics2ddirectspacestate#class-physics2ddirectspacestate) | [direct\_space\_state](#class-world2d-property-direct-space-state) | | [RID](class_rid#class-rid) | [navigation\_map](#class-world2d-property-navigation-map) | | [RID](class_rid#class-rid) | [space](#class-world2d-property-space) | Property Descriptions --------------------- ### [RID](class_rid#class-rid) canvas | | | | --- | --- | | *Getter* | get\_canvas() | The [RID](class_rid#class-rid) of this world's canvas resource. Used by the [VisualServer](class_visualserver#class-visualserver) for 2D drawing. ### [Physics2DDirectSpaceState](class_physics2ddirectspacestate#class-physics2ddirectspacestate) direct\_space\_state | | | | --- | --- | | *Getter* | get\_direct\_space\_state() | Direct access to the world's physics 2D space state. Used for querying current and potential collisions. When using multi-threaded physics, access is limited to `_physics_process(delta)` in the main thread. ### [RID](class_rid#class-rid) navigation\_map | | | | --- | --- | | *Getter* | get\_navigation\_map() | The [RID](class_rid#class-rid) of this world's navigation map. Used by the [Navigation2DServer](class_navigation2dserver#class-navigation2dserver). ### [RID](class_rid#class-rid) space | | | | --- | --- | | *Getter* | get\_space() | The [RID](class_rid#class-rid) of this world's physics space resource. Used by the [Physics2DServer](class_physics2dserver#class-physics2dserver) for 2D physics, treating it as both a space and an area. godot ParticlesMaterial ParticlesMaterial ================= **Inherits:** [Material](class_material#class-material) **<** [Resource](class_resource#class-resource) **<** [Reference](class_reference#class-reference) **<** [Object](class_object#class-object) Particle properties for [Particles](class_particles#class-particles) and [Particles2D](class_particles2d#class-particles2d) nodes. Description ----------- ParticlesMaterial defines particle properties and behavior. It is used in the `process_material` of [Particles](class_particles#class-particles) and [Particles2D](class_particles2d#class-particles2d) emitter nodes. Some of this material's properties are applied to each particle when emitted, while others can have a [CurveTexture](class_curvetexture#class-curvetexture) applied to vary values over the lifetime of the particle. When a randomness ratio is applied to a property it is used to scale that property by a random amount. The random ratio is used to interpolate between `1.0` and a random number less than one, the result is multiplied by the property to obtain the randomized property. For example a random ratio of `0.4` would scale the original property between `0.4-1.0` of its original value. Properties ---------- | | | | | --- | --- | --- | | [float](class_float#class-float) | [angle](#class-particlesmaterial-property-angle) | `0.0` | | [Texture](class_texture#class-texture) | [angle\_curve](#class-particlesmaterial-property-angle-curve) | | | [float](class_float#class-float) | [angle\_random](#class-particlesmaterial-property-angle-random) | `0.0` | | [float](class_float#class-float) | [angular\_velocity](#class-particlesmaterial-property-angular-velocity) | `0.0` | | [Texture](class_texture#class-texture) | [angular\_velocity\_curve](#class-particlesmaterial-property-angular-velocity-curve) | | | [float](class_float#class-float) | [angular\_velocity\_random](#class-particlesmaterial-property-angular-velocity-random) | `0.0` | | [float](class_float#class-float) | [anim\_offset](#class-particlesmaterial-property-anim-offset) | `0.0` | | [Texture](class_texture#class-texture) | [anim\_offset\_curve](#class-particlesmaterial-property-anim-offset-curve) | | | [float](class_float#class-float) | [anim\_offset\_random](#class-particlesmaterial-property-anim-offset-random) | `0.0` | | [float](class_float#class-float) | [anim\_speed](#class-particlesmaterial-property-anim-speed) | `0.0` | | [Texture](class_texture#class-texture) | [anim\_speed\_curve](#class-particlesmaterial-property-anim-speed-curve) | | | [float](class_float#class-float) | [anim\_speed\_random](#class-particlesmaterial-property-anim-speed-random) | `0.0` | | [Color](class_color#class-color) | [color](#class-particlesmaterial-property-color) | `Color( 1, 1, 1, 1 )` | | [Texture](class_texture#class-texture) | [color\_initial\_ramp](#class-particlesmaterial-property-color-initial-ramp) | | | [Texture](class_texture#class-texture) | [color\_ramp](#class-particlesmaterial-property-color-ramp) | | | [float](class_float#class-float) | [damping](#class-particlesmaterial-property-damping) | `0.0` | | [Texture](class_texture#class-texture) | [damping\_curve](#class-particlesmaterial-property-damping-curve) | | | [float](class_float#class-float) | [damping\_random](#class-particlesmaterial-property-damping-random) | `0.0` | | [Vector3](class_vector3#class-vector3) | [direction](#class-particlesmaterial-property-direction) | `Vector3( 1, 0, 0 )` | | [Vector3](class_vector3#class-vector3) | [emission\_box\_extents](#class-particlesmaterial-property-emission-box-extents) | | | [Texture](class_texture#class-texture) | [emission\_color\_texture](#class-particlesmaterial-property-emission-color-texture) | | | [Texture](class_texture#class-texture) | [emission\_normal\_texture](#class-particlesmaterial-property-emission-normal-texture) | | | [int](class_int#class-int) | [emission\_point\_count](#class-particlesmaterial-property-emission-point-count) | | | [Texture](class_texture#class-texture) | [emission\_point\_texture](#class-particlesmaterial-property-emission-point-texture) | | | [Vector3](class_vector3#class-vector3) | [emission\_ring\_axis](#class-particlesmaterial-property-emission-ring-axis) | | | [float](class_float#class-float) | [emission\_ring\_height](#class-particlesmaterial-property-emission-ring-height) | | | [float](class_float#class-float) | [emission\_ring\_inner\_radius](#class-particlesmaterial-property-emission-ring-inner-radius) | | | [float](class_float#class-float) | [emission\_ring\_radius](#class-particlesmaterial-property-emission-ring-radius) | | | [EmissionShape](#enum-particlesmaterial-emissionshape) | [emission\_shape](#class-particlesmaterial-property-emission-shape) | `0` | | [float](class_float#class-float) | [emission\_sphere\_radius](#class-particlesmaterial-property-emission-sphere-radius) | | | [bool](class_bool#class-bool) | [flag\_align\_y](#class-particlesmaterial-property-flag-align-y) | `false` | | [bool](class_bool#class-bool) | [flag\_disable\_z](#class-particlesmaterial-property-flag-disable-z) | `false` | | [bool](class_bool#class-bool) | [flag\_rotate\_y](#class-particlesmaterial-property-flag-rotate-y) | `false` | | [float](class_float#class-float) | [flatness](#class-particlesmaterial-property-flatness) | `0.0` | | [Vector3](class_vector3#class-vector3) | [gravity](#class-particlesmaterial-property-gravity) | `Vector3( 0, -9.8, 0 )` | | [float](class_float#class-float) | [hue\_variation](#class-particlesmaterial-property-hue-variation) | `0.0` | | [Texture](class_texture#class-texture) | [hue\_variation\_curve](#class-particlesmaterial-property-hue-variation-curve) | | | [float](class_float#class-float) | [hue\_variation\_random](#class-particlesmaterial-property-hue-variation-random) | `0.0` | | [float](class_float#class-float) | [initial\_velocity](#class-particlesmaterial-property-initial-velocity) | `0.0` | | [float](class_float#class-float) | [initial\_velocity\_random](#class-particlesmaterial-property-initial-velocity-random) | `0.0` | | [float](class_float#class-float) | [lifetime\_randomness](#class-particlesmaterial-property-lifetime-randomness) | `0.0` | | [float](class_float#class-float) | [linear\_accel](#class-particlesmaterial-property-linear-accel) | `0.0` | | [Texture](class_texture#class-texture) | [linear\_accel\_curve](#class-particlesmaterial-property-linear-accel-curve) | | | [float](class_float#class-float) | [linear\_accel\_random](#class-particlesmaterial-property-linear-accel-random) | `0.0` | | [float](class_float#class-float) | [orbit\_velocity](#class-particlesmaterial-property-orbit-velocity) | | | [Texture](class_texture#class-texture) | [orbit\_velocity\_curve](#class-particlesmaterial-property-orbit-velocity-curve) | | | [float](class_float#class-float) | [orbit\_velocity\_random](#class-particlesmaterial-property-orbit-velocity-random) | | | [float](class_float#class-float) | [radial\_accel](#class-particlesmaterial-property-radial-accel) | `0.0` | | [Texture](class_texture#class-texture) | [radial\_accel\_curve](#class-particlesmaterial-property-radial-accel-curve) | | | [float](class_float#class-float) | [radial\_accel\_random](#class-particlesmaterial-property-radial-accel-random) | `0.0` | | [float](class_float#class-float) | [scale](#class-particlesmaterial-property-scale) | `1.0` | | [Texture](class_texture#class-texture) | [scale\_curve](#class-particlesmaterial-property-scale-curve) | | | [float](class_float#class-float) | [scale\_random](#class-particlesmaterial-property-scale-random) | `0.0` | | [float](class_float#class-float) | [spread](#class-particlesmaterial-property-spread) | `45.0` | | [float](class_float#class-float) | [tangential\_accel](#class-particlesmaterial-property-tangential-accel) | `0.0` | | [Texture](class_texture#class-texture) | [tangential\_accel\_curve](#class-particlesmaterial-property-tangential-accel-curve) | | | [float](class_float#class-float) | [tangential\_accel\_random](#class-particlesmaterial-property-tangential-accel-random) | `0.0` | | [GradientTexture](class_gradienttexture#class-gradienttexture) | [trail\_color\_modifier](#class-particlesmaterial-property-trail-color-modifier) | | | [int](class_int#class-int) | [trail\_divisor](#class-particlesmaterial-property-trail-divisor) | `1` | | [CurveTexture](class_curvetexture#class-curvetexture) | [trail\_size\_modifier](#class-particlesmaterial-property-trail-size-modifier) | | Methods ------- | | | | --- | --- | | [bool](class_bool#class-bool) | [get\_flag](#class-particlesmaterial-method-get-flag) **(** [Flags](#enum-particlesmaterial-flags) flag **)** const | | [float](class_float#class-float) | [get\_param](#class-particlesmaterial-method-get-param) **(** [Parameter](#enum-particlesmaterial-parameter) param **)** const | | [float](class_float#class-float) | [get\_param\_randomness](#class-particlesmaterial-method-get-param-randomness) **(** [Parameter](#enum-particlesmaterial-parameter) param **)** const | | [Texture](class_texture#class-texture) | [get\_param\_texture](#class-particlesmaterial-method-get-param-texture) **(** [Parameter](#enum-particlesmaterial-parameter) param **)** const | | void | [set\_flag](#class-particlesmaterial-method-set-flag) **(** [Flags](#enum-particlesmaterial-flags) flag, [bool](class_bool#class-bool) enable **)** | | void | [set\_param](#class-particlesmaterial-method-set-param) **(** [Parameter](#enum-particlesmaterial-parameter) param, [float](class_float#class-float) value **)** | | void | [set\_param\_randomness](#class-particlesmaterial-method-set-param-randomness) **(** [Parameter](#enum-particlesmaterial-parameter) param, [float](class_float#class-float) randomness **)** | | void | [set\_param\_texture](#class-particlesmaterial-method-set-param-texture) **(** [Parameter](#enum-particlesmaterial-parameter) param, [Texture](class_texture#class-texture) texture **)** | Enumerations ------------ enum **Parameter**: * **PARAM\_INITIAL\_LINEAR\_VELOCITY** = **0** --- Use with [set\_param](#class-particlesmaterial-method-set-param), [set\_param\_randomness](#class-particlesmaterial-method-set-param-randomness), and [set\_param\_texture](#class-particlesmaterial-method-set-param-texture) to set initial velocity properties. * **PARAM\_ANGULAR\_VELOCITY** = **1** --- Use with [set\_param](#class-particlesmaterial-method-set-param), [set\_param\_randomness](#class-particlesmaterial-method-set-param-randomness), and [set\_param\_texture](#class-particlesmaterial-method-set-param-texture) to set angular velocity properties. * **PARAM\_ORBIT\_VELOCITY** = **2** --- Use with [set\_param](#class-particlesmaterial-method-set-param), [set\_param\_randomness](#class-particlesmaterial-method-set-param-randomness), and [set\_param\_texture](#class-particlesmaterial-method-set-param-texture) to set orbital velocity properties. * **PARAM\_LINEAR\_ACCEL** = **3** --- Use with [set\_param](#class-particlesmaterial-method-set-param), [set\_param\_randomness](#class-particlesmaterial-method-set-param-randomness), and [set\_param\_texture](#class-particlesmaterial-method-set-param-texture) to set linear acceleration properties. * **PARAM\_RADIAL\_ACCEL** = **4** --- Use with [set\_param](#class-particlesmaterial-method-set-param), [set\_param\_randomness](#class-particlesmaterial-method-set-param-randomness), and [set\_param\_texture](#class-particlesmaterial-method-set-param-texture) to set radial acceleration properties. * **PARAM\_TANGENTIAL\_ACCEL** = **5** --- Use with [set\_param](#class-particlesmaterial-method-set-param), [set\_param\_randomness](#class-particlesmaterial-method-set-param-randomness), and [set\_param\_texture](#class-particlesmaterial-method-set-param-texture) to set tangential acceleration properties. * **PARAM\_DAMPING** = **6** --- Use with [set\_param](#class-particlesmaterial-method-set-param), [set\_param\_randomness](#class-particlesmaterial-method-set-param-randomness), and [set\_param\_texture](#class-particlesmaterial-method-set-param-texture) to set damping properties. * **PARAM\_ANGLE** = **7** --- Use with [set\_param](#class-particlesmaterial-method-set-param), [set\_param\_randomness](#class-particlesmaterial-method-set-param-randomness), and [set\_param\_texture](#class-particlesmaterial-method-set-param-texture) to set angle properties. * **PARAM\_SCALE** = **8** --- Use with [set\_param](#class-particlesmaterial-method-set-param), [set\_param\_randomness](#class-particlesmaterial-method-set-param-randomness), and [set\_param\_texture](#class-particlesmaterial-method-set-param-texture) to set scale properties. * **PARAM\_HUE\_VARIATION** = **9** --- Use with [set\_param](#class-particlesmaterial-method-set-param), [set\_param\_randomness](#class-particlesmaterial-method-set-param-randomness), and [set\_param\_texture](#class-particlesmaterial-method-set-param-texture) to set hue variation properties. * **PARAM\_ANIM\_SPEED** = **10** --- Use with [set\_param](#class-particlesmaterial-method-set-param), [set\_param\_randomness](#class-particlesmaterial-method-set-param-randomness), and [set\_param\_texture](#class-particlesmaterial-method-set-param-texture) to set animation speed properties. * **PARAM\_ANIM\_OFFSET** = **11** --- Use with [set\_param](#class-particlesmaterial-method-set-param), [set\_param\_randomness](#class-particlesmaterial-method-set-param-randomness), and [set\_param\_texture](#class-particlesmaterial-method-set-param-texture) to set animation offset properties. * **PARAM\_MAX** = **12** --- Represents the size of the [Parameter](#enum-particlesmaterial-parameter) enum. enum **Flags**: * **FLAG\_ALIGN\_Y\_TO\_VELOCITY** = **0** --- Use with [set\_flag](#class-particlesmaterial-method-set-flag) to set [flag\_align\_y](#class-particlesmaterial-property-flag-align-y). * **FLAG\_ROTATE\_Y** = **1** --- Use with [set\_flag](#class-particlesmaterial-method-set-flag) to set [flag\_rotate\_y](#class-particlesmaterial-property-flag-rotate-y). * **FLAG\_DISABLE\_Z** = **2** --- Use with [set\_flag](#class-particlesmaterial-method-set-flag) to set [flag\_disable\_z](#class-particlesmaterial-property-flag-disable-z). * **FLAG\_MAX** = **3** --- Represents the size of the [Flags](#enum-particlesmaterial-flags) enum. enum **EmissionShape**: * **EMISSION\_SHAPE\_POINT** = **0** --- All particles will be emitted from a single point. * **EMISSION\_SHAPE\_SPHERE** = **1** --- Particles will be emitted in the volume of a sphere. * **EMISSION\_SHAPE\_BOX** = **2** --- Particles will be emitted in the volume of a box. * **EMISSION\_SHAPE\_POINTS** = **3** --- Particles will be emitted at a position determined by sampling a random point on the [emission\_point\_texture](#class-particlesmaterial-property-emission-point-texture). Particle color will be modulated by [emission\_color\_texture](#class-particlesmaterial-property-emission-color-texture). * **EMISSION\_SHAPE\_DIRECTED\_POINTS** = **4** --- Particles will be emitted at a position determined by sampling a random point on the [emission\_point\_texture](#class-particlesmaterial-property-emission-point-texture). Particle velocity and rotation will be set based on [emission\_normal\_texture](#class-particlesmaterial-property-emission-normal-texture). Particle color will be modulated by [emission\_color\_texture](#class-particlesmaterial-property-emission-color-texture). * **EMISSION\_SHAPE\_RING** = **5** --- Particles will be emitted in a ring or cylinder. * **EMISSION\_SHAPE\_MAX** = **6** --- Represents the size of the [EmissionShape](#enum-particlesmaterial-emissionshape) enum. Property Descriptions --------------------- ### [float](class_float#class-float) angle | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial rotation applied to each particle, in degrees. **Note:** Only applied when [flag\_disable\_z](#class-particlesmaterial-property-flag-disable-z) or [flag\_rotate\_y](#class-particlesmaterial-property-flag-rotate-y) are `true` or the [SpatialMaterial](class_spatialmaterial#class-spatialmaterial) being used to draw the particle is using [SpatialMaterial.BILLBOARD\_PARTICLES](class_spatialmaterial#class-spatialmaterial-constant-billboard-particles). ### [Texture](class_texture#class-texture) angle\_curve | | | | --- | --- | | *Setter* | set\_param\_texture(value) | | *Getter* | get\_param\_texture() | Each particle's rotation will be animated along this [CurveTexture](class_curvetexture#class-curvetexture). ### [float](class_float#class-float) angle\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Rotation randomness ratio. ### [float](class_float#class-float) angular\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial angular velocity applied to each particle in *degrees* per second. Sets the speed of rotation of the particle. **Note:** Only applied when [flag\_disable\_z](#class-particlesmaterial-property-flag-disable-z) or [flag\_rotate\_y](#class-particlesmaterial-property-flag-rotate-y) are `true` or the [SpatialMaterial](class_spatialmaterial#class-spatialmaterial) being used to draw the particle is using [SpatialMaterial.BILLBOARD\_PARTICLES](class_spatialmaterial#class-spatialmaterial-constant-billboard-particles). ### [Texture](class_texture#class-texture) angular\_velocity\_curve | | | | --- | --- | | *Setter* | set\_param\_texture(value) | | *Getter* | get\_param\_texture() | Each particle's angular velocity will vary along this [CurveTexture](class_curvetexture#class-curvetexture). ### [float](class_float#class-float) angular\_velocity\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Angular velocity randomness ratio. ### [float](class_float#class-float) anim\_offset | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Particle animation offset. ### [Texture](class_texture#class-texture) anim\_offset\_curve | | | | --- | --- | | *Setter* | set\_param\_texture(value) | | *Getter* | get\_param\_texture() | Each particle's animation offset will vary along this [CurveTexture](class_curvetexture#class-curvetexture). ### [float](class_float#class-float) anim\_offset\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Animation offset randomness ratio. ### [float](class_float#class-float) anim\_speed | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Particle animation speed. ### [Texture](class_texture#class-texture) anim\_speed\_curve | | | | --- | --- | | *Setter* | set\_param\_texture(value) | | *Getter* | get\_param\_texture() | Each particle's animation speed will vary along this [CurveTexture](class_curvetexture#class-curvetexture). ### [float](class_float#class-float) anim\_speed\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Animation speed randomness ratio. ### [Color](class_color#class-color) color | | | | --- | --- | | *Default* | `Color( 1, 1, 1, 1 )` | | *Setter* | set\_color(value) | | *Getter* | get\_color() | Each particle's initial color. If the [Particles2D](class_particles2d#class-particles2d)'s `texture` is defined, it will be multiplied by this color. To have particle display color in a [SpatialMaterial](class_spatialmaterial#class-spatialmaterial) make sure to set [SpatialMaterial.vertex\_color\_use\_as\_albedo](class_spatialmaterial#class-spatialmaterial-property-vertex-color-use-as-albedo) to `true`. ### [Texture](class_texture#class-texture) color\_initial\_ramp | | | | --- | --- | | *Setter* | set\_color\_initial\_ramp(value) | | *Getter* | get\_color\_initial\_ramp() | Each particle's initial color will vary along this [GradientTexture](class_gradienttexture#class-gradienttexture) (multiplied with [color](#class-particlesmaterial-property-color)). ### [Texture](class_texture#class-texture) color\_ramp | | | | --- | --- | | *Setter* | set\_color\_ramp(value) | | *Getter* | get\_color\_ramp() | Each particle's color will vary along this [GradientTexture](class_gradienttexture#class-gradienttexture) over its lifetime (multiplied with [color](#class-particlesmaterial-property-color)). ### [float](class_float#class-float) damping | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | The rate at which particles lose velocity. ### [Texture](class_texture#class-texture) damping\_curve | | | | --- | --- | | *Setter* | set\_param\_texture(value) | | *Getter* | get\_param\_texture() | Damping will vary along this [CurveTexture](class_curvetexture#class-curvetexture). ### [float](class_float#class-float) damping\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Damping randomness ratio. ### [Vector3](class_vector3#class-vector3) direction | | | | --- | --- | | *Default* | `Vector3( 1, 0, 0 )` | | *Setter* | set\_direction(value) | | *Getter* | get\_direction() | Unit vector specifying the particles' emission direction. ### [Vector3](class_vector3#class-vector3) emission\_box\_extents | | | | --- | --- | | *Setter* | set\_emission\_box\_extents(value) | | *Getter* | get\_emission\_box\_extents() | The box's extents if `emission_shape` is set to [EMISSION\_SHAPE\_BOX](#class-particlesmaterial-constant-emission-shape-box). ### [Texture](class_texture#class-texture) emission\_color\_texture | | | | --- | --- | | *Setter* | set\_emission\_color\_texture(value) | | *Getter* | get\_emission\_color\_texture() | Particle color will be modulated by color determined by sampling this texture at the same point as the [emission\_point\_texture](#class-particlesmaterial-property-emission-point-texture). ### [Texture](class_texture#class-texture) emission\_normal\_texture | | | | --- | --- | | *Setter* | set\_emission\_normal\_texture(value) | | *Getter* | get\_emission\_normal\_texture() | Particle velocity and rotation will be set by sampling this texture at the same point as the [emission\_point\_texture](#class-particlesmaterial-property-emission-point-texture). Used only in [EMISSION\_SHAPE\_DIRECTED\_POINTS](#class-particlesmaterial-constant-emission-shape-directed-points). Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. ### [int](class_int#class-int) emission\_point\_count | | | | --- | --- | | *Setter* | set\_emission\_point\_count(value) | | *Getter* | get\_emission\_point\_count() | The number of emission points if `emission_shape` is set to [EMISSION\_SHAPE\_POINTS](#class-particlesmaterial-constant-emission-shape-points) or [EMISSION\_SHAPE\_DIRECTED\_POINTS](#class-particlesmaterial-constant-emission-shape-directed-points). ### [Texture](class_texture#class-texture) emission\_point\_texture | | | | --- | --- | | *Setter* | set\_emission\_point\_texture(value) | | *Getter* | get\_emission\_point\_texture() | Particles will be emitted at positions determined by sampling this texture at a random position. Used with [EMISSION\_SHAPE\_POINTS](#class-particlesmaterial-constant-emission-shape-points) and [EMISSION\_SHAPE\_DIRECTED\_POINTS](#class-particlesmaterial-constant-emission-shape-directed-points). Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. ### [Vector3](class_vector3#class-vector3) emission\_ring\_axis | | | | --- | --- | | *Setter* | set\_emission\_ring\_axis(value) | | *Getter* | get\_emission\_ring\_axis() | The axis of the ring when using the emitter [EMISSION\_SHAPE\_RING](#class-particlesmaterial-constant-emission-shape-ring). ### [float](class_float#class-float) emission\_ring\_height | | | | --- | --- | | *Setter* | set\_emission\_ring\_height(value) | | *Getter* | get\_emission\_ring\_height() | The height of the ring when using the emitter [EMISSION\_SHAPE\_RING](#class-particlesmaterial-constant-emission-shape-ring). ### [float](class_float#class-float) emission\_ring\_inner\_radius | | | | --- | --- | | *Setter* | set\_emission\_ring\_inner\_radius(value) | | *Getter* | get\_emission\_ring\_inner\_radius() | The inner radius of the ring when using the emitter [EMISSION\_SHAPE\_RING](#class-particlesmaterial-constant-emission-shape-ring). ### [float](class_float#class-float) emission\_ring\_radius | | | | --- | --- | | *Setter* | set\_emission\_ring\_radius(value) | | *Getter* | get\_emission\_ring\_radius() | The radius of the ring when using the emitter [EMISSION\_SHAPE\_RING](#class-particlesmaterial-constant-emission-shape-ring). ### [EmissionShape](#enum-particlesmaterial-emissionshape) emission\_shape | | | | --- | --- | | *Default* | `0` | | *Setter* | set\_emission\_shape(value) | | *Getter* | get\_emission\_shape() | Particles will be emitted inside this region. Use [EmissionShape](#enum-particlesmaterial-emissionshape) constants for values. ### [float](class_float#class-float) emission\_sphere\_radius | | | | --- | --- | | *Setter* | set\_emission\_sphere\_radius(value) | | *Getter* | get\_emission\_sphere\_radius() | The sphere's radius if `emission_shape` is set to [EMISSION\_SHAPE\_SPHERE](#class-particlesmaterial-constant-emission-shape-sphere). ### [bool](class_bool#class-bool) flag\_align\_y | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag(value) | | *Getter* | get\_flag() | Align Y axis of particle with the direction of its velocity. ### [bool](class_bool#class-bool) flag\_disable\_z | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag(value) | | *Getter* | get\_flag() | If `true`, particles will not move on the z axis. ### [bool](class_bool#class-bool) flag\_rotate\_y | | | | --- | --- | | *Default* | `false` | | *Setter* | set\_flag(value) | | *Getter* | get\_flag() | If `true`, particles rotate around Y axis by [angle](#class-particlesmaterial-property-angle). ### [float](class_float#class-float) flatness | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_flatness(value) | | *Getter* | get\_flatness() | Amount of [spread](#class-particlesmaterial-property-spread) along the Y axis. ### [Vector3](class_vector3#class-vector3) gravity | | | | --- | --- | | *Default* | `Vector3( 0, -9.8, 0 )` | | *Setter* | set\_gravity(value) | | *Getter* | get\_gravity() | Gravity applied to every particle. ### [float](class_float#class-float) hue\_variation | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial hue variation applied to each particle. ### [Texture](class_texture#class-texture) hue\_variation\_curve | | | | --- | --- | | *Setter* | set\_param\_texture(value) | | *Getter* | get\_param\_texture() | Each particle's hue will vary along this [CurveTexture](class_curvetexture#class-curvetexture). ### [float](class_float#class-float) hue\_variation\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Hue variation randomness ratio. ### [float](class_float#class-float) initial\_velocity | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial velocity magnitude for each particle. Direction comes from [spread](#class-particlesmaterial-property-spread) and the node's orientation. ### [float](class_float#class-float) initial\_velocity\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Initial velocity randomness ratio. ### [float](class_float#class-float) lifetime\_randomness | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_lifetime\_randomness(value) | | *Getter* | get\_lifetime\_randomness() | Particle lifetime randomness ratio. ### [float](class_float#class-float) linear\_accel | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Linear acceleration applied to each particle in the direction of motion. ### [Texture](class_texture#class-texture) linear\_accel\_curve | | | | --- | --- | | *Setter* | set\_param\_texture(value) | | *Getter* | get\_param\_texture() | Each particle's linear acceleration will vary along this [CurveTexture](class_curvetexture#class-curvetexture). ### [float](class_float#class-float) linear\_accel\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Linear acceleration randomness ratio. ### [float](class_float#class-float) orbit\_velocity | | | | --- | --- | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. **Note:** Only available when [flag\_disable\_z](#class-particlesmaterial-property-flag-disable-z) is `true`. ### [Texture](class_texture#class-texture) orbit\_velocity\_curve | | | | --- | --- | | *Setter* | set\_param\_texture(value) | | *Getter* | get\_param\_texture() | Each particle's orbital velocity will vary along this [CurveTexture](class_curvetexture#class-curvetexture). ### [float](class_float#class-float) orbit\_velocity\_random | | | | --- | --- | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Orbital velocity randomness ratio. ### [float](class_float#class-float) radial\_accel | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Radial acceleration applied to each particle. Makes particle accelerate away from origin. ### [Texture](class_texture#class-texture) radial\_accel\_curve | | | | --- | --- | | *Setter* | set\_param\_texture(value) | | *Getter* | get\_param\_texture() | Each particle's radial acceleration will vary along this [CurveTexture](class_curvetexture#class-curvetexture). ### [float](class_float#class-float) radial\_accel\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Radial acceleration randomness ratio. ### [float](class_float#class-float) scale | | | | --- | --- | | *Default* | `1.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Initial scale applied to each particle. ### [Texture](class_texture#class-texture) scale\_curve | | | | --- | --- | | *Setter* | set\_param\_texture(value) | | *Getter* | get\_param\_texture() | Each particle's scale will vary along this [CurveTexture](class_curvetexture#class-curvetexture). ### [float](class_float#class-float) scale\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Scale randomness ratio. ### [float](class_float#class-float) spread | | | | --- | --- | | *Default* | `45.0` | | *Setter* | set\_spread(value) | | *Getter* | get\_spread() | Each particle's initial direction range from `+spread` to `-spread` degrees. ### [float](class_float#class-float) tangential\_accel | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param(value) | | *Getter* | get\_param() | Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. ### [Texture](class_texture#class-texture) tangential\_accel\_curve | | | | --- | --- | | *Setter* | set\_param\_texture(value) | | *Getter* | get\_param\_texture() | Each particle's tangential acceleration will vary along this [CurveTexture](class_curvetexture#class-curvetexture). ### [float](class_float#class-float) tangential\_accel\_random | | | | --- | --- | | *Default* | `0.0` | | *Setter* | set\_param\_randomness(value) | | *Getter* | get\_param\_randomness() | Tangential acceleration randomness ratio. ### [GradientTexture](class_gradienttexture#class-gradienttexture) trail\_color\_modifier | | | | --- | --- | | *Setter* | set\_trail\_color\_modifier(value) | | *Getter* | get\_trail\_color\_modifier() | Trail particles' color will vary along this [GradientTexture](class_gradienttexture#class-gradienttexture). ### [int](class_int#class-int) trail\_divisor | | | | --- | --- | | *Default* | `1` | | *Setter* | set\_trail\_divisor(value) | | *Getter* | get\_trail\_divisor() | Emitter will emit `amount` divided by `trail_divisor` particles. The remaining particles will be used as trail(s). ### [CurveTexture](class_curvetexture#class-curvetexture) trail\_size\_modifier | | | | --- | --- | | *Setter* | set\_trail\_size\_modifier(value) | | *Getter* | get\_trail\_size\_modifier() | Trail particles' size will vary along this [CurveTexture](class_curvetexture#class-curvetexture). Method Descriptions ------------------- ### [bool](class_bool#class-bool) get\_flag ( [Flags](#enum-particlesmaterial-flags) flag ) const Returns `true` if the specified flag is enabled. ### [float](class_float#class-float) get\_param ( [Parameter](#enum-particlesmaterial-parameter) param ) const Returns the value of the specified parameter. ### [float](class_float#class-float) get\_param\_randomness ( [Parameter](#enum-particlesmaterial-parameter) param ) const Returns the randomness ratio associated with the specified parameter. ### [Texture](class_texture#class-texture) get\_param\_texture ( [Parameter](#enum-particlesmaterial-parameter) param ) const Returns the [Texture](class_texture#class-texture) used by the specified parameter. ### void set\_flag ( [Flags](#enum-particlesmaterial-flags) flag, [bool](class_bool#class-bool) enable ) If `true`, enables the specified flag. See [Flags](#enum-particlesmaterial-flags) for options. ### void set\_param ( [Parameter](#enum-particlesmaterial-parameter) param, [float](class_float#class-float) value ) Sets the specified [Parameter](#enum-particlesmaterial-parameter). ### void set\_param\_randomness ( [Parameter](#enum-particlesmaterial-parameter) param, [float](class_float#class-float) randomness ) Sets the randomness ratio for the specified [Parameter](#enum-particlesmaterial-parameter). ### void set\_param\_texture ( [Parameter](#enum-particlesmaterial-parameter) param, [Texture](class_texture#class-texture) texture ) Sets the [Texture](class_texture#class-texture) for the specified [Parameter](#enum-particlesmaterial-parameter).
programming_docs