Skip to content

Instantly share code, notes, and snippets.

@talentless
Created November 2, 2011 15:47
Show Gist options
  • Save talentless/1333984 to your computer and use it in GitHub Desktop.
Save talentless/1333984 to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
#import "cocos2d.h"
@interface TGScoreLabel : CCLabelTTF {
double curScore_; // the current score value of the label
BOOL updating_; // if we currently have an update running
double interval_; // how long we wait between updates
int score; // the target score
NSString * formatString; // the string that we format
int pointsPerSecond; // how fast we update
}
@property int score;
@property (nonatomic, retain) NSString * formatString;
@property int pointsPerSecond;
// give me that object!
+(id) scoreLabelWithFormatString:(NSString*)formatString score:(int)score dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size;
// start rolling up
-(void) rollToScore:(int)newScore;
// internal stuff
-(void) update_;
-(void) setup_:(int)score formatString:(NSString *)formatString;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment