<?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: ProgressTimer for cocos2d</title>
	<atom:link href="http://fancyratstudios.com/2010/02/programming/progresstimer-for-cocos2d/feed/" rel="self" type="application/rss+xml" />
	<link>http://fancyratstudios.com/2010/02/programming/progresstimer-for-cocos2d/</link>
	<description>A Fancy Rat Blog</description>
	<lastBuildDate>Fri, 04 Jun 2010 01:47:06 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Truffle Apps</title>
		<link>http://fancyratstudios.com/2010/02/programming/progresstimer-for-cocos2d/comment-page-1/#comment-28</link>
		<dc:creator>Truffle Apps</dc:creator>
		<pubDate>Mon, 12 Apr 2010 02:37:54 +0000</pubDate>
		<guid isPermaLink="false">http://fancyratstudios.com/?p=126#comment-28</guid>
		<description>Awesome article
Thanks for sharing</description>
		<content:encoded><![CDATA[<p>Awesome article<br />
Thanks for sharing</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 2010-02-20 cocos2d 学习</title>
		<link>http://fancyratstudios.com/2010/02/programming/progresstimer-for-cocos2d/comment-page-1/#comment-22</link>
		<dc:creator>2010-02-20 cocos2d 学习</dc:creator>
		<pubDate>Sat, 20 Feb 2010 05:13:45 +0000</pubDate>
		<guid isPermaLink="false">http://fancyratstudios.com/?p=126#comment-22</guid>
		<description>[...]  ProgressTimer for cocos2d [...]</description>
		<content:encoded><![CDATA[<p>[...]  ProgressTimer for cocos2d [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lam</title>
		<link>http://fancyratstudios.com/2010/02/programming/progresstimer-for-cocos2d/comment-page-1/#comment-19</link>
		<dc:creator>Lam</dc:creator>
		<pubDate>Tue, 16 Feb 2010 00:00:19 +0000</pubDate>
		<guid isPermaLink="false">http://fancyratstudios.com/?p=126#comment-19</guid>
		<description>That&#039;s true. I was going to make changing the anchorPoint change the midpoint of the radial progress timer. I should check to see if that has bugs.
If you need to change the anchor point where the image is drawn you can access the sprite property and change the sprite anchorPoint.

Now anchorPoint may be confusing so any suggestions on how that functions would be great and I&#039;ll add it to the class.</description>
		<content:encoded><![CDATA[<p>That&#8217;s true. I was going to make changing the anchorPoint change the midpoint of the radial progress timer. I should check to see if that has bugs.<br />
If you need to change the anchor point where the image is drawn you can access the sprite property and change the sprite anchorPoint.</p>
<p>Now anchorPoint may be confusing so any suggestions on how that functions would be great and I&#8217;ll add it to the class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sherwin</title>
		<link>http://fancyratstudios.com/2010/02/programming/progresstimer-for-cocos2d/comment-page-1/#comment-18</link>
		<dc:creator>Sherwin</dc:creator>
		<pubDate>Sun, 14 Feb 2010 22:54:44 +0000</pubDate>
		<guid isPermaLink="false">http://fancyratstudios.com/?p=126#comment-18</guid>
		<description>Hi, I also just wanted to point out that the Anchor Point of the Cocosnode/Progress Timer is not taken into consideration</description>
		<content:encoded><![CDATA[<p>Hi, I also just wanted to point out that the Anchor Point of the Cocosnode/Progress Timer is not taken into consideration</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sherwin</title>
		<link>http://fancyratstudios.com/2010/02/programming/progresstimer-for-cocos2d/comment-page-1/#comment-16</link>
		<dc:creator>Sherwin</dc:creator>
		<pubDate>Fri, 12 Feb 2010 20:28:14 +0000</pubDate>
		<guid isPermaLink="false">http://fancyratstudios.com/?p=126#comment-16</guid>
		<description>This is most impressive, my team and I were about to try to figure this out until we saw that riq on Cocos2d linked to your article.  Thanks a lot for the tutorial!</description>
		<content:encoded><![CDATA[<p>This is most impressive, my team and I were about to try to figure this out until we saw that riq on Cocos2d linked to your article.  Thanks a lot for the tutorial!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lam</title>
		<link>http://fancyratstudios.com/2010/02/programming/progresstimer-for-cocos2d/comment-page-1/#comment-11</link>
		<dc:creator>Lam</dc:creator>
		<pubDate>Sat, 06 Feb 2010 10:18:26 +0000</pubDate>
		<guid isPermaLink="false">http://fancyratstudios.com/?p=126#comment-11</guid>
		<description>Oh whoops... the code in the post previously was incorrect, I seemed to have mixed the bit shifting for the post. I&#039;ve fixed that now. The demo does have the correct bit shifting operation so I&#039;m going to use that function.

Maybe fixing that mistake makes more sense to you now but I&#039;ll break down that complicated bit operation that I did if you are still unsure.

Let&#039;s assume that normally we have an array of kProgressTextureCoords = { {0,0}, {0,1}, {1,1}, {1,0} } which represents the corners of the rectangle.
{0,0} is the top left, {0,1} is the bottom left,  {1,1} is the bottom right,   {1,0} is the top right

For now I&#039;ll assume our type is kProgressTimerTypeRadialCW. This means we want to grab corners in a clock-wise direction.
So if I passed in index = 1 we need to get access to the bottom right corner. {1, 1}
So an index 0 =&gt; {1,0}, 1 =&gt; {1,1}, 2 =&gt; {0,1} and so on.

But now I&#039;ve simplified it into bits to save space 00011110.

If I pass in index = 1, it should return {1,1}. Let&#039;s see if it works.
The function sets up our CGPoint for (x,y) where:
x = (kProgressTextureCoords&gt;&gt;((index&lt;&lt;1)+1))&amp;1
and
y = (kProgressTextureCoords&gt;&gt;(index&lt;&lt;1))&amp;1)

Remember that we want the value between the square bracket in our bit pattern: 0001[11]10. Which is contained in kProgressTextureCoords.

Let&#039;s solve each term to see if we do get the correct value for x = (kProgressTextureCoords&gt;&gt;((index&lt;&lt;1)+1))&amp;1
Since our index is 1. We&#039;ll work of course from our inner brackets outward.
&lt;code&gt;
x = (00011110&gt;&gt;((1&lt;&lt;1)+1))&amp;1
(00011110&gt;&gt;(2+1))&amp;1
(00011110&gt;&gt;3)&amp;1
(00011)&amp;1
x = 1
&lt;/code&gt;
&lt;code&gt;
y = (00011110&gt;&gt;((1&lt;&lt;1)))&amp;1
(00011110&gt;&gt;2)&amp;1
(000111)&amp;1
y = 1
&lt;/code&gt;

Now we get {1,1} which is what we needed. Hope that helps but do ask if there are still problems.
</description>
		<content:encoded><![CDATA[<p>Oh whoops&#8230; the code in the post previously was incorrect, I seemed to have mixed the bit shifting for the post. I&#8217;ve fixed that now. The demo does have the correct bit shifting operation so I&#8217;m going to use that function.</p>
<p>Maybe fixing that mistake makes more sense to you now but I&#8217;ll break down that complicated bit operation that I did if you are still unsure.</p>
<p>Let&#8217;s assume that normally we have an array of kProgressTextureCoords = { {0,0}, {0,1}, {1,1}, {1,0} } which represents the corners of the rectangle.<br />
{0,0} is the top left, {0,1} is the bottom left,  {1,1} is the bottom right,   {1,0} is the top right</p>
<p>For now I&#8217;ll assume our type is kProgressTimerTypeRadialCW. This means we want to grab corners in a clock-wise direction.<br />
So if I passed in index = 1 we need to get access to the bottom right corner. {1, 1}<br />
So an index 0 => {1,0}, 1 => {1,1}, 2 => {0,1} and so on.</p>
<p>But now I&#8217;ve simplified it into bits to save space 00011110.</p>
<p>If I pass in index = 1, it should return {1,1}. Let&#8217;s see if it works.<br />
The function sets up our CGPoint for (x,y) where:<br />
x = (kProgressTextureCoords>>((index< &lt;1)+1))&#038;1<br />
and<br />
y = (kProgressTextureCoords>>(index< &lt;1))&#038;1)</p>
<p>Remember that we want the value between the square bracket in our bit pattern: 0001[11]10. Which is contained in kProgressTextureCoords.</p>
<p>Let's solve each term to see if we do get the correct value for x = (kProgressTextureCoords>>((index< &lt;1)+1))&#038;1<br />
Since our index is 1. We'll work of course from our inner brackets outward.<br />
<code><br />
x = (00011110>>((1< &lt;1)+1))&#038;1<br />
(00011110>>(2+1))&#038;1<br />
(00011110>>3)&#038;1<br />
(00011)&#038;1<br />
x = 1</p>
<p><code><br />
y = (00011110>>((1< &lt;1)))&#038;1<br />
(00011110>>2)&#038;1<br />
(000111)&#038;1<br />
y = 1<br />
</code></p>
<p>Now we get {1,1} which is what we needed. Hope that helps but do ask if there are still problems.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chebur</title>
		<link>http://fancyratstudios.com/2010/02/programming/progresstimer-for-cocos2d/comment-page-1/#comment-10</link>
		<dc:creator>chebur</dc:creator>
		<pubDate>Sat, 06 Feb 2010 09:00:56 +0000</pubDate>
		<guid isPermaLink="false">http://fancyratstudios.com/?p=126#comment-10</guid>
		<description>great article. very useful.

please, can you explain how -(CGPoint)boundaryTexCoord:(char)index method works? I know bit operations, but i can&#039;t understand how exactly you retreive corresponding texture coordinates for an index value.

thanks</description>
		<content:encoded><![CDATA[<p>great article. very useful.</p>
<p>please, can you explain how -(CGPoint)boundaryTexCoord:(char)index method works? I know bit operations, but i can&#8217;t understand how exactly you retreive corresponding texture coordinates for an index value.</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ProgressTimer for cocos2d &#124; cocos2d for iPhone</title>
		<link>http://fancyratstudios.com/2010/02/programming/progresstimer-for-cocos2d/comment-page-1/#comment-6</link>
		<dc:creator>ProgressTimer for cocos2d &#124; cocos2d for iPhone</dc:creator>
		<pubDate>Fri, 05 Feb 2010 18:44:28 +0000</pubDate>
		<guid isPermaLink="false">http://fancyratstudios.com/?p=126#comment-6</guid>
		<description>[...] The article is here: ProgressTimer for cocos2d [...]</description>
		<content:encoded><![CDATA[<p>[...] The article is here: ProgressTimer for cocos2d [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
