Permalink
Browse files

s: show/hide mouse

  • Loading branch information...
1 parent 88f8be8 commit bc7d7840dd3d04ac43f26c632d722999e760aa49 @timgarbos timgarbos committed Apr 29, 2012
Showing with 25 additions and 2 deletions.
  1. +3 −1 code/GameBlock.h
  2. +21 −1 code/testApp.cpp
  3. +1 −0 code/testApp.h
View
@@ -32,7 +32,9 @@ enum BlockAnimationType {
S_waterplant=15,
S_waterplantTrunk=16,
S_branchLeft=18,
- S_branchRight=19
+ S_branchRight=19,
+ S_vineBranchLeft=20,
+ S_vineBranchRight=21
};
const double BlockFadeTime = 0.8;
View
@@ -43,6 +43,16 @@ void testApp::draw(){
//--------------------------------------------------------------
void testApp::keyPressed(int key){
+ if(key=='s')
+ {
+ showMouse = !showMouse;
+
+ if(showMouse)
+ ofShowCursor();
+ else
+ ofHideCursor();
+ }
+
game.keyPressed(key);
tracker.keyPressed(key);
@@ -66,20 +76,30 @@ void testApp::mouseMoved(int x, int y ){
//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
+ if(showMouse)
+ {
tracker.mouseDragged(x, y, button);
+ }
}
//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
- tracker.mousePressed(x, y, button);
+ if(showMouse)
+ {
+ tracker.mousePressed(x, y, button);
game.mousePressed(x,y,button);
+ }
+
}
//--------------------------------------------------------------
void testApp::mouseReleased(int x, int y, int button){
+ if(showMouse)
+ {
tracker.mouseReleased(x, y, button);
+ }
}
View
@@ -23,6 +23,7 @@ class testApp : public ofBaseApp{
//---------------------
bool trackerDebug;
+ bool showMouse;
//---------------------

0 comments on commit bc7d784

Please sign in to comment.