<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<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; Topic: When changing textures in Sprite, It shows both...</title>
		<link>http://www.cocos2d-iphone.org/forum/topic/3989</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Thu, 09 Sep 2010 10:18:09 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</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/topic/3989" rel="self" type="application/rss+xml" />

		<item>
			<title>MikeSz on "When changing textures in Sprite, It shows both..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3989#post-24000</link>
			<pubDate>Fri, 22 Jan 2010 15:17:39 +0000</pubDate>
			<dc:creator>MikeSz</dc:creator>
			<guid isPermaLink="false">24000@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;no. we have used Animation in 0.7.0 and it should also be working in newer releases&#60;/p&#62;
&#60;p&#62;here is the code we used, bear in mind it's from 0.7 so you might have to make sme modifications:&#60;/p&#62;
&#60;p&#62;// create animation&#60;br /&#62;
Animation * someAnim = [Animation animationWithName:@&#34;anim_name&#34; delay:0.0 images:@&#34;image1.png&#34;,@&#34;image2.png&#34;, nil];&#60;/p&#62;
&#60;p&#62;// create sprite&#60;br /&#62;
Sprite * spr = [Sprite spriteWithFile:@&#34;image1.png&#34;];&#60;br /&#62;
[spr addAnimation:someAnim];&#60;br /&#62;
[spr setDisplayFrame: @&#34;anim_name&#34; index:1];&#60;/p&#62;
&#60;p&#62;that should switch the image to image2.png
&#60;/p&#62;</description>
		</item>
		<item>
			<title>agfa555 on "When changing textures in Sprite, It shows both..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3989#post-23990</link>
			<pubDate>Fri, 22 Jan 2010 14:12:28 +0000</pubDate>
			<dc:creator>agfa555</dc:creator>
			<guid isPermaLink="false">23990@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;I searched all sprite test example but there is nothing about changing textures.&#60;br /&#62;
Is the only way of changing the sprite's texture by removing and adding another child???
&#60;/p&#62;</description>
		</item>
		<item>
			<title>agfa555 on "When changing textures in Sprite, It shows both..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3989#post-23975</link>
			<pubDate>Fri, 22 Jan 2010 11:47:09 +0000</pubDate>
			<dc:creator>agfa555</dc:creator>
			<guid isPermaLink="false">23975@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;I use normal Sprites.&#60;br /&#62;
Have not used SpriteSheet&#60;/p&#62;
&#60;p&#62;Here is sample code for changing the texture:&#60;/p&#62;
&#60;p&#62;Texture2D *texture = [[Texture2D alloc] initWithImage:[UIImage imageNamed:file]];&#60;br /&#62;
[powerBlock setTexture:texture];
&#60;/p&#62;</description>
		</item>
		<item>
			<title>MikeSz on "When changing textures in Sprite, It shows both..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3989#post-23974</link>
			<pubDate>Fri, 22 Jan 2010 11:44:23 +0000</pubDate>
			<dc:creator>MikeSz</dc:creator>
			<guid isPermaLink="false">23974@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;are you using spritesheet or separe images for the sprites ?&#60;/p&#62;
&#60;p&#62;well, you probably use separate images&#60;/p&#62;
&#60;p&#62;for that I used animations...&#60;/p&#62;
&#60;p&#62;Id recommend you to just look into the code samples (sprite test)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>agfa555 on "When changing textures in Sprite, It shows both..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3989#post-23972</link>
			<pubDate>Fri, 22 Jan 2010 11:38:05 +0000</pubDate>
			<dc:creator>agfa555</dc:creator>
			<guid isPermaLink="false">23972@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;That removes the sprite from screen.&#60;br /&#62;
I just want to switch the sprite texture but can't seem to get rid of the original one.&#60;br /&#62;
HELP!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>MikeSz on "When changing textures in Sprite, It shows both..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3989#post-23908</link>
			<pubDate>Thu, 21 Jan 2010 14:41:03 +0000</pubDate>
			<dc:creator>MikeSz</dc:creator>
			<guid isPermaLink="false">23908@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;[sprite.parent removeChild:sprite];&#60;/p&#62;
&#60;p&#62;something like this
&#60;/p&#62;</description>
		</item>
		<item>
			<title>agfa555 on "When changing textures in Sprite, It shows both..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3989#post-23905</link>
			<pubDate>Thu, 21 Jan 2010 14:18:45 +0000</pubDate>
			<dc:creator>agfa555</dc:creator>
			<guid isPermaLink="false">23905@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Thanks.&#60;/p&#62;
&#60;p&#62;How do i remove that???&#60;br /&#62;
I tried releasing the texture but it crashes.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>MikeSz on "When changing textures in Sprite, It shows both..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3989#post-23903</link>
			<pubDate>Thu, 21 Jan 2010 14:04:36 +0000</pubDate>
			<dc:creator>MikeSz</dc:creator>
			<guid isPermaLink="false">23903@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;because you dont remove it from the layer / spritesheer probably
&#60;/p&#62;</description>
		</item>
		<item>
			<title>agfa555 on "When changing textures in Sprite, It shows both..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/3989#post-23894</link>
			<pubDate>Thu, 21 Jan 2010 12:55:36 +0000</pubDate>
			<dc:creator>agfa555</dc:creator>
			<guid isPermaLink="false">23894@http://www.cocos2d-iphone.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I'm trying to figure out why when i change my sprite's texture the old one appears in the lower left corner.&#60;br /&#62;
Can't get rid of it.&#60;/p&#62;
&#60;p&#62;Thanks in advance
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
