Base class of anything 2D. Base class of anything 2D. Canvas items are laid out in a tree and children inherit and extend the transform of their parent. CanvasItem is extended by [Control], for anything GUI related, and by [Node2D] for anything 2D engine related. Any CanvasItem can draw. For this, the "update" function must be called, then NOTIFICATION_DRAW will be received on idle time to request redraw. Because of this, canvas items don't need to be redraw on every frame, improving the performance significantly. Several functions for drawing on the CanvasItem are provided (see draw_* functions). They can only be used inside the notification, signal or _draw() overrides function, though. Canvas items are draw in tree order. By default, children are on top of their parents so a root CanvasItem will be drawn behind everything (this can be changed per item though). Canvas items can also be hidden (hiding also their subtree). They provide many means for changing standard parameters such as opacity (for it and the subtree) and self opacity, 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. http://docs.godotengine.org/en/3.0/tutorials/2d/2d_transforms.html http://docs.godotengine.org/en/3.0/tutorials/2d/custom_drawing_in_2d.html Called (if exists) to draw the canvas item. Draws a string character using a custom font. Returns the advance, depending on the char width and kerning with an optional next char. Draws a colored circle. Draws a colored polygon of any amount of points, convex or concave. Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. Draws multiple, parallel lines with a uniform [code]color[/code] and [code]width[/code] and optional antialiasing. 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]. Draws a polygon of any amount of points, convex or concave. Draws interconnected line segments with a uniform [code]color[/code] and [code]width[/code] and optional antialiasing. 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]. 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. Draws a colored rectangle. Sets a custom transform for drawing via components. Anything drawn afterwards will be transformed by this. Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this. Draws a string using a custom font. Draws a styled rectangle. Draws a texture at a given position. Draws a textured rectangle at a given position, optionally modulated by a color. Transpose swaps the x and y coordinates when reading the texture. Draws a textured rectangle region at a given position, optionally modulated by a color. Transpose swaps the x and y coordinates when reading the texture. Return the [RID] of the [World2D] canvas where this item is in. Return the canvas item RID used by [VisualServer] for this item. Get the transform matrix of this item's canvas. Get the global position of the mouse. Get the global transform matrix of this item. Get the global transform matrix of this item in relation to the canvas. Get the mouse position relative to this item's position. Get the transform matrix of this item. Get the viewport's boundaries as a [Rect2]. Get this item's transform in relation to the viewport. Get the [World2D] where this item is in. Hide the CanvasItem currently visible. Returns [code]true[/code] if local transform notifications are communicated to children. Return if set as toplevel. See [method set_as_toplevel]. Returns [code]true[/code] if global transform notifications are communicated to children. 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]. Assigns [code]screen_point[/code] as this node's new local transform. Transformations issued by [code]event[/code]'s inputs are applied in local space instead of global space. Sets as top level. This means that it will not inherit transform from parent canvas items. If [code]enable[/code] is [code]true[/code], children will be updated with local transform data. If [code]enable[/code] is [code]true[/code], children will be updated with global transform data. Show the CanvasItem currently hidden. Queue the CanvasItem for update. [code]NOTIFICATION_DRAW[/code] will be called on idle time to request redraw. The rendering layers in which this [code]CanvasItem[/code] responds to [Light2D] nodes. Default value: [code]1[/code]. The material applied to textures on this [code]CanvasItem[/code]. Default value: [code]null[/code]. The color applied to textures on this [code]CanvasItem[/code]. Default value: [code]Color(1, 1, 1, 1)[/code] (opaque "white"). The color applied to textures on this [code]CanvasItem[/code]. This is not inherited by children [code]CanvasItem[/code]s. Default value: [code]Color(1, 1, 1, 1)[/code] (opaque "white").. If [code]true[/code] the object draws behind its parent. Default value: [code]false[/code]. If [code]true[/code] the object draws on top of its parent. Default value: [code]true[/code]. If [code]true[/code] the parent [code]CanvasItem[/code]'s [member material] property is used as this one's material. Default value: [code]false[/code]. If [code]true[/code] this [code]CanvasItem[/code] is drawn. Default value: [code]true[/code]. Emitted when the CanvasItem must redraw. This can only be connected realtime, as deferred will not allow drawing. Emitted when becoming hidden. Emitted when the item rect has changed. Emitted when the visibility (hidden/visible) changes. Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value. Additive blending mode. Subtractive blending mode. Multiplicative blending mode. Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value. Disable blending mode. Colors including alpha are written as is. Only applicable for render targets with a transparent background. No lighting will be applied. Canvas item transform has changed. Only received if requested. CanvasItem is requested to draw. Canvas item visibility has changed. Canvas item has entered the canvas. Canvas item has exited the canvas.