With this code you can create MenuItem BitMapFontAtlas.
MenuItem.h:
@interface MenuItemBitmapFontAtlas : MenuItemLabel
{
}
+(id) itemFromString: (NSString*) value fntFile:(NSString*)fntFile;
+(id) itemFromString: (NSString*) value fntFile:(NSString*)fntFile target:(id) rec selector:(SEL) cb;
-(id) initFromString: (NSString*) value fntFile:(NSString*)fntFile target:(id) rec selector:(SEL) cb;
@end
MenuItem.m:
#pragma mark -
#pragma mark MenuItemBitmapFontAtlas
@implementation MenuItemBitmapFontAtlas
+(id) itemFromString: (NSString*) value fntFile:(NSString*)fntFile
{
return [[[self alloc] initFromString:value fntFile:fntFile target:nil selector:nil] autorelease];
}
+(id) itemFromString: (NSString*) value fntFile:(NSString*)fntFile target:(id) rec selector:(SEL) cb
{
return [[[self alloc] initFromString:value fntFile:fntFile target:rec selector:cb] autorelease];
}
-(id) initFromString: (NSString*) value fntFile:(NSString*)fntFile target:(id) rec selector:(SEL) cb
{
NSAssert( [value length] != 0, @"value lenght must be greater than 0");
BitmapFontAtlas *label = [[BitmapFontAtlas alloc] initWithString:value fntFile:fntFile];
[label autorelease];
if((self=[super initWithLabel:label target:rec selector:cb]) ) {
// do something ?
}
return self;
}
-(void) dealloc
{
[super dealloc];
}
@end