Forum Libraries, Components, and Plugins

Can't detect multi touch on iOS

BenoitRenaudBenoitRenaud CAMember ✭✭

Hi,
I'm not able to handle multi touch on a CocosSharpView in iOS (works fine in android/wp8), do I need to enable something somewhere? (or am I just doing it wrong)

var touchListener = new CCEventListenerTouchAllAtOnce();
touchListener.OnTouchesMoved = OnTouchMoved;
AddEventListener(touchListener, this);

void OnTouchMoved(List<CCTouch> touches, CCEvent touchEvent)
{ 
    if (touches.Count == 1)
    {
        //...
    }
    else if (touches.Count >= 2)
    {
        //...
    }
}

Thanks

Tagged:

Best Answer

Answers

  • JonJarnJonJarn SEMember

    Hi, it's working fine for me on iOS. I get two touches in the list argument, so the code above looks fine.

    Which version of CocosSharp are you using? I'm using 1.6.2 (had some issues with touch event when I tried upgrading to 1.7, so downgraded again)

  • BenoitRenaudBenoitRenaud CAMember ✭✭

    I'm using 1.7; I'll try downgrading tonight

  • BenoitRenaudBenoitRenaud CAMember ✭✭

    Silly question but... how do I get version 1.6.2?
    NuGet Gallery only has 1.7.1 and 1.7.0 (tried to add "version:*" to no avail )

  • JonJarnJonJarn SEMember

    Search for CocosSharp PCL

  • BenoitRenaudBenoitRenaud CAMember ✭✭

    Thanks it worked (was having trouble reverting because I was using the embedded view)
    In case the links ever dies, here was the solution

    @DominiqueBiesmans said:
    Another option is to set it on the CCGameView (in ViewController.LoadGame())

                  gameView.MultipleTouchEnabled = true;
    
Sign In or Register to comment.