<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>cocos2d for iPhone &#187; Tag: Label - Recent Topics</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/label</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 03:54:09 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/tags/label/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>tiggybouncer on "CCMenuItem Scene transfer help! And some other stuff..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28958#post-142729</link>
			<pubDate>Sun, 05 Feb 2012 09:48:29 +0000</pubDate>
			<dc:creator>tiggybouncer</dc:creator>
			<guid isPermaLink="false">142729@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi.<br />
For the past few months, on my menus I have been using a piece of code similar to this to go from one scene to another:<br />
<pre><code>-(void)backToMainMenu:(id)sender
{
	MainMenuScene *mms = [MainMenuScene node];
	[[CCDirector sharedDirector]replaceScene:mms];
}</code></pre>
<p>This has worked in many other places inside my app, but it doesn't work now. Can someone please explain this to me.</p>
<p>Here is some more code to help:<br />
<pre><code>CCMenuItemLabel * backToMainMenu = [CCMenuItemLabel itemWithLabel:backToMainMenuLabel target:self selector:@selector(backToMainMenu:)];</code></pre>
<p>I have tried putting 'selector' on the end instead of 'sender'.</p>
<p>Another thing, yesterday, I created more defined colours in the ccTypes file. These all work wonderfully, so now there is a wider choice of colours to use. I would like to upload it to Github, but I can't. Is there anyone who I can send it to so it can be uploaded (I would be most grateful if someone could).</p>
<p>Thanks.</p>
<p>EDIT : I tested my code on the 1.0.1 version :)
</p></description>
		</item>
		<item>
			<title>popsalicious on "Display Random Text"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29046#post-143232</link>
			<pubDate>Wed, 08 Feb 2012 08:49:50 +0000</pubDate>
			<dc:creator>popsalicious</dc:creator>
			<guid isPermaLink="false">143232@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm trying to do a bit of splash text on the opening screen of my game, like the Minecraft opening text, but I'm too new to cocos2d to figure this out.  Right now I've written the CCLabelBMFont lines for all the quotes I'd like to put on and numbered them (quote0-quote5) and I have arc4random() drawing a random number, but I'm don't know how to put these together to call the random quote.  I know there's a more elegant way to do it than just an if statement for each random number.  Plist?  Array?  Help?
</p></description>
		</item>
		<item>
			<title>beleg on "Adding a UiLabel to a layer"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28918#post-142533</link>
			<pubDate>Fri, 03 Feb 2012 18:21:12 +0000</pubDate>
			<dc:creator>beleg</dc:creator>
			<guid isPermaLink="false">142533@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Is there a easy way to add a UILabel to a layer? I do not want to use the Coco2d label (CCLabelTTF) because I wrote my own custom class that overrides UILabel and I want to use that instead. Thanks
</p></description>
		</item>
		<item>
			<title>NOG on "Some confusion about CCLabelTTF"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28883#post-142343</link>
			<pubDate>Thu, 02 Feb 2012 17:35:45 +0000</pubDate>
			<dc:creator>NOG</dc:creator>
			<guid isPermaLink="false">142343@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>In my game now I have plenty of CCLabelTTF's.  Names of labels point to it in my header file, and that design makes sense to me.  I'm at a point now where I sometimes have a menu display over the paused game, and it will have x amount of labels. There may up to 40-50 of them, who knows.  I'm not really sure how to proceed with this in the most organized way, but I'm confused whether or not CCLabelTTF's could ever be temporary and then all be released when that menu goes away.  The way I handle getting rid of the labels now is just setting the string to a space " " which I know is probably really ghetto and not the proper procedure. Furthermore, those labels still exist. I know they don't take up a lot of resources, but if I'm going to have an upward of 200 of them or more (not all displaying all at once of course), I don't just want them hanging around.
</p></description>
		</item>
		<item>
			<title>zzt4 on "Graphical glitch using per-character animation"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28666#post-141263</link>
			<pubDate>Wed, 25 Jan 2012 21:22:52 +0000</pubDate>
			<dc:creator>zzt4</dc:creator>
			<guid isPermaLink="false">141263@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am currently animating each character in a CCLabelBMFont. Sometimes when the animation finishes, the label can end up looking weird. Anyone have any ideas what could be causing this?</p>
<pre><code>double totalTime = 1.0f;
int currentCharIndex = 0;
CCMenu* _menu = (CCMenu*)[self getChildByTag:kNodeTagLabelMenu];
CCNode* _node;
CCARRAY_FOREACH([_menu children], _node) {
    CCNode* _labelNode;
    CCARRAY_FOREACH([_node children], _labelNode) {
        double individualTime = totalTime / [[_labelNode children] count];
        CCNode* _charNode;
        CCARRAY_FOREACH([_labelNode children], _charNode) {
            _charNode.scale = 0.5;
            [_charNode runAction:[CCSequence actions:[CCDelayTime actionWithDuration:individualTime * currentCharIndex],
                                                     [CCSpawn actions:[CCScaleTo actionWithDuration:0.1f scale:1.0],
                                                                      [CCFadeIn actionWithDuration:0.1f],
                                                                      [CCMoveBy actionWithDuration:0.1f position:ccp(0, -20)],
                                                                      nil],
                                                     nil]];

            currentCharIndex++;
        }
        currentCharIndex = 0;
    }
}</code></pre>
<p>The animation always runs successfully and looks great.<br />
However, sometimes the end of the animation looks like this: (yay!)<br />
[IMG]http://i42.tinypic.com/330xquc.jpg[/IMG]</p>
<p>And then sometimes it looks like this: (boo!)<br />
[IMG]http://i42.tinypic.com/ohllc0.jpg[/IMG]
</p></description>
		</item>
		<item>
			<title>Jamorn on "CCMenuItemLabelAndImage"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19789#post-110752</link>
			<pubDate>Mon, 15 Aug 2011 18:43:32 +0000</pubDate>
			<dc:creator>Jamorn</dc:creator>
			<guid isPermaLink="false">110752@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi guys, I've been using cocos2d for a while (still learning) but I've just created a class that I needed which is:</p>
