How To Create a HUD Layer with Cocos2D
32 posts
• Page 1 of 4 • 1, 2, 3, 4
How To Create a HUD Layer with Cocos2D
This is the official thread to discuss the following blog post: How To Create a HUD Layer with Cocos2D
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

rwenderlich - Site Admin
- Posts: 1776
- Joined: Thu Dec 23, 2010 4:14 pm
- Has thanked: 26 times
- Been thanked: 187 times
Re: How To Create a HUD Layer with Cocos2D
hey ray... i'm getting an error on the download link. great post. i was just working on this for the AR book... HUD = cool
- kyle
- Baby Hacker
- Posts: 6
- Joined: Wed Feb 23, 2011 3:02 am
- Has thanked: 0 time
- Been thanked: 0 time
Re: How To Create a HUD Layer with Cocos2D
Whoops sorry about that, download link fixed!
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

rwenderlich - Site Admin
- Posts: 1776
- Joined: Thu Dec 23, 2010 4:14 pm
- Has thanked: 26 times
- Been thanked: 187 times
Re: How To Create a HUD Layer with Cocos2D
Hi,
I cant change the project to run on the simulator.
There is only one option to select and that is iOS device.
Im using Xcode 4
Anyone that know how to fix this?
I cant change the project to run on the simulator.
There is only one option to select and that is iOS device.
Im using Xcode 4
Anyone that know how to fix this?
- Attachments
-
- screen-capture.png (45.26 KiB) Viewed 5888 times
- CreoNic
- Hacker
- Posts: 16
- Joined: Mon May 09, 2011 8:23 am
- Location: Sweden
- Has thanked: 0 time
- Been thanked: 0 time
Re: How To Create a HUD Layer with Cocos2D
Hi,
I had the same - just change from iOS 5 to iOS4.3 in your project settings.
Piotr
I had the same - just change from iOS 5 to iOS4.3 in your project settings.
Piotr
- Gawron
- n00b
- Posts: 1
- Joined: Wed Aug 31, 2011 9:40 am
- Has thanked: 0 time
- Been thanked: 0 time
Re: How To Create a HUD Layer with Cocos2D
That did the trick!

- CreoNic
- Hacker
- Posts: 16
- Joined: Mon May 09, 2011 8:23 am
- Location: Sweden
- Has thanked: 0 time
- Been thanked: 0 time
Re: How To Create a HUD Layer with Cocos2D
Rule of Xcode - make your "base SDK" setting "Latest iOS" and never touch it again. Choose your "iOS Deployment Target" setting more carefully, set it to the oldest iOS version you want to be able to run your app. If you make it 5 and your users all have 4, nobody gets to run anything. If you set it to 3 but you have used 4.0 APIs, an iOS 3 user can install your app and crash.
- aeberbach
- Forum Subject Matter Expert
- Posts: 1021
- Joined: Sat Feb 19, 2011 5:37 am
- Has thanked: 9 times
- Been thanked: 82 times
Re: How To Create a HUD Layer with Cocos2D
Hello,
Do anyone know how to go about to implement sneaky input joystick in a hud layer?
Well that is a simple question but what I want is not that simple.
I want to implement the following:
1.Hud layer with joystick and score information.
2.A game layer where my hero object is placed.
3.A shared game object that contains score and other shared information. (Read by the hud layer and other objects.)
4.A hero object that is placed on the game layer but gets its movements from the hud joystick.
5.The hero object is responsible for clamping the movements to the screen boundary.
I don't want to implement a lot of sneaky joystick code in my hero class.
I want all or as much as possible of sneaky joystick to be implemented in the hud layer.
The clamping should NOT be in the hud layer as I might use another type of hero that I don not want to clamp in the future.
I guess I need to use delegates in some way to do this but I don't know how.
I don't expect a full example just some idea and general direction on how to go about to do this.
Should I use delegates?
What should I delegate where?
Regards
CreoNic
Do anyone know how to go about to implement sneaky input joystick in a hud layer?
Well that is a simple question but what I want is not that simple.
I want to implement the following:
1.Hud layer with joystick and score information.
2.A game layer where my hero object is placed.
3.A shared game object that contains score and other shared information. (Read by the hud layer and other objects.)
4.A hero object that is placed on the game layer but gets its movements from the hud joystick.
5.The hero object is responsible for clamping the movements to the screen boundary.
I don't want to implement a lot of sneaky joystick code in my hero class.
I want all or as much as possible of sneaky joystick to be implemented in the hud layer.
The clamping should NOT be in the hud layer as I might use another type of hero that I don not want to clamp in the future.
I guess I need to use delegates in some way to do this but I don't know how.
I don't expect a full example just some idea and general direction on how to go about to do this.
Should I use delegates?
What should I delegate where?
Regards
CreoNic
- CreoNic
- Hacker
- Posts: 16
- Joined: Mon May 09, 2011 8:23 am
- Location: Sweden
- Has thanked: 0 time
- Been thanked: 0 time
Re: How To Create a HUD Layer with Cocos2D
Hello Ray,
Suppose I want to add and implement a Pause button to the game where is the best place to put it? ...
would it be in the Action layer or the HUD layer or the Scene itself?
Suppose I want to add and implement a Pause button to the game where is the best place to put it? ...
would it be in the Action layer or the HUD layer or the Scene itself?
- Etteba
- Hacker
- Posts: 44
- Joined: Mon Dec 27, 2010 11:04 am
- Has thanked: 0 time
- Been thanked: 0 time
32 posts
• Page 1 of 4 • 1, 2, 3, 4
Who is online
Users browsing this forum: Google Adsense [Bot], michael.griebling and 9 guests