SneakyJoyStick


#1

please guys i need your help for config a joystick in cocos2dx

SneakyJoystickSkinnedBase* joystickBase = new SneakyJoystickSkinnedBase();

SneakyJoystick* tmpJoystick = new SneakyJoystick();
tmpJoystick->initWithRect(CCRectMake(0, 0, 128, 128));

joystickBase->setBackgroundSprite(CCSprite::create("joystick.png"));
joystickBase->setThumbSprite(CCSprite::create("thumb.png"));
joystickBase->setJoystick(tmpJoystick);
joystickBase->setPosition(ccp(64, 64));
tmpJoystick = joystickBase->getJoystick();
tmpJoystick->release();

this->addChild(tmpJoystick,1);

#2

ready config my joystick but my thumb no move

SneakyJoystickSkinnedBase* joystickBase = new SneakyJoystickSkinnedBase();
joyStick = new SneakyJoystick();
joyStick->initWithRect(CCRectMake(0, 0, 128, 128));

joystickBase->setBackgroundSprite(CCSprite::create("joystick.png"));
joystickBase->setThumbSprite(CCSprite::create("thumb.png"));
joystickBase->setJoystick(joyStick);
joystickBase->setPosition(ccp(110, 110));
joyStick = joystickBase->getJoystick();

this->addChild(joystickBase,1);
joyStick->retain();