Results 1 to 4 of 4

Thread: Pinch/Zoom and Rotate Mechanics

  1. #1
    Lesser Wizard
    Join Date
    Nov 2010
    Location
    Los Angeles, California, United States, United States
    Posts
    126

    Default Pinch/Zoom and Rotate Mechanics

    Any clues on how I could implement a pinch to zoom in/out and two-finger rotate?

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,380

    Default

    I haven't done that yet, not sure. I think my iOS glue needs to also send the "touchID", but according to the Apple docs it isn't actually which finger, but more about how many touches are down at once which I find confusing. (Although that work work fine with pinching/zooming.. I guess I'm more thinking about a paint app with four discreet fingers drawing, that kind of thing)

    Right now in EAGLView.mm we do this:

    Code:
    // Handles the start of a touch
    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
    {
      	// Enumerate through all the touch objects.
    	NSUInteger touchCount = 0;
    	for (UITouch *touch in touches)
    	{
    		CGPoint pt =[touch locationInView:self];
    		ConvertCoordinatesIfRequired(pt.x, pt.y);
    		GetMessageManager()->SendGUI(MESSAGE_TYPE_GUI_CLICK_START,pt.x, pt.y);			
    		touchCount++;  
    	}	
    }
    The SendGUI message should probably also be sending the ID for the touch I guess. Or maybe we're supposed to track it by ourselves and guess which finger by checking distance against the last touches we got. I'll make this change soon...
    Seth A. Robinson
    Robinson Technologies

  3. #3
    Lesser Wizard
    Join Date
    Nov 2010
    Location
    Los Angeles, California, United States, United States
    Posts
    126

    Default

    Right on. If I get to it before you I'll let you know. Thanks!

  4. #4
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,380

    Default

    (update - I now send a fingerID with the touch messages so it should be a lot easier to figure out complicated gestures/pinches - RTSimpleApp now has TouchTestComponent example of how to use it)
    Attached Images Attached Images  
    Seth A. Robinson
    Robinson Technologies

Similar Threads

  1. make child rotate too.
    By speeder in forum Novashell Game Creation System
    Replies: 0
    Last Post: 05-09-2010, 04:50 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •