<?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: texture - Recent Topics</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/texture</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 04:09:16 +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/texture/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>riq on "workaround for %33 texture memory bug"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29121#post-143486</link>
			<pubDate>Thu, 09 Feb 2012 19:10:33 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">143486@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>So,</p>
<p>If you didn't know, when you create a texture, iOS will allocate 33% more memory, presumably to have enough room in case mipmaps are needed.<br />
( <a href="http://www.cocos2d-iphone.org/forum/topic/23887#post-129097" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/23887#post-129097</a> )</p>
<p>But it is worth noting that this bug is only present on POT (Power Of Two) textures ( Mipmapping is only supported on POT textures ).<br />
So, in order to reduce memory, what you have to do is two create NPOT textures.</p>
<p>eg:<br />
If you are using a 2048x2048 textures, convert it into a 2048x2047 textures (and you will save 33% memory).<br />
In case you can't make it smaller, then make it bigger. eg:<br />
If you have a 2048x1024 texture, create a 2048x1025 texture.</p>
<p>If you are using cocos2d v1.0, then you have to edit <code>ccConfig.h</code> with:<br />
<pre><code>#<a href='http://www.cocos2d-iphone.org/forum/tags/define'>define</a> CC_TEXTURE_NPOT_SUPPORT 1</code></pre>
<p>If you are using v1.1 or v2.0, then you are OK, since they already support NPOT textures by default.</p>
<p>Ways to know if you are using POT / NPOT textures:<br />
<strong>A)</strong>  Parse your PNG, GIF, BMP, JPEG files with <code>file</code>:<br />
<pre><code>$ find . -name &#34;*.png&#34; -print0 &#124; xargs -0 file</code></pre>
<p><strong>B)</strong> Run this line of code and see your debug console:<br />
<pre><code>[[CCTextureCache sharedTextureCache] dumpCachedTextureInfo];</code></pre>
<p>Further info:<br />
<a href="https://devforums.apple.com/thread/113889?start=0&#038;tstart=0" rel="nofollow">https://devforums.apple.com/thread/113889?start=0&#038;tstart=0</a></p>
<p>Important: NPOT textures can't have mipmaps, and also they only accept GL_CLAMP_TO_EDGE in GL_TEXTURE_WRAP_{S,T}</p>
<p>Important 2: PVRTC (2bpp and 4bpp) textures can't be converted to NPOT
</p></description>
		</item>
		<item>
			<title>n8burba on "[Book] Cocos2d for iPhone 1 Game Development Cookbook"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28114#post-138225</link>
			<pubDate>Thu, 05 Jan 2012 19:46:12 +0000</pubDate>
			<dc:creator>n8burba</dc:creator>
			<guid isPermaLink="false">138225@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey everyone, this is long-time forum lurker Nathan Burba.</p>
<p>After a year of writing and development I am proud to say that Cocos2d for iPhone 1 Game Development Cookbook is now in print!</p>
<p><img src="http://cocos2dcookbook.com/wp-content/uploads/2011/12/cover_image_250w.jpg" /></p>
<p>This book is designed to be the ultimate 2D game development book. It includes the full code of over 100 recipes built using XCode 4 and iOS 5. Every major area of game development is covered.</p>
<p>Recipes are designed to be modular. Get the book, download the code and plug them into your project.</p>
<p>Here are some of the stand-out recipes:</p>
<ul>
<li>Texture filled polygons</li>
<li>Realistic 2D lighting</li>
<li>Performing gestures</li>
<li>Creating a vehicle</li>
<li>Simulating bullets</li>
<li>Creating a top-down isometric game engine</li>
<li>Creating a loading screen with indicator</li>
<li>Using positional audio in a game</li>
<li>Recording audio</li>
<li>Speech recognition and text-to-speech</li>
<li>Firing projectiles at moving targets</li>
<li>AI flocking using Boids</li>
<li>A* pathfinding in a side-scroller</li>
<li>Using Lua for dialogue trees</li>
<li>Bluetooth/Wi-Fi voice chat without GKPeerPicker</li>
<li>Wi-Fi client/server chat using CFNetwork</li>
</ul>
<p>.<br />
Go to the book website here: <a href="http://cocos2dcookbook.com/" rel="nofollow">http://cocos2dcookbook.com/</a> and you can download the first chapter (17 recipes) for free (PDF + XCode project).</p>
<p>You can also explore the entire book, watch videos explaining each recipe and download free apps to test the recipe demos on your device.</p>
<p>Here is the video for Chapter 7: AI and Logic:</p>
<p><object width="540" height="390"><embed src="http://www.youtube.com/v/7S--gnUwgg8?fs=1&#38;hl=en_US" type="application/x-shockwave-flash" width="540" height="390" /></object></p>
<p>You can purchase the book on Amazon or from Packt Publishing:</p>
<ul>
<li>Amazon Paperback: <a href="http://www.amazon.com/Cocos2d-iPhone-Game-Development-Cookbook/dp/1849514003" rel="nofollow">http://www.amazon.com/Cocos2d-iPhone-Game-Development-Cookbook/dp/1849514003</a></li>
<li>Amazon Kindle: <a href="http://www.amazon.com/Cocos2d-iPhone-Development-Cookbook-ebook/dp/B006MGDIAA/" rel="nofollow">http://www.amazon.com/Cocos2d-iPhone-Development-Cookbook-ebook/dp/B006MGDIAA/</a></li>
<li>Packt Paperback and/or eBook: <a href="http://www.packtpub.com/cocos2d-for-iphone-1-game-development-cookbook/book" rel="nofollow">http://www.packtpub.com/cocos2d-for-iphone-1-game-development-cookbook/book</a></li>
</ul>
<p>.<br />
If you have any questions you can send me an email at <a href="mailto:cocos2dcookbook@gmail.com">cocos2dcookbook@gmail.com</a>.</p>
<p>I would like to thank everyone who has contributed to cocos2d-iphone. Without such a great framework and community to support it I wouldn't have the opportunity to write this book.
</p></description>
		</item>
		<item>
			<title>gwmike on "CCProgressTimer with Sprite Frame?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/10540#post-60147</link>
			<pubDate>Thu, 21 Oct 2010 01:31:20 +0000</pubDate>
			<dc:creator>gwmike</dc:creator>
			<guid isPermaLink="false">60147@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>CCProgressTimer is meant to be used with a texture.  When I try to use it with a specific frame of a sprite sheet it will use the whole sprite sheet as the texture.</p>