<p>A menu item that uses a Label (text) as well as Images so that you can use normal image, selected image, and disabled image. This is so you can create buttons with labels dynamically instead of making a 1000 buttons in photoshop by just changing its text.</p>
<p>If you observe, the text label actually moves down by 1 pixel when you press the menu item, that's meant to happen, to simulate the button being pressed.</p>
<p>The class is created as a cross between CCMenuItemLabel and CCMenuItemImage. It is in fact a child of the CCMenuItemImage and I've added the label capability within.</p>
<p>Maybe this has been created already but I couldn't find it. I hope people can benefit from this :) It works really well for me.</p>
<p><strong>CCMenuItemLabelAndImage.h</strong><br />
<pre><code>/*
 * CCMenuItemLabelAndImage
 *
 * Copyright (c) 2011 Jamorn Horathai
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the &#34;Software&#34;), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED &#34;AS IS&#34;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 */

#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#60;Foundation/Foundation.h&#62;
#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;cocos2d.h&#34;

@interface CCMenuItemLabelAndImage : CCMenuItemImage {
    CCNode&#60;CCLabelProtocol, CCRGBAProtocol&#62; *label_;
	ccColor3B	colorBackup;
	ccColor3B	disabledColor_;
}

/** the color that will be used to disable the item */
@property (nonatomic,readwrite) ccColor3B disabledColor;

/** Label that is rendered. It can be any CCNode that implements the CCLabelProtocol */
@property (nonatomic,readwrite,assign) CCNode&#60;CCLabelProtocol, CCRGBAProtocol&#62;* label;

/** creates a menu item with a label and a normal and selected image*/
+ (id) itemWithLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage:(NSString*)value selectedImage:(NSString*) value2;
/** creates a menu item with a label and a normal and selected image with target/selector */
+(id) itemFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*)value selectedImage:(NSString*) value2 target:(id) r selector:(SEL) s;
/** creates a menu item with a label and a normal,selected  and disabled image */
+(id) itemFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage: (NSString*) value3;
/** creates a menu item with a label and a normal,selected  and disabled image with target/selector */
+(id) itemFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 target:(id) r selector:(SEL) s;
/** initializes a menu item with a label and a normal, selected  and disabled image with target/selector */
-(id) initFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*) value selectedImage:(NSString*)value2 disabledImage:(NSString*) value3 target:(id) r selector:(SEL) s;
#<a href='http://www.cocos2d-iphone.org/forum/tags/if'>if</a> NS_BLOCKS_AVAILABLE
/** creates a menu item with a label and a normal and selected image with a block.
 The block will be &#34;copied&#34;.
 */
+(id) itemFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*)value selectedImage:(NSString*) value2 block:(void(^)(id sender))block;
/** creates a menu item with a label and a normal,selected  and disabled image with a block.
 The block will be &#34;copied&#34;.
 */
+(id) itemFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block;
/** initializes a menu item with a label and a normal, selected  and disabled image with a block.
 The block will be &#34;copied&#34;.
 */
-(id) initFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*) value selectedImage:(NSString*)value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block;
#endif

/** sets a new string to the inner label */
-(void) setString:(NSString*)label;

/** Enable or disabled the CCMenuItemFont
 @warning setIsEnabled changes the RGB color of the font
 */
-(void) setIsEnabled: (BOOL)enabled;

@end</code></pre>
<p><strong>CCMenuItemLabelAndImage.m</strong><br />
<pre><code>/*
 * CCMenuItemLabelAndImage
 *
 * Copyright (c) 2011 Jamorn Horathai
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the &#34;Software&#34;), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED &#34;AS IS&#34;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 */

#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;CCMenuItemLabelAndImage.h&#34;

@interface CCMenuItemLabelAndImage()

- (void) repositionLabel;

@end

@implementation CCMenuItemLabelAndImage

@synthesize disabledColor = disabledColor_;

+ (id) itemWithLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage:(NSString*)value selectedImage:(NSString*) value2
{
    return [self itemFromLabel:label normalImage:value selectedImage:value2 disabledImage:nil target:nil selector:nil];
}

+(id) itemFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*)value selectedImage:(NSString*) value2 target:(id) r selector:(SEL) s
{
    return [self itemFromLabel:label normalImage:value selectedImage:value2 disabledImage:nil target:r selector:s];
}

+(id) itemFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage: (NSString*) value3
{
    return [[[self alloc] initFromLabel:label normalImage:value selectedImage:value2 disabledImage:value3 target:nil selector:nil] autorelease];
}

+(id) itemFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 target:(id) r selector:(SEL) s
{
    return [[[self alloc] initFromLabel:label normalImage:value selectedImage:value2 disabledImage:value3 target:r selector:s] autorelease];
}

