2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2020-01-26 15:01:49 +00:00
<class name= "CanvasItem" inherits= "Node" version= "3.2" >
2017-09-12 20:42:36 +00:00
<brief_description >
Base class of anything 2D.
</brief_description>
<description >
2020-01-23 10:14:14 +00:00
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] for anything GUI-related, and by [Node2D] for anything related to the 2D engine.
Any [CanvasItem] can draw. For this, [method update] must be called, then [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 [code]draw_*[/code] functions). However, they can only be used inside the [method Object._notification], signal or [method _draw] virtual functions.
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.
2017-09-12 20:42:36 +00:00
Ultimately, a transform notification can be requested, which will notify the node that its global position changed in case the parent tree changed.
2020-04-17 13:25:55 +00:00
[b]Note:[/b] Unless otherwise specified, all methods that have angle parameters must have angles specified as [i]radians[/i]. To convert degrees to radians, use [method @GDScript.deg2rad].
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
2018-11-05 07:46:27 +00:00
<link > https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link>
<link > https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link>
2017-09-12 20:42:36 +00:00
</tutorials>
<methods >
<method name= "_draw" qualifiers= "virtual" >
<return type= "void" >
</return>
<description >
2020-01-23 10:14:14 +00:00
Overridable function called by the engine (if defined) to draw the canvas item.
2017-09-12 20:42:36 +00:00
</description>
</method>
2019-10-26 14:40:31 +00:00
<method name= "draw_arc" >
<return type= "void" >
</return>
<argument index= "0" name= "center" type= "Vector2" >
</argument>
<argument index= "1" name= "radius" type= "float" >
</argument>
<argument index= "2" name= "start_angle" type= "float" >
</argument>
<argument index= "3" name= "end_angle" type= "float" >
</argument>
<argument index= "4" name= "point_count" type= "int" >
</argument>
<argument index= "5" name= "color" type= "Color" >
</argument>
<argument index= "6" name= "width" type= "float" default= "1.0" >
</argument>
<argument index= "7" name= "antialiased" type= "bool" default= "false" >
</argument>
<description >
2020-01-10 18:46:41 +00:00
Draws an arc between the given angles. The larger the value of [code]point_count[/code], the smoother the curve.
2019-10-26 14:40:31 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "draw_char" >
<return type= "float" >
</return>
<argument index= "0" name= "font" type= "Font" >
</argument>
2017-09-10 13:37:49 +00:00
<argument index= "1" name= "position" type= "Vector2" >
2017-09-12 20:42:36 +00:00
</argument>
<argument index= "2" name= "char" type= "String" >
</argument>
<argument index= "3" name= "next" type= "String" >
</argument>
<argument index= "4" name= "modulate" type= "Color" default= "Color( 1, 1, 1, 1 )" >
</argument>
<description >
2019-05-14 07:08:22 +00:00
Draws a string character using a custom font. Returns the advance, depending on the character width and kerning with an optional next character.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_circle" >
<return type= "void" >
</return>
2017-09-10 13:37:49 +00:00
<argument index= "0" name= "position" type= "Vector2" >
2017-09-12 20:42:36 +00:00
</argument>
<argument index= "1" name= "radius" type= "float" >
</argument>
<argument index= "2" name= "color" type= "Color" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Draws a colored circle.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_colored_polygon" >
<return type= "void" >
</return>
<argument index= "0" name= "points" type= "PoolVector2Array" >
</argument>
<argument index= "1" name= "color" type= "Color" >
</argument>
<argument index= "2" name= "uvs" type= "PoolVector2Array" default= "PoolVector2Array( )" >
</argument>
<argument index= "3" name= "texture" type= "Texture" default= "null" >
</argument>
<argument index= "4" name= "normal_map" type= "Texture" default= "null" >
</argument>
<argument index= "5" name= "antialiased" type= "bool" default= "false" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Draws a colored polygon of any amount of points, convex or concave.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_line" >
<return type= "void" >
</return>
<argument index= "0" name= "from" type= "Vector2" >
</argument>
<argument index= "1" name= "to" type= "Vector2" >
</argument>
<argument index= "2" name= "color" type= "Color" >
</argument>
<argument index= "3" name= "width" type= "float" default= "1.0" >
</argument>
<argument index= "4" name= "antialiased" type= "bool" default= "false" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased.
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-02-25 06:19:42 +00:00
<method name= "draw_mesh" >
<return type= "void" >
</return>
<argument index= "0" name= "mesh" type= "Mesh" >
</argument>
<argument index= "1" name= "texture" type= "Texture" >
</argument>
<argument index= "2" name= "normal_map" type= "Texture" default= "null" >
</argument>
2019-04-23 19:39:09 +00:00
<argument index= "3" name= "transform" type= "Transform2D" default= "Transform2D( 1, 0, 0, 1, 0, 0 )" >
</argument>
<argument index= "4" name= "modulate" type= "Color" default= "Color( 1, 1, 1, 1 )" >
</argument>
2018-02-25 06:19:42 +00:00
<description >
2020-01-23 10:14:14 +00:00
Draws a [Mesh] in 2D, using the provided texture. See [MeshInstance2D] for related documentation.
2018-02-25 06:19:42 +00:00
</description>
</method>
2017-12-09 23:43:30 +00:00
<method name= "draw_multiline" >
<return type= "void" >
</return>
<argument index= "0" name= "points" type= "PoolVector2Array" >
</argument>
<argument index= "1" name= "color" type= "Color" >
</argument>
<argument index= "2" name= "width" type= "float" default= "1.0" >
</argument>
<argument index= "3" name= "antialiased" type= "bool" default= "false" >
</argument>
<description >
2019-05-14 07:08:22 +00:00
Draws multiple, parallel lines with a uniform [code]color[/code]. [code]width[/code] and [code]antialiased[/code] are currently not implemented and have no effect.
2017-12-09 23:43:30 +00:00
</description>
</method>
<method name= "draw_multiline_colors" >
<return type= "void" >
</return>
<argument index= "0" name= "points" type= "PoolVector2Array" >
</argument>
<argument index= "1" name= "colors" type= "PoolColorArray" >
</argument>
<argument index= "2" name= "width" type= "float" default= "1.0" >
</argument>
<argument index= "3" name= "antialiased" type= "bool" default= "false" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Draws multiple, parallel lines with a uniform [code]width[/code], segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code].
2017-12-09 23:43:30 +00:00
</description>
</method>
2018-02-25 06:19:42 +00:00
<method name= "draw_multimesh" >
<return type= "void" >
</return>
2018-12-13 14:12:25 +00:00
<argument index= "0" name= "multimesh" type= "MultiMesh" >
2018-02-25 06:19:42 +00:00
</argument>
<argument index= "1" name= "texture" type= "Texture" >
</argument>
<argument index= "2" name= "normal_map" type= "Texture" default= "null" >
</argument>
<description >
2020-01-23 10:14:14 +00:00
Draws a [MultiMesh] in 2D with the provided texture. See [MultiMeshInstance2D] for related documentation.
2018-02-25 06:19:42 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "draw_polygon" >
<return type= "void" >
</return>
<argument index= "0" name= "points" type= "PoolVector2Array" >
</argument>
<argument index= "1" name= "colors" type= "PoolColorArray" >
</argument>
<argument index= "2" name= "uvs" type= "PoolVector2Array" default= "PoolVector2Array( )" >
</argument>
<argument index= "3" name= "texture" type= "Texture" default= "null" >
</argument>
<argument index= "4" name= "normal_map" type= "Texture" default= "null" >
</argument>
<argument index= "5" name= "antialiased" type= "bool" default= "false" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Draws a polygon of any amount of points, convex or concave.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_polyline" >
<return type= "void" >
</return>
<argument index= "0" name= "points" type= "PoolVector2Array" >
</argument>
<argument index= "1" name= "color" type= "Color" >
</argument>
<argument index= "2" name= "width" type= "float" default= "1.0" >
</argument>
<argument index= "3" name= "antialiased" type= "bool" default= "false" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Draws interconnected line segments with a uniform [code]color[/code] and [code]width[/code] and optional antialiasing.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_polyline_colors" >
<return type= "void" >
</return>
<argument index= "0" name= "points" type= "PoolVector2Array" >
</argument>
<argument index= "1" name= "colors" type= "PoolColorArray" >
</argument>
<argument index= "2" name= "width" type= "float" default= "1.0" >
</argument>
<argument index= "3" name= "antialiased" type= "bool" default= "false" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Draws interconnected line segments with a uniform [code]width[/code], segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_primitive" >
<return type= "void" >
</return>
<argument index= "0" name= "points" type= "PoolVector2Array" >
</argument>
<argument index= "1" name= "colors" type= "PoolColorArray" >
</argument>
<argument index= "2" name= "uvs" type= "PoolVector2Array" >
</argument>
<argument index= "3" name= "texture" type= "Texture" default= "null" >
</argument>
<argument index= "4" name= "width" type= "float" default= "1.0" >
</argument>
<argument index= "5" name= "normal_map" type= "Texture" default= "null" >
</argument>
<description >
2019-05-14 07:08:22 +00:00
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.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_rect" >
<return type= "void" >
</return>
<argument index= "0" name= "rect" type= "Rect2" >
</argument>
<argument index= "1" name= "color" type= "Color" >
</argument>
<argument index= "2" name= "filled" type= "bool" default= "true" >
</argument>
2019-07-09 13:22:01 +00:00
<argument index= "3" name= "width" type= "float" default= "1.0" >
</argument>
<argument index= "4" name= "antialiased" type= "bool" default= "false" >
</argument>
2017-09-12 20:42:36 +00:00
<description >
2019-07-09 13:22:01 +00:00
Draws a rectangle. If [code]filled[/code] is [code]true[/code], the rectangle will be filled with the [code]color[/code] specified. If [code]filled[/code] is [code]false[/code], the rectangle will be drawn as a stroke with the [code]color[/code] and [code]width[/code] specified. If [code]antialiased[/code] is [code]true[/code], the lines will be antialiased.
[b]Note:[/b] [code]width[/code] and [code]antialiased[/code] are only effective if [code]filled[/code] is [code]false[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_set_transform" >
<return type= "void" >
</return>
2017-09-10 13:37:49 +00:00
<argument index= "0" name= "position" type= "Vector2" >
2017-09-12 20:42:36 +00:00
</argument>
2017-09-23 08:59:35 +00:00
<argument index= "1" name= "rotation" type= "float" >
2017-09-12 20:42:36 +00:00
</argument>
<argument index= "2" name= "scale" type= "Vector2" >
</argument>
<description >
2017-12-07 19:17:08 +00:00
Sets a custom transform for drawing via components. Anything drawn afterwards will be transformed by this.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_set_transform_matrix" >
<return type= "void" >
</return>
<argument index= "0" name= "xform" type= "Transform2D" >
</argument>
<description >
2017-12-07 19:17:08 +00:00
Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_string" >
<return type= "void" >
</return>
<argument index= "0" name= "font" type= "Font" >
</argument>
2017-09-10 13:37:49 +00:00
<argument index= "1" name= "position" type= "Vector2" >
2017-09-12 20:42:36 +00:00
</argument>
<argument index= "2" name= "text" type= "String" >
</argument>
<argument index= "3" name= "modulate" type= "Color" default= "Color( 1, 1, 1, 1 )" >
</argument>
<argument index= "4" name= "clip_w" type= "int" default= "-1" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Draws a string using a custom font.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_style_box" >
<return type= "void" >
</return>
<argument index= "0" name= "style_box" type= "StyleBox" >
</argument>
<argument index= "1" name= "rect" type= "Rect2" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Draws a styled rectangle.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_texture" >
<return type= "void" >
</return>
<argument index= "0" name= "texture" type= "Texture" >
</argument>
2017-09-10 13:37:49 +00:00
<argument index= "1" name= "position" type= "Vector2" >
2017-09-12 20:42:36 +00:00
</argument>
<argument index= "2" name= "modulate" type= "Color" default= "Color( 1, 1, 1, 1 )" >
</argument>
<argument index= "3" name= "normal_map" type= "Texture" default= "null" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Draws a texture at a given position.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_texture_rect" >
<return type= "void" >
</return>
<argument index= "0" name= "texture" type= "Texture" >
</argument>
<argument index= "1" name= "rect" type= "Rect2" >
</argument>
<argument index= "2" name= "tile" type= "bool" >
</argument>
<argument index= "3" name= "modulate" type= "Color" default= "Color( 1, 1, 1, 1 )" >
</argument>
<argument index= "4" name= "transpose" type= "bool" default= "false" >
</argument>
<argument index= "5" name= "normal_map" type= "Texture" default= "null" >
</argument>
<description >
2019-05-14 07:08:22 +00:00
Draws a textured rectangle at a given position, optionally modulated by a color. If [code]transpose[/code] is [code]true[/code], the texture will have its X and Y coordinates swapped.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "draw_texture_rect_region" >
<return type= "void" >
</return>
<argument index= "0" name= "texture" type= "Texture" >
</argument>
<argument index= "1" name= "rect" type= "Rect2" >
</argument>
<argument index= "2" name= "src_rect" type= "Rect2" >
</argument>
<argument index= "3" name= "modulate" type= "Color" default= "Color( 1, 1, 1, 1 )" >
</argument>
<argument index= "4" name= "transpose" type= "bool" default= "false" >
</argument>
<argument index= "5" name= "normal_map" type= "Texture" default= "null" >
</argument>
<argument index= "6" name= "clip_uv" type= "bool" default= "true" >
</argument>
<description >
2019-05-14 07:08:22 +00:00
Draws a textured rectangle region at a given position, optionally modulated by a color. If [code]transpose[/code] is [code]true[/code], the texture will have its X and Y coordinates swapped.
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-09-10 22:18:05 +00:00
<method name= "force_update_transform" >
<return type= "void" >
</return>
<description >
2019-11-01 09:37:39 +00:00
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.
2018-09-10 22:18:05 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "get_canvas" qualifiers= "const" >
<return type= "RID" >
</return>
<description >
2019-05-24 02:15:43 +00:00
Returns the [RID] of the [World2D] canvas where this item is in.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_canvas_item" qualifiers= "const" >
<return type= "RID" >
</return>
<description >
2019-05-24 02:15:43 +00:00
Returns the canvas item RID used by [VisualServer] for this item.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_canvas_transform" qualifiers= "const" >
<return type= "Transform2D" >
</return>
<description >
2020-01-23 10:14:14 +00:00
Returns the transform matrix of this item's canvas.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_global_mouse_position" qualifiers= "const" >
<return type= "Vector2" >
</return>
<description >
2020-01-23 10:14:14 +00:00
Returns the global position of the mouse.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_global_transform" qualifiers= "const" >
<return type= "Transform2D" >
</return>
<description >
2020-01-23 10:14:14 +00:00
Returns the global transform matrix of this item.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_global_transform_with_canvas" qualifiers= "const" >
<return type= "Transform2D" >
</return>
<description >
2020-01-23 10:14:14 +00:00
Returns the global transform matrix of this item in relation to the canvas.
2017-09-12 20:42:36 +00:00
</description>
</method>
2017-09-10 13:37:49 +00:00
<method name= "get_local_mouse_position" qualifiers= "const" >
2017-09-12 20:42:36 +00:00
<return type= "Vector2" >
</return>
<description >
2020-01-23 10:14:14 +00:00
Returns the mouse position relative to this item's position.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_transform" qualifiers= "const" >
<return type= "Transform2D" >
</return>
<description >
2020-01-23 10:14:14 +00:00
Returns the transform matrix of this item.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_viewport_rect" qualifiers= "const" >
<return type= "Rect2" >
</return>
<description >
2020-01-23 10:14:14 +00:00
Returns the viewport's boundaries as a [Rect2].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_viewport_transform" qualifiers= "const" >
<return type= "Transform2D" >
</return>
<description >
2020-01-23 10:14:14 +00:00
Returns this item's transform in relation to the viewport.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_world_2d" qualifiers= "const" >
<return type= "World2D" >
</return>
<description >
2020-01-23 10:14:14 +00:00
Returns the [World2D] where this item is in.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "hide" >
<return type= "void" >
</return>
<description >
2020-01-23 10:14:14 +00:00
Hide the [CanvasItem] if it's currently visible.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "is_local_transform_notification_enabled" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
2017-12-07 19:17:08 +00:00
Returns [code]true[/code] if local transform notifications are communicated to children.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "is_set_as_toplevel" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
2019-05-14 07:08:22 +00:00
Returns [code]true[/code] if the node is set as top-level. See [method set_as_toplevel].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "is_transform_notification_enabled" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
2017-12-07 19:17:08 +00:00
Returns [code]true[/code] if global transform notifications are communicated to children.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "is_visible_in_tree" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
2018-01-21 11:09:57 +00:00
Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and its inherited visibility is also [code]true[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
2017-09-10 13:37:49 +00:00
<method name= "make_canvas_position_local" qualifiers= "const" >
2017-09-12 20:42:36 +00:00
<return type= "Vector2" >
</return>
<argument index= "0" name= "screen_point" type= "Vector2" >
</argument>
<description >
2017-12-07 19:17:08 +00:00
Assigns [code]screen_point[/code] as this node's new local transform.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "make_input_local" qualifiers= "const" >
<return type= "InputEvent" >
</return>
<argument index= "0" name= "event" type= "InputEvent" >
</argument>
<description >
2017-12-07 19:17:08 +00:00
Transformations issued by [code]event[/code]'s inputs are applied in local space instead of global space.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_as_toplevel" >
<return type= "void" >
</return>
<argument index= "0" name= "enable" type= "bool" >
</argument>
<description >
2019-05-14 07:08:22 +00:00
If [code]enable[/code] is [code]true[/code], the node won't inherit its transform from parent canvas items.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_notify_local_transform" >
<return type= "void" >
</return>
<argument index= "0" name= "enable" type= "bool" >
</argument>
<description >
2017-12-07 19:17:08 +00:00
If [code]enable[/code] is [code]true[/code], children will be updated with local transform data.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_notify_transform" >
<return type= "void" >
</return>
<argument index= "0" name= "enable" type= "bool" >
</argument>
<description >
2017-12-07 19:17:08 +00:00
If [code]enable[/code] is [code]true[/code], children will be updated with global transform data.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "show" >
<return type= "void" >
</return>
<description >
2020-01-23 10:14:14 +00:00
Show the [CanvasItem] if it's currently hidden. For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "update" >
<return type= "void" >
</return>
<description >
2020-01-23 10:14:14 +00:00
Queue the [CanvasItem] for update. [constant NOTIFICATION_DRAW] will be called on idle time to request redraw.
2017-09-12 20:42:36 +00:00
</description>
</method>
</methods>
<members >
2019-06-29 10:38:01 +00:00
<member name= "light_mask" type= "int" setter= "set_light_mask" getter= "get_light_mask" default= "1" >
2019-06-29 13:24:23 +00:00
The rendering layers in which this [CanvasItem] responds to [Light2D] nodes.
2017-09-12 20:42:36 +00:00
</member>
2019-07-15 18:42:47 +00:00
<member name= "material" type= "Material" setter= "set_material" getter= "get_material" >
2019-06-29 13:24:23 +00:00
The material applied to textures on this [CanvasItem].
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "modulate" type= "Color" setter= "set_modulate" getter= "get_modulate" default= "Color( 1, 1, 1, 1 )" >
2019-06-29 13:24:23 +00:00
The color applied to textures on this [CanvasItem].
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "self_modulate" type= "Color" setter= "set_self_modulate" getter= "get_self_modulate" default= "Color( 1, 1, 1, 1 )" >
2019-06-29 13:24:23 +00:00
The color applied to textures on this [CanvasItem]. This is not inherited by children [CanvasItem]s.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "show_behind_parent" type= "bool" setter= "set_draw_behind_parent" getter= "is_draw_behind_parent_enabled" default= "false" >
2019-06-29 13:24:23 +00:00
If [code]true[/code], the object draws behind its parent.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 19:22:15 +00:00
<member name= "show_on_top" type= "bool" setter= "_set_on_top" getter= "_is_on_top" >
2019-06-29 13:24:23 +00:00
If [code]true[/code], the object draws on top of its parent.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "use_parent_material" type= "bool" setter= "set_use_parent_material" getter= "get_use_parent_material" default= "false" >
2019-06-29 13:24:23 +00:00
If [code]true[/code], the parent [CanvasItem]'s [member material] property is used as this one's material.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "visible" type= "bool" setter= "set_visible" getter= "is_visible" default= "true" >
2019-06-29 13:24:23 +00:00
If [code]true[/code], this [CanvasItem] is drawn. For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead.
2017-09-12 20:42:36 +00:00
</member>
</members>
<signals >
<signal name= "draw" >
<description >
2020-01-23 10:14:14 +00:00
Emitted when the [CanvasItem] must redraw. This can only be connected realtime, as deferred will not allow drawing.
2017-09-12 20:42:36 +00:00
</description>
</signal>
<signal name= "hide" >
<description >
Emitted when becoming hidden.
</description>
</signal>
<signal name= "item_rect_changed" >
<description >
Emitted when the item rect has changed.
</description>
</signal>
<signal name= "visibility_changed" >
<description >
Emitted when the visibility (hidden/visible) changes.
</description>
</signal>
</signals>
<constants >
2017-11-24 22:16:30 +00:00
<constant name= "BLEND_MODE_MIX" value= "0" enum= "BlendMode" >
2017-09-12 20:42:36 +00:00
Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "BLEND_MODE_ADD" value= "1" enum= "BlendMode" >
2017-09-12 20:42:36 +00:00
Additive blending mode.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "BLEND_MODE_SUB" value= "2" enum= "BlendMode" >
2017-09-12 20:42:36 +00:00
Subtractive blending mode.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "BLEND_MODE_MUL" value= "3" enum= "BlendMode" >
2017-09-12 20:42:36 +00:00
Multiplicative blending mode.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "BLEND_MODE_PREMULT_ALPHA" value= "4" enum= "BlendMode" >
2017-09-12 20:42:36 +00:00
Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value.
</constant>
2018-05-12 07:38:00 +00:00
<constant name= "BLEND_MODE_DISABLED" value= "5" enum= "BlendMode" >
2019-06-21 23:04:47 +00:00
Disables blending mode. Colors including alpha are written as-is. Only applicable for render targets with a transparent background. No lighting will be applied.
2018-05-12 07:38:00 +00:00
</constant>
2019-04-15 12:49:41 +00:00
<constant name= "NOTIFICATION_TRANSFORM_CHANGED" value= "2000" >
2020-01-23 10:14:14 +00:00
The [CanvasItem]'s transform has changed. This notification is only received if enabled by [method set_notify_transform] or [method set_notify_local_transform].
2017-10-22 10:56:11 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "NOTIFICATION_DRAW" value= "30" >
2020-01-23 10:14:14 +00:00
The [CanvasItem] is requested to draw.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "NOTIFICATION_VISIBILITY_CHANGED" value= "31" >
2020-01-23 10:14:14 +00:00
The [CanvasItem]'s visibility has changed.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "NOTIFICATION_ENTER_CANVAS" value= "32" >
2020-01-23 10:14:14 +00:00
The [CanvasItem] has entered the canvas.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "NOTIFICATION_EXIT_CANVAS" value= "33" >
2020-01-23 10:14:14 +00:00
The [CanvasItem] has exited the canvas.
2017-09-12 20:42:36 +00:00
</constant>
</constants>
</class>