diff options
Diffstat (limited to 'doc/classes/Sprite.xml')
-rw-r--r-- | doc/classes/Sprite.xml | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/doc/classes/Sprite.xml b/doc/classes/Sprite.xml index d1cdbffc6c..26ff67cc74 100644 --- a/doc/classes/Sprite.xml +++ b/doc/classes/Sprite.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Sprite" inherits="Node2D" category="Core" version="3.1"> +<class name="Sprite" inherits="Node2D" category="Core" version="3.2"> <brief_description> General purpose Sprite node. </brief_description> @@ -8,14 +8,18 @@ </description> <tutorials> </tutorials> - <demos> - </demos> <methods> <method name="get_rect" qualifiers="const"> <return type="Rect2"> </return> <description> - Returns a Rect2 representing the Sprite's boundary relative to its local coordinates. + Returns a [Rect2] representing the Sprite's boundary in local coordinates. Can be used to detect if the Sprite was clicked. Example: + [codeblock] + func _input(event): + if event is InputEventMouseButton and event.pressed and event.button_index == BUTTON_LEFT: + if get_rect().has_point(to_local(event.position)): + print("A click!") + [/codeblock] </description> </method> <method name="is_pixel_opaque" qualifiers="const"> @@ -50,7 +54,7 @@ The texture's drawing offset. </member> <member name="region_enabled" type="bool" setter="set_region" getter="is_region"> - If [code]true[/code], texture is cut from a larger atlas texture. See [code]region_rect[/code]. Default value: [code]false[/code]. + If [code]true[/code], texture is cut from a larger atlas texture. See [member region_rect]. Default value: [code]false[/code]. </member> <member name="region_filter_clip" type="bool" setter="set_region_filter_clip" getter="is_region_filter_clip_enabled"> If [code]true[/code], the outermost pixels get blurred out. |