aboutsummaryrefslogtreecommitdiff
path: root/core/variant_call.cpp
diff options
context:
space:
mode:
authorAndreas Haas2016-09-19 23:10:30 +0200
committerRémi Verschelde2016-10-09 17:18:29 +0200
commit94e5c480044f8d06dede4d96f8b4ed23bdf61969 (patch)
tree912e926dc191efc797d185fb4af78e8184a4ad36 /core/variant_call.cpp
parent4084ec4869075e66e18d365531be68265270786c (diff)
downloadgodot-94e5c480044f8d06dede4d96f8b4ed23bdf61969.tar.gz
godot-94e5c480044f8d06dede4d96f8b4ed23bdf61969.tar.zst
godot-94e5c480044f8d06dede4d96f8b4ed23bdf61969.zip
Expose Vector2::clamped() to scripts
Needed this and wondered that there's no built-in function for it. So I wanted to implement it and saw that it's actually already there, just wasn't bound ^^ (cherry picked from commit c21412fa7e098ac31b5d667d4d9f8eee3f12a2cd)
Diffstat (limited to 'core/variant_call.cpp')
-rw-r--r--core/variant_call.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 7956c14c2..4efeda735 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -346,6 +346,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var
VCALL_LOCALMEM0R(Vector2,angle);
// VCALL_LOCALMEM1R(Vector2,cross);
VCALL_LOCALMEM0R(Vector2,abs);
+ VCALL_LOCALMEM1R(Vector2,clamped);
VCALL_LOCALMEM0R(Rect2,get_area);
VCALL_LOCALMEM1R(Rect2,intersects);
@@ -1398,6 +1399,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
ADDFUNC1(VECTOR2,VECTOR2,Vector2,reflect,VECTOR2,"vec",varray());
//ADDFUNC1(VECTOR2,REAL,Vector2,cross,VECTOR2,"with",varray());
ADDFUNC0(VECTOR2,VECTOR2,Vector2,abs,varray());
+ ADDFUNC1(VECTOR2,VECTOR2,Vector2,clamped,REAL,"length",varray());
ADDFUNC0(RECT2,REAL,Rect2,get_area,varray());
ADDFUNC1(RECT2,BOOL,Rect2,intersects,RECT2,"b",varray());