summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-02-01 18:59:47 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-02-01 18:59:47 -0300
commitcecb37a7a3269338432ec0cf455af355e8af0eb8 (patch)
tree35069c57b6d68bd1c8537966f60cbe092608d127 /core
parent519c8667032225d2c987562a716c7a2629198772 (diff)
parentb65376249113a2524f8726507a98b161a6cf45a4 (diff)
Merge pull request #3532 from eska014/fix-globals-vectors
Encode vectors in Globals
Diffstat (limited to 'core')
-rw-r--r--core/globals.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/globals.cpp b/core/globals.cpp
index 5f52420735..d63f9c1bb4 100644
--- a/core/globals.cpp
+++ b/core/globals.cpp
@@ -916,6 +916,14 @@ static String _encode_variant(const Variant& p_variant) {
float val = p_variant;
return rtos(val)+(val==int(val)?".0":"");
} break;
+ case Variant::VECTOR2: {
+ Vector2 val = p_variant;
+ return String("Vector2(")+rtos(val.x)+String(", ")+rtos(val.y)+String(")");
+ } break;
+ case Variant::VECTOR3: {
+ Vector3 val = p_variant;
+ return String("Vector3(")+rtos(val.x)+ String(", ") +rtos(val.y)+ String(", ") +rtos(val.z)+String(")");
+ } break;
case Variant::STRING: {
String val = p_variant;
return "\""+val.xml_escape()+"\"";