Merge pull request #21842 from merumelu/curve-point-count

Bind Curve::get_point_count
This commit is contained in:
Rémi Verschelde 2018-09-10 16:49:09 +02:00 committed by GitHub
commit 584f1ab0c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -49,6 +49,13 @@
Removes all points from the curve.
</description>
</method>
<method name="get_point_count" qualifiers="const">
<return type="int">
</return>
<description>
Returns the number of points describing the curve.
</description>
</method>
<method name="get_point_left_mode" qualifiers="const">
<return type="int" enum="Curve.TangentMode">
</return>

View file

@ -491,6 +491,7 @@ void Curve::ensure_default_setup(float p_min, float p_max) {
void Curve::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_point_count"), &Curve::get_point_count);
ClassDB::bind_method(D_METHOD("add_point", "position", "left_tangent", "right_tangent", "left_mode", "right_mode"), &Curve::add_point, DEFVAL(0), DEFVAL(0), DEFVAL(TANGENT_FREE), DEFVAL(TANGENT_FREE));
ClassDB::bind_method(D_METHOD("remove_point", "index"), &Curve::remove_point);
ClassDB::bind_method(D_METHOD("clear_points"), &Curve::clear_points);