Kaynağa Gözat

Implements virtual keyboard callback and fixes issue in which the x/y of the touch points were reversed

Brandon Slack 14 yıl önce
ebeveyn
işleme
aacc02246a
1 değiştirilmiş dosya ile 10 ekleme ve 3 silme
  1. 10 3
      gameplay/src/PlatformiOS.mm

+ 10 - 3
gameplay/src/PlatformiOS.mm

@@ -308,7 +308,7 @@ int getKey(unichar keyCode);
         CGPoint touchLoc = [t locationInView:self];
         if(self.multipleTouchEnabled == YES) 
             uniqueTouch = [t hash];
-        Game::getInstance()->touchEvent(Touch::TOUCH_PRESS, touchLoc.y,  touchLoc.x, uniqueTouch);
+        Game::getInstance()->touchEvent(Touch::TOUCH_PRESS, touchLoc.x,  touchLoc.y, uniqueTouch);
     }
 }
 
@@ -320,7 +320,7 @@ int getKey(unichar keyCode);
         CGPoint touchLoc = [t locationInView:self];
         if(self.multipleTouchEnabled == YES) 
             uniqueTouch = [t hash];
-        Game::getInstance()->touchEvent(Touch::TOUCH_RELEASE, touchLoc.y, touchLoc.x, uniqueTouch);
+        Game::getInstance()->touchEvent(Touch::TOUCH_RELEASE, touchLoc.x, touchLoc.y, uniqueTouch);
     }
 }
 
@@ -338,7 +338,7 @@ int getKey(unichar keyCode);
         CGPoint touchLoc = [t locationInView:self];
         if(self.multipleTouchEnabled == YES) 
             uniqueTouch = [t hash];
-        Game::getInstance()->touchEvent(Touch::TOUCH_MOVE, touchLoc.y,  touchLoc.x, uniqueTouch);
+        Game::getInstance()->touchEvent(Touch::TOUCH_MOVE, touchLoc.x,  touchLoc.y, uniqueTouch);
     }
 }
 
@@ -788,6 +788,13 @@ namespace gameplay
             [[__view getContext] presentRenderbuffer:GL_RENDERBUFFER];
     }
     
+    void displayKeyboard(bool display) {
+        if(__view) {
+            if(display) [__view showKeyboard];
+            else [__view dismissKeyboard];
+        }
+    }
+    
 }
 
 #endif