Public Member Functions | Static Public Member Functions | Protected Attributes

GameHUD Class Reference

Displays Score Labels and could also be used to show the graphic frames enclosing score labels (optional). More...

#import <GameHUD.h>

List of all members.

Public Member Functions

(id) - init
 initializes class and returns an instance of the class, you must take care of allocating the object yourself
(void) - dealloc [implementation]
(void) - loadBestScore [implementation]
 load the best score from "disk" using NSKeyedUnarchiver.
(void) - saveBestScore [implementation]
 saves the best score from "disk" using NSKeyedArchiver.
(void) - updateScoreLabel [implementation]
(void) - updateBestScoreLabel [implementation]
(void) - updateScores: [implementation]

Static Public Member Functions

(id) + hud
 initializes class and returns an autoreleased instance of the class
(void) + resetScore
 resets the score to 0
(unsigned int) + getScore
 returns the current score
(void) + increaseScore
 increases score by one

Protected Attributes

CCLabel * scoreLabel
CCLabel * bestScoreLabel
unsigned int lastScore
unsigned int oldBestScore

Detailed Description

Displays Score Labels and could also be used to show the graphic frames enclosing score labels (optional).

Is drawn just above the GameBackground but below all GameObjects.


Member Function Documentation

- (void) dealloc   [implementation]
+ (unsigned int) getScore  

returns the current score

+ (id) hud  

initializes class and returns an autoreleased instance of the class

+ (void) increaseScore  

increases score by one

- (id) init  

initializes class and returns an instance of the class, you must take care of allocating the object yourself

- (void) loadBestScore   [implementation]

load the best score from "disk" using NSKeyedUnarchiver.

There are several ways for save/load and this illustrates just one. The most flexible being NSCoding support for classes that need to be saved/loaded.

+ (void) resetScore  

resets the score to 0

- (void) saveBestScore   [implementation]

saves the best score from "disk" using NSKeyedArchiver.

There are several ways for save/load and this illustrates just one. The most flexible being NSCoding support for classes that need to be saved/loaded.

- (void) updateBestScoreLabel   [implementation]
- (void) updateScoreLabel   [implementation]
- (void) updateScores: (ccTime)  delta   [implementation]

Member Data Documentation

- (CCLabel*) bestScoreLabel [protected]
- (unsigned int) lastScore [protected]
- (unsigned int) oldBestScore [protected]
- (CCLabel*) scoreLabel [protected]

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator Properties