我想给HUD提供操纵杆。 p>
我的HUD文件:
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];
并在HelloWorldLayer中:
(Void) onCCJoyStickUpdate (CCNode *) sender Angle: (float) Angle Direction: (CGPoint) direction Power: (float) power {
if (sender == myJoystick) {
spider2.rotation =-angle;
...
找不到myJoystick。 我该如何解决这个问题?
这是我的代码: Link