Is it possible to use BitmapAtlastFonts for MenuItemToggle? I can use it in MenuItems but not sure how to get Toggle to work.
BitmapAtlasFont with MenuItemToggle?
(3 posts) (2 voices)-
Posted 2 years ago #
-
I found a hack solution so far:
//Difficulty MenuItem *e = [MenuItemLabel itemWithLabel:[BitmapFontAtlas bitmapFontAtlasWithString:@"Easy" fntFile:@"MagicSchoolOne.fnt"] target:self selector:@selector(fake:)]; MenuItem *m = [MenuItemLabel itemWithLabel:[BitmapFontAtlas bitmapFontAtlasWithString:@"Medium" fntFile:@"MagicSchoolOne.fnt"] target:self selector:@selector(fake:)]; MenuItem *h = [MenuItemLabel itemWithLabel:[BitmapFontAtlas bitmapFontAtlasWithString:@"Hard" fntFile:@"MagicSchoolOne.fnt"] target:self selector:@selector(fake:)]; MenuItemToggle *difficulty = [MenuItemToggle itemWithTarget:self selector:@selector(setDiff:) items:e,m,h, nil]; -(void)fake: (id)sender { // Not called }Posted 2 years ago # -
Is that a hack solution? The menu test examples for cocos2d does exactly that.
Good job on finding how to toggle BitmapFontAtlas'.
Posted 2 years ago #
Reply
You must log in to post.