Explorar o código

Merge pull request #251 from greenfire27/getpositionxy

Added getPositionX and Y
Peter Robinson %!s(int64=10) %!d(string=hai) anos
pai
achega
a677c4b640
Modificáronse 1 ficheiros con 22 adicións e 0 borrados
  1. 22 0
      engine/source/2d/sceneobject/SceneObject_ScriptBinding.h

+ 22 - 0
engine/source/2d/sceneobject/SceneObject_ScriptBinding.h

@@ -590,6 +590,28 @@ ConsoleMethodWithDocs(SceneObject, getPosition, ConsoleString, 2, 2, ())
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
+/*! Gets the object's position.
+	@return The x (horizontal) position of the object.
+*/
+ConsoleMethodWithDocs(SceneObject, getPositionX, ConsoleFloat, 2, 2, ())
+{
+	// Get position.
+	return object->getPosition().x;
+}
+
+//-----------------------------------------------------------------------------
+
+/*! Gets the object's position.
+	@return The y (vertical) position of the object.
+*/
+ConsoleMethodWithDocs(SceneObject, getPositionY, ConsoleFloat, 2, 2, ())
+{
+	// Get position.
+	return object->getPosition().y;
+}
+
+//-----------------------------------------------------------------------------
+
 /*! Gets the current render position.
 /*! Gets the current render position.
     @return (float x/float y) The x and y (horizontal and vertical) render position of the object.
     @return (float x/float y) The x and y (horizontal and vertical) render position of the object.
 */
 */