diff options
Diffstat (limited to 'doc/classes/CanvasItem.xml')
-rw-r--r-- | doc/classes/CanvasItem.xml | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index be361f93f3..899988022f 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -316,7 +316,16 @@ <argument index="4" name="clip_w" type="int" default="-1"> </argument> <description> - Draws a string using a custom font. + Draws [code]text[/code] using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. + [b]Example using the default project font:[/b] + [codeblock] + # 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") + [/codeblock] + See also [method Font.draw]. </description> </method> <method name="draw_style_box"> @@ -525,7 +534,7 @@ <return type="bool"> </return> <description> - 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]. + Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree. </description> </method> <method name="make_canvas_position_local" qualifiers="const"> @@ -617,7 +626,8 @@ If [code]true[/code], the parent [CanvasItem]'s [member material] property is used as this one's material. </member> <member name="visible" type="bool" setter="set_visible" getter="is_visible" default="true"> - 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. + If [code]true[/code], this [CanvasItem] is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]). + [b]Note:[/b] For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead. </member> </members> <signals> |