Browse Source

Changed object->cast_to to Object::cast_to

Wilson E. Alvarez 6 years ago
parent
commit
e7a3db9f1f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      development/cpp/object_class.rst

+ 2 - 2
development/cpp/object_class.rst

@@ -25,7 +25,7 @@ This makes Objects gain a lot of functionality, like for example
     obj = memnew(CustomObject);
     print_line("Object class: ", obj->get_class()); // print object class
 
-    obj2 = obj->cast_to<OtherClass>(); // converting between classes, this also works without RTTI enabled.
+    obj2 = Object::cast_to<OtherClass>(obj); // converting between classes, this also works without RTTI enabled.
 
 References:
 ~~~~~~~~~~~
@@ -199,7 +199,7 @@ example:
 
     void somefunc(Object *some_obj) {
 
-         Button *button = some_obj->cast_to<Button>();
+         Button *button = Object::cast_to<Button>(some_obj);
     }
 
 If cast fails, NULL is returned. This system uses RTTI, but it also