2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2019-04-01 10:33:56 +00:00
<class name= "Curve" inherits= "Resource" category= "Core" version= "3.2" >
2017-09-12 20:42:36 +00:00
<brief_description >
2017-12-11 19:05:26 +00:00
A mathematic curve.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2017-12-11 19:05:26 +00:00
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.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
</tutorials>
<demos >
</demos>
<methods >
<method name= "add_point" >
<return type= "int" >
</return>
2017-09-10 13:37:49 +00:00
<argument index= "0" name= "position" type= "Vector2" >
2017-09-12 20:42:36 +00:00
</argument>
<argument index= "1" name= "left_tangent" type= "float" default= "0" >
</argument>
<argument index= "2" name= "right_tangent" type= "float" default= "0" >
</argument>
<argument index= "3" name= "left_mode" type= "int" enum= "Curve.TangentMode" default= "0" >
</argument>
<argument index= "4" name= "right_mode" type= "int" enum= "Curve.TangentMode" default= "0" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
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].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "bake" >
<return type= "void" >
</return>
<description >
2017-12-11 19:05:26 +00:00
Recomputes the baked cache of points for the curve.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "clean_dupes" >
<return type= "void" >
</return>
<description >
2017-12-11 19:05:26 +00:00
Removes points that are closer than [code]CMP_EPSILON[/code] (0.00001) units to their neighbor on the curve.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "clear_points" >
<return type= "void" >
</return>
<description >
2017-12-11 19:05:26 +00:00
Removes all points from the curve.
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-09-07 18:07:44 +00:00
<method name= "get_point_count" qualifiers= "const" >
<return type= "int" >
</return>
<description >
Returns the number of points describing the curve.
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "get_point_left_mode" qualifiers= "const" >
<return type= "int" enum= "Curve.TangentMode" >
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Returns the left [code]TangentMode[/code] for the point at [code]index[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_point_left_tangent" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Returns the left tangent angle (in degrees) for the point at [code]index[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
2017-09-10 13:37:49 +00:00
<method name= "get_point_position" qualifiers= "const" >
2017-09-12 20:42:36 +00:00
<return type= "Vector2" >
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Returns the curve coordinates for the point at [code]index[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_point_right_mode" qualifiers= "const" >
<return type= "int" enum= "Curve.TangentMode" >
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Returns the right [code]TangentMode[/code] for the point at [code]index[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_point_right_tangent" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Returns the right tangent angle (in degrees) for the point at [code]index[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "interpolate" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "offset" type= "float" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Returns the y value for the point that would exist at x-position [code]offset[/code] along the curve.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "interpolate_baked" >
<return type= "float" >
</return>
<argument index= "0" name= "offset" type= "float" >
</argument>
<description >
2017-12-16 19:34:16 +00:00
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.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "remove_point" >
<return type= "void" >
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Removes the point at [code]index[/code] from the curve.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_point_left_mode" >
<return type= "void" >
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<argument index= "1" name= "mode" type= "int" enum= "Curve.TangentMode" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Sets the left [code]TangentMode[/code] for the point at [code]index[/code] to [code]mode[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_point_left_tangent" >
<return type= "void" >
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<argument index= "1" name= "tangent" type= "float" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Sets the left tangent angle for the point at [code]index[/code] to [code]tangent[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_point_offset" >
2017-10-11 21:54:43 +00:00
<return type= "int" >
2017-09-12 20:42:36 +00:00
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<argument index= "1" name= "offset" type= "float" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Sets the offset from [code]0.5[/code]
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_point_right_mode" >
<return type= "void" >
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<argument index= "1" name= "mode" type= "int" enum= "Curve.TangentMode" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Sets the right [code]TangentMode[/code] for the point at [code]index[/code] to [code]mode[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_point_right_tangent" >
<return type= "void" >
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<argument index= "1" name= "tangent" type= "float" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Sets the right tangent angle for the point at [code]index[/code] to [code]tangent[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_point_value" >
<return type= "void" >
</return>
<argument index= "0" name= "index" type= "int" >
</argument>
<argument index= "1" name= "y" type= "float" >
</argument>
<description >
2017-12-11 19:05:26 +00:00
Assigns the vertical position [code]y[/code] to the point at [code]index[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
</methods>
<members >
2017-09-13 06:49:40 +00:00
<member name= "bake_resolution" type= "int" setter= "set_bake_resolution" getter= "get_bake_resolution" >
2017-12-11 19:05:26 +00:00
The number of points to include in the baked (i.e. cached) curve data.
2017-09-12 20:42:36 +00:00
</member>
2017-09-13 06:49:40 +00:00
<member name= "max_value" type= "float" setter= "set_max_value" getter= "get_max_value" >
2017-12-11 19:05:26 +00:00
The maximum value the curve can reach. Default value: [code]1[/code].
2017-09-12 20:42:36 +00:00
</member>
2017-09-13 06:49:40 +00:00
<member name= "min_value" type= "float" setter= "set_min_value" getter= "get_min_value" >
2017-12-11 19:05:26 +00:00
The minimum value the curve can reach. Default value: [code]0[/code].
2017-09-12 20:42:36 +00:00
</member>
</members>
<signals >
<signal name= "range_changed" >
<description >
2017-12-11 19:05:26 +00:00
Emitted when [member max_value] or [member min_value] is changed.
2017-09-12 20:42:36 +00:00
</description>
</signal>
</signals>
<constants >
2017-11-24 22:16:30 +00:00
<constant name= "TANGENT_FREE" value= "0" enum= "TangentMode" >
2017-12-11 19:05:26 +00:00
The tangent on this side of the point is user-defined.
2017-09-15 23:46:14 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "TANGENT_LINEAR" value= "1" enum= "TangentMode" >
2017-12-11 19:05:26 +00:00
The curve calculates the tangent on this side of the point as the slope halfway towards the adjacent point.
2017-09-15 23:46:14 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "TANGENT_MODE_COUNT" value= "2" enum= "TangentMode" >
2017-12-11 19:05:26 +00:00
The total number of available tangent modes.
2017-09-15 23:46:14 +00:00
</constant>
2017-09-12 20:42:36 +00:00
</constants>
</class>