Curve¶
Inherits: Resource < RefCounted < Object
A mathematical curve.
Description¶
This resource describes a mathematical curve by defining a set of points and tangents at each point. By default, it ranges between 0
and 1
on the Y axis and positions points relative to the 0.5
Y position.
See also Gradient which is designed for color interpolation. See also Curve2D and Curve3D.
Properties¶
|
||
|
||
|
||
|
Methods¶
add_point ( Vector2 position, float left_tangent=0, float right_tangent=0, TangentMode left_mode=0, TangentMode right_mode=0 ) |
|
void |
bake ( ) |
void |
clean_dupes ( ) |
void |
clear_points ( ) |
get_point_left_mode ( int index ) const |
|
get_point_left_tangent ( int index ) const |
|
get_point_position ( int index ) const |
|
get_point_right_mode ( int index ) const |
|
get_point_right_tangent ( int index ) const |
|
void |
remove_point ( int index ) |
sample_baked ( float offset ) const |
|
void |
set_point_left_mode ( int index, TangentMode mode ) |
void |
set_point_left_tangent ( int index, float tangent ) |
set_point_offset ( int index, float offset ) |
|
void |
set_point_right_mode ( int index, TangentMode mode ) |
void |
set_point_right_tangent ( int index, float tangent ) |
void |
set_point_value ( int index, float y ) |
Signals¶
range_changed ( )
Enumerations¶
enum TangentMode:
TangentMode TANGENT_FREE = 0
The tangent on this side of the point is user-defined.
TangentMode TANGENT_LINEAR = 1
The curve calculates the tangent on this side of the point as the slope halfway towards the adjacent point.
TangentMode TANGENT_MODE_COUNT = 2
The total number of available tangent modes.
Property Descriptions¶
int bake_resolution = 100
The number of points to include in the baked (i.e. cached) curve data.
float max_value = 1.0
The maximum value the curve can reach.
float min_value = 0.0