★ TouchArcade needs your help. Click here to support us on Patreon.

HUD layer for Sneaky Input Joystick (cocos2d iPhone)

09-10-2011, 09:23 AM
#1
Joined: Oct 2010
Posts: 7
HUD layer for Sneaky Input Joystick (cocos2d iPhone)

I'm using the SneakyInput Joystick to move my sprite, and TMX maps for my game. I added auto-camera-movement to my app, so the hero sprite is always visible. When I go through my map, the joystick goes off the screen (it stays where it's original position is). I made a HUD so that the joystick is always at the same position, and doesn't move along with the map. The joystick shows up on screen fine, but when I drag it it doesn't move my hero.

I've made the HUDLayer a CCLayer in GameLayer, which is where I'm making the moveHero method. I know the problem is that I do [self setCenter....blah blah blah]; instead of only setting Level1 as the center. How do I only move the camera for Level1, and not HUDLayer?

http://codeviewer.org/view/code:1e54
09-11-2011, 07:49 AM
#2
Joined: Oct 2010
Posts: 7
I have a Stack Overflow question with a bounty
http://stackoverflow.com/questions/7...cocos2d-iphone