<p>Has anyone modified or got this class to work with a sprite frame?  If so, please post how and possibly a code sample.
</p></description>
		</item>
		<item>
			<title>calin on "Texture deformation based on edge shape points"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28604#post-140872</link>
			<pubDate>Mon, 23 Jan 2012 19:17:27 +0000</pubDate>
			<dc:creator>calin</dc:creator>
			<guid isPermaLink="false">140872@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Is it possible to deform a texture (sprite) given that you have points on the edge shape, as seen in the following image?</p>
<p><img src="http://i39.tinypic.com/2vt343a.png" /></p>
<p>I think one method is to triangulate the polygon and then use GL_TRIANGLES to draw the texture, then if a point changes, triangulate the polygon again and redraw. But this won't work in this case because you can have a pretty complex shape and the processing time would be overwhelming.</p>
<p>Basically what I want is to deform the texture when a point on the edge changes.<br />
Is there a way to achieve this deformation? I hope I described it well enough.</p>
<p>Thanks!
</p></description>
		</item>
		<item>
			<title>tiffanyPea on "Infinite Loop!!1!1 help!"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28515#post-140357</link>
			<pubDate>Fri, 20 Jan 2012 08:23:05 +0000</pubDate>
			<dc:creator>tiffanyPea</dc:creator>
			<guid isPermaLink="false">140357@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hii guys, so I am totally new to cocos2d, and I really need your help! (:</p>
<p>I have three classes involved, a Bullet, BulletCache, and Player class. The Bullet class passes its methods to the BulletCache class, and I am trying to get the Player class to successfully call the methods of the BulletCache class. </p>
<p>I created a new Player instance variable:</p>
<pre><code>@interface Player : LevelObject
{
BulletCache *bulletCache;
}</code></pre>
<p>I wanted to initialize the BulletCache class in the Player class, so I called the bulletCache init in the Player's init method:</p>
<pre><code>-(id)init
	{
		self = [super initWithTitle:@&#34;barbarian king&#34;];
		if(self != nil)
		{
			// give ourselves a tag so other nodes can find us
			// (we don&#039;t have a tag because Level adds us without one)
			self.tag = kTagPlayer;

			//initialize bulletCache in Player class
			bulletCache = [BulletCache node];
                       //Other methods...
}</code></pre>
<p>However, when I built &#38; ran this, and pressed "new game" in the main menu, the Loading Screen loaded, but the console screen showed an infinite loop.</p>
<p>I enabled breakpoints In the Bullet and BulletCache methods:</p>
<pre><code>-(id) initWithBulletImage
{
	// Uses the Texture Atlas now.
if ((self = [super initWithSpriteFrameName:@&#34;bullet1big e0000.png&#34;]))
	{
	}

	return self;
}</code></pre>
<p>and </p>
<pre><code>CCSpriteFrame* bulletFrame = [[CCSpriteFrameCache sharedSpriteFrameCache]
spriteFrameByName:@&#34;bullet1big e0000.png&#34;];</code></pre>
<p>The console read </p>
<p><code>And the message displayed in the console read: GDB:Stopped at breakpoint 1 (hit count: 3) &#039;-initWithBulletImage - Line 29&#039;</code></p>
<p>and</p>
<p><code>&#34;GDB: Stopped at breakpoint 1 (hit count: 1) -&#039;-init-Line 84&#039;</code></p>
<p>Does anyone have any ideas or help? I'm really stuck ): and appreciate the help guys!!! (:
</p></description>
		</item>
		<item>
			<title>asinesio on "Rendering a texture-filled polygon"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/8142#post-47400</link>
			<pubDate>Fri, 23 Jul 2010 05:44:40 +0000</pubDate>
			<dc:creator>asinesio</dc:creator>
			<guid isPermaLink="false">47400@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>For my current project, I'm essentially looking for a way to do a texture-filled polygon.  The texture should not stretch or warp, but it should repeat to fill the entire polygon.  The polygon may be concave or convex.</p>
<p>Basically, I want the same thing that ccDrawPoly() does, but instead of just an outline, it would fill with a repeating texture.   I'm an openGL noob, so keep that in mind.</p>
<p>Think of creating a polygon in Photoshop then clicking the paint bucket to fill it with a pattern.</p>
<p>So far, I've tried the following approaches with very little success.</p>
<p>1) Modified CCTexture2D and adding a "drawInPolygon" method, like this:<br />
<pre><code>- (void) drawInPolygon: (CGPoint *) poli points: (int) points
{
	GLfloat	 coordinates[] = {  0.0f,	_maxT,
		_maxS,	_maxT,
		0.0f,	0.0f,
		_maxS,	0.0f  };

	glBindTexture(GL_TEXTURE_2D, _name);
	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
	glVertexPointer(2, GL_FLOAT, 0, poli);
	glTexCoordPointer(2, GL_FLOAT, 0, coordinates);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

	glDrawArrays(GL_TRIANGLE_FAN, 0, points);
}</code></pre>
<p>This has led to the texture being stretched and rotated... and looking awful, and it also requires that the polygon is convex, so I've even got a library that makes a polygon convex by triangulation.</p>
<p>2) Implementing a CCRibbon object as a child of my node that has the vertices.</p>
<p>This kinda works, but it looks ugly.</p>
<p>3) CCRenderTexture, which doesn't work because the levels I'm creating are well over 5000 px wide and it seems silly to create huge textures in memory when it's just made up of one smaller texture repeated and clipped.</p>
<p>---</p>
<p>Does anyone have any advice for me?   Am I missing something obvious here, like maybe just setting the background to be a huge CCSprite that has GL_REPEAT in its texture options and clipping it somehow?</p>
<p>I've searched these forums for a few days now and haven't really had a lot of luck.</p>
<p>Any help you could provide would be greatly appreciated!
</p></description>
		</item>
		<item>
			<title>SizzlerWA on "[SOLVED] Particle Systems behave differently based on start order"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28393#post-139779</link>
			<pubDate>Tue, 17 Jan 2012 02:52:10 +0000</pubDate>
			<dc:creator>SizzlerWA</dc:creator>
			<guid isPermaLink="false">139779@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>I have a simple scene with two particle systems in it, one on the left side, the other on the right side.</p>
<p>Both particle systems are initialized like:</p>
<p>CCParticleSystem* particleSystemA = [CCParticleSystemQuad particleWithFile:@"Some Particle Designer File A"];<br />
CCParticleSystem* particleSystemB = [CCParticleSystemQuad particleWithFile:@"Some Particle Designer File B"];</p>
<p>Here's what happens:</p>
<p>-Add and start A first, then B  ===&#62;  BOTH particle systems look fuzzy and have wrongly shaped particles<br />
-Add and start B first, then A  ===&#62;  BOTH particle systems look sharp and have correctly shaped particles</p>
<p>This behavior is totally repeatable and independent of my code.</p>
<p>Any ideas what's going on here?  Is there some kind of interdependency/aliasing bug/ordering/race condition in cocos2d that is happening?  I can demo this with a simple demo project if need be.</p>
<p>I'd be thankful for any insight or tips that people could provide!</p>
<p>This is in cocos2d 1.0.1 on Mac OS X 10.6.8.</p>
<p>Thanks!</p>
<p>****<br />
---- SOLVED ----<br />
****</p>
<p>I'm posting the solution here in case this impacts anybody else.</p>
<p>This was caused with a "bug" in Particle Designer/Cocos2d as follows:</p>
<p>-In Particle Designer, if you embed your texture in the file and save as a cocos2d plist, Particle Designer sets the textureFileName to particleTexture.png and WILL NOT let you edit the textureFileName (it's grayed out as soon as you set the texture to be embedded).<br />
-In Cocos2d, even if the file at textureFileName cannot be loaded, and cocos2d uses the embedded texture in the ParticleDesigner-created plist file, cocos2d uses the textureFileName as the texture name in its texture cache.</p>
<p>So in my case, the textures for particleSystemA and particleSystemB were both being loaded and stored under the texture cache name/key "particleTexture.png".  So whichever system was created first won.</p>
<p>I think this is a bug in the combination of ParticleDesigner/cocos2d because the joint use of them fails to follow the "principle of least surprise" here.</p>
<p>I filed a bug report with the ParticleDesigner folks:</p>
<p><a href="http://www.71squared.com/community/viewtopic.php?f=25&#038;t=1059" rel="nofollow">http://www.71squared.com/community/viewtopic.php?f=25&#038;t=1059</a></p>
<p>ParticleDesigner is awesome by the way, but in this one case it behaved counterintuitively.</p>
<p>Cheers!</p>
<p>I bulk updated all my plist files as follows, on OS X, in Bash:</p>
<p>for j in *.plist; do sed -i 'uau' "s/particleTexture.png/${j}_<code>uuidgen</code>/g" "$j"; done
</p></description>
		</item>
		<item>
			<title>cocosbean on "Check sprite texture"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/25626#post-133433</link>
			<pubDate>Thu, 15 Dec 2011 03:45:31 +0000</pubDate>
			<dc:creator>cocosbean</dc:creator>
			<guid isPermaLink="false">133433@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have a sprite that will change it's texture multiple times during the game. How do I check which texture it currently has?
</p></description>
		</item>
		<item>
			<title>marraboy on "Shadow Map"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28103#post-138165</link>
			<pubDate>Thu, 05 Jan 2012 13:57:37 +0000</pubDate>
			<dc:creator>marraboy</dc:creator>
			<guid isPermaLink="false">138165@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi</p>
<p>Is there anything built into the Cocos3D framework that allows me to apply a shadow map to a second material with it's own UV coords or do I need to delve in to the source code and do some OpenGL?</p>
<p>Thanks</p>
<p>JT
</p></description>
		</item>
		<item>
			<title>marraboy on "Texture transparency"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28066#post-138000</link>
			<pubDate>Wed, 04 Jan 2012 18:09:26 +0000</pubDate>
			<dc:creator>marraboy</dc:creator>
			<guid isPermaLink="false">138000@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi</p>
<p>I have added a simple model (a single plane) to a scene that has a material with a .png file on it that has an element of transparency. I have placed an object behind it.</p>
<p>The transparency is not working, it is black and I cannot see the object behind it. Is there anything I need to programatically set on the material or should this 'just work'?</p>
<p>Regards</p>
<p>JT
</p></description>
		</item>
		<item>
			<title>birdkingz on "How should I free up more memory?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/27827#post-136709</link>
			<pubDate>Fri, 23 Dec 2011 15:16:41 +0000</pubDate>
			<dc:creator>birdkingz</dc:creator>
			<guid isPermaLink="false">136709@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I know there are two methods of getting more memory back..</p>
<pre><code>[[CCSpriteFrameCache sharedSpriteFrameCache] removeSpriteFrames];
[[CCTextureCache sharedTextureCache] removeAllTextures];</code></pre>
<p>But when or what is the proper way of calling it?</p>
<p>Currently I'm handling like this:<br />
I have 4 scenes with 4 texture atlas...<br />
Whenever I'm changing scene, I will just remove all the sprite frames and all textures first, then only load the coming scene texture and sprite frames.<br />
Am I doing it correctly?</p>
<p>Anyone has better ways of managing this? I'm really headache of figuring out the better/proper way of doing memory free.
</p></description>
		</item>
		<item>
			<title>Daniel López on "Implementing SoftBody with Box2D with Birkemose Method"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20817#post-115719</link>
			<pubDate>Tue, 13 Sep 2011 15:37:31 +0000</pubDate>
			<dc:creator>Daniel López</dc:creator>
			<guid isPermaLink="false">115719@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi all, First contact with Box2D and I began with something very difficult xD</p>
<p>I am implementing the @<a href='http://www.cocos2d-iphone.org/forum/profile/20192'>Birkemose</a> method for softbodys (which was done by Chipmunk) in Box2D.</p>
<p>Following his thread I almost done everything, but the texture doesn't draw good at all...</p>
<p>Here an Screen Shot. (I don't care yet about the texture isn't draw in the  good position, it's something related to Retina and CC_CONTENT_SCALE), I think i can repair that by myself<br />
<img src="http://img26.imageshack.us/img26/7712/weirdh.png" alt="Weird texture" /></p>
<p>It seems that the last texture coordinate doesn't draw good... I can't solve it... Any help? Or hint?</p>
<p>Here is the source code (almost same than Birkemose)<br />
<pre><code>-( void )draw {
	CGPoint segmentPos[ LADOS + 2 ];
	CGPoint texturePos[ LADOS + 2 ];
	CGPoint textureCenter;
	float angle, baseAngle = 0.0f;

	// calculate triangle fan segments
	segmentPos[ 0 ] = CGPointZero;
	for ( int count = 0; count &#60; LADOS; count ++ ) {
        NSValue *val = [muelles objectAtIndex:count];
        b2Body *muelle;
        [val getValue:&#38;muelle];

        CGPoint e = ccp(muelle-&#62;GetPosition().x,muelle-&#62;GetPosition().y);
        CGPoint c = ccp(centralBody-&#62;GetPosition().x,centralBody-&#62;GetPosition().y);

        // get relative position and multiply for scale
		segmentPos[ count + 1 ] = ccpMult( ccpSub( e,c ), 64 ); //BLOB SKIN SCALE

	}
	segmentPos[ LADOS + 1 ] = segmentPos[ 1 ];

	// move to absolute position
	for ( int count = 0; count &#60; ( LADOS + 2 ); count ++ ){
        CGPoint c = ccp(centralBody-&#62;GetPosition().x,centralBody-&#62;GetPosition().y);
        segmentPos[ count ] = ccpAdd( c, segmentPos[ count ] );
    }

	// remap skin
	// done to be able to control skin rotation independently from blob rotation

	//baseAngle = [ UTIL angle:m_centerBody.pos b:m_perimeterBodies[ 0 ].pos ];

	texturePos[ 0 ] = CGPointZero;
	for ( int count = 0; count &#60; LADOS; count ++ ) {
		// calculate new angle
		angle						= baseAngle + ( 2 * M_PI / LADOS * count );
		// calculate texture position
		texturePos[ count + 1 ].x	= sinf( angle );
		texturePos[ count + 1 ].y	= cosf( angle );
	}
	texturePos[ LADOS + 1 ] = texturePos[ 1 ];

	// recalculate to texture coordinates
	textureCenter = CGPointMake( 0.5f, 0.5f );
	for ( int count = 0; count &#60; ( LADOS + 2 ); count ++ )
		texturePos[ count ] = ccpAdd( ccpMult( texturePos[ count ], 0.5f ), textureCenter );

	glEnable( GL_TEXTURE_2D );
	glBindTexture( GL_TEXTURE_2D, [skin name] ); 

        glDisableClientState( GL_COLOR_ARRAY ),
	glTexCoordPointer( 2, GL_FLOAT, 0, texturePos );
	glVertexPointer( 2, GL_FLOAT, 0, segmentPos );
	glDrawArrays( GL_TRIANGLE_FAN, 0, LADOS + 2 );
        glEnableClientState( GL_COLOR_ARRAY ) ;

}</code></pre></description>
		</item>
		<item>
			<title>zedarus on "Use part of an image as a texture for sprite"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/27799#post-136554</link>
			<pubDate>Thu, 22 Dec 2011 09:55:01 +0000</pubDate>
			<dc:creator>zedarus</dc:creator>
			<guid isPermaLink="false">136554@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey everybody!</p>
<p>Here's what I'm trying to do: let's say we have an image and a square sprite with random size. I need to take a random area from the image like this:</p>
<p><img src="http://www.zedarus.ru/public/initial_small.png" alt="Texture Image" /></p>
<p>And apply it as a texture to the square sprite like this:</p>
<p><img src="http://www.zedarus.ru/public/result_small.png" alt="Textured sprite" /></p>
<p>Is there a way to do so in cocos2d with OpenGL? Unfortunately, I'm not very good with OpenGL (yet), so I will really appreciate if someone will point me in a right direction.</p>
<p>Thanks!
</p></description>
		</item>
		<item>
			<title>zdo.str on "Bug with textures blinking/flickering in cocos2d 1.0.1 on iOS 5"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/24740#post-130424</link>
			<pubDate>Wed, 30 Nov 2011 16:08:38 +0000</pubDate>
			<dc:creator>zdo.str</dc:creator>
			<guid isPermaLink="false">130424@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>This bug can be reproduced very simply. Just create two CCSprite's and move it one over another.<br />
And this bug is only on iOS 5 (I've seen it on iPad2 and iPhone4s).</p>
<p>CCSprite *s1 = [CCSprite spriteWithFile:@"tex_uvw.png"];<br />
CCSprite *s2 = [CCSprite spriteWithFile:@"tex_uvw.png"];</p>
<p>s1.position = ccp(0, 0);<br />
s2.position = ccp(300, 300);</p>
<p>{<br />
	id a1 = [CCMoveBy actionWithDuration:1.0 position:ccp(100, 100)];<br />
	id a2 = [CCMoveBy actionWithDuration:1.0 position:ccp(-100, -100)];<br />
	id t = [CCSequence actionOne:a1 two:a2];<br />
	id t2 = [CCRepeatForever actionWithAction:t];<br />
	[s1 runAction:t2];<br />
}<br />
{<br />
	id a1 = [CCMoveBy actionWithDuration:1.0 position:ccp(-100, -100)];<br />
	id a2 = [CCMoveBy actionWithDuration:1.0 position:ccp(100, 100)];<br />
	id t = [CCSequence actionOne:a1 two:a2];<br />
	id t2 = [CCRepeatForever actionWithAction:t];<br />
	[s2 runAction:t2];<br />
}</p>
<p>[self addChild:s1];<br />
[self addChild:s2];</p>
<p>What can I do to fix this bug?</p>
<p>Source code for demonstration is here: <a href="http://rghost.net/32696441" rel="nofollow">http://rghost.net/32696441</a>
</p></description>
		</item>
		<item>
			<title>ZeroBoom on "if guys can understand my english, reply for me plz.."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/25631#post-133453</link>
			<pubDate>Thu, 15 Dec 2011 08:09:01 +0000</pubDate>
			<dc:creator>ZeroBoom</dc:creator>
			<guid isPermaLink="false">133453@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>i have lots of tile files(like 1000files).<br />
so i cant make one texture + one png file for batch node.<br />
also i cant load all tile files cuz need more memory</p>
<p>so i want to do this.<br />
1. make one BIG texture(2048x2048) and put some little textures in code<br />
2. draw one BIG texture.</p>
<p>big texture never change while game playing.<br />
but i need to change big texture with data value what i did pashing when game loading.</p>
<p>problem is PERFORMANCE. i did found rendertexture. but i dont think it work for me.</p>
<p><a href="http://www.cocos2d-iphone.org/forum/topic/7233" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/7233</a></p>
<p>this topic looks like what i want.</p>
<p>or if better way here, let me know plz.</p>
<p>Thank You.
</p></description>
		</item>
		<item>
			<title>dgtheman on "How to techinically &quot;scale&quot; a sprite without effecting image quality?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/25427#post-132375</link>
			<pubDate>Fri, 09 Dec 2011 02:16:48 +0000</pubDate>
			<dc:creator>dgtheman</dc:creator>
			<guid isPermaLink="false">132375@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>How can I scale a sprite to four times its original size without effecting the quality of the image? Is there something that can set the resolution of a sprite rather than the scale in cocos2d? The scale of the sprite I have noticed only magnifies the sprite thus leading to a bad image quality. I want to multiply the regular image by a scale of four without setting the "scale" so instead of sprite.scale = 4 I would like to make something like sprite.resolution = ..... so it actually "scales" the sprite not magnifies it.</p>
<p>Ok here is why im trying to do this:<br />
Originally all the images are exported in a pretty high resolution. Then in texture packer (the plist creator I use) I scale the images by 0.25. This way I can fit more into one plist. I need this scale in order to fit all the things I need in one plist (even the things I need in one scene). Please if anyone can help me with this dilemma I will be forever grateful for them. The plist issue has been troubling me since I started developing my game! I will be much obliged for any help!! THANK YOU!!! :)
</p></description>
		</item>
		<item>
			<title>Zues on "how to make a texture with some little texture?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/24757#post-130537</link>
			<pubDate>Thu, 01 Dec 2011 13:12:43 +0000</pubDate>
			<dc:creator>Zues</dc:creator>
			<guid isPermaLink="false">130537@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>i have some little texture,i want to make them in one,can someone help me?
</p></description>
		</item>
		<item>
			<title>alefoulon on "Form recognition separated by sprites."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/25359#post-131950</link>
			<pubDate>Tue, 06 Dec 2011 20:10:30 +0000</pubDate>
			<dc:creator>alefoulon</dc:creator>
			<guid isPermaLink="false">131950@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi, everybody,<br />
I am now doing a CAD iPad application (you can drag and drop pieces to build doors, gates....)<br />
I would like to do something a bit tricky : When you're building your elements you first do the squeleton with rectangle or curved beams. After that i would like to add a texture inside the forms constructed by those sprites.<br />
I have to do a form recognition in order to put textures inside (like wood effects, or steel etc ...).</p>
<p>I already saw opengl function which textured hand-drew polygones, but it's not really adapted...<br />
Can you help me ? Thank you, please let me know if my explanations are'nt clear.</p>
<p>Thank you !
</p></description>
		</item>
		<item>
			<title>woaicocos2d on "cctexture"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/24822#post-130880</link>
			<pubDate>Sat, 03 Dec 2011 10:28:17 +0000</pubDate>
			<dc:creator>woaicocos2d</dc:creator>
			<guid isPermaLink="false">130880@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hi guys,<br />
     i am a green hand to texture. i dont know what it is ,how to use it. and what can i benifit from  it ? can someone give a tip,or give a url or a book .thanks
</p></description>
		</item>
		<item>
			<title>pikali on "Applying texture sprite for a Ragdoll object"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/24679#post-130082</link>
			<pubDate>Tue, 29 Nov 2011 07:02:30 +0000</pubDate>
			<dc:creator>pikali</dc:creator>
			<guid isPermaLink="false">130082@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey,</p>
<p>I am trying to achieve a realistic death sequence for a character in my game by replacing ragdoll object once it gets hit (ie) dies. I was wondering how to add textures for the ragdoll which comprise of limbs and other joints. </p>
<p>Many Thanks !
</p></description>
		</item>
		<item>
			<title>CyberJoe on "Dynamically Modify Sprite or CCLayer with bunch of Sprites in it"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/24537#post-129770</link>
			<pubDate>Mon, 28 Nov 2011 12:18:28 +0000</pubDate>
			<dc:creator>CyberJoe</dc:creator>
			<guid isPermaLink="false">129770@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>So let's say I have a png image, and it is some kind of image or texture.<br />
Or better say there is a bunch of them in one CCLayer.<br />
How can I:<br />
1) Modify HUE and Saturation of that CCLayer, (make it more black and white, or making it more colorful). In Photoshop you can modify colors of entire image by playing with HUE/Saturation sliders, Is there a way to achieve this with code in cocos2d for given CCLayer?<br />
2) Overlay Other texture over CCLayer so their colors would mix like you do in Photoshop when you put a layer on top of another and set Layer properties to overlay.</p>
<p>Is there a way to achieve it with Cocos2D functions only? or it's only possible with playing with render functions of OpenGL, if it is the second option, could you please bring some code samples?</p>
<p>If this kind of stuff would become possible, it would be possible to create really beautiful auto-generated landscapes in ios game, which is an asset.</p>
<p>Thanks.
</p></description>
		</item>
		<item>
			<title>ltby_sky on "Taken 40M memory for loading 2 piece of 2048*2048 pngs ?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/23887#post-128946</link>
			<pubDate>Sun, 27 Nov 2011 02:45:05 +0000</pubDate>
			<dc:creator>ltby_sky</dc:creator>
			<guid isPermaLink="false">128946@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I combine lot of magic effect frames into 2 big images (2048*2048), and taken more than 40M memory for loading them into memory by using CCSpriteFrameCache, anyone have this problem ?</p>
<p>Or you can just simply try with it:</p>
<p> [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile: @"magicAtlas1.plist"];<br />
 [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile: @"magicAtlas2.plist"];</p>
<p>magicAtlas1.plist:<br />
<a href="http://www.mediafire.com/?q5haj6zcy4aljnf" rel="nofollow">http://www.mediafire.com/?q5haj6zcy4aljnf</a><br />
magicAtlas1.png:<br />
<a href="http://www.mediafire.com/i/?d3al4ik74cx12mg" rel="nofollow">http://www.mediafire.com/i/?d3al4ik74cx12mg</a></p>
<p>magicAtlas2.plist:<br />
<a href="http://www.mediafire.com/?kho4jtdyuxixpt6" rel="nofollow">http://www.mediafire.com/?kho4jtdyuxixpt6</a><br />
magicAtlas2.png:<br />
<a href="http://www.mediafire.com/i/?9rrr67ewts4u5yn" rel="nofollow">http://www.mediafire.com/i/?9rrr67ewts4u5yn</a>
</p></description>
		</item>
		<item>
			<title>cocoBavan on "Playing with texture from a CCSprite"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/23842#post-128734</link>
			<pubDate>Fri, 25 Nov 2011 12:45:18 +0000</pubDate>
			<dc:creator>cocoBavan</dc:creator>
			<guid isPermaLink="false">128734@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I just want to get a texture from a CCSprite and and draw a reddish version of it, keeping the original safe. So what I did is this</p>
<pre><code>-(void)draw{

    glColor4f(0, 0, 0, 1);
    glDisableClientState(GL_COLOR_ARRAY);
    glBindTexture(GL_TEXTURE_2D, originalSprite.texture.name);
    glVertexPointer(2, GL_FLOAT, 0, quadCordinates); //
    glTexCoordPointer(2, GL_FLOAT, 0, textureCordinates);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
    glEnableClientState(GL_COLOR_ARRAY);
    glColor4f(1, 1, 1, 1);
}</code></pre>
<p>where<br />
<pre><code>quadCordinates[0] = ccp(-originalSprite.contentSize.width/2, -originalSprite.contentSize.height/2);
        quadCordinates[1] = ccp(-originalSprite.contentSize.width/2, originalSprite.contentSize.height/2);
        quadCordinates[2] = ccp(originalSprite.contentSize.width/2, -originalSprite.contentSize.height/2);
        quadCordinates[3] = ccp(originalSprite.contentSize.width/2, originalSprite.contentSize.height/2);

        textureCordinates[0] = ccp(0, 1);
        textureCordinates[1] = ccp(0, 0);
        textureCordinates[2] = ccp(1, 1);
        textureCordinates[3] = ccp(1, 0);</code></pre>
<p>I get expected result only when the sprite size is in powers of 2. Otherwise the resulted drawing is scaled down. What is wrong? How can I amend this? Thank you.
</p></description>
		</item>
		<item>
			<title>Xcalllibur on "&quot;Predator&quot; - A Sprite Sheet Creator &amp; Sprite Animation Editor"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/23098#post-127364</link>
			<pubDate>Mon, 21 Nov 2011 15:42:52 +0000</pubDate>
			<dc:creator>Xcalllibur</dc:creator>
			<guid isPermaLink="false">127364@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey everybody! I'm happy to announce the release of Predator, a new tool we have been working on for game developers. It lets you create sprite sheets from your sprite assets as well as turn those sprite frames into animations. You can then export the sprite sheet image along with the definition files to the game framework of your choice.</p>
<p>Where we are looking to differentiate our product from others out there is a streamlined UI experience that aligns to how you develop games, as well as support for all game frameworks out there. The first release has support for LibGDX and Cocos2D, but if you need support for another framework, please <a href="http://spritesheeteditor.com/contact/">contact us</a> with the details and we can usually write an exporter within a few days.</p>
<p>There is a basic edition of the program that is fully featured and FREE to use forever! We also have a professional edition that adds advanced layout options, including optimised sprite sheet layout</p>
<p><strong>Right now for a limited time we are offering the professional edition for $15</strong>. We will be adding lots of features over the coming months and i will announce these changes on here as they happen. Please give it a go and give us your feedback, good or bad, so we can make this the best editor out there!</p>
<p>Try it out at <a href="http://spritesheeteditor.com/">http://spritesheeteditor.com/</a></p>
<p>-Louis Gale, Inverse Square Root Software
</p></description>
		</item>
		<item>
			<title>cocoBavan on "openGLES - learning"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/23125#post-127399</link>
			<pubDate>Mon, 21 Nov 2011 15:57:12 +0000</pubDate>
			<dc:creator>cocoBavan</dc:creator>
			<guid isPermaLink="false">127399@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I want to get hold of some concepts in openGLES. I was trying to understand <a href="http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-part-6_25.html" rel="nofollow">http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-part-6_25.html</a>.</p>
<p>I tried to fill a polygon with textures which are smaller and bigger the polygon. I wanted the texture to warp and fill the polygon. However the result was not what I expected. Could some body point me where I am doing it wrong? Please.</p>
<p>My Project is downloadable at <a href="http://www.4shared.com/file/JusLcoCs/TestingOpenGLES.html?" rel="nofollow">http://www.4shared.com/file/JusLcoCs/TestingOpenGLES.html?</a></p>
<p>the HelloWorldLayer Class has<br />
<pre><code>-(id) init
{

	if( (self=[super init])) {	

        CGSize screenSize = [[CCDirector sharedDirector] winSize];

        CCSprite* spriteForPolygonTexture = [CCSprite spriteWithFile:@&#34;openGLKing.png&#34;];
        ccTexParams tp = {GL_LINEAR, GL_LINEAR, GL_REPEAT, GL_CLAMP_TO_EDGE};
        [spriteForPolygonTexture.texture setTexParameters:&#38;tp];
        Polygon* samplePolygon = [[Polygon alloc] initWithSprite:spriteForPolygonTexture];
        samplePolygon.position =  ccp(2*screenSize.width/3, 2*screenSize.height/3);
        [self addChild:samplePolygon];

        CCSprite* spriteForPolygonTexture2 = [CCSprite spriteWithFile:@&#34;openGLKingBig.png&#34;];
        [spriteForPolygonTexture2.texture setTexParameters:&#38;tp];
        Polygon* samplePolygon2 = [[Polygon alloc] initWithSprite:spriteForPolygonTexture2];
        samplePolygon2.position =  ccp(1*screenSize.width/3, 1*screenSize.height/3);
        [self addChild:samplePolygon2];        

	}
	return self;
}</code></pre>
<p>the polygon class is<br />
<pre><code>-(id)initWithSprite:(CCSprite*)_sprite
{
    if((self = [super init]))
    {
        self.spriteForPolygonTexture = _sprite;
    }
    return self;
}

-(void)draw
{

    //Drawing outline

    CGPoint verts[] = {{-69.5, 76.0},{82.5, 76.0},{135.5, -67.0} ,{-110.5, -62.0}};   

    glDisable(GL_TEXTURE_2D);
    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
    glDisableClientState(GL_COLOR_ARRAY);

    glColor4f(1, 1, 1, 1);
    glVertexPointer(2, GL_FLOAT, 0, verts);
    glDrawArrays(GL_LINE_LOOP, 0, 4); 

    glEnableClientState(GL_COLOR_ARRAY);
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    glEnable(GL_TEXTURE_2D);

    //Filling the Diagram with Texture
    glDisableClientState(GL_COLOR_ARRAY);

    CGPoint verts2[] = {{-69.5, 76.0},{82.5, 76.0},{-110.5, -62.0},{135.5, -67.0}};
    CGPoint texCords[] = {{0,0},{1,0},{0,1},{1,1}};

    glBindTexture(GL_TEXTURE_2D, spriteForPolygonTexture.texture.name);

    glVertexPointer(2, GL_FLOAT, 0, verts2);
    glTexCoordPointer(2, GL_FLOAT, 0, texCords);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

    glEnableClientState(GL_COLOR_ARRAY);
}</code></pre>
<p>Please point me to few good related posts too. Thank you
</p></description>
		</item>
		<item>
			<title>gametreesnet on "An app with many images"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22777#post-126097</link>
			<pubDate>Tue, 15 Nov 2011 03:08:40 +0000</pubDate>
			<dc:creator>gametreesnet</dc:creator>
			<guid isPermaLink="false">126097@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello!<br />
I'm having an issue with importing many images.<br />
Does it matter how many images I have in the app?<br />
I'm only going to use a few at a time, so if i have 50 images, i would use 10 of them in the actual screen.<br />
If it matters, then is it ok to put them into a few texture atlases, not one?<br />
i kind of want to separate images through categories, but I heard people saying i should make only one big texture atlas.<br />
Thanks.
</p></description>
		</item>
		<item>
			<title>gametreesnet on "texture atlas question"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22757#post-126012</link>
			<pubDate>Mon, 14 Nov 2011 18:59:41 +0000</pubDate>
			<dc:creator>gametreesnet</dc:creator>
			<guid isPermaLink="false">126012@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello!<br />
Is it better to put all my images into one big texture atlas?<br />
Or is it still ok to categorize the images by making multiple atlases? (dividing them into categories like enemy, sprite, and stuff).<br />
I'm sure a big texture atlas is better for my app's size, but just for curiosity.<br />
Thanks.
</p></description>
		</item>
		<item>
			<title>gaminghorror on "Memory usage of CCTexture2D is doubled during load"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4526#post-26900</link>
			<pubDate>Tue, 16 Feb 2010 19:44:47 +0000</pubDate>
			<dc:creator>gaminghorror</dc:creator>
			<guid isPermaLink="false">26900@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I noticed that loading a Texture consumes twice the memory it should but only while the texture is being loaded. I think i once read about it here but i'm not sure, which is why i'm posting this. It could also be a bug because i'm using 32-bit PNG in RGBA8888 format. I stepped through CCTexture2D and there is certainly no conversion being done.</p>
<p>When i load my texture atlases i ran into memory warnings. I have &#62;20 MBs free in all cases, and am loading at most 14 MB of textures. Yet i got memory warnings. So i dove in to figure out what is going on.</p>
<p>I found out that each 1024x1024x32 PNG image takes twice the amount (8 MB) of memory but only while loading (in the same tick/step/frame), which is why i can't load my texture atlases all at once. After refactoring the texture loading into a scheduled method that runs at 0.1f interval i get the following output and no more memory warnings. Notice how each texture takes 8 MB during load, but when the next one is being loaded 4 MB have re-appeared.</p>
<pre><code>Loading: Atlas_Tierteile1
 start KB = 27516.000000	final KB = 18972.000000	diff = 8544.000000
Loading: Atlas_Tierteile2
 start KB = 23144.000000	final KB = 15840.000000	diff = 7304.000000
Loading: Atlas_Tierteile3
 start KB = 19960.000000	final KB = 12196.000000	diff = 7764.000000
Loading: Atlas_Tierteile4
 start KB = 16632.000000	final KB = 15660.000000	diff = 972.000000
 start KB = 16180.000000	final KB = 16180.000000	diff = 0.000000</code></pre>
<p>`</p>
<p>I wonder, did anyone else run into this problem and how did you solve it? I'm currently thinking about writing a scheduled texture loader that loads them in sequence. But maybe it's also possible to force freeing the memory within the same step, possibly by draining the autorelease pool somehow?</p>
<p>I also came across "async" methods, can i use those or are they simply for thread-safe texture loading?
</p></description>
		</item>
		<item>
			<title>Will Allstead on "8-bit graphics?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18785#post-105387</link>
			<pubDate>Sun, 17 Jul 2011 03:07:34 +0000</pubDate>
			<dc:creator>Will Allstead</dc:creator>
			<guid isPermaLink="false">105387@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello everyone,<br />
I would like to develop a retro game with a graphic style similar to League of Evil's. I tried the a few things to get a smaller resolution.. and, in short, FAILURE. </p>
<p>So, I came accrossed this post: <a href="http://www.cocos2d-iphone.org/forum/topic/18603">here</a> and someone said that i had to use a smaller CCLayer. My question to you is, how? how would i use a smaller CCLayer in lets say..<a href="https://github.com/haqu/climbers">this source code?</a></p>
<p>Thanks in advance. :)
</p></description>
		</item>
		<item>
			<title>woaicocos2d on "ccspritebatchnode"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22478#post-124790</link>
			<pubDate>Mon, 07 Nov 2011 06:53:38 +0000</pubDate>
			<dc:creator>woaicocos2d</dc:creator>
			<guid isPermaLink="false">124790@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hi,guys<br />
  this is my first use CCSpriteBatchNode,i meet a error,can anybody give me some tips.<br />
 first ,i use<br />
 pathNodeBatch = [[CCSpriteBatchNode alloc] initWithFile:@"pathPoint.png" capacity:30];<br />
[self addchild:pathNodeBatch];<br />
then in another method ,<br />
- (void)addPathNode<br />
{</p>
<p>    for(uint i=0;i&#60;[playerNodeArray count];i++)<br />
    {<br />
        CCSprite * pathNode = [CCSprite spriteWithFile:@"pathPoint.png"];<br />
        CGPoint point=CGPointMake([[playerNodeArray objectAtIndex:i] nodeX],[[playerNodeArray objectAtIndex:i] nodeY] );<br />
        pathNode.positionInPixels = CGPointMake(([self changeTileToCoordRec:point ].x-_tileMap.positionInPixels.x),        ([self changeTileToCoordRec :point ].y-_tileMap.positionInPixels.y));<br />
        pathNode.vertexZ = -700;<br />
        NSLog(@"%@",pathNode.texture);<br />
        [pathNodeBatch addChild:pathNode z:MAP_TOP_Z tag:(PATH_NODE_OFFSET + i)];<br />
        pathNodeTag = i;<br />
    }<br />
}</p>
<p>and the debug said:<br />
*** Assertion failure in -[CCSpriteBatchNode addChild:z:tag:], /Users/user/Documents/Metown/trunk/Metown/libs/cocos2d/CCSpriteBatchNode.m:201<br />
2011-11-07 14:44:40.845 Metown[17550:307] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'CCSprite is not using the same texture id'</p>
<p>then i log the sprite.texture is:  &#60;CCTexture2D = 118BE790 &#124; Name = 75 &#124; Dimensions = 16x16 &#124; Coordinates = (0.75, 0.56)&#62;<br />
the spriteBatchNode texture is :&#60;CCTexture2D = 091A9200 &#124; Name = 52 &#124; Dimensions = 16x16 &#124; Coordinates = (0.75, 0.56)&#62;</p>
<p>when i run the program on the simular,there is no error,but when i run it on ipad,it meet the error above. can anyone give me some advices
</p></description>
		</item>

	</channel>
</rss>

