Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-26-2011, 06:15 AM   #1 (permalink)
Registered Member
 
Join Date: Dec 2011
Posts: 3
LukasBanana is on a distinguished road
Default Problems with Multi-Touch

Hi everybody, I'm new here and I don't know if this is the right sub-forum.
I have some problems with the multi-touch for iOS. I thought "touchesBegan" from the UIView will always be called when a new finger touches the screen.
But it don't. It only occurs when the first finger touches the screen and "touchesEnded" occurs when the first finger releases the screen.
But I want to know when a new finger touches the screen. I don't know how to determine that in my program.

Another problem is that the "touchesMoved" only occurs when the first finger moves. The other fingers also get a movement information but this function will only be called when the first finger moves.

And the third problem I have is that the indices of the touches changes when new fingers touche the screen.
i.e. when I go-through the NSSet of all "[event allTouches]" the first touch can sometimes change to the second one when a new finger touches the screen.

This is my current code part:

Code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [super touchesBegan:touches withEvent:event];
    NSSet* touchSet = [event allTouches];
    
    int i = 0;
    for (id touch in touchSet)
    {
        CGPoint Point = [touch locationInView:self];
        
        iOS_SetTouchBegin(i++, Point.x, Point.y);
    }
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    [super touchesMoved:touches withEvent:event];
    NSSet* touchSet = [event allTouches];
    
    int i = 0;
    for (id touch in touchSet)
    {
        CGPoint Point = [touch locationInView:self];
        
        iOS_SetTouchMove(i++, Point.x, Point.y);
    }
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    [super touchesEnded:touches withEvent:event];
    NSSet* touchSet = [event allTouches];
    
    int i = 0;
    for (id touch in touchSet)
        iOS_SetTouchEnd(i++);
}
My C functions "iOS_SetTouchBegin", "iOS_SetTouchEnd" and "iOS_SetTouchMove" always get the Index of the individual touch event.
But this is never guaranteed the correct Index.

I hope you understood my problem and anyone can help me.

Greetings,
Lukas
LukasBanana is offline   Reply With Quote
Old 01-06-2012, 07:53 AM   #2 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 2
Jinkos is on a distinguished road
Default

I have exact same problem. Not found and answer, yet.

multipleTouchEnabled = YES;
also seems to make no difference.
Jinkos is offline   Reply With Quote
Old 01-06-2012, 08:08 AM   #3 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 2
Jinkos is on a distinguished road
Default

You have to set multipleTouchEnabled to YES if you want the behaviour you are looking for.

You need to set it in all the views involved
Jinkos is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 384
10 members and 374 guests
apatsufas, comicool, Creativ, Dalia, dansparrow, husthlj, LunarMoon, mer10, Murphy, pbart
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,677
Threads: 94,127
Posts: 402,916
Top Poster: BrianSlick (7,990)
Welcome to our newest member, husthlj
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:04 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0