How To Create a HUD Layer with Cocos2D

Discussion of the official tutorials published on raywenderlich.com. Please only discuss the official tutorials here - for general questions, use the General Discussion forum instead.

How To Create a HUD Layer with Cocos2D

Postby rwenderlich » Tue Aug 30, 2011 11:30 am

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
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Team Member
Site Admin
 
Posts: 2058
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 293 times

Re: How To Create a HUD Layer with Cocos2D

Postby kyle » Tue Aug 30, 2011 5:50 pm

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

Postby Bobj-c » Tue Aug 30, 2011 7:21 pm

Hi Ray,

Nice tutor 10q :))
Bobj-c
Hacker
 
Posts: 43
Joined: Mon Feb 07, 2011 3:39 pm
Has thanked: 0 time
Been thanked: 1 time

Re: How To Create a HUD Layer with Cocos2D

Postby rwenderlich » Tue Aug 30, 2011 8:22 pm

Whoops sorry about that, download link fixed!
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Team Member
Site Admin
 
Posts: 2058
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 293 times

Re: How To Create a HUD Layer with Cocos2D

Postby CreoNic » Wed Aug 31, 2011 6:41 am

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?
Attachments
screen-capture.png
screen-capture.png (45.26 KiB) Viewed 7449 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

Postby Gawron » Wed Aug 31, 2011 9:41 am

Hi,

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

Postby CreoNic » Wed Aug 31, 2011 3:04 pm

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

Postby aeberbach » Thu Sep 01, 2011 5:01 am

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.
User avatar
aeberbach
Team Member
Forum Subject Matter Expert
 
Posts: 1267
Joined: Sat Feb 19, 2011 5:37 am
Has thanked: 13 times
Been thanked: 153 times

Re: How To Create a HUD Layer with Cocos2D

Postby CreoNic » Tue Sep 06, 2011 7:27 pm

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
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

Postby Etteba » Tue Sep 13, 2011 8:17 pm

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?
Etteba
Hacker
 
Posts: 44
Joined: Mon Dec 27, 2010 11:04 am
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Official Tutorials

Who is online

Users browsing this forum: No registered users and 10 guests