-(id) initFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*) value selectedImage:(NSString*)value2 disabledImage:(NSString*) value3 target:(id) r selector:(SEL) s
{
    if ((self = [super initFromNormalImage:value selectedImage:value2 disabledImage:value3 target:r selector:s])) {
        colorBackup = ccWHITE;
        disabledColor_ = ccWHITE;
        self.label = label;
    }
    return self;
}

#<a href='http://www.cocos2d-iphone.org/forum/tags/if'>if</a> NS_BLOCKS_AVAILABLE

+(id) itemFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*)value selectedImage:(NSString*) value2 block:(void(^)(id sender))block
{
    return [self itemFromLabel:label normalImage:value selectedImage:value2 disabledImage:nil block:block];
}

+(id) itemFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block
{
    return [[[self alloc] initFromLabel:label normalImage:value selectedImage:value2 disabledImage:value3 block:block] autorelease];
}

-(id) initFromLabel:(CCNode&#60;CCLabelProtocol,CCRGBAProtocol&#62;*)label normalImage: (NSString*) value selectedImage:(NSString*)value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block
{
    block_ = [block copy];
    return [self initFromLabel:label normalImage:value selectedImage:value2 disabledImage:value3 target:block_ selector:@selector(ccCallbackBlockWithSender:)];
}
#endif // NS_BLOCKS_AVAILABLE

-(CCNode&#60;CCLabelProtocol, CCRGBAProtocol&#62;*) label
{
	return label_;
}
-(void) setLabel:(CCNode&#60;CCLabelProtocol, CCRGBAProtocol&#62;*) label
{
	if( label != label_ ) {
		[self removeChild:label_ cleanup:YES];
		[self addChild:label];

		label_ = label;

        [self repositionLabel];
	}
}

-(void) setString:(NSString *)string
{
	[label_ setString:string];
    [self repositionLabel];
}

-(void) setPosition:(CGPoint)position
{
    [super setPosition:position];
    [self repositionLabel];
}

-(void) repositionLabel
{
    label_.position = ccp(normalImage_.position.x + normalImage_.contentSize.width/2, normalImage_.position.y + normalImage_.contentSize.height/2);
}

-(void) selected
{
	// subclass to change the default action
	if(isEnabled_) {
		[super selected];
        // Move the label down 1 point to look like the button&#39;s pressed.
        label_.position = ccp(label_.position.x, label_.position.y-1);
	}
}

-(void) unselected
{
	// subclass to change the default action
	if(isEnabled_) {
		[super unselected];
        // Move the label back up
		label_.position = ccp(label_.position.x, label_.position.y+1);
	}
}

-(void) setIsEnabled: (BOOL)enabled
{
	if( isEnabled_ != enabled ) {
		if(enabled == NO) {
			colorBackup = [label_ color];
			[label_ setColor: disabledColor_];
		}
		else
			[label_ setColor:colorBackup];
	}

	[super setIsEnabled:enabled];
}

- (void) setOpacity: (GLubyte)opacity
{
    [label_ setOpacity:opacity];
}
-(GLubyte) opacity
{
	return [label_ opacity];
}
-(void) setColor:(ccColor3B)color
{
	[label_ setColor:color];
}
-(ccColor3B) color
{
	return [label_ color];
}

@end</code></pre></description>
		</item>
		<item>
			<title>jarodl on "Displaying CCSprite/CCLabelTTF on sides of cube"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28392#post-139772</link>
			<pubDate>Tue, 17 Jan 2012 01:04:17 +0000</pubDate>
			<dc:creator>jarodl</dc:creator>
			<guid isPermaLink="false">139772@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm trying to add a CCSprite and a CCLabelTTF to the side of a cube and have it use the proper perspective as it rotates. I started by trying to add a CC3Billboard to the side of a CC3BoxNode.</p>
<pre><code>// Make a simple box template available. Only 6 faces per node.
CC3BoxNode *mn = [CC3BoxNode nodeWithName:kBoxName];
CC3BoundingBox bBox;
bBox.minimum = cc3v(-100.0f, -100.0f, -100.0f);
bBox.maximum = cc3v( 100.0f,  100.0f,  100.0f);
mn.uniformScale = 5.0f;
mn.material = [CC3Material material];
mn.isTouchEnabled = YES;
CCLabelTTF *testLabel = [CCLabelTTF labelWithString:@&#34;TestBB&#34;
                                           fontName:kStandardFontName
                                             fontSize:30.0f];
CC3Billboard *bb = [CC3Billboard nodeWithName:@&#34;TestBB&#34; withBillboard:testLabel];
bb.color = ccYELLOW;
bb.shouldUseLighting = NO;
bb.zOrder = -1;
bb.shouldDrawAs2DOverlay = YES;
bb.location = cc3v( 0.0, 80.0, 0.0 );
bb.unityScaleDistance = 425.0;
bb.offsetPosition = ccp( 0.0, 15.0 );
[mn addChild:bb];
[mn populateAsSolidBox:bBox];</code></pre>
<p>I'm using the sample project titled CC3Demo3DTiles as a starting point and not much else has changed. I'm doing this in the <code>initializeTemplates</code> method.
</p></description>
		</item>
		<item>
			<title>Thnx4TheXP on "Custom Fonts in Cocos2D 2.0?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22209#post-123344</link>
			<pubDate>Fri, 28 Oct 2011 00:06:51 +0000</pubDate>
			<dc:creator>Thnx4TheXP</dc:creator>
			<guid isPermaLink="false">123344@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I had custom fonts working before in cocos2d 1.0.0 and I upgraded to 2.0 and they don't work anymore. Does anyone know what is wrong? Is there a different way of loading them now?</p>
<pre><code>[CCMenuItemFont setFontName:@&#34;ka1.ttf&#34;];

		CCMenuItemFont* levels = [CCMenuItemFont itemFromString:@&#34;Levels&#34; block:^(id sender) {
			[[CCDirector sharedDirector] replaceScene:[LevelGrid node]];
		}];
		CCMenu* menu = [CCMenu menuWithItems:levels, nil];
		[self addChild:menu];</code></pre></description>
		</item>
		<item>
			<title>prashn64 on "Setting a format for parts of a label."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19569#post-109446</link>
			<pubDate>Mon, 08 Aug 2011 17:23:57 +0000</pubDate>
			<dc:creator>prashn64</dc:creator>
			<guid isPermaLink="false">109446@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Let's say I have this senetence in a cclabelttf...</p>
<p>My name is prashn64</p>
<p>I want it to output this instead:</p>
<p>My name is <strong><em>prashn64</em></strong></p>
<p>How would I go about doing this dynamically using just one label.  I'd do it with multiple labels, but the positioning would not come out properly.
</p></description>
		</item>
		<item>
			<title>wybielacz on "Visual text(font) improvements"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20905#post-116179</link>
			<pubDate>Thu, 15 Sep 2011 19:33:23 +0000</pubDate>
			<dc:creator>wybielacz</dc:creator>
			<guid isPermaLink="false">116179@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,</p>
<p>i'm trying to improve the visuals off the text in my game and I have some problems achieving the effect that I want.</p>
<p>My text right now looks like this:<br />
<img src="http://img850.imageshack.us/img850/740/testtr.png" alt="" /><br />
Simple with no effects.</p>
<p>But I want my text look something similar to this:<br />
<img src="http://img594.imageshack.us/img594/1181/optimus.png" alt="" /></p>
<p>I guess that I can make the gradient using Hiero or some other BMFont editor. But the most problems give me how to achieve such a blurred pink stroke like on the screen above. My idea was to use a pre rendered image but this idea is not good since in different languages the text and text length is different. Expect that I would want to use the same text effect on menu items or fast changeable text like timer counting the time. So i guess my idea is bad for this.<br />
Does anybody know any good tips on how to at least achieve an effect similar to such as seen on the second screen? I want to use the text with actions, menu items and also time counting that's why achieving such effect should be flexible. I would appreciate any help with my problem :)</p>
<p>BTW: Is it possible to use a BMFont as a menu item ?</p>
<p>Thanks.
</p></description>
		</item>
		<item>
			<title>svenito on "MenuItem with image and text"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/2784#post-17274</link>
			<pubDate>Tue, 03 Nov 2009 14:37:15 +0000</pubDate>
			<dc:creator>svenito</dc:creator>
			<guid isPermaLink="false">17274@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Sorry if I've missed something but from the header files I cannot see that it's possible to create a MenuItem with a background image and text. Am I correct?<br />
I ask because it would be great if I could have a reusable background image for all (or most) of my menu items with a font based text overlay rather than one for each item with different text</p>
<p>So is this possible or would I need to subclass  or other?</p>
<p>Thanks
</p></description>
		</item>
		<item>
			<title>vaskal08 on "Fonts"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20405#post-113482</link>
			<pubDate>Tue, 30 Aug 2011 17:35:37 +0000</pubDate>
			<dc:creator>vaskal08</dc:creator>
			<guid isPermaLink="false">113482@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>When i use my custom font with a .fnt file and a png file to make a CCLabelBMFont, an error terminates the game saying "Invalid texture for sprite". What could be the problem and how to i fix it?</p>
<p>code for label:</p>
<p>gamelabel = [CCLabelBMFont labelWithString:[NSString stringWithFormat:@"%i", gamecounter] fntFile:@"DigitalDreamFatSkew.fnt"];<br />
[self addChild: gamelabel];
</p></description>
		</item>
		<item>
			<title>gaminghorror on "How to create a CCLabelAtlas from a CCLabel? It should be possible, right?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/5427#post-32427</link>
			<pubDate>Thu, 01 Apr 2010 13:28:06 +0000</pubDate>
			<dc:creator>gaminghorror</dc:creator>
			<guid isPermaLink="false">32427@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Is it possible to create a texture for use with CCLabelAtlas by means of rendering a sprite using CCLabel and a TrueType font?</p>
<p>I think it should work, has anyone tried it before? It would be a cheap and easy way to speed up font rendering without having to create your own bitmap font or trying to find one that fits your game and is free.</p>
<p>Here's what i was thinking in pseudo-code:</p>
<pre><code>CCLabel* font = [CCLabel labelWithString:@&#34;ABCDEFGHIJKLMNOPQRSTUVWXYZ&#34; font:@&#34;Courier&#34; size:13];
CCLabelAtlas* atlas = [CCLabelAtlas atlasWithTexture2D:[font texture] string:@&#34;HELLO ATLAS&#34; width:26*13 height:13 startChar:(int)&#39;A&#39;];</code></pre>
<p>What do you think of that? Could it be added to cocos2d as a feature?
</p></description>
		</item>
		<item>
			<title>albrufsky on "Texture error on CClabelBMFont"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20341#post-113125</link>
			<pubDate>Sun, 28 Aug 2011 16:31:21 +0000</pubDate>
			<dc:creator>albrufsky</dc:creator>
			<guid isPermaLink="false">113125@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>****UPDATED*****</p>
<p>i'm a n00b and am having trouble with this texture error in my BMFont label.</p>
<p>Here is my code :</p>
<p>in my init method<br />
<pre><code>g_label = [CCLabelBMFont labelWithString:@&#34;let&#39;s Play in 3&#34; fntFile:@&#34;csans_15.fnt&#34;];

        [g_label setPosition:ccp( s.width/2, 285 )];
        [self addChild:g_label z:3];</code></pre>
<p>errors: NSAssert(texture!=nil, @"Invalid texture for sprite"); recived sigabrt
</p></description>
		</item>
		<item>
			<title>komocode on "Fonts, CCLabelBMFont in retina?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/14821#post-84157</link>
			<pubDate>Wed, 23 Mar 2011 23:45:05 +0000</pubDate>
			<dc:creator>komocode</dc:creator>
			<guid isPermaLink="false">84157@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have both schema.fnt &#124; schema.png and schema-hd.fnt &#124; schema-hd.png in the project. However when I run the program in retina display mode, I see a warning: cocos2d: Filename(schema-hd.png) contains -hd suffix. Removing it. See cocos2d issue #<a href='http://www.cocos2d-iphone.org/forum/tags/1040'>1040</a>. And my font is half the size in retina display. I've taken a look at issue #<a href='http://www.cocos2d-iphone.org/forum/tags/1040'>1040</a> but I'm not exactly sure what it means. I want the schema-hd font to be displayed, how would I do this?</p>
<p>I'm using 1.0 beta.
</p></description>
		</item>
		<item>
			<title>yaser on "Fiexd label in a big box2d word + scale anchorpoint problem.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18697#post-104905</link>
			<pubDate>Thu, 14 Jul 2011 18:33:17 +0000</pubDate>
			<dc:creator>yaser</dc:creator>
			<guid isPermaLink="false">104905@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hi guys </p>
<p>Im new to this wonderful forum ,,<br />
lets say I have really big word and im moving the player throw a force to go further in the game. I have two problem here:</p>
<p><strong>1- I wana have a fixed label in the corner for the score </strong><br />
every time I make CCLabel ,, I cant make it stay in the corner since Im folloing the player by CCFollow , it looks like an object from the game.</p>
<p><strong>2- scale anchorpoint problem</strong></p>
<p>when I scale for the zoom out , it work good for first , but when the player go right lets say the player in position (0,1000) the scale look really bad cus of the anchorpoint I guess , I tried to change anchorpoint by self.anchorpoint but its always fixed at (.5,.5)</p>
<p>thank you for ur time
</p></description>
		</item>
		<item>
			<title>VanKurt on "CCLabelBMFont dimensions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/12085#post-68082</link>
			<pubDate>Thu, 23 Dec 2010 10:15:53 +0000</pubDate>
			<dc:creator>VanKurt</dc:creator>
			<guid isPermaLink="false">68082@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi there!<br />
Is there a way to set a dimension-rect for a CCLabelBMFont object (like with the CCLabelTTF)?<br />
So that the words get automatically wrapped (newlines are inserted)?</p>
<p>Thanks!
</p></description>
		</item>
		<item>
			<title>joecritch on "CCLabel and Label classes not working C++"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/17338#post-97522</link>
			<pubDate>Mon, 06 Jun 2011 16:14:29 +0000</pubDate>
			<dc:creator>joecritch</dc:creator>
			<guid isPermaLink="false">97522@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi chaps,</p>
<p>I'm trying to get a basic score label working. I've tried using LabelAtlas, as apparently that's faster, but my character map isn't working correctly; plus I don't think I need to be bothered about speed (it'll only update about once per second).</p>
<p>So, I've tried the following in my Scene class (HelloWorldScene.mm) (I need to use the ".mm" because of Box2D.)</p>
<pre><code>scoreLabel = [Label labelWithString: [NSString stringWithFormat:@&#34;Score: %d&#34;, score]
								 dimensions: CGSizeMake(180, 20)
								  alignment: UITextAlignmentRight
								   fontName:@&#34;Arial&#34;
								   fontSize: 20];</code></pre>
<p>Then, I've got this in my header (HelloWorldScene.h):</p>
<p><code>Label *scoreLabel;</code></p>
<p>Problem is, this header statement causes the following error.</p>
<p><code>error: ISO C++ forbids declaration of &#39;Label&#39; with no type</code></p>
<p>Have you got any ideas why this compile-time error is happening?</p>
<p>Cheers!
</p></description>
		</item>
		<item>
			<title>hima on "Help with Japanese Font and BitmapFontAtlas."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8361#post-48622</link>
			<pubDate>Sun, 01 Aug 2010 15:23:33 +0000</pubDate>
			<dc:creator>hima</dc:creator>
			<guid isPermaLink="false">48622@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am currently having the same problem with cublah as he has posted a topic here <a href="http://www.cocos2d-iphone.org/forum/topic/1798" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/1798</a></p>
<p>However, I have looked at the current CCBitmapFontAtlas, and it seems like this patch has already been integrated. Yet, I still cannot use Japanese characters, since it give me the error. The error is as written below.</p>
<p>Assertion failure in -[CCBitmapFontConfiguration parseCharacterDefinition:charDef:</p>
<p>Can somebody please help me with this?</p>
<p>Thank you in advance :)
</p></description>
		</item>
		<item>
			<title>badben on "I can&#039;t see the custom font TTF"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8301#post-48284</link>
			<pubDate>Thu, 29 Jul 2010 14:05:41 +0000</pubDate>
			<dc:creator>badben</dc:creator>
			<guid isPermaLink="false">48284@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,</p>
<p>I'm trying to add a custom font:<br />
<a href="http://www.1001fonts.com/font_details.html?font_id=2556" rel="nofollow">http://www.1001fonts.com/font_details.html?font_id=2556</a><br />
I added the font into the projet but nothing append.<br />
The text is hidden.</p>
<pre><code>CCLabel *label = [[CCLabel labelWithString:@&#34;New game&#34;
								dimensions:CGSizeMake(320, 50) alignment:UITextAlignmentCenter
								  fontName:@&#34;Terminator Real NFI&#34; fontSize:18.0] retain];</code></pre>
<p>Thanks.
</p></description>
		</item>
		<item>
			<title>Jack Loverde on "Call Function to change nsstring wont work"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16023#post-90293</link>
			<pubDate>Wed, 27 Apr 2011 17:12:32 +0000</pubDate>
			<dc:creator>Jack Loverde</dc:creator>
			<guid isPermaLink="false">90293@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>the ScoreController.h file i have</p>
<pre><code>@interface ScoreController : CCLayer
{
	CCLabelTTF	*pontos;
}
- (void)func_pegar_itens:(int)num_de_itens;

@end</code></pre>
<p>the ScoreController.m i have<br />
<pre><code>@implementation ScoreController

-(id) init
{
    if ((self = [super init]))
	{
        CGSize winSize	= [[CCDirector sharedDirector] winSize];
        pontos			= [CCLabelTTF labelWithString:@&#34;C00&#34; dimensions:CGSizeMake(50, 20) alignment:UITextAlignmentRight fontName:@&#34;Verdana-Bold&#34; fontSize:18.0];
        pontos.color	= ccc3(255,255,255);
        int margin		= 10;
        pontos.position	= ccp(winSize.width - (pontos.contentSize.width/2) - margin, pontos.contentSize.height/2 + margin);
        [self addChild:pontos];
    }
    return self;
}

- (void)func_pegar_itens:(int)num_de_itens
{
	[pontos setString:[NSString stringWithFormat:@&#34;%i&#34;, num_de_itens]];

	NSString *alertMessage = [[NSString alloc] initWithFormat:@&#34;Valor arrecadado = %d&#34;,  num_de_itens];

	UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:alertMessage delegate:self cancelButtonTitle:@&#34;OK&#34; otherButtonTitles:nil];
	[alert show];
	[alert release];
}
- (void) dealloc
{
	[super dealloc];
}
@end</code></pre>
<p>Now i have HelloWordScene.h</p>
<pre><code>#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;ScoreController.h&#34;

// HelloWorld Layer
@interface HelloWorld : CCLayer
{
	ScoreController		*score_controller;
	int					num_de_itens;
	PlayerController	*player_controller;
}

@property (nonatomic, retain) ScoreController	*score_controller;
@property (nonatomic, assign) int				num_de_itens;
@property (nonatomic, retain) PlayerController	*player_controller;

// returns a Scene that contains the HelloWorld as the only child
+(id) scene;</code></pre>
<p>And the HelloWordScene.m</p>
<pre><code>@implementation HelloWorld

@synthesize score_controller;
@synthesize num_de_itens;
@synthesize player_controller;

+(id) scene
{
	// &#39;scene&#39; is an autorelease object.
	CCScene *scene = [CCScene node];

	// &#39;layer&#39; is an autorelease object.
	HelloWorld *layer = [HelloWorld node];

	// add layer as a child to scene
	[scene addChild: layer];

	// Adiciona a layer do Personagem
	PlayerController *player_controller = [PlayerController node];
	[scene addChild:player_controller];

	layer.player_controller = player_controller;

	// Adiciona a layer dos Pontos
	ScoreController *score_controller = [ScoreController node];
	[scene addChild: score_controller];

	layer.score_controller = score_controller;

	// return the scene
	return scene;
}

// on &#34;init&#34; you need to initialize your instance
-(id) init
{
	// always call &#34;super&#34; init
	// Apple recommends to re-assign &#34;self&#34; with the &#34;super&#34; return value
	if( (self=[super init] ))
	{
		ScoreController *newScoreController = [[ScoreController alloc] init];
		[self setScore_controller:newScoreController];

		PlayerController *newPlayerController = [[PlayerController alloc] init];
		[self setPlayer_controller:newPlayerController];

		[score_controller func_pegar_itens: 2];
	}
	return self;
}

// on &#34;dealloc&#34; you need to release all your retained objects
- (void) dealloc
{
	[super dealloc];
}
@end</code></pre>
<p>I try to call the function "func_pegar_itens" that ScoreController.m but not in the exchange value of NSString, but draws<br />
and the alert shows the value normally.<br />
Can anyone help me?</p>
<p>Thanks
</p></description>
		</item>
		<item>
			<title>Seasons on "Optimized CCBMFontLabel &amp; supported Unicode."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15311#post-86884</link>
			<pubDate>Wed, 06 Apr 2011 09:31:15 +0000</pubDate>
			<dc:creator>Seasons</dc:creator>
			<guid isPermaLink="false">86884@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>I tried to optimized CCBMFontLabel code.<br />
Size of ccBMFontDef  is 32byte default.<br />
But it is too waste.</p>
<p>Why?<br />
I would like to use Japanese in CCBMFontLabel.<br />
Japanese is unicode,but CCBMFontLabel not support unicode default.</p>
<p>So , I optimized this code and I optimized this code to 12byte.<br />
And I changed kCCBMFontMaxChars to 0xffff.</p>
<p>Succeeded in saving memory!!<br />
Default use 2047kbyte , but this code only use 767kbytes on memory.<br />
(65535*12/1024)</p>
<p>This is the test code.  If you find a bad code , please tell me.</p>
<p><a href="https://gist.github.com/904083" rel="nofollow">https://gist.github.com/904083</a>
</p></description>
		</item>
		<item>
			<title>bodmcn on "Menu handling - aligning a label beside a toggle button"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15271#post-86657</link>
			<pubDate>Tue, 05 Apr 2011 09:01:16 +0000</pubDate>
			<dc:creator>bodmcn</dc:creator>
			<guid isPermaLink="false">86657@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Is it possible to align a label beside a toggle button that is simply a label (ie no functionality)?</p>
<p>The only menu labels I can find are also selectable buttons.
</p></description>
		</item>
		<item>
			<title>ksjogo on "Change Label String From Thread"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/6759#post-39594</link>
			<pubDate>Mon, 31 May 2010 19:35:54 +0000</pubDate>
			<dc:creator>ksjogo</dc:creator>
			<guid isPermaLink="false">39594@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,<br />
I am used to be a GNU/Linux &#38; PHP programmer but now I have an Iphone project.<br />
I have a game scene needing to load some numbers from the internet. If I directly send messages to my InternetUtils Class the interface will be unresponsible until an answer.(is this normal behaviour?) So I want to send a message to a internet thread, changing one label after receiving the data.<br />
I pass the scene to the thread and if the thread changes the string, the label acts unexpected, it becomes a white box.</p>
<p>Shorted Code:<br />
GameScene<br />
<pre><code>...
[NSThread detachNewThreadSelector:@selector(calculateLabel:) toTarget:[InternetUtils class] withObject:self];</code></pre>
<p>Thread:<br />
<pre><code>@implementation InternetUtils
+(void)calculateLabel:(GuessScene*)scene{
	id p =[NSAutoreleasePool new];
	bestWord = @&#34;builded from more code&#34;;
	[scene.GuessingWord setString:bestWord];
	[p release];
}

@end</code></pre>
<p>Does someone know what is wrong with this code?<br />
And do I need to add special steps to end the thread?</p>
<p>Generally: Are there any greater examples/guidelines about the organisation of the code? Should be game logic added to scenes or other objects?</p>
<p>Cheers<br />
jogo
</p></description>
		</item>
		<item>
			<title>komal on "NSString detect the characters and change the color"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/10698#post-61012</link>
			<pubDate>Thu, 28 Oct 2010 07:12:24 +0000</pubDate>
			<dc:creator>komal</dc:creator>
			<guid isPermaLink="false">61012@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,<br />
I have one created CCLabel which has string "I am using cocos2d.". Now on the selected MenuItem I want to find vowels in this string and Then i want to store it in the array and chnage the color of detedcted vowels from black to red..<br />
So how can I do this.?</p>
<p>If anyone can help then I will really appreciate it.<br />
Thanks..
</p></description>
		</item>
		<item>
			<title>WWWeb-ster on "CCLabelTTF multi line"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/13829#post-77906</link>
			<pubDate>Tue, 22 Feb 2011 10:38:07 +0000</pubDate>
			<dc:creator>WWWeb-ster</dc:creator>
			<guid isPermaLink="false">77906@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm trying to make a CCLabelTTF label which has text across several lines. I'm sure I've done this before (most likely in a previous version of cocos2d), just by using the constructor with the dimensions argument. However, now, the text does not wrap!</p>
<pre><code>tutorialLabel = [CCLabelTTFOutlined labelWithString:txt
												   fontName:DEFAULT_FONT
												   fontSize:20
												 dimensions:maxSize
												  alignment:UITextAlignmentLeft
												  fillColor:ccc3(255, 255, 255)
											   outlineColor:ccc3(0, 0, 0)
											   outlineWidth:1];</code></pre>
<p>Can anybody spot something obvious that I'm doing wrong as I've parsed through the methods that are called all the way to FontLabelStringDrawing.m and I believe the text should wrap. Else, can somebody suggest something that I might try?</p>
<p>I have #<a href='http://www.cocos2d-iphone.org/forum/tags/define'>define</a> CC_FONT_LABEL_SUPPORT	1.<br />
I have tried using [txt sizeWithFont: ];<br />
I have tried forcing new lines with the \n escape character.</p>
<p>Any ideas please?</p>
<p>Thanks,</p>
<p>WorldWideWebster
</p></description>
		</item>
		<item>
			<title>markforster on "NSAttributedString"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/13316#post-74704</link>
			<pubDate>Sun, 06 Feb 2011 21:38:14 +0000</pubDate>
			<dc:creator>markforster</dc:creator>
			<guid isPermaLink="false">74704@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi Guys, I've looked every where for an answer and I cant find one anywhere. I want to render an NSAttributedString to a CCLabelTTF. I dont want to modify the code in texture2d although I will if I need to. Additionally, I've noticed that the code there uses NSAttributedString but for mac OSX only however, now that 4.? supports NSAttributedString I was wondering if one of you clever wot nots had any thoughts on tweaking cocos to render my string how I want it (i.e. with bold / italics / underlines etc..) </p>
<p>Its likely I'll spend some time scratching my head over this one before I come to a solution but any help would be great.</p>
<p>Thanks
</p></description>
		</item>
		<item>
			<title>katsudon on "How to use LabelAtlasCreator???"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/13220#post-74174</link>
			<pubDate>Thu, 03 Feb 2011 21:33:38 +0000</pubDate>
			<dc:creator>katsudon</dc:creator>
			<guid isPermaLink="false">74174@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi all</p>
<p>I have been spending time to figure out changing font size or space between letters using LabelAtlasCreator, but no success...<br />
When I change font size on LabeAtlasCreator and create png file to put it to sdk, it shows letters way off left or right on iphone simulator. How do you change font size and show letters properly on iphone? itemWidth and itemHeight are should be same as Glyph Dimension? Simulator shows "right" letters when itemWidth is 48 and itemHeight is 64....but there are so much spaces between each letters.... please help!</p>
<p>CCLabelAtlas *label1 = [CCLabelAtlas labelWithString:dateString charMapFile:@"centuryGothic3.png" itemWidth:48 itemHeight:64 startCharMap:' '];
</p></description>
		</item>
		<item>
			<title>indeeo on "LabelAtlasCreator - label atlas tool for Mac OS X"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4357#post-26036</link>
			<pubDate>Tue, 09 Feb 2010 01:36:57 +0000</pubDate>
			<dc:creator>indeeo</dc:creator>
			<guid isPermaLink="false">26036@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi guys,</p>
<p>I've been reading this forum for a while now, but haven't posted much until now.  With our game now finally nearing release (after many months of development), I found some time to clean up one of our internally made tools to make it useable for others. Hopefully some of you will find it helpful.  </p>
<p>Early on in development, we created a Mac OS X native font atlas image maker. This was made before I found the other tools (like Hiero) that are now available. I think it's still a rather useful tool; fast and easy to use.   </p>
<p><img src="http://indeeo.com/development/LabelAtlasScreen.png" /></p>
<p>The app outputs label atlas images, as well as plist files containing font layout info, such as the glyph advance values, for each atlas created.</p>
<p>Also included is a LabelAtlas subclass which uses the created atlas image and plist files to create and draw strings in cocos2d.  One of the neat features of the class is that it has a setting for adjusting the kerning.</p>
<p>You can download the app here:</p>
<p><a href="http://indeeo.com/development/LabelAtlasCreator.zip">http://indeeo.com/development/LabelAtlasCreator.zip</a></p>
<p>Please let me know if you have any comments or suggestions!
</p></description>
		</item>
		<item>
			<title>tchamblee67 on "problem implementing transparent pause layer"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/12422#post-69879</link>
			<pubDate>Fri, 07 Jan 2011 13:29:26 +0000</pubDate>
			<dc:creator>tchamblee67</dc:creator>
			<guid isPermaLink="false">69879@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey guys/gals,</p>
<p>I have a gameplay scene class derived from CCLayer that I am using to perform all of the gameplay for a small puzzle game.  This layer uses a targeted touch delegate with priority 1 and contains a CCMenu on it with a few buttons.  (Sorry I don't have the code with me on this computer.) But in a nutshell this is how I have my gameplay scene:</p>
<p>class GameplayScene : CCLayer<br />
{<br />
 // vars<br />
}</p>
<p>+(id) scene;  // creates scene, self, adds self to scene and returns self<br />
-(id) init;   // initializes, adds children, sets touch enabled to true<br />
// I also have methods to register the targeted touch delegate and receive touch events</p>
<p>The gameplay scene works correctly as expected.  The touch events are firing and the menu items are receiving touches and firing their touch events as well.</p>
<p>I am having a problem implementing a transparent pause layer, however.  To do this, I have created a custom layer derived from CCLayerColor and setting it up with a targeted touch delegate of priority 0 (lower than the gameplay layer) so that it has the ability to swallow all touches.</p>
<p>class PauseLayer : CCLayerColor<br />
{<br />
}</p>
<p>+(id) initNew; // creates new autorelease instance of PauseLayer<br />
-(id) init;    // initializes, adds children, sets touch enabled to true<br />
// also have functions to register touch delegate, receive touch events</p>
<p>I implemented this PauseLayer in the GameLayer PauseButtonTouched function similar to:</p>
<p>PauseButtonTouched<br />
{<br />
    PauseLayer* layer = [PauseLayer initNew];<br />
    [[self parent] addChild:PauseLayer];<br />
}</p>
<p>The transparent pause layer appears on top of the gameplay layer as expected and all of the items on it (labels, menu items) are shown.  The touch events in the pause layer are firing (touch began, touch moved, touch ended) and no touches are passing through to the gameplay layer.</p>
<p>My problem, however, is that the CCMenuItems on the pause layer are not responding to any touchs.  They do not show a response when touched and their touch events are not firing at all.  I have a resume button on the pause layer that I cannot touch.  I could just turn the resume button into a sprite and check for a touch within the button using the touch began, touch ended methods, but I really want to keep the resume button as menu item.</p>
<p>Does anyone have any advice?  I will post some code when I get home if I can't get this resolved.</p>
<p>Thanks!!</p>
<p>Tony
</p></description>
		</item>

	</channel>
</rss>

