1. Download our Official Android App: Forums for Android!

Cocos2D-android: click event issue while setting rotation for menu item

Discussion in 'Android Apps & Games' started by aparnabhure, Apr 4, 2011.

  1. aparnabhure

    aparnabhure Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    6
    Joined:
    Jan 13, 2011

    Jan 13, 2011
    6
    0
    5
    Hello All,

    I am developing a game using Cocos2D-Android.
    I am getting issue while setting rotation to CCMenu item. After setting rotation I am not getting Click event on that menu, but If I remove rotation then I am getting proper click event.

    Please let me know is it a right place to add thread for Cocos2D queries? If yes then please help me to solve this issue. If no then please provide me link where I can post this query if anyone know.

    Here is the sample of code which I am trying to implement:

    CCMenuItemImage arrow = CCMenuItemImage.item(
    "arrow.png", "arrow_t.png", this, "buttonHandler");

    arrow.setPosition(CGPoint.ccp(0, 0));
    arrow.setTag(10);

    CCMenu tmpMenu = CCMenu.menu(arrow);
    tmpMenu.setScale(0.5f);
    tmpMenu.setAnchorPoint(CGPoint.ccp(0, 0));

    if (/*Some condition*/) {
    tmpMenu.setRotation(/*With some value lets say 90*/);
    tmpMenu.setPosition(/* Some CGPoint value /);
    }
    else{
    tmpMenu.setPosition(/*Some position/);
    }

    addChild(tmpMenu);

    Thank you,
    Regards,
    Aparna
     

    Advertisement

  2. shaolin95

    shaolin95 Well-Known Member
    Rank:
    None
    Points:
    38
    Posts:
    229
    Joined:
    Sep 3, 2010

    Sep 3, 2010
    229
    19
    38
    Haha you got my hopes high...I thought it was a Tandy Coco emulator! lol
     

Share This Page

Loading...