<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ReignDesign Blog</title>
	<atom:link href="http://www.reigndesign.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.reigndesign.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 06 Jul 2010 10:26:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Nick Kruse, 1979 &#8211; 2010</title>
		<link>http://www.reigndesign.com/blog/nick-kruse-1979-2010/</link>
		<comments>http://www.reigndesign.com/blog/nick-kruse-1979-2010/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 10:17:09 +0000</pubDate>
		<dc:creator>Matt Mayer</dc:creator>
				<category><![CDATA[Company]]></category>

		<guid isPermaLink="false">http://www.reigndesign.com/blog/?p=1642</guid>
		<description><![CDATA[We were devastated to learn that our friend and colleague Nick Kruse died at the weekend after collapsing while participating in the Gobi March. We're still piecing together exactly what happened, but we wanted to share some of our memories of Nick.


Matt: I worked with Nick for the last 3 and a half years in [...]]]></description>
			<content:encoded><![CDATA[<p>We were devastated to learn that our friend and colleague Nick Kruse died at the weekend after collapsing while <a href="http://www.reigndesign.com/blog/nicholas-kruse-participating-in-gobi-march-2010/">participating in the Gobi March</a>. We're still piecing together exactly what happened, but we wanted to share some of our memories of Nick.</p>
<p style="text-align: center;"><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/IMG_5481_edited.png"><img class="aligncenter size-large wp-image-1651" title="IMG_5481_edited" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/IMG_5481_edited-1024x682.png" alt="" width="573" height="382" /></a></p>
<p><span id="more-1642"></span></p>
<p><strong>Matt:</strong> I worked with Nick for the last 3 and a half years in Shanghai and in that time I learned so much from him, about design, about business, and about life. He took huge pride in his work, and in the company he had helped to build.</p>
<p>After cycling his way into the office in the Shanghai summer heat, Nick would stand in front of the air-conditioner, hair flying in all directions, trying to cool down. He would be the voice of reason and of calm.  He would frustrate and delight us. He would argue for hours about the difference between Helvetica Light Bold, and Helvetica Bold Light. He would go to faraway places and return with oddly-tasting gifts, but his greatest gift was the happiness he brought to everyone who met him. Shanghai and ReignDesign will never be the same without him.</p>
<p style="text-align: center;"><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/SHA_Oct08_2.jpg"><img class="aligncenter size-large wp-image-1666" title="SHA_Oct08_2" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/SHA_Oct08_2-1024x768.jpg" alt="" width="819" height="614" /></a></p>
<p><strong>Stephen:</strong> I first met Nick in 2007, shortly after I arrived in Shanghai. Like anyone who met him, we immediately hit it off. One thing I'll always remember is when I first heard him speak Chinese - I was in complete awe. Back then, I could barely say 'ni hao' and apart from Chinese TV personality "da shan" I had never heard a foreigner speak Mandarin so well. I had to ask: "How did you learn to speak Chinese like that?!" His advice stuck with me: "Just speak!! And don't' be afraid to sound stupid. You're *going* to sound stupid. But you'll get better."</p>
<p>Nick will always be remembered to me as the person who immediately lit up any room he entered, and who always made everyone feel welcome and a part of something big. He was never without an interesting or funny story to share, and was one of the most passionate and enthusiastic people I've ever known. I feel extremely fortunate for having known Nick, and he will always be an important part of my life.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/IMG_0286.jpg"><img class="aligncenter size-large wp-image-1654" title="IMG_0286" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/IMG_0286-768x1024.jpg" alt="" width="768" height="1024" /></a></p>
<p><strong>Thinkey</strong>: I just can not believe such a sunny, funny and optimistic guy left us in such a sudden way.</p>
<p>I still remember the first time we met. On the game we played Nick had to perform Furongjiejie. He didn't like to do that. But when he began, he tried his best and performed so seriously, that delighted all of us and lead to a big laugh. At that moment, I said to myself the man who tries so hard in a game will surely make his place on anything he want to do.</p>
<p>I still remember the talks about career and ideal we had on MSN. He was quite busy in that period. But he talked to me so patiently to help me to make sure what kind of things I really want to do. He told me to take my time to do whatever I like, since that's my life. So, Nick, take your time to do whatever you like, that's your life!</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/IMG_0934.jpg"><img class="aligncenter size-full wp-image-1655" title="IMG_0934" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/IMG_0934.jpg" alt="" width="720" height="480" /></a></p>
<p><strong>Anna</strong>: Nick was the person who got me to come to Shanghai in the first place. I had no real intention to go to China and it was him who told me about it over the phone in a job interview - which he finished with the sentence: "you would need to come here within 2 weeks." - off i was.</p>
<p>During the time when we nearly fell apart as a team it was him who invested and believed in us first, and started the idea of our own company.</p>
<p>You could see how enthusiastic he was when he got sentimental late at night too, he would always share his ideas then. Nick dared things and inspired me to do the same, to anticipate something positive and dare to go for it. His cheeky sense of humor is a very smart way of showing his opinions although he would deliberately drive people mad angry with it and enjoy it too.</p>
<p>I saw and was around Nick almost every normal day of more than the last three years. And his passing away leaves a big hole in my reality which i find very hard to accept. I have to keep reminding myself that i wont see him again, that he wont be back. He will be missed dearly.</p>
<div id="attachment_1652" class="wp-caption aligncenter" style="width: 610px"><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/n543853046_2253540_5981654.jpg"><img class="size-full wp-image-1652" title="One big flower" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/n543853046_2253540_5981654.jpg" alt="" width="600" height="450" /></a><p class="wp-caption-text">One night Nick described our company as one big flower. This was in the beginning of our new formation in the middle of the financial crisis and he continued the image by saying: &quot;A flower WITH water, all the other flowers are dry these days.&quot;</p></div>
<p style="text-align: center;">
<p><strong>Mark</strong>: Nick could teach lessons though laughing.  Not the nervous or sarcastic laugh which can be all too common.  Nick was a man of heartfelt, from the soul, genuine laughter.  The kind that let you know you were heard.  The kind that reminded you not to laugh sarcastically.  And that made you like him instantly.</p>
<p>I didn’t know Nick for that long, but he had a way of reminding you of old friends.  That college roommate who always had a joke.  The opinionated guy in art studio who actually knew what he was talking about.  The high school friend who always got you in trouble when he said, “Wouldn’t it be funny if we ...”  He had a bit of them all.  But he was also his own blend of courage, intelligence, and tenacity which made him so unique.  He will be missed.</p>
<p style="text-align: center;"><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/IMG_0409.jpg"><img class="aligncenter size-large wp-image-1653" title="IMG_0409" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/IMG_0409-1024x682.jpg" alt="" width="819" height="546" /></a></p>
<p><strong>Todd</strong>: Like a few others at ReignDesign, Nick was the reason I moved to China. I was looking for adventure, perspective, and a challenge - he delivered on all three counts. I will always remember our designer vs. developer bouts of witty banter (okay, maybe no one else enjoyed them) and those late night strategy sessions over a beer. Nick pushed me to prove my big ideas. Stop the talk and just do it.<br />
In our last conversation, the night before he left for the Gobi March, he thanked me for my efforts at ReignDesign. Pig-headed as I am, I was dismissive, telling him we haven’t arrived yet and to save it. I’ll never have the opportunity to truly thank him - for his support, friendship, and enduring trust. He was a good friend to the end. I’ll miss you, Nick.</p>
<p><strong><br />
</strong></p>
<p style="text-align: center;"><strong><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/IMG_0411.jpg"><img class="aligncenter size-large wp-image-1664" title="IMG_0411" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/07/IMG_0411-1024x682.jpg" alt="" width="819" height="546" /></a><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.reigndesign.com/blog/nick-kruse-1979-2010/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Nicholas Kruse participating in Gobi March 2010</title>
		<link>http://www.reigndesign.com/blog/nicholas-kruse-participating-in-gobi-march-2010/</link>
		<comments>http://www.reigndesign.com/blog/nicholas-kruse-participating-in-gobi-march-2010/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 06:06:05 +0000</pubDate>
		<dc:creator>Stephen Ceresia</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[gobi march]]></category>

		<guid isPermaLink="false">http://www.reigndesign.com/blog/?p=1635</guid>
		<description><![CDATA[
Not content to sit around in a pub watching the World Cup like some of us, ReignDesign's own Nicholas Kruse is currently participating in the Gobi March, part of the 4 Deserts series of footraces that take place in the "hottest, coldest, windiest, and driest places on earth."
The Gobi March spans 250km over seven days, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/gobiMarchMap.png"><img class="size-full wp-image-1638" title="Gobi March route" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/gobiMarchMap.png" alt="Gobi March route" width="400" height="262" /></a></p>
<p>Not content to sit around in a pub watching the World Cup like some of us, ReignDesign's own Nicholas Kruse is currently participating in the <a title="Gobi March" href="http://www.4deserts.com/gobimarch" target="_blank">Gobi March</a>, part of the <a title="4 Deserts" href="http://www.4deserts.com/" target="_blank">4 Deserts</a> series of footraces that take place in the "hottest, coldest, windiest, and driest places on earth."</p>
<p>The Gobi March spans 250km over seven days, and takes place across China's Gobi Desert.</p>
<p>Some quick facts:</p>
<ul>
<li>Temperatures for the Gobi March (China) can vary greatly – in 2010 average temperatures will be about 10°C / 50°F on the early part of the course and 35-40°C / 95-104°F on the later stages.</li>
<li>Competitors come from more than 20 countries with roughly 1/3 from North America, 1/3 from Asia and 1/3 from Europe.</li>
<li>The fastest completion time is around 25 hours and the slowest around 80 hours.</li>
<li>The average backpack weighs 20 lbs (8-9 kilograms).</li>
</ul>
<p>You can check out daily updated coverage of the competitors' progress <a title="Gobi March" href="http://www.4deserts.com/gobimarch/rtpgmtp2.php?SID=3&amp;SBID=RC3&amp;competitorsBiosNum=5" target="_blank">here</a>.</p>
<p>Best of luck, Nick!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reigndesign.com/blog/nicholas-kruse-participating-in-gobi-march-2010/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTML5&#8217;s missing tag: sarcasm</title>
		<link>http://www.reigndesign.com/blog/html5s-missing-tag-sarcasm/</link>
		<comments>http://www.reigndesign.com/blog/html5s-missing-tag-sarcasm/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 04:14:34 +0000</pubDate>
		<dc:creator>Matt Mayer</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[barcamp]]></category>
		<category><![CDATA[barcampsh]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[sarcasm]]></category>
		<category><![CDATA[w3c]]></category>

		<guid isPermaLink="false">http://www.reigndesign.com/blog/?p=1609</guid>
		<description><![CDATA[I attended Barcamp Shanghai (Twitter: #barcampsh) at the weekend. It was an entertaining day with talks and demos on a variety of geeky topics. Here's a reproduction of my talk about HTML5's missing tag: &#60;sarcasm&#62;.


Let's review the 3 tiers used in modern frontend web development. First, HTML is used to mark up semantic content. It [...]]]></description>
			<content:encoded><![CDATA[<p>I attended <a href="http://barcampshanghai.mixxt.com/">Barcamp Shanghai</a> (Twitter: <a href="http://search.twitter.com/search?q=%23barcampsh">#barcampsh</a>) at the weekend. It was an entertaining day with talks and demos on a variety of geeky topics. Here's a reproduction of my talk about HTML5's missing tag: <strong>&lt;sarcasm&gt;</strong>.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img01.png"><img class="aligncenter size-full wp-image-1613" title="img0" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img01.png" alt="" width="512" height="384" /></a><br />
<span id="more-1609"></span><br />
Let's review the 3 tiers used in modern frontend web development. First, <strong>HTML </strong>is used to mark up semantic content. It provides meaning and structure to your content. Then <strong>CSS </strong>is used for presentation. It determines how your content appears: the colors, fonts and positioning. Finally, <strong>Javascript </strong>is layered on top for behaviour: allowing the user to interact and modify the content in interesting ways.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img1.png"><img class="aligncenter size-full wp-image-1614" title="img1" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img1.png" alt="" width="512" height="384" /></a></p>
<p>You've probably heard a lot about <strong>HTML5</strong> recently. A lot of the talk has been around the new<strong> &lt;video&gt;</strong> tag. People are excited because for the first time, it will be possible to play video natively in the browser without plugins like Flash Player. Of course there's still a lot of discussion about which codecs will be supported. WebM? h264? Ogg Theora?</p>
<p>But there's so much more to HTML5 than the <strong>&lt;video&gt;</strong> tag.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img2.png"><img class="aligncenter size-full wp-image-1615" title="img2" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img2.png" alt="" width="512" height="384" /></a></p>
<p>Many other  new tags have been introduced which can add extra semantic structure to your HTML pages.  For example, <strong>&lt;section&gt;</strong> can be used to mark up distinct sections of your document, <strong>&lt;nav&gt;</strong> contains primary navigation, <strong>&lt;aside&gt;</strong> can be used for content like sidebars and pullquotes,<strong> &lt;time&gt;</strong> can be used to mark up dates and times so they can be easily parsed by computers.</p>
<p>Of course you were always able to use <strong>&lt;div&gt;</strong>s and <strong>&lt;span&gt;</strong>s to mark up your content, but the new elements promote more semantic, cleaner code with less need for cryptic id and class names.</p>
<p>Here's a sample HTML5 page.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img0.png"></a><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img3.png"><img class="aligncenter size-full wp-image-1616" title="img3" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img3.png" alt="" width="512" height="384" /></a></p>
<p>It should look pretty familiar if you've worked with HTML5 before. Notice the new short DOCTYPE. We still have the familar <strong>&lt;head&gt;</strong> and <strong>&lt;body&gt;</strong> tags. We're using some of the new elements in the body. Let's dive deeper and take a look at another example.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img4.png"><img class="aligncenter size-full wp-image-1618" title="img4" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img4.png" alt="" width="512" height="384" /></a></p>
<p>This is a completely valid HTML5 snippet.</p>
<p>Yet, I can't help feeling that something is missing. There's something I can't quite capture using this markup. Something that's very difficult to express using existing HTML.</p>
<p>Of course, the problem is that Zapata's <strong>isn't</strong> a very classy bar. But how can I express that semantic meaning using HTML? I could try using <strong>&lt;em&gt;</strong> tags.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img5.png"><img class="aligncenter size-full wp-image-1617" title="img5" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img5.png" alt="" width="512" height="384" /></a></p>
<p>In most browsers, that will make the text italic. But that doesn't seem right, it's not clear <em>why </em>I'm emphasising the text. Perhaps it's because I really <em>do </em>like Zapata's. Now, thanks to HTML5, we have a solution. I simply mark up the text using <strong>&lt;sarcasm&gt;</strong> tags.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img6.png"><img class="aligncenter size-full wp-image-1619" title="img6" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img6.png" alt="" width="512" height="384" /></a></p>
<p>This is really great! Now it's explicit that the marked up text is sarcastic. And, because we're using semantic HTML, we can use CSS to easily style the presentation of our sarcasm. For example, here's a quick stylesheet which will make any sarcastic text <span style="color: #ff0000; font-size: 200%; font-style: italic;">italic, red, and a large font size</span>.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img7.png"><img class="aligncenter size-full wp-image-1620" title="img7" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img7.png" alt="" width="512" height="384" /></a></p>
<p>And this really works! Here an example of the HTML5 snippet rendered in Google Chrome using this stylesheet. Now it's really easy to see that I'm being sarcastic.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img8.png"><img class="aligncenter size-full wp-image-1621" title="img8" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img8.png" alt="" width="512" height="384" /></a></p>
<p>This is just the beginning. We can take advantage of new features in CSS, like <a href="http://www.w3.org/TR/css3-speech/">CSS3 Speech stylesheets</a> to provide greater accessibility for users with visual impairments. A blind user using a compatible screen reader can be served a stylesheet like this:</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img9.png"><img class="aligncenter size-full wp-image-1623" title="img9" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img9.png" alt="" width="512" height="384" /></a></p>
<p>Now you can ensure that any text marked up as <strong>&lt;sarcasm&gt;</strong> will be spoken with a particular voice, stressed, and with a subtle sound effect played afterwards just in case.</p>
<p>But there's a problem. And the problem is Internet Explorer.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img10.png"><img class="aligncenter size-full wp-image-1624" title="img10" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img10.png" alt="" width="512" height="384" /></a></p>
<p>As you can see, when I render the previous example using IE, no styling is applied. In fact, IE doesn't recognise the &lt;sarcasm&gt; tag, or any of the new HTML5 tags. They are not created as DOM elements, and can't be targeted by CSS or Javascript.</p>
<p>Luckily, there's a solution.</p>
<p>If we use Javascript to create one dummy &lt;sarcasm&gt; node in the document, that's enough to trick IE into recognising &lt;sarcasm&gt;. This works in IE8, IE7 and even IE6. Let's see how it works:</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img11.png"><img class="aligncenter size-full wp-image-1625" title="img11" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img11.png" alt="" width="512" height="384" /></a></p>
<p>We're using <a href="http://www.quirksmode.org/css/condcom.html">conditional comments</a> to hide this from browsers other than IE, then creating one dummy sarcasm node. Now, if we load a page containing <strong>&lt;sarcasm&gt;</strong> in IE, our styling is applied!</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img12.png"><img class="aligncenter size-full wp-image-1626" title="img12" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img12.png" alt="" width="512" height="384" /></a></p>
<p>Now we've nailed cross-browser support, the opportunities are almost endless. For example, it takes only one line of code using jQuery and Greasemonkey to automatically replace any sarcastic comments <a href="http://en.wikipedia.org/wikiRickrolling">with a video of Rick Astley</a>.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img13.png"><img class="aligncenter size-full wp-image-1627" title="img13" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img13.png" alt="" width="512" height="384" /></a></p>
<p>And just think how useful it will be once other sites start using <strong>&lt;sarcasm&gt;</strong>. It will make online communication far simpler. We'll be able to tell easily when politicians aren't telling the truth.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img141.png"><img class="aligncenter size-full wp-image-1628" title="img14" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img141.png" alt="" width="512" height="384" /></a></p>
<p>So, I encourage you to go out and spread the word. Start implementing <strong>&lt;sarcasm&gt;</strong> on your site. Lobby the <a href="http://www.w3.org/">W3C</a>, the web's governing body, to make <strong>&lt;sarcasm&gt;</strong> part of the <a href="http://dev.w3.org/html5/spec/Overview.html">official HTML5 spec</a>.</p>
<p>Know that we are not alone. <a href="http://twitter.com/gf3">Gianni Chiappetta</a> is someone else who appreciates the importance of <strong>&lt;sarcasm&gt;</strong>. He sent a tweet to the W3C proposing <strong>&lt;sarcasm&gt;</strong>:</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img151.png"><img class="aligncenter size-full wp-image-1629" title="img15" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img151.png" alt="" width="512" height="384" /></a></p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img16.png"><img class="aligncenter size-full wp-image-1630" title="img16" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/img16.png" alt="" width="512" height="384" /></a></p>
<p>If you'd like to talk more seriously about what HTML5 web applications can do for you and your business, do <a href="http://www.reigndesign.com/contact">get in touch with ReignDesign</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reigndesign.com/blog/html5s-missing-tag-sarcasm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a button using CCMenuItemToggle in cocos2d</title>
		<link>http://www.reigndesign.com/blog/creating-a-button-using-ccmenuitemtoggle-in-cocos2d/</link>
		<comments>http://www.reigndesign.com/blog/creating-a-button-using-ccmenuitemtoggle-in-cocos2d/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 06:48:36 +0000</pubDate>
		<dc:creator>Stephen Ceresia</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work methods]]></category>
		<category><![CDATA[cocos2d]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.reigndesign.com/blog/?p=1544</guid>
		<description><![CDATA[
Last time we talked about creating a simple menu in cocos2d. This tutorial will show you how to use CCMenuItemToggle to create a simple sound on/off button using images to represent the two states.

Create a new cocos2d application, or use the application from the last tutorial. We'll need to use some images for the on/off [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/cocos2dlogo.png"><img class="size-full wp-image-1512" title="cocos2d" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/cocos2dlogo.png" alt="cocos2d" width="160" height="237" /></a></p>
<p>Last time we talked about <a href="http://www.reigndesign.com/blog/creating-a-simple-menu-with-scene-transition-in-cocos2d/">creating a simple menu in cocos2d</a>. This tutorial will show you how to use <strong>CCMenuItemToggle</strong> to create a simple sound on/off button using images to represent the two states.<br />
<span id="more-1544"></span></p>
<p>Create a new cocos2d application, or use the application from the last tutorial. We'll need to use some images for the on/off states, so add the following images to your project's Resources group:</p>
<ul>
<li><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/soundOn.png">soundOn.png</a></li>
<li><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/soundOff.png">soundOff.png</a></li>
</ul>
<p>In the scene where you would like to place your sound on/off button, add the following code to your init method:</p>
<pre class="objc"><span style="color: #ff0000;">// Sound on/off toggle</span>
CCMenuItem *soundOnItem = <span style="color: #002200;">&#91;</span>CCMenuItemImage itemFromNormalImage:@<span style="color: #666666;">&quot;soundOn.png&quot;</span>
						selectedImage:@<span style="color: #666666;">&quot;soundOn.png&quot;</span>
						       target:<span style="color: #0000ff;">nil</span>
						     selector:<span style="color: #0000ff;">nil</span><span style="color: #002200;">&#93;</span>;
&nbsp;
CCMenuItem *soundOffItem = <span style="color: #002200;">&#91;</span>CCMenuItemImage itemFromNormalImage:@<span style="color: #666666;">&quot;soundOff.png&quot;</span>
						 selectedImage:@<span style="color: #666666;">&quot;soundOff.png&quot;</span>
							target:<span style="color: #0000ff;">nil</span>
						      selector:<span style="color: #0000ff;">nil</span><span style="color: #002200;">&#93;</span>;
&nbsp;
CCMenuItemToggle *soundToggleItem = <span style="color: #002200;">&#91;</span>CCMenuItemToggle itemWithTarget:self
							    selector:<span style="color: #0000ff;">@selector</span><span style="color: #002200;">&#40;</span>soundButtonTapped:<span style="color: #002200;">&#41;</span>
							       items:soundOnItem, soundOffItem, <span style="color: #0000ff;">nil</span><span style="color: #002200;">&#93;</span>;</pre>
<p>First, we create two menu items from our sound on/off images. They'll just be used as reference for our toggle item, so we just set our target and selector to nil.</p>
<p>Next, we create the actual <strong>CCMenuItemToggle</strong>. The target will be self, and we'll specify a soundButtonTapped: method for our selector (which we'll create later). Then, we add our soundOnItem and soundOffItem to the toggle.</p>
<p>Now, we'll create a menu to add our soundToggleItem:</p>
<pre class="objc">CCMenu *bottomMenu = <span style="color: #002200;">&#91;</span>CCMenu menuWithItems:soundToggleItem, <span style="color: #0000ff;">nil</span><span style="color: #002200;">&#93;</span>;
soundToggleItem.position = ccp<span style="color: #002200;">&#40;</span> <span style="color: #0000dd;">-90</span>,<span style="color: #0000dd;">-120</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#91;</span>self addChild: bottomMenu z: <span style="color: #0000dd;">10</span><span style="color: #002200;">&#93;</span>;</pre>
<p>Finally, let's just add our method for when the sound button is tapped:</p>
<pre class="objc">-<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span> soundButtonTapped: <span style="color: #002200;">&#40;</span><span style="color: #0000ff;">id</span><span style="color: #002200;">&#41;</span> sender
<span style="color: #002200;">&#123;</span>
 	<span style="color: #ff0000;">// do something… maybe even turn the sound on/off!</span>
	NSLog<span style="color: #002200;">&#40;</span>@<span style="color: #666666;">&quot;Sound button tapped!&quot;</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span></pre>
<p>Build and run, and you should see a sound on/off button that changes state each time you tap it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reigndesign.com/blog/creating-a-button-using-ccmenuitemtoggle-in-cocos2d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ReignDesign visits Shanghai World Expo 2010!</title>
		<link>http://www.reigndesign.com/blog/reigndesign-visits-shanghai-world-expo-2010/</link>
		<comments>http://www.reigndesign.com/blog/reigndesign-visits-shanghai-world-expo-2010/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 08:06:53 +0000</pubDate>
		<dc:creator>Stephen Ceresia</dc:creator>
				<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://www.reigndesign.com/blog/?p=1575</guid>
		<description><![CDATA[
Last Friday the ReignDesign team spent the day at the Shanghai Expo. The weather called for rain, but luckily it decided to co-operate with us and hold off. Also, being a relatively quiet day with only 432,000 people in attendance, we got to check out the massive Expo grounds and different pavilions about as crowd-free [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo2010.jpg"><img src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo2010.jpg" alt="Shanghai Expo 2010 logo" title="Shanghai Expo 2010 logo" width="200" height="227" class="size-full wp-image-1585" /></a></p>
<p>Last Friday the <a href="http://www.reigndesign.com">ReignDesign</a> team spent the day at the <a href="http://en.expo2010.cn/">Shanghai Expo</a>. The weather called for rain, but luckily it decided to co-operate with us and hold off. Also, being a relatively quiet day with only <a href="http://en.expo2010.cn/yqkl/index.htm">432,000 people in attendance</a>, we got to check out the massive Expo grounds and different pavilions about as crowd-free as one can expect.</p>
<p>Some highlights included:</p>
<p>- Lunch at Sri Lanka's pavilion<br />
- Beer and fries at the Belgium pavilion<br />
- Wine and cocktails at the Chile pavilion<br />
- Mojitos at the Cuba pavilion (started seeing a pattern here...)<br />
<span id="more-1575"></span></p>
<p>Overall, it was a great day and fun was had by all. </p>
<p>The wait for most of the major pavilions was in the 3-hour zone, but that didn't stop us from posing for shots outside our respective countries' attractions!:</p>
<div id="attachment_1577" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-022.jpg"><img src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-022.jpg" alt="Steve outside the Canada pavilion" title="Steve outside the Canada pavilion" width="400" height="266" class="size-full wp-image-1577" /></a><p class="wp-caption-text">Steve outside the Canada pavilion</p></div>
<div id="attachment_1578" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-026.jpg"><img src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-026.jpg" alt="Fluxa outside the Chile pavilion " title="Fluxa outside the Chile pavilion " width="400" height="266" class="size-full wp-image-1578" /></a><p class="wp-caption-text">Fluxa outside the Chile pavilion </p></div>
<div id="attachment_1579" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-039.jpg"><img src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-039.jpg" alt="Thinkey outside the China pavilion " title="Thinkey outside the China pavilion " width="400" height="266" class="size-full wp-image-1579" /></a><p class="wp-caption-text">Thinkey outside the China pavilion </p></div><br />
<div id="attachment_1580" class="wp-caption aligncenter" style="width: 406px"><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-013.jpg"><img src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-013.jpg" alt="Anna outside the Germany pavilion " title="Anna outside the Germany pavilion " width="396" height="459" class="size-full wp-image-1580" /></a><p class="wp-caption-text">Anna outside the Germany pavilion </p></div><br />
<div id="attachment_1581" class="wp-caption aligncenter" style="width: 372px"><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-014.jpg"><img src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-014.jpg" alt="Matt outside the UK pavilion " title="Matt outside the UK pavilion " width="362" height="366" class="size-full wp-image-1581" /></a><p class="wp-caption-text">Matt outside the UK pavilion </p></div><br />
<div id="attachment_1582" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-034.jpg"><img src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-034.jpg" alt="Mark, Nick, and Todd outside the USA pavilion" title="Mark, Nick, and Todd outside the USA pavilion" width="400" height="266" class="size-full wp-image-1582" /></a><p class="wp-caption-text">Mark, Nick, and Todd outside the USA pavilion</p></div>
<p>Want to join us at our next company event? Become <a href="http://www.reigndesign.com/jobs">part of the ReignDesign team</a>!<br />
<div id="attachment_1590" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-040.jpg"><img src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/expo-040.jpg" alt="ReignDesign at Shanghai Expo 2010" title="ReignDesign at Shanghai Expo 2010" width="400" height="266" class="size-full wp-image-1590" /></a><p class="wp-caption-text">ReignDesign at Shanghai Expo 2010</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://www.reigndesign.com/blog/reigndesign-visits-shanghai-world-expo-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a simple menu with scene transition in cocos2d</title>
		<link>http://www.reigndesign.com/blog/creating-a-simple-menu-with-scene-transition-in-cocos2d/</link>
		<comments>http://www.reigndesign.com/blog/creating-a-simple-menu-with-scene-transition-in-cocos2d/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 04:51:40 +0000</pubDate>
		<dc:creator>Stephen Ceresia</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work methods]]></category>
		<category><![CDATA[cocos2d]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.reigndesign.com/blog/?p=1511</guid>
		<description><![CDATA[
cocos2d for iPhone is a fast, free, flexible, community-supported and easy to use framework for making iPhone games.
In this first tutorial, we'll discuss how to create a main menu scene with transition to a second scene using cocos2d.

What you'll need:

A Mac with Xcode 3.0 or higher installed.
A recent version of the cocos2d framework installed. You [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/cocos2dlogo.png"><img class="size-thumbnail wp-image-1512" title="cocos2d" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/cocos2dlogo.png" alt="cocos2d" /></a></p>
<p><a href="http://www.cocos2d-iphone.org">cocos2d for iPhone</a> is a fast, free, flexible, community-supported and easy to use framework for making iPhone games.</p>
<p>In this first tutorial, we'll discuss how to create a main menu scene with transition to a second scene using cocos2d.</p>
<p><span id="more-1511"></span></p>
<p>What you'll need:</p>
<ul>
<li>A Mac with Xcode 3.0 or higher installed.</li>
<li>A recent version of the cocos2d framework installed. You can find it and installation instructions <a href="http://www.cocos2d-iphone.org/download">here</a>.</li>
</ul>
<p><strong>Create a new cocos2d project<br />
</strong><br />
In Xcode, choose File -&gt; New Project and select cocos2d Application from your list of templates.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/fileNew.png"><img class="size-thumbnail wp-image-1513" title="Create new cocos2d application" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/fileNew.png" alt="Create new cocos2d application" /></a></p>
<p>Click "Choose", name the project "BestGameEver", and click "Save". If this is your first time using cocos2d, you might want to build and run the default HelloWorld application in the simulator. We won't be needing the HelloWorldScene, so let's just delete both the HelloWorldScene.h and HelloWorldScene.m file.</p>
<p>Next, open up the BestGameEverAppDelegate.m file and look for this line in the <strong>applicationDidFinishLaunching:</strong> method:</p>
<pre class="objc"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> runWithScene: <span style="color: #002200;">&#91;</span>HelloWorld scene<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;</pre>
<p>This is the scene that will load when your app launches. Change HelloWorld to MainMenuScene, which we're about to create:</p>
<pre class="objc"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> runWithScene: <span style="color: #002200;">&#91;</span>MainMenuScene scene<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;</pre>
<p>At the top of the file, change the HelloWorld import statement to import our MainMenuScene instead:</p>
<pre class="objc"><span style="color: #339900;">#import &quot;MainMenuScene.h&quot;</span></pre>
<p><strong>Create the new scenes<br />
</strong><br />
What we will be need are scenes for our main menu and for our game, so let's create those now. From the Xcode menu, click File -&gt; New File… In the templates menu select Cocoa Touch Class and double-click Objective-C class.</p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/addNew.png"><img class="size-thumbnail wp-image-1515" title="Add new class files" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/addNew" alt="Add new class files" /></a></p>
<p>Name the file MainMenuScene and be sure that "Also create MainMenuScene.h" is also checked. Repeat this process to create your GameScene.h and GameScene.m files.</p>
<p>Let's deal with the MainMenuScene first. Open up the MainMenuScene.h interface file and replace whatever is in it with the following:</p>
<pre class="objc"><span style="color: #339900;">#import &quot;cocos2d.h&quot;</span>
&nbsp;
<span style="color: #0000ff;">@interface</span> MainMenuScene : CCLayer
<span style="color: #002200;">&#123;</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
+<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">id</span><span style="color: #002200;">&#41;</span> scene;
&nbsp;
<span style="color: #0000ff;">@end</span></pre>
<p>This is the standard structure of scenes in cocos2d. First, we're importing the cocos2d class files. Next, we're setting up our interface section and declaring our MainMenuScene which will be a child of the cocos2d class CCLayer. Finally, we declare the class method that will return our scene.</p>
<p>Next up, the MainMenuScene.m implementation file. Select it, delete its contents, and replace with the following:</p>
<pre class="objc"><span style="color: #339900;">#import &quot;MainMenuScene.h&quot;</span>
&nbsp;
<span style="color: #0000ff;">@implementation</span> MainMenuScene
&nbsp;
+<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">id</span><span style="color: #002200;">&#41;</span> scene
<span style="color: #002200;">&#123;</span>
CCScene *scene = <span style="color: #002200;">&#91;</span>CCScene node<span style="color: #002200;">&#93;</span>;
&nbsp;
MainMenuScene *layer = <span style="color: #002200;">&#91;</span>MainMenuScene node<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #002200;">&#91;</span>scene addChild: layer<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #0000ff;">return</span> scene;
<span style="color: #002200;">&#125;</span>
&nbsp;
-<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">id</span><span style="color: #002200;">&#41;</span> init
<span style="color: #002200;">&#123;</span>
&nbsp;
<span style="color: #0000ff;">if</span><span style="color: #002200;">&#40;</span> <span style="color: #002200;">&#40;</span>self=<span style="color: #002200;">&#91;</span>super init<span style="color: #002200;">&#93;</span> <span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
<span style="color: #002200;">&#125;</span>
<span style="color: #0000ff;">return</span> self;
<span style="color: #002200;">&#125;</span>
&nbsp;
- <span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span> dealloc
<span style="color: #002200;">&#123;</span>
&nbsp;
<span style="color: #002200;">&#91;</span>super dealloc<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
<span style="color: #0000ff;">@end</span></pre>
<p>Again, very similar to the HelloWorldScene.m. First, we're creating our scene which will contain all of our main menu's content. Then we're creating a MainMenuScene layer where we'll put our text, buttons, etc.</p>
<p>There is a bit of confusion between scenes and layers, so let me try to simplify it through an example. Think of scenes are containers for different views or screens in a game. You put your content on layers, and add these layers to the scene. For example, you might have a MainMenuScene, a LevelSelectScene, a GameScene, a GameOverScene, etc. In the GameScene you might add a background layer, a score layer, and a sprites layer.</p>
<p>The init method contains all the things you want to happen when the scene is loaded. For example, here you might want to add your buttons and title. Put everything between the:</p>
<pre class="objc"><span style="color: #0000ff;">if</span><span style="color: #002200;">&#40;</span> <span style="color: #002200;">&#40;</span>self=<span style="color: #002200;">&#91;</span>super init<span style="color: #002200;">&#93;</span> <span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
<span style="color: #002200;">&#125;</span>
<span style="color: #0000ff;">return</span> self;</pre>
<p>The dealloc method is for memory management stuff we won't need to worry about for this tutorial.</p>
<p><strong>Add a title to our scene</strong></p>
<p>So our MainMenuScene looks like a menu page, let's give it a title and position it near the top of the screen:</p>
<pre class="objc">CCLabel *title = <span style="color: #002200;">&#91;</span>CCLabel labelWithString:@<span style="color: #666666;">&quot;Main Menu&quot;</span> fontName:@<span style="color: #666666;">&quot;Courier&quot;</span> fontSize:<span style="color: #0000dd;">64</span><span style="color: #002200;">&#93;</span>;
title.position =  ccp<span style="color: #002200;">&#40;</span><span style="color: #0000dd;">240</span>, <span style="color: #0000dd;">240</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#91;</span>self addChild: title<span style="color: #002200;">&#93;</span>;</pre>
<p><strong>Create a new menu layer</strong></p>
<p>In this simple tutorial we really don't need another layer, but let's make one anyway to help illustrate their purpose. First, we'll declare a new layer for our menu and add it as a child of our scene:</p>
<pre class="objc">CCLayer *menuLayer = <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCLayer alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>self addChild:menuLayer<span style="color: #002200;">&#93;</span>;</pre>
<p>This layer will contain all (one!) of our menu items. Next, we'll add a button/link to start our game using CCMenuItemImage. When the user touches the button, it will change to the selected image and when released, launch the game scene. We'll use some images for the button, so add these two images to your Resources group in Xcode:</p>
<ul>
<li><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/startButton.png">startButton.png</a></li>
<li><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/startButtonSelected.png">startButtonSelected.png</a></li>
</ul>
<pre class="objc">CCMenuItemImage *startButton = <span style="color: #002200;">&#91;</span>CCMenuItemImage
					itemFromNormalImage:@<span style="color: #666666;">&quot;startButton.png&quot;</span>
					      selectedImage:@<span style="color: #666666;">&quot;startButtonSelected.png&quot;</span>
						     target:self
						   selector:<span style="color: #0000ff;">@selector</span><span style="color: #002200;">&#40;</span>startGame:<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;</pre>
<p>Note the <strong>startGame:</strong> method. We'll create this later.</p>
<p><strong>Create and add the menu<br />
</strong><br />
Now, let's actually create the menu and add our startButton to it. Note that we're adding the menu to the menuLayer we just created.</p>
<pre class="objc">CCMenu *menu = <span style="color: #002200;">&#91;</span>CCMenu menuWithItems: startButton, <span style="color: #0000ff;">nil</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>menuLayer addChild: menu<span style="color: #002200;">&#93;</span>;</pre>
<p><strong>Create the startGame: method<br />
</strong><br />
Everything looks good so far, but we'll need to define where to go when the startButton is pressed. To do that, add the following method below your <strong>init</strong> method, but before the @end statement of your MainMenuScene.m file:</p>
<pre class="objc">- <span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span> startGame: <span style="color: #002200;">&#40;</span><span style="color: #0000ff;">id</span><span style="color: #002200;">&#41;</span> sender
<span style="color: #002200;">&#123;</span>
<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> replaceScene:<span style="color: #002200;">&#91;</span>GameScene scene<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre>
<p>As you can see, we're replacing the current scene with our GameScene. We'll need to import our GameScene.h file now, so add an import statement to the top of the MainMenuScene.m file:</p>
<pre class="objc"><span style="color: #339900;">#import &quot;GameScene.h&quot;</span></pre>
<p>Great, but our GameScene is blank so let's add some content to it.</p>
<p><strong>Add GameScene content<br />
</strong><br />
Just so we don't launch to a black screen and you think this whole tutorial is a big lie, add the following to your GameScene.h file:</p>
<pre class="objc"><span style="color: #339900;">#import &quot;cocos2d.h&quot;</span>
&nbsp;
<span style="color: #0000ff;">@interface</span> GameScene : CCLayer
<span style="color: #002200;">&#123;</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
+<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">id</span><span style="color: #002200;">&#41;</span> scene;
&nbsp;
<span style="color: #0000ff;">@end</span></pre>
<p>And add the following to your GameScene.m file:</p>
<pre class="objc"><span style="color: #339900;">#import &quot;GameScene.h&quot;</span>
&nbsp;
<span style="color: #0000ff;">@implementation</span> GameScene
&nbsp;
+<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">id</span><span style="color: #002200;">&#41;</span> scene
<span style="color: #002200;">&#123;</span>
CCScene *scene = <span style="color: #002200;">&#91;</span>CCScene node<span style="color: #002200;">&#93;</span>;
&nbsp;
GameScene *layer = <span style="color: #002200;">&#91;</span>GameScene node<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #002200;">&#91;</span>scene addChild: layer<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #0000ff;">return</span> scene;
<span style="color: #002200;">&#125;</span>
&nbsp;
-<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">id</span><span style="color: #002200;">&#41;</span> init
<span style="color: #002200;">&#123;</span>
&nbsp;
<span style="color: #0000ff;">if</span><span style="color: #002200;">&#40;</span> <span style="color: #002200;">&#40;</span>self=<span style="color: #002200;">&#91;</span>super init<span style="color: #002200;">&#93;</span> <span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
CCLabel *message = <span style="color: #002200;">&#91;</span>CCLabel labelWithString:@<span style="color: #666666;">&quot;Greetings&quot;</span> fontName:@<span style="color: #666666;">&quot;Courier&quot;</span> fontSize:<span style="color: #0000dd;">64</span><span style="color: #002200;">&#93;</span>;
message.position =  ccp<span style="color: #002200;">&#40;</span><span style="color: #0000dd;">240</span>, <span style="color: #0000dd;">160</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#91;</span>self addChild: message<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
<span style="color: #0000ff;">return</span> self;
<span style="color: #002200;">&#125;</span>
&nbsp;
- <span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span> dealloc
<span style="color: #002200;">&#123;</span>
&nbsp;
<span style="color: #002200;">&#91;</span>super dealloc<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
<span style="color: #0000ff;">@end</span></pre>
<p>Build and run the application. First, your MainMenuScene should load. Clicking the startButton will replace it with the GameScene.<br />
<a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/MainMenuSimulator.png"><img class="size-full wp-image-1524" title="MainMenuSimulator" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/MainMenuSimulator.png" alt="MainMenuSimulator" width="400" height="215" /></a></p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/GameSceneSImulator.png"><img class="size-full wp-image-1525" title="GameSceneSimulator" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/06/GameSceneSImulator.png" alt="GameSceneSimulator" width="400" height="215" /></a></p>
<p>Ok, maybe BestGameEver is a bit of an overstatement, but it's a start! Next time, I'll explain how to import a spritesheet, and add a sprite to the game scene.</p>
<p>If you're interested in cocos2d, I'd also suggest checking out <a href="http://www.raywenderlich.com/">Ray Wenderlich's</a> fantastic cocos2d and iPhone tutorials.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reigndesign.com/blog/creating-a-simple-menu-with-scene-transition-in-cocos2d/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>10 Xcode power user tips for iPhone devs</title>
		<link>http://www.reigndesign.com/blog/10-xcode-power-user-tips-for-iphone-devs/</link>
		<comments>http://www.reigndesign.com/blog/10-xcode-power-user-tips-for-iphone-devs/#comments</comments>
		<pubDate>Wed, 19 May 2010 07:01:22 +0000</pubDate>
		<dc:creator>Stephen Ceresia</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work methods]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://www.reigndesign.com/blog/?p=1438</guid>
		<description><![CDATA[
If you're developing apps or games for Apple's iPhone/iPad/Touch devices, chances are you're using Xcode. Xcode has a lot of great features that can help increase productivity, so we thought we'd put together a list of ten power user tips for those new to the environment.

1. Quickly switch between .h and .m files

One of the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/04/xcode.png"><img src="http://www.reigndesign.com/blog/wp-content/uploads/2010/04/xcode-150x150.png" alt="Xcode" title="Xcode" width="150" height="150" class="size-thumbnail wp-image-1412" /></a></p>
<p>If you're developing apps or games for Apple's iPhone/iPad/Touch devices, chances are you're using Xcode. Xcode has a lot of great features that can help increase productivity, so we thought we'd put together a list of ten power user tips for those new to the environment.</p>
<p><span id="more-1438"></span></p>
<p><strong>1. Quickly switch between .h and .m files<br />
</strong><br />
One of the more common tasks you'll be doing is switching between interface and implementation files. As luck would have it, there are a couple of shortcuts to do this so you don't have to manually select the files each time:</p>
<ul>
<li>Click the <em>Go to Counterpart</em> double-squares icon in the top-right corner of the editing window.</li>
<li>Use the keyboard shortcut ⌘ Command + ⌥ Option + Up arrow.</li>
</ul>
<p><strong>2. Change default company name at the top of each .h and .m file<br />
</strong><br />
When you create class files in Xcode, you'll notice the header contains default some boilerplate information commented out:</p>
<pre class="objc"><span style="color: #ff0000;">//  Created by stephen on 10-05-18.</span>
<span style="color: #ff0000;">//  Copyright 2010 __MyCompanyName__. All rights reserved.</span></pre>
<p>To customize the company name, open up a terminal and enter the following:</p>
<pre class="objc">defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions <span style="color: #666666;">&quot;{ <span style="color: #666666; font-weight: bold;">\&quot;</span>ORGANIZATIONNAME<span style="color: #666666; font-weight: bold;">\&quot;</span> = <span style="color: #666666; font-weight: bold;">\&quot;</span>ReignDesign<span style="color: #666666; font-weight: bold;">\&quot;</span>;}&quot;</span></pre>
<p>replacing ReignDesign with your company name. Restart Xcode for the change to take effect.</p>
<p><strong>3. Symbol identifier definitions<br />
</strong><br />
To jump to the definition for any symbol, hold ⌘ Command + double-click the symbol. For example, if you hold ⌘ Command + double-click a method name, you'll be brought to its .h definition.</p>
<p><strong>4. Symbol documentation<br />
</strong><br />
<a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/cmdOption.png"><img class="size-full wp-image-1466" title="Symbol documentation" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/cmdOption.png" alt="Symbol documentation" width="386" height="228" /></a></p>
<p>To bring up a brief documentation abstract for any symbol, hold ⌥ Option + double-click the symbol (the cursor will become a crosshair).</p>
<p>Information about the symbol will be displayed in a small window with links to its documentation page and definition.</p>
<p><strong>5. Parenthesis matching<br />
</strong></p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/bracketMatching.png"><img class="size-full wp-image-1467" title="Parenthesis matching" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/bracketMatching.png" alt="Parenthesis matching" width="278" height="172" /></a></p>
<p>Lost in a nest of if statements? Just double click any bracket or parenthesis, to see its corresponding open or closed counterpart.</p>
<p><strong>6. Edit all in scope<br />
</strong></p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/scope.png"><img class="size-full wp-image-1468" title="Edit all in scope" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/scope.png" alt="Edit all in scope" width="230" height="216" /></a></p>
<p>Need to rename a variable but don't want to do it manually, and don't trust Find and Replace? Right-click its name and choose <em>Edit all in scope</em>. All instances will be selected, and when you start typing they'll be modified.</p>
<p><strong>7. ESC to pop-up available code completion options<br />
</strong></p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/esc.png"><img class="size-full wp-image-1469" title="Available code completion options" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/esc.png" alt="Available code completion options" width="318" height="296" /></a></p>
<p>Code completion is great, but sometimes it just doesn't provide what you're looking for. In these instances, if you press the Escape key, Xcode will pop-up a list of possible suggestions.</p>
<p><strong>8. Snapshots<br />
</strong></p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/snapshots.png"><img class="size-full wp-image-1470" title="Snapshots" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/snapshots.png" alt="Snapshots" width="380" height="358" /></a></p>
<p>Xcode's "Make Snapshot" option enables you to take a snapshot of your project's current state and revert back to it. You can also save multiple snapshots. To take a Snapshot, click <em>File</em> and choose <em>Make Snapshot</em>.</p>
<p><em>Note: Xcode's Snapshot feature hasn't been 100% reliable for <a href="http://arstechnica.com/civis/viewtopic.php?f=20&amp;t=134924">some users</a>. While it is a useful and convenient feature, we'd suggest not relying on it as your only form of back up!</em></p>
<p><strong>9. Re-indent selection<br />
</strong><br />
After rewriting that method a few times, your code may not be lined up as perfectly as you'd like. In these cases, Xcode can re-format the code for you so it lines up:</p>
<ul>
<li>Select the area of text you wish to reformat</li>
<li>Right-click the selection and choose <em>Re-Indent selection</em> from the context menu</li>
</ul>
<p>Voila! Your code is neatly lined up. Works well with Parenthesis matching. <img src='http://www.reigndesign.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>10. Pragma mark directives, //TODO:, //FIXME:, //!!!:, and //???:<br />
</strong></p>
<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/pragmaTwo.png"><img class="size-full wp-image-1471" title="pragma marks" src="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/pragmaTwo.png" alt="pragma marks" width="579" height="329" /></a></p>
<p>As your implementation files grow, pragma marks can be an extremely useful way to keep things organized. For example:</p>
<pre class="objc"><span style="color: #339900;">#pragma mark -</span>
<span style="color: #339900;">#pragma mark Cleanup</span></pre>
<p>Note that there is no space after the dash in the first <strong>#pragma mark</strong>. An alternative - since <strong>#pragma mark</strong> directives are compiler dependent - is to use <strong>// MARK:</strong>. For example:</p>
<pre class="objc">&nbsp;
<span style="color: #ff0000;">// MARK: Cleanup</span>
&nbsp;</pre>
<p>In addition to using pragma marks, you can also use the following tags to make certain items stand out:</p>
<pre class="objc"><span style="color: #ff0000;">//TODO:</span>
<span style="color: #ff0000;">//FIXME:</span>
<span style="color: #ff0000;">//!!!:</span>
<span style="color: #ff0000;">//???:</span></pre>
<p>Have a great Xcode productivity tip that we missed? Let us know in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reigndesign.com/blog/10-xcode-power-user-tips-for-iphone-devs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crash the Crib released to the App Store!</title>
		<link>http://www.reigndesign.com/blog/crash-the-crib-released-to-the-app-store/</link>
		<comments>http://www.reigndesign.com/blog/crash-the-crib-released-to-the-app-store/#comments</comments>
		<pubDate>Tue, 18 May 2010 10:00:55 +0000</pubDate>
		<dc:creator>Stephen Ceresia</dc:creator>
				<category><![CDATA[Apps]]></category>
		<category><![CDATA[crash the crib]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.reigndesign.com/blog/?p=1258</guid>
		<description><![CDATA[
ReignDesign partnered recently with Red Rocket Games to help develop their latest iPhone/iPod Touch game, Crash the Crib.

Description from Red Rocket Games' website:
"Hollywood… Southern CA. Smug celebrities flaunting their wealth in our faces like there’s no tomorrow. That’s where YOU come in; take your modern-day siege engine and obliterate the lifestyles of the rich and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/cTc.png"><img src="http://www.reigndesign.com/blog/wp-content/uploads/2010/05/cTc.png" alt="Crash the Crib" title="Crash the Crib" width="259" height="159" class="size-full wp-image-1457" /></a></p>
<p><a href="http://www.reigndesign.com">ReignDesign</a> partnered recently with <a href="http://www.redrocketgames.com/">Red Rocket Games</a> to help develop their latest iPhone/iPod Touch game, <a href="http://www.redrocketgames.com/games/crash-the-crib">Crash the Crib</a>.<br />
<span id="more-1258"></span></p>
<p>Description from Red Rocket Games' website:</p>
<p><em>"Hollywood… Southern CA. Smug celebrities flaunting their wealth in our faces like there’s no tomorrow. That’s where YOU come in; take your modern-day siege engine and obliterate the lifestyles of the rich and famous! Load your Junk-Chucker with quality ammo: paparazzi, lawyers, groupies, and obnoxious sports cars. Leave a trail of destruction, mayhem, and depressed B-list celebrities in your wake."</em></p>
<p><strong>Crash the Crib</strong> is a ton of fun, and smashing these so-called stars' cribs with your trebuchet is even more fulfilling than it sounds.</p>
<p>Check it out on the iTunes App Store, on sale now for $0.99!</p>
<p><a href="http://itunes.apple.com/ca/app/crash-the-crib/id353953112?mt=8">iTunes App Store Link</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.reigndesign.com/blog/crash-the-crib-released-to-the-app-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pig Rush featured in Apple&#8217;s New and Noteworthy section!</title>
		<link>http://www.reigndesign.com/blog/pig-rush-featured-in-apples-new-and-noteworthy-section/</link>
		<comments>http://www.reigndesign.com/blog/pig-rush-featured-in-apples-new-and-noteworthy-section/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 09:09:15 +0000</pubDate>
		<dc:creator>Stephen Ceresia</dc:creator>
				<category><![CDATA[Apps]]></category>
		<category><![CDATA[app store]]></category>
		<category><![CDATA[pigrush]]></category>

		<guid isPermaLink="false">http://www.reigndesign.com/blog/?p=1339</guid>
		<description><![CDATA[
A few weeks back we released a major update to our loveable little pig game, Pig Rush. We've received a ton of great feedback from users all over the world, and the response has been great.
That said, it still took us by surprise to see Pig Rush featured in Apple's New and Noteworthy section in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.reigndesign.com/blog/wp-content/uploads/2010/03/newandnoteworthy.jpg"><img src="http://www.reigndesign.com/blog/wp-content/uploads/2010/03/newandnoteworthy.jpg" alt="Pig Rush: New and Noteworthy" title="Pig Rush: New and Noteworthy" width="393" height="334" class="size-full wp-image-1340" /></a></p>
<p>A few weeks back we released a <a href="http://www.reigndesign.com/blog/pig-rush-1-2-released-and-approved-by-apple-in-12-5-hours/">major update</a> to our loveable little pig game, <a href="http://www.pigrush.com">Pig Rush</a>. We've received a ton of great feedback from users all over the world, and the response has been great.</p>
<p>That said, it still took us by surprise to see Pig Rush featured in Apple's New and Noteworthy section in the US App Store. Thanks Apple! </p>
<p>Next stop, "What's Hot!" section!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reigndesign.com/blog/pig-rush-featured-in-apples-new-and-noteworthy-section/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why is our app twice as large as what we submitted? &#8220;Contagious zeros&#8221;</title>
		<link>http://www.reigndesign.com/blog/why-is-our-app-twice-as-large-as-what-we-submitted-contagious-zeros/</link>
		<comments>http://www.reigndesign.com/blog/why-is-our-app-twice-as-large-as-what-we-submitted-contagious-zeros/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 07:01:28 +0000</pubDate>
		<dc:creator>Stephen Ceresia</dc:creator>
				<category><![CDATA[Apps]]></category>
		<category><![CDATA[app store]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.reigndesign.com/blog/?p=1293</guid>
		<description><![CDATA[
As you probably know, Apple has an app download limit for users downloading over 3G. Up until recently, this limit was 10 MB. If your app's file size exceeds the limit, users attempting to download it over 3G receive an error and must try again later over wifi. Needless to say, this can lead to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.reigndesign.com/blog/wp-content/uploads/2010/02/AppStoreicon.png" alt="iTunes App Store" title="iTunes App Store" width="200" height="198" class="alignleft size-full wp-image-1315" /></p>
<p>As you probably know, Apple has an app download limit for users downloading over 3G. <a href="http://reviews.cnet.com/8301-19512_7-10456067-233.html">Up until recently</a>, this limit was 10 MB. If your app's file size exceeds the limit, users attempting to download it over 3G receive an error and must try again later over wifi. Needless to say, this can lead to frustrated users and lost sales and if you can get your app under this limit, it's definitely worth the effort.</p>
<p>So, when we submitted our latest update of <a href="http://www.pigrush.com">Pig Rush</a> to Apple for review, we worked hard to get it under the (then) 10 MB 3G app download limit.<br />
<span id="more-1293"></span></p>
<p>Eventually, we got the file size down to <strong>8.9 MB</strong>, knocking a massive 66% off of the original file size. Awesome!</p>
<p>We then submitted our update to Apple for review. Amazingly, <a href="http://www.reigndesign.com/blog/pig-rush-1-2-released-and-approved-by-apple-in-12-5-hours/">only 12.5 hours later</a> it was approved and live on the App Store. Excellent!</p>
<p>Then we noticed the file size listed in the App Store… <strong>16.5 MB</strong>.</p>
<p>How could this be? This was nearly double the size of what what we submitted!</p>
<p>We downloaded the compressed package from the app store, and compared it to the version we uploaded. Sure enough, the version on the App Store was larger: 17.4 MB vs. our 8.9 MB version.</p>
<p>We extracted both files to compare, but apart from some standard config files added everything was the same.</p>
<p>Upon further inspection, it turned out there was one big difference: the main executable was 13.7 MB in both versions. However, the App Store version of this file compressed to <strong>12.4 MB</strong> while ours compressed to <strong>4 MB</strong>.</p>
<p>That's a pretty significant difference. We decided to ask Apple about this, and here's the answer we got:</p>
<blockquote><p>"When your application is delivered to Apple, it is encrypted for DRM purposes and re-compressed. When the encryption is added, the size of the compressed file will increase. The exact size of the increase will vary from app to app, however, the size increase can be large when the binary has a lot of contagious zeros in it. We are unable to guarantee the size of your file after the encryption has been added."</p></blockquote>
<p>File size increasing after encryption is added makes sense - but an increase from 4 MB to 13.7 MB seems extremely high. I've also never heard of "contagious zeros" before, and it looks like <a href="http://www.google.com/search?hl=en&client=opera&hs=xAq&rls=en&q=%22contagious+zeros%22&aq=f&aqi=&aql=&oq=">I'm not the only one</a>.</p>
<p>Luckily, the new 3G limit has been upped to 20 MB so we still fall under it, but I'd still be interested in hearing others' experiences in final app package size vs. what was uploaded. Also, if you have any suggestions on limiting the number of contagious zeros in your binaries, please let us know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reigndesign.com/blog/why-is-our-app-twice-as-large-as-what-we-submitted-contagious-zeros/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
