Browse Source

- Toys now correctly call the parent package for touch events so manipulation continues to work.

MelvMay-GG 12 years ago
parent
commit
a99d2bc

+ 9 - 0
modules/DeathBallToy/1/main.cs

@@ -458,6 +458,9 @@ package DeathBallToyPackage
 
 function SandboxWindow::onTouchDown(%this, %touchID, %worldPosition)
 {
+    // Call parent.
+    Parent::onTouchDown(%this, %touchID, %worldPosition );
+    
     %origin = Deathball.getPosition();
     %angle = -mRadToDeg( mAtan( getWord(%worldPosition,0)-getWord(%origin,0), getWord(%worldPosition,1)-getWord(%origin,1) ) );
 
@@ -476,6 +479,9 @@ function SandboxWindow::onTouchDown(%this, %touchID, %worldPosition)
 
 function SandboxWindow::onTouchUp(%this, %touchID, %worldPosition)
 {
+    // Call parent.
+    Parent::onTouchUp(%this, %touchID, %worldPosition );
+    
     %origin = Deathball.getPosition();
     %angle = -mRadToDeg( mAtan( getWord(%worldPosition,0)-getWord(%origin,0), getWord(%worldPosition,1)-getWord(%origin,1) ) );
 
@@ -490,6 +496,9 @@ function SandboxWindow::onTouchUp(%this, %touchID, %worldPosition)
 
 function SandboxWindow::onTouchDragged(%this, %touchID, %worldPosition)
 {
+    // Call parent.
+    Parent::onTouchDragged(%this, %touchID, %worldPosition );
+    
     %origin = Deathball.getPosition();
     %angle = -mRadToDeg( mAtan( getWord(%worldPosition,0)-getWord(%origin,0), getWord(%worldPosition,1)-getWord(%origin,1) ) );
 

+ 6 - 0
modules/MoveToToy/1/main.cs

@@ -169,6 +169,9 @@ package MoveToToyPackage
 
 function SandboxWindow::onTouchDown(%this, %touchID, %worldPosition)
 {
+    // Call parent.
+    Parent::onTouchDown(%this, %touchID, %worldPosition );
+    
     // Set the target to the touched position.
     MoveToToy.TargetObject.Position = %worldPosition;
     
@@ -180,6 +183,9 @@ function SandboxWindow::onTouchDown(%this, %touchID, %worldPosition)
 
 function SandboxWindow::onTouchMoved(%this, %touchID, %worldPosition)
 {
+    // Call parent.
+    Parent::onTouchMoved(%this, %touchID, %worldPosition );
+    
     // Finish if not tracking the mouse.
     if ( !MoveToToy.trackMouse )
         return;

+ 6 - 0
modules/RotateToToy/1/main.cs

@@ -133,6 +133,9 @@ package RotateToToyPackage
 
 function SandboxWindow::onTouchDown(%this, %touchID, %worldPosition)
 {
+    // Call parent.
+    Parent::onTouchDown(%this, %touchID, %worldPosition );
+    
     // Calculate the angle to the mouse.
     %origin = RotateToToy.TargetObject.getPosition();
     %angle = -mRadToDeg( mAtan( %worldPosition.x-%origin.x, %worldPosition.y-%origin.y ) );
@@ -145,6 +148,9 @@ function SandboxWindow::onTouchDown(%this, %touchID, %worldPosition)
 
 function SandboxWindow::onTouchMoved(%this, %touchID, %worldPosition)
 {
+    // Call parent.
+    Parent::onTouchMoved(%this, %touchID, %worldPosition );
+    
     // Finish if not tracking the mouse.
     if ( !RotateToToy.trackMouse )
         return;

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

@@ -155,7 +155,10 @@ package ScrollerToyPackage
 {
 
 function SandboxWindow::onTouchDown(%this, %touchID, %worldPosition)
-{   
+{
+    // Call parent.
+    Parent::onTouchDown(%this, %touchID, %worldPosition );
+
     // Set the scrollers speed to be the distance from the farground scrollers origin.
     // Also use the sign to control the direction of scrolling.
     %scrollerSpeed = %worldPosition.x - ScrollerToy.FarScroller.Position.x;

+ 6 - 0
modules/TruckToy/1/main.cs

@@ -936,6 +936,9 @@ package TruckToyPackage
 
 function SandboxWindow::onTouchDown(%this, %touchID, %worldPosition)
 {
+    // Call parent.
+    Parent::onTouchDown(%this, %touchID, %worldPosition );
+    
     // Finish if truck is already moving.
     if ( TruckToy.TruckMoving )
         return;
@@ -955,6 +958,9 @@ function SandboxWindow::onTouchDown(%this, %touchID, %worldPosition)
 
 function SandboxWindow::onTouchUp(%this, %touchID, %worldPosition)
 {
+    // Call parent.
+    Parent::onTouchUp(%this, %touchID, %worldPosition );
+    
     // Stop the truck.
     TruckToy.truckStop();
 }