I want to give the image a joystick to HUD.
The HUD file I have:
myJoystick = [CCJoyStick initWithBallRadius: 25 MoveAreaRadius: 65 isFollowTouch: NO isCanVisible: YES isAutoHide: NO hasAnimation: YES];
[myJoystick setBallTexture: @ "joystick_control.png"];
[myJoystick setDockTexture: @ "joystick_lid.png"];
[myJoystick setHitAreaWithRadius: 100];
myJoystick.position = ccp (100,100);
myJoystick.scale = 0.3;
myJoystick.delegate = self;
[self addChild: myJoystick of: 5];
and in HelloWorldLayer:
(Void) onCCJoyStickUpdate (CCNode *) sender Angle: (float) Angle Direction: (CGPoint) direction Power: (float) power {
if (sender == myJoystick) {
spider2.rotation =-angle;
...
myJoystick not found. How do I fix this?
This is my code: Link