Merge pull request #14646 from willnationsdev/docs4

[DOCS] Animation, CanvasItem, Curve3D, Curve
This commit is contained in:
Noshyaar 2017-12-15 17:44:13 +07:00 committed by GitHub
commit 01c04d611f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 14 deletions

View file

@ -38,6 +38,7 @@
<argument index="1" name="to_animation" type="Animation"> <argument index="1" name="to_animation" type="Animation">
</argument> </argument>
<description> <description>
Adds a new track that is a copy of the given track from [code]to_animation[/code].
</description> </description>
</method> </method>
<method name="find_track" qualifiers="const"> <method name="find_track" qualifiers="const">
@ -260,6 +261,7 @@
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Returns [code]true[/code] if the track at index [code]idx[/code] is enabled.
</description> </description>
</method> </method>
<method name="track_is_imported" qualifiers="const"> <method name="track_is_imported" qualifiers="const">
@ -319,6 +321,7 @@
<argument index="1" name="enabled" type="bool"> <argument index="1" name="enabled" type="bool">
</argument> </argument>
<description> <description>
Enables/disables the given track. Tracks are enabled by default.
</description> </description>
</method> </method>
<method name="track_set_imported"> <method name="track_set_imported">

View file

@ -36,7 +36,7 @@
<argument index="4" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> <argument index="4" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
</argument> </argument>
<description> <description>
Draw a string character using a custom font. Returns the advance, depending on the char width and kerning with an optional next char. Draws a string character using a custom font. Returns the advance, depending on the char width and kerning with an optional next char.
</description> </description>
</method> </method>
<method name="draw_circle"> <method name="draw_circle">
@ -49,7 +49,7 @@
<argument index="2" name="color" type="Color"> <argument index="2" name="color" type="Color">
</argument> </argument>
<description> <description>
Draw a colored circle. Draws a colored circle.
</description> </description>
</method> </method>
<method name="draw_colored_polygon"> <method name="draw_colored_polygon">
@ -68,7 +68,7 @@
<argument index="5" name="antialiased" type="bool" default="false"> <argument index="5" name="antialiased" type="bool" default="false">
</argument> </argument>
<description> <description>
Draw a colored polygon of any amount of points, convex or concave. Draws a colored polygon of any amount of points, convex or concave.
</description> </description>
</method> </method>
<method name="draw_line"> <method name="draw_line">
@ -85,7 +85,7 @@
<argument index="4" name="antialiased" type="bool" default="false"> <argument index="4" name="antialiased" type="bool" default="false">
</argument> </argument>
<description> <description>
Draw a line from a 2D point to another, with a given color and width. It can be optionally antialiased. Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased.
</description> </description>
</method> </method>
<method name="draw_multiline"> <method name="draw_multiline">
@ -100,6 +100,7 @@
<argument index="3" name="antialiased" type="bool" default="false"> <argument index="3" name="antialiased" type="bool" default="false">
</argument> </argument>
<description> <description>
Draws multiple, parallel lines with a uniform [code]color[/code] and [code]width[/code] and optional antialiasing.
</description> </description>
</method> </method>
<method name="draw_multiline_colors"> <method name="draw_multiline_colors">
@ -114,6 +115,7 @@
<argument index="3" name="antialiased" type="bool" default="false"> <argument index="3" name="antialiased" type="bool" default="false">
</argument> </argument>
<description> <description>
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].
</description> </description>
</method> </method>
<method name="draw_polygon"> <method name="draw_polygon">
@ -132,7 +134,7 @@
<argument index="5" name="antialiased" type="bool" default="false"> <argument index="5" name="antialiased" type="bool" default="false">
</argument> </argument>
<description> <description>
Draw a polygon of any amount of points, convex or concave. Draws a polygon of any amount of points, convex or concave.
</description> </description>
</method> </method>
<method name="draw_polyline"> <method name="draw_polyline">
@ -147,7 +149,7 @@
<argument index="3" name="antialiased" type="bool" default="false"> <argument index="3" name="antialiased" type="bool" default="false">
</argument> </argument>
<description> <description>
Draw a polyline with a uniform [code]color[/code] and [code]width[/code] and optional antialiasing. Draws interconnected line segments with a uniform [code]color[/code] and [code]width[/code] and optional antialiasing.
</description> </description>
</method> </method>
<method name="draw_polyline_colors"> <method name="draw_polyline_colors">
@ -162,7 +164,7 @@
<argument index="3" name="antialiased" type="bool" default="false"> <argument index="3" name="antialiased" type="bool" default="false">
</argument> </argument>
<description> <description>
Draw a polyline 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 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].
</description> </description>
</method> </method>
<method name="draw_primitive"> <method name="draw_primitive">
@ -181,7 +183,7 @@
<argument index="5" name="normal_map" type="Texture" default="null"> <argument index="5" name="normal_map" type="Texture" default="null">
</argument> </argument>
<description> <description>
Draw 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 custom primitive, 1 point for a point, 2 points for a line, 3 points for a triangle and 4 points for a quad.
</description> </description>
</method> </method>
<method name="draw_rect"> <method name="draw_rect">
@ -194,7 +196,7 @@
<argument index="2" name="filled" type="bool" default="true"> <argument index="2" name="filled" type="bool" default="true">
</argument> </argument>
<description> <description>
Draw a colored rectangle. Draws a colored rectangle.
</description> </description>
</method> </method>
<method name="draw_set_transform"> <method name="draw_set_transform">
@ -233,7 +235,7 @@
<argument index="4" name="clip_w" type="int" default="-1"> <argument index="4" name="clip_w" type="int" default="-1">
</argument> </argument>
<description> <description>
Draw a string using a custom font. Draws a string using a custom font.
</description> </description>
</method> </method>
<method name="draw_style_box"> <method name="draw_style_box">
@ -244,7 +246,7 @@
<argument index="1" name="rect" type="Rect2"> <argument index="1" name="rect" type="Rect2">
</argument> </argument>
<description> <description>
Draw a styled rectangle. Draws a styled rectangle.
</description> </description>
</method> </method>
<method name="draw_texture"> <method name="draw_texture">
@ -259,7 +261,7 @@
<argument index="3" name="normal_map" type="Texture" default="null"> <argument index="3" name="normal_map" type="Texture" default="null">
</argument> </argument>
<description> <description>
Draw a texture at a given position. Draws a texture at a given position.
</description> </description>
</method> </method>
<method name="draw_texture_rect"> <method name="draw_texture_rect">
@ -278,7 +280,7 @@
<argument index="5" name="normal_map" type="Texture" default="null"> <argument index="5" name="normal_map" type="Texture" default="null">
</argument> </argument>
<description> <description>
Draw 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 at a given position, optionally modulated by a color. Transpose swaps the x and y coordinates when reading the texture.
</description> </description>
</method> </method>
<method name="draw_texture_rect_region"> <method name="draw_texture_rect_region">
@ -299,7 +301,7 @@
<argument index="6" name="clip_uv" type="bool" default="true"> <argument index="6" name="clip_uv" type="bool" default="true">
</argument> </argument>
<description> <description>
Draw a textured rectangle region 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.
</description> </description>
</method> </method>
<method name="get_canvas" qualifiers="const"> <method name="get_canvas" qualifiers="const">

