diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/CanvasItem.xml | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index d1fdca5814..d8c1af0b3c 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -5,7 +5,7 @@ </brief_description> <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] for anything GUI-related, and by [Node2D] for anything related to the 2D engine. - Any [CanvasItem] can draw. For this, [method update] is called by the engine, 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 [method _draw], its corresponding [method Object._notification] or methods connected to the [signal draw] signal. + Any [CanvasItem] can draw. For this, [method queue_redraw] is called by the engine, 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 [method _draw], its corresponding [method Object._notification] or methods connected to the [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. @@ -20,7 +20,7 @@ <method name="_draw" qualifiers="virtual"> <return type="void" /> <description> - Called when [CanvasItem] has been requested to redraw (when [method update] is called, either manually or by the engine). + Called when [CanvasItem] has been requested to redraw (after [method queue_redraw] is called, either manually or by the engine). Corresponds to the [constant NOTIFICATION_DRAW] notification in [method Object._notification]. </description> </method> @@ -500,6 +500,12 @@ Transformations issued by [param event]'s inputs are applied in local space instead of global space. </description> </method> + <method name="queue_redraw"> + <return type="void" /> + <description> + Queues the [CanvasItem] to redraw. During idle time, if [CanvasItem] is visible, [constant NOTIFICATION_DRAW] is sent and [method _draw] is called. This only occurs [b]once[/b] per frame, even if this method has been called multiple times. + </description> + </method> <method name="set_notify_local_transform"> <return type="void" /> <param index="0" name="enable" type="bool" /> @@ -520,12 +526,6 @@ Show the [CanvasItem] if it's currently hidden. This is equivalent to setting [member visible] to [code]true[/code]. For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead. </description> </method> - <method name="update"> - <return type="void" /> - <description> - Queues the [CanvasItem] to redraw. During idle time, if [CanvasItem] is visible, [constant NOTIFICATION_DRAW] is sent and [method _draw] is called. This only occurs [b]once[/b] per frame, even if this method has been called multiple times. - </description> - </method> </methods> <members> <member name="clip_children" type="bool" setter="set_clip_children" getter="is_clipping_children" default="false"> |