Browse Source

- Removed SceneObject "getPositionX()" and "getPositionY()" as it can be replaced in script with field components of ".position.x" and ".position.y".
- Updated the toys that use it.

MelvMay-GG 12 years ago
parent
commit
7cb605a

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

@@ -514,24 +514,6 @@ ConsoleMethod(SceneObject, getPosition, const char*, 2, 2, "() Gets the object's
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-ConsoleMethod(SceneObject, getPositionX, F32, 2, 2, "() Gets the object's x position.\n"
-                                                       "@return (float x) The horizontal position of the object")
-{
-    // Get Position X-Component.
-    return object->getPosition().x;
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethod(SceneObject, getPositionY, F32, 2, 2, "() Gets the object's y position.\n"
-                                                       "@return (float y) The vertical position of the object")
-{
-    // Get Position Y-Component.
-    return object->getPosition().y;
-}
-
-//-----------------------------------------------------------------------------
-
 ConsoleMethod(SceneObject, getRenderPosition, const char*, 2, 2, "() Gets the current render position.\n"
 ConsoleMethod(SceneObject, getRenderPosition, const char*, 2, 2, "() Gets the current render position.\n"
                                                                     "@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.")
 {
 {

+ 1 - 1
modules/ScrollerToy/1/main.cs

@@ -158,7 +158,7 @@ function SandboxWindow::onTouchDown(%this, %touchID, %worldPosition)
 {   
 {   
     // Set the scrollers speed to be the distance from the farground scrollers origin.
     // Set the scrollers speed to be the distance from the farground scrollers origin.
     // Also use the sign to control the direction of scrolling.
     // Also use the sign to control the direction of scrolling.
-    %scrollerSpeed = getWord(%worldPosition,0) - ScrollerToy.FarScroller .getPositionX();
+    %scrollerSpeed = %worldPosition.x - ScrollerToy.FarScroller.Position.x;
 
 
     // Set the scroller speeds.
     // Set the scroller speeds.
     ScrollerToy.FarScroller.ScrollX = %scrollerSpeed;
     ScrollerToy.FarScroller.ScrollX = %scrollerSpeed;

+ 2 - 2
modules/TruckToy/1/main.cs

@@ -645,7 +645,7 @@ function TruckToy::createBonfire(%this, %x, %y, %scale, %layer)
 function TruckToy::createProjectile(%this)
 function TruckToy::createProjectile(%this)
 {
 {
     // Fetch the truck position.
     // Fetch the truck position.
-    %truckPositionX = TruckToy.TruckBody.getPositionX();
+    %truckPositionX = TruckToy.TruckBody.Position.x;
     
     
     %projectile = new Sprite() { class = "TruckProjectile"; };
     %projectile = new Sprite() { class = "TruckProjectile"; };
     %projectile.Animation = "ToyAssets:Projectile_FireballAnim";
     %projectile.Animation = "ToyAssets:Projectile_FireballAnim";
@@ -933,7 +933,7 @@ function SandboxWindow::onTouchDown(%this, %touchID, %worldPosition)
         return;
         return;
 
 
     // If we touch in-front of the truck then move forward else reverse.
     // If we touch in-front of the truck then move forward else reverse.
-    if ( getWord(%worldPosition,0) >= TruckToy.TruckBody.getPositionX() )
+    if ( %worldPosition.x >= TruckToy.TruckBody.Position.x )
     {
     {
         truckForward( true );
         truckForward( true );
     }
     }