View file

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="Curve" inherits="Resource" category="Core" version="3.0-beta"> <class name="Curve" inherits="Resource" category="Core" version="3.0-beta">
<brief_description> <brief_description>
A mathematic curve.
</brief_description> </brief_description>
<description> <description>
A curve that can be saved and re-used for other objects. By default it ranges between [code]0[/code] and [code]1[/code] on the y-axis and positions points relative to the [code]0.5[/code] y-position.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>
@ -23,24 +25,28 @@
<argument index="4" name="right_mode" type="int" enum="Curve.TangentMode" default="0"> <argument index="4" name="right_mode" type="int" enum="Curve.TangentMode" default="0">
</argument> </argument>
<description> <description>
Adds a point to the curve. For each side, if the [code]*_mode[/code] is [code]TANGENT_LINEAR[/code], the [code]*_tangent[/code] angle (in degrees) uses the slope of the curve halfway to the adjacent point. Allows custom assignments to the [code]*_tangent[/code] angle if [code]*_mode[/code] is set to [code]TANGENT_FREE[/code].
</description> </description>
</method> </method>
<method name="bake"> <method name="bake">
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Recomputes the baked cache of points for the curve.
</description> </description>
</method> </method>
<method name="clean_dupes"> <method name="clean_dupes">
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Removes points that are closer than [code]CMP_EPSILON[/code] (0.00001) units to their neighbor on the curve.
</description> </description>
</method> </method>
<method name="clear_points"> <method name="clear_points">
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Removes all points from the curve.
</description> </description>
</method> </method>
<method name="get_point_left_mode" qualifiers="const"> <method name="get_point_left_mode" qualifiers="const">
@ -49,6 +55,7 @@
<argument index="0" name="index" type="int"> <argument index="0" name="index" type="int">
</argument> </argument>
<description> <description>
Returns the left [code]TangentMode[/code] for the point at [code]index[/code].
</description> </description>
</method> </method>
<method name="get_point_left_tangent" qualifiers="const"> <method name="get_point_left_tangent" qualifiers="const">
@ -57,6 +64,7 @@
<argument index="0" name="index" type="int"> <argument index="0" name="index" type="int">
</argument> </argument>
<description> <description>
Returns the left tangent angle (in degrees) for the point at [code]index[/code].
</description> </description>
</method> </method>
<method name="get_point_position" qualifiers="const"> <method name="get_point_position" qualifiers="const">
@ -65,6 +73,7 @@
<argument index="0" name="index" type="int"> <argument index="0" name="index" type="int">
</argument> </argument>
<description> <description>
Returns the curve coordinates for the point at [code]index[/code].
</description> </description>
</method> </method>
<method name="get_point_right_mode" qualifiers="const"> <method name="get_point_right_mode" qualifiers="const">
@ -73,6 +82,7 @@
<argument index="0" name="index" type="int"> <argument index="0" name="index" type="int">
</argument> </argument>
<description> <description>
Returns the right [code]TangentMode[/code] for the point at [code]index[/code].
</description> </description>
</method> </method>
<method name="get_point_right_tangent" qualifiers="const"> <method name="get_point_right_tangent" qualifiers="const">
@ -81,6 +91,7 @@
<argument index="0" name="index" type="int"> <argument index="0" name="index" type="int">
</argument> </argument>
<description> <description>
Returns the right tangent angle (in degrees) for the point at [code]index[/code].
</description> </description>
</method> </method>
<method name="interpolate" qualifiers="const"> <method name="interpolate" qualifiers="const">
@ -89,12 +100,14 @@
<argument index="0" name="offset" type="float"> <argument index="0" name="offset" type="float">
</argument> </argument>
<description> <description>
Returns the y value for the point that would exist at x-position [code]offset[/code] along the curve.
</description> </description>
</method> </method>
<method name="interpolate_baked"> <method name="interpolate_baked">
<return type="float"> <return type="float">
</return> </return>
<argument index="0" name="offset" type="float"> <argument index="0" name="offset" type="float">
Returns the y value for the point that would exist at x-position [code]offset[/code] along the curve using the baked cache. Bakes the curve's points if not already baked.
</argument> </argument>
<description> <description>
</description> </description>
@ -105,6 +118,7 @@
<argument index="0" name="index" type="int"> <argument index="0" name="index" type="int">
</argument> </argument>
<description> <description>
Removes the point at [code]index[/code] from the curve.
</description> </description>
</method> </method>
<method name="set_point_left_mode"> <method name="set_point_left_mode">
@ -115,6 +129,7 @@
<argument index="1" name="mode" type="int" enum="Curve.TangentMode"> <argument index="1" name="mode" type="int" enum="Curve.TangentMode">
</argument> </argument>
<description> <description>
Sets the left [code]TangentMode[/code] for the point at [code]index[/code] to [code]mode[/code].
</description> </description>
</method> </method>
<method name="set_point_left_tangent"> <method name="set_point_left_tangent">
@ -125,6 +140,7 @@
<argument index="1" name="tangent" type="float"> <argument index="1" name="tangent" type="float">
</argument> </argument>
<description> <description>
Sets the left tangent angle for the point at [code]index[/code] to [code]tangent[/code].
</description> </description>
</method> </method>
<method name="set_point_offset"> <method name="set_point_offset">
@ -135,6 +151,7 @@
<argument index="1" name="offset" type="float"> <argument index="1" name="offset" type="float">
</argument> </argument>
<description> <description>
Sets the offset from [code]0.5[/code]
</description> </description>
</method> </method>
<method name="set_point_right_mode"> <method name="set_point_right_mode">
@ -145,6 +162,7 @@
<argument index="1" name="mode" type="int" enum="Curve.TangentMode"> <argument index="1" name="mode" type="int" enum="Curve.TangentMode">
</argument> </argument>
<description> <description>
Sets the right [code]TangentMode[/code] for the point at [code]index[/code] to [code]mode[/code].
</description> </description>
</method> </method>
<method name="set_point_right_tangent"> <method name="set_point_right_tangent">
@ -155,6 +173,7 @@
<argument index="1" name="tangent" type="float"> <argument index="1" name="tangent" type="float">
</argument> </argument>
<description> <description>
Sets the right tangent angle for the point at [code]index[/code] to [code]tangent[/code].
</description> </description>
</method> </method>
<method name="set_point_value"> <method name="set_point_value">
@ -165,29 +184,37 @@
<argument index="1" name="y" type="float"> <argument index="1" name="y" type="float">
</argument> </argument>
<description> <description>
Assigns the vertical position [code]y[/code] to the point at [code]index[/code].
</description> </description>
</method> </method>
</methods> </methods>
<members> <members>
<member name="bake_resolution" type="int" setter="set_bake_resolution" getter="get_bake_resolution"> <member name="bake_resolution" type="int" setter="set_bake_resolution" getter="get_bake_resolution">
The number of points to include in the baked (i.e. cached) curve data.
</member> </member>
<member name="max_value" type="float" setter="set_max_value" getter="get_max_value"> <member name="max_value" type="float" setter="set_max_value" getter="get_max_value">
The maximum value the curve can reach. Default value: [code]1[/code].
</member> </member>
<member name="min_value" type="float" setter="set_min_value" getter="get_min_value"> <member name="min_value" type="float" setter="set_min_value" getter="get_min_value">
The minimum value the curve can reach. Default value: [code]0[/code].
</member> </member>
</members> </members>
<signals> <signals>
<signal name="range_changed"> <signal name="range_changed">
<description> <description>
Emitted when [member max_value] or [member min_value] is changed.
</description> </description>
</signal> </signal>
</signals> </signals>
<constants> <constants>
<constant name="TANGENT_FREE" value="0" enum="TangentMode"> <constant name="TANGENT_FREE" value="0" enum="TangentMode">
The tangent on this side of the point is user-defined.
</constant> </constant>
<constant name="TANGENT_LINEAR" value="1" enum="TangentMode"> <constant name="TANGENT_LINEAR" value="1" enum="TangentMode">
The curve calculates the tangent on this side of the point as the slope halfway towards the adjacent point.
</constant> </constant>
<constant name="TANGENT_MODE_COUNT" value="2" enum="TangentMode"> <constant name="TANGENT_MODE_COUNT" value="2" enum="TangentMode">
The total number of available tangent modes.
</constant> </constant>
</constants> </constants>
</class> </class>

View file

@ -32,6 +32,7 @@
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Removes all points from the curve.
</description> </description>
</method> </method>
<method name="get_baked_length" qualifiers="const"> <method name="get_baked_length" qualifiers="const">
@ -203,6 +204,7 @@
</methods> </methods>
<members> <members>
<member name="bake_interval" type="float" setter="set_bake_interval" getter="get_bake_interval"> <member name="bake_interval" type="float" setter="set_bake_interval" getter="get_bake_interval">
The distance in meters between two adjacent cached points. Changing it forces the cache to be recomputed the next time the [method get_baked_points] or [method get_baked_length] function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care.
</member> </member>
</members> </members>
<constants> <constants>