<?xml version="1.0" encoding="UTF-8"?><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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Cocos2d Image Button Function</title>
	<atom:link href="http://www.dbuggr.com/leothenerd/cocos2d-image-button-function/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dbuggr.com/leothenerd/cocos2d-image-button-function/</link>
	<description>Share Knowledge &#38; Be Rewarded</description>
	<lastBuildDate>Fri, 03 Feb 2012 23:13:48 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: leothenerd</title>
		<link>http://www.dbuggr.com/leothenerd/cocos2d-image-button-function/comment-page-1/#comment-3795</link>
		<dc:creator>leothenerd</dc:creator>
		<pubDate>Wed, 07 Jul 2010 23:48:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbuggr.com/leothenerd/cocos2d-image-button-function/#comment-3795</guid>
		<description>&lt;code&gt;
- (void)addImageButton:(NSString*)normalImage 
				   selected:(NSString*)selectedImage 
				   position:(CGPoint)position 
					 target:(id)target
				   selector:(SEL)sel 
						  z:(int)z
						tag:(int)tag
{
	CCSprite *normalSprite = [CCSprite spriteWithFile:normalImage];
	CCSprite *selectSprite = [CCSprite spriteWithFile:selectedImage];
	
	normalSprite.anchorPoint = ccp(0,0);
	selectSprite.anchorPoint = ccp(0,0);
	
	assert(normalSprite);
	assert(selectSprite);
	
	CCMenuItem *menuItem = [CCMenuItemSprite itemFromNormalSprite:normalSprite
												   selectedSprite:selectSprite
														   target:target
														 selector:sel];
	
	CCMenu *menu = [CCMenu menuWithItems:menuItem, nil];
	menu.position = position;
	
	[target addChild:menu z:z tag:tag];	
}

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p><pre><code>
- (void)addImageButton:(NSString*)normalImage 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; selected:(NSString*)selectedImage 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; position:(CGPoint)position 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; target:(id)target
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; selector:(SEL)sel 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z:(int)z
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tag:(int)tag
{
&nbsp;&nbsp;CCSprite *normalSprite = [CCSprite spriteWithFile:normalImage];
&nbsp;&nbsp;CCSprite *selectSprite = [CCSprite spriteWithFile:selectedImage];
&nbsp;&nbsp;
&nbsp;&nbsp;normalSprite.anchorPoint = ccp(0,0);
&nbsp;&nbsp;selectSprite.anchorPoint = ccp(0,0);
&nbsp;&nbsp;
&nbsp;&nbsp;assert(normalSprite);
&nbsp;&nbsp;assert(selectSprite);
&nbsp;&nbsp;
&nbsp;&nbsp;CCMenuItem *menuItem = [CCMenuItemSprite itemFromNormalSprite:normalSprite
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; selectedSprite:selectSprite
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; target:target
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; selector:sel];
&nbsp;&nbsp;
&nbsp;&nbsp;CCMenu *menu = [CCMenu menuWithItems:menuItem, nil];
&nbsp;&nbsp;menu.position = position;
&nbsp;&nbsp;
&nbsp;&nbsp;[target addChild:menu z:z tag:tag];&nbsp;&nbsp;
}

</code></pre></p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
