Document Viewport and ViewportSprite classes

(cherry picked from commit 662e0cc411)
This commit is contained in:
Bojidar Marinov 2016-06-05 14:51:44 +03:00 committed by Rémi Verschelde
parent d5bed26e42
commit aad9cd3e22
1 changed files with 61 additions and 0 deletions

View File

@ -40471,54 +40471,63 @@ This method controls whether the position between two cached points is interpola
<return type="World2D"> <return type="World2D">
</return> </return>
<description> <description>
Return the 2D world of the viewport.
</description> </description>
</method> </method>
<method name="set_world"> <method name="set_world">
<argument index="0" name="world" type="World"> <argument index="0" name="world" type="World">
</argument> </argument>
<description> <description>
Change the 3D world of the viewport.
</description> </description>
</method> </method>
<method name="get_world" qualifiers="const"> <method name="get_world" qualifiers="const">
<return type="World"> <return type="World">
</return> </return>
<description> <description>
Return the 3D world of the viewport.
</description> </description>
</method> </method>
<method name="find_world" qualifiers="const"> <method name="find_world" qualifiers="const">
<return type="World"> <return type="World">
</return> </return>
<description> <description>
Return the 3D world of the viewport, or if no such present, the one of the parent viewport.
</description> </description>
</method> </method>
<method name="set_canvas_transform"> <method name="set_canvas_transform">
<argument index="0" name="xform" type="Matrix32"> <argument index="0" name="xform" type="Matrix32">
</argument> </argument>
<description> <description>
Set the canvas transform of the viewport, useful for changing the on-screen positions of all child [CanvasItem]s. This is relative to the global canvas transform of the viewport.
</description> </description>
</method> </method>
<method name="get_canvas_transform" qualifiers="const"> <method name="get_canvas_transform" qualifiers="const">
<return type="Matrix32"> <return type="Matrix32">
</return> </return>
<description> <description>
Get the canvas transform of the viewport.
</description> </description>
</method> </method>
<method name="set_global_canvas_transform"> <method name="set_global_canvas_transform">
<argument index="0" name="xform" type="Matrix32"> <argument index="0" name="xform" type="Matrix32">
</argument> </argument>
<description> <description>
Set the global canvas transform of the viewport. The canvas transform is relative to this.
</description> </description>
</method> </method>
<method name="get_global_canvas_transform" qualifiers="const"> <method name="get_global_canvas_transform" qualifiers="const">
<return type="Matrix32"> <return type="Matrix32">
</return> </return>
<description> <description>
Get the global canvas transform of the viewport.
</description> </description>
</method> </method>
<method name="get_final_transform" qualifiers="const"> <method name="get_final_transform" qualifiers="const">
<return type="Matrix32"> <return type="Matrix32">
</return> </return>
<description> <description>
Get the total transform of the viewport.
</description> </description>
</method> </method>
<method name="get_visible_rect" qualifiers="const"> <method name="get_visible_rect" qualifiers="const">
@ -40550,134 +40559,157 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="margin" type="Vector2" default="Vector2(0,0)"> <argument index="2" name="margin" type="Vector2" default="Vector2(0,0)">
</argument> </argument>
<description> <description>
Set the size of the viewport. If the enable parameter is true, it would use the override, otherwise it would use the default size. If the size parameter is equal to [code](-1, -1)[/code], it won't update the size.
</description> </description>
</method> </method>
<method name="get_size_override" qualifiers="const"> <method name="get_size_override" qualifiers="const">
<return type="Vector2"> <return type="Vector2">
</return> </return>
<description> <description>
Get the size override set with [method set_size_override].
</description> </description>
</method> </method>
<method name="is_size_override_enabled" qualifiers="const"> <method name="is_size_override_enabled" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Get the enabled status of the size override set with [method set_size_override].
</description> </description>
</method> </method>
<method name="set_size_override_stretch"> <method name="set_size_override_stretch">
<argument index="0" name="enabled" type="bool"> <argument index="0" name="enabled" type="bool">
</argument> </argument>
<description> <description>
Set whether the size override affects stretch as well.
</description> </description>
</method> </method>
<method name="is_size_override_stretch_enabled" qualifiers="const"> <method name="is_size_override_stretch_enabled" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Get the enabled status of the size strech override set with [method set_size_override_stretch].
</description> </description>
</method> </method>
<method name="queue_screen_capture"> <method name="queue_screen_capture">
<description> <description>
Queue a multithreaded screenshot, you can retrive it at a later frame via [method get_screen_capture].
</description> </description>
</method> </method>
<method name="get_screen_capture" qualifiers="const"> <method name="get_screen_capture" qualifiers="const">
<return type="Image"> <return type="Image">
</return> </return>
<description> <description>
Return the captured screenshot after [method queue_screen_capture]. You might need to check more than one frame untill the right image is returned.
</description> </description>
</method> </method>
<method name="set_as_render_target"> <method name="set_as_render_target">
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
Set the viewport's render target mode.
</description> </description>
</method> </method>
<method name="is_set_as_render_target" qualifiers="const"> <method name="is_set_as_render_target" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return whether the viewport is set as a render target by [method set_as_render_target].
</description> </description>
</method> </method>
<method name="set_render_target_vflip"> <method name="set_render_target_vflip">
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
Set whether the render target should be flipped on the Y axis.
</description> </description>
</method> </method>
<method name="get_render_target_vflip" qualifiers="const"> <method name="get_render_target_vflip" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Set whether the render target is flipped on the Y axis.
</description> </description>
</method> </method>
<method name="set_render_target_clear_on_new_frame"> <method name="set_render_target_clear_on_new_frame">
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
Enable/disable automatic clearing of the render target on each frame. You might find it better to disable this if you are using the viewport for rarely updated textures. To clear manually, check [method render_target_clear]
</description> </description>
</method> </method>
<method name="get_render_target_clear_on_new_frame" qualifiers="const"> <method name="get_render_target_clear_on_new_frame" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return whether automatic clearing of the render target on each frame is enabled.
</description> </description>
</method> </method>
<method name="render_target_clear"> <method name="render_target_clear">
<description> <description>
Clear the render target manually.
</description> </description>
</method> </method>
<method name="set_render_target_filter"> <method name="set_render_target_filter">
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
Set whether the rendered texture should have filters enabled. Disable if you want the texture's pixels be visible.
</description> </description>
</method> </method>
<method name="get_render_target_filter" qualifiers="const"> <method name="get_render_target_filter" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Get whether the rendered texture has filters enabled.
</description> </description>
</method> </method>
<method name="set_render_target_gen_mipmaps"> <method name="set_render_target_gen_mipmaps">
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
Set whether the rendered texture should have mipmaps generated. Mipmaps allow the texture to have better antialiasing from far away.
</description> </description>
</method> </method>
<method name="get_render_target_gen_mipmaps" qualifiers="const"> <method name="get_render_target_gen_mipmaps" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Get whether the rendered texture will have mipmaps generated.
</description> </description>
</method> </method>
<method name="set_render_target_update_mode"> <method name="set_render_target_update_mode">
<argument index="0" name="mode" type="int"> <argument index="0" name="mode" type="int">
</argument> </argument>
<description> <description>
Set when the render target should be updated, has to be one of the [code]RENDER_TARGET_UPDATE_*[/code] constants.
</description> </description>
</method> </method>
<method name="get_render_target_update_mode" qualifiers="const"> <method name="get_render_target_update_mode" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Get when the render target would be updated, will be one of the [code]RENDER_TARGET_UPDATE_*[/code] constants.
</description> </description>
</method> </method>
<method name="get_render_target_texture" qualifiers="const"> <method name="get_render_target_texture" qualifiers="const">
<return type="RenderTargetTexture"> <return type="RenderTargetTexture">
</return> </return>
<description> <description>
Get the render target's texture, for use with various objects that you want to texture with the viewport.
</description> </description>
</method> </method>
<method name="set_physics_object_picking"> <method name="set_physics_object_picking">
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
Enable/disable picking for all physics objects inside the viewport.
</description> </description>
</method> </method>
<method name="get_physics_object_picking"> <method name="get_physics_object_picking">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Get whether picking for all physics objects inside the viewport is enabled.
</description> </description>
</method> </method>
<method name="get_viewport" qualifiers="const"> <method name="get_viewport" qualifiers="const">
@ -40701,156 +40733,185 @@ This method controls whether the position between two cached points is interpola
</method> </method>
<method name="update_worlds"> <method name="update_worlds">
<description> <description>
Force update of the 2D and 3D worlds.
</description> </description>
</method> </method>
<method name="set_use_own_world"> <method name="set_use_own_world">
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
Make the viewport use a world separate from the parent viewport's world.
</description> </description>
</method> </method>
<method name="is_using_own_world" qualifiers="const"> <method name="is_using_own_world" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return whether the viewport is using a world separate from the parent viewport's world.
</description> </description>
</method> </method>
<method name="get_camera" qualifiers="const"> <method name="get_camera" qualifiers="const">
<return type="Camera"> <return type="Camera">
</return> </return>
<description> <description>
Return the active 3D camera.
</description> </description>
</method> </method>
<method name="set_as_audio_listener"> <method name="set_as_audio_listener">
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
Makes the viewport send sounds to the speakers.
</description> </description>
</method> </method>
<method name="is_audio_listener" qualifiers="const"> <method name="is_audio_listener" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns whether the viewport sends sounds to the speakers.
</description> </description>
</method> </method>
<method name="set_as_audio_listener_2d"> <method name="set_as_audio_listener_2d">
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
Makes the viewport send sounds from 2D emitters to the speakers.
</description> </description>
</method> </method>
<method name="is_audio_listener_2d" qualifiers="const"> <method name="is_audio_listener_2d" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns whether the viewport sends soundsfrom 2D emitters to the speakers.
</description> </description>
</method> </method>
<method name="set_render_target_to_screen_rect"> <method name="set_render_target_to_screen_rect">
<argument index="0" name="rect" type="Rect2"> <argument index="0" name="rect" type="Rect2">
</argument> </argument>
<description> <description>
Map a part of the screen to the render target directly.
</description> </description>
</method> </method>
<method name="get_mouse_pos" qualifiers="const"> <method name="get_mouse_pos" qualifiers="const">
<return type="Vector2"> <return type="Vector2">
</return> </return>
<description> <description>
Get the mouse position, relative to the viewport.
</description> </description>
</method> </method>
<method name="warp_mouse"> <method name="warp_mouse">
<argument index="0" name="to_pos" type="Vector2"> <argument index="0" name="to_pos" type="Vector2">
</argument> </argument>
<description> <description>
Wrap the mouse to a position, relative to the viewport.
</description> </description>
</method> </method>
<method name="gui_has_modal_stack" qualifiers="const"> <method name="gui_has_modal_stack" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returs whether there are shown modals on-screen.
</description> </description>
</method> </method>
<method name="set_disable_input"> <method name="set_disable_input">
<argument index="0" name="disable" type="bool"> <argument index="0" name="disable" type="bool">
</argument> </argument>
<description> <description>
Set whether input to the viewport is disabled.
</description> </description>
</method> </method>
<method name="is_input_disabled" qualifiers="const"> <method name="is_input_disabled" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return whether input to the viewport is disabled.
</description> </description>
</method> </method>
</methods> </methods>
<signals> <signals>
<signal name="size_changed"> <signal name="size_changed">
<description> <description>
Emitted when the size of the viewport is changed, whether by [method set_size_override], resize of window, or some other means.
</description> </description>
</signal> </signal>
</signals> </signals>
<constants> <constants>
<constant name="RENDER_TARGET_UPDATE_DISABLED" value="0"> <constant name="RENDER_TARGET_UPDATE_DISABLED" value="0">
Do not update the render target.
</constant> </constant>
<constant name="RENDER_TARGET_UPDATE_ONCE" value="1"> <constant name="RENDER_TARGET_UPDATE_ONCE" value="1">
Update the render target once, then switch to [code]RENDER_TARGET_UPDATE_DISABLED[/code]
</constant> </constant>
<constant name="RENDER_TARGET_UPDATE_WHEN_VISIBLE" value="2"> <constant name="RENDER_TARGET_UPDATE_WHEN_VISIBLE" value="2">
Update the render target only when it is visible. This is the default value.
</constant> </constant>
<constant name="RENDER_TARGET_UPDATE_ALWAYS" value="3"> <constant name="RENDER_TARGET_UPDATE_ALWAYS" value="3">
Update the render target always.
</constant> </constant>
</constants> </constants>
</class> </class>
<class name="ViewportSprite" inherits="Node2D" category="Core"> <class name="ViewportSprite" inherits="Node2D" category="Core">
<brief_description> <brief_description>
Displays a viewport as a sprite.
</brief_description> </brief_description>
<description> <description>
Used to display a [Viewport] node at some position in the world, without having to mess with [RenderTargetTexture]s.
</description> </description>
<methods> <methods>
<method name="set_viewport_path"> <method name="set_viewport_path">
<argument index="0" name="path" type="NodePath"> <argument index="0" name="path" type="NodePath">
</argument> </argument>
<description> <description>
Set the path to the shown [Viewport] node.
</description> </description>
</method> </method>
<method name="get_viewport_path" qualifiers="const"> <method name="get_viewport_path" qualifiers="const">
<return type="NodePath"> <return type="NodePath">
</return> </return>
<description> <description>
Return the path to the shown [Viewport] node.
</description> </description>
</method> </method>
<method name="set_centered"> <method name="set_centered">
<argument index="0" name="centered" type="bool"> <argument index="0" name="centered" type="bool">
</argument> </argument>
<description> <description>
Set whether the viewport's texture should be centered on the origin.
</description> </description>
</method> </method>
<method name="is_centered" qualifiers="const"> <method name="is_centered" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return whether the viewport's texture is centered on the origin.
</description> </description>
</method> </method>
<method name="set_offset"> <method name="set_offset">
<argument index="0" name="offset" type="Vector2"> <argument index="0" name="offset" type="Vector2">
</argument> </argument>
<description> <description>
Set the offset to the origin of the texture.
</description> </description>
</method> </method>
<method name="get_offset" qualifiers="const"> <method name="get_offset" qualifiers="const">
<return type="Vector2"> <return type="Vector2">
</return> </return>
<description> <description>
get the offset to the origin of the texture.
</description> </description>
</method> </method>
<method name="set_modulate"> <method name="set_modulate">
<argument index="0" name="modulate" type="Color"> <argument index="0" name="modulate" type="Color">
</argument> </argument>
<description> <description>
Set color modulation for the texture. All texture pixels are multiplied by this color. Color may contain rgb values above 1 to achieve a highlight effect.
</description> </description>
</method> </method>
<method name="get_modulate" qualifiers="const"> <method name="get_modulate" qualifiers="const">
<return type="Color"> <return type="Color">
</return> </return>
<description> <description>
Get color modulation for the texture. All texture pixels are multiplied by this color.
</description> </description>
</method> </method>
</methods> </methods>