<?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>Sinceriously</title>
	<atom:link href="http://www.sinceriously.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sinceriously.com</link>
	<description>Designment and Development</description>
	<lastBuildDate>Sun, 18 Jul 2010 01:36:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Apple Tablet: Multiplayer Fingerprint Detection?</title>
		<link>http://www.sinceriously.com/2010/01/multiplayer-apps-in-a-tablet-world/</link>
		<comments>http://www.sinceriously.com/2010/01/multiplayer-apps-in-a-tablet-world/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 18:19:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Speculation]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[fingerprints]]></category>
		<category><![CDATA[multiplayer]]></category>
		<category><![CDATA[tablet]]></category>

		<guid isPermaLink="false">http://www.sinceriously.com/?p=278</guid>
		<description><![CDATA[This blog entry is purely speculative based on a number of different news articles I have read over the past couple of months. As an iPhone developer, I am giddy with anticipation over tomorrow’s supposed unveiling of Apple’s upcoming tablet. Specifically, my interest in multiplayer gaming as it relates to the iPhone and iPod Touch, [...]]]></description>
			<content:encoded><![CDATA[<p><em>This blog entry is purely speculative based on a number of different news articles I have read over the past couple of months.</em></p>
<p>As an iPhone developer, I am giddy with anticipation over tomorrow’s supposed unveiling of Apple’s upcoming tablet. Specifically, my interest in multiplayer gaming as it relates to the iPhone and iPod Touch, and now iPad (if that’s what the tablet is to be called), has peaked recently as I begin development of a couple of new mobile games of my own.</p>
<p>Yesterday a number of friends forwarded me a New York Times article entitled <a href=”http://www.nytimes.com/2010/01/25/technology/25apps.html”>A Playland for Apps in a Tablet World</a>. I actually didn’t make it through the entire article because I stopped dead in my tracks by the fourth paragraph which reads:</p>
<blockquote><p>But the larger screen &mdash; most likely 10 inches diagonally &mdash; and other features of the tablet could inspire developers to create new twists on apps, like games that two or more people can easily play at once on the same device.</p></blockquote>
<p><span id="more-278"></span></p>
<p>The concept of a device large enough for two people to play simultaneously is not news in its own right, or cause for mass hysteria. Yes, a 10” tablet would definitely be large enough to support a multitude of simultaneous finger/toe touches. The same article quotes Smule co-founder, Ge Wang, as saying:</p>
<blockquote><p>“On the iPhone, there are five touch points max,” Mr. Wang said. “You don’t need much more than that because that’s about all you can fit on that screen.”</p>
<p>A tablet with a bigger and better multitouch screen, he said, “could mean entirely new user interfaces, screen layouts, instruments, contraptions and games.”</p></blockquote>
<p>But <strong>how</strong> the tablet would distinguish one player’s touch from another player’s, that’s what’s got my mind twerking. Will the tablet be sophisticated enough to differentiate one player’s <strong>fingerprints</strong> from the other player’s?</p>
<p>Surprisingly, this concept may not be that far fetched. Let’s look at the facts.</p>
<p>Apple filed a patent as early as <a href=”http://www.appleinsider.com/articles/08/03/26/apples_patent_for_an_lcd_display_that_also_takes_photos_video.html”>June 2004</a> that involved “many tiny image sensors wedged between LCD cells, and software to stitch together all of the smaller pieces.” Later, in <a href=”http://www.appleinsider.com/articles/09/01/08/apple_files_patent_for_camera_hidden_behind_display.html”>July 2007</a>, a new filing detailed plans for a camera mounted behind a display that could capture an image &#8220;while the display elements are in an inactive state (in which the display elements are darkened and at least partially transparent).&#8221;</p>
<p>At that time, technologies like these was envisioned to be used on desktop or laptop displays, but why couldn’t a technique like this be used on a touch screen? And could the camera images be detailed enough for the computer to decipher fingerprints?</p>
<p>While digging further for information to support fingerprint-awareness, I found this article which brings the idea well into the realm of plausibility. In July 2009, Macrumors, along with a number of other news sites, published the findings of another Apple patent entitled <a href=”http://www.macrumors.com/2009/07/02/haptic-feedback-fingerprint-identification-and-rfid-tag-readers-in-future-iphones/”>Fingerprint Identification as an Input Method</a>. The patent involves the use of fingerprint patterns to actually identify distinct fingers and suggests that the technique could be used to produce specific functions depending on <em>which</em> finger is being used. For instance, an index finger press might perform one action (PLAY/STOP) while a middle finger press could fast forward. If this patented technique is sophisticated enough to distinguish an individual’s index finger from their middle finger, surely it could be used to distinguish two (or more) completely separate sets of fingerprints?</p>
<p>And honestly, how else can “games that two or more people can easily play at once on the same device” be possible without fingerprint recognition?</p>
<p>There’s no indication that any of these patented technologies are accessible enough to include in affordable consumer devices, but we can dream can’t we? Steve Jobs has been quoted as saying the tablet &#8220;will be the most important thing [he's] ever done.&#8221; Based on that, I&#8217;m expecting a lot of surprises. What do you all think?</p>
<p><strong>&mdash; Ryan</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/www.sinceriously.com/p=278</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Canvas Demos</title>
		<link>http://www.sinceriously.com/2009/03/canvas-demos/</link>
		<comments>http://www.sinceriously.com/2009/03/canvas-demos/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 20:44:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[css canvas]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web app]]></category>

		<guid isPermaLink="false">http://www.sinceriously.com/?p=236</guid>
		<description><![CDATA[In the third update to my crossword web app tutorial, I discussed CSS Canvas. I mentioned how potentially powerful the canvas can be, especially as an alternative to Flash, but I wasn&#8217;t able to provide concrete examples since I hadn&#8217;t personally done anything exceptionally extraordinary with it yet. Well now I have the proof! A [...]]]></description>
			<content:encoded><![CDATA[<p>In the third update to my crossword web app tutorial, I discussed CSS Canvas. I mentioned how potentially powerful the canvas can be, especially as an alternative to Flash, but I wasn&#8217;t able to provide concrete examples since I hadn&#8217;t personally done anything exceptionally extraordinary with it yet.</p>
<p>Well now I have the proof! A couple of weeks ago I was followed on Twitter by <a href="http://twitter.com/canvasdemos" onclick="window.open(this.href); return false;">@canvasdemos</a>. The <a href="http://www.canvasdemos.com/" onclick="window.open(this.href); return false;">Canvas Demos</a> blog dedicates its time to tracking down and showcasing demos and tutorials for the HTML canvas element. Some of the examples they&#8217;ve uncovered are truly amazing and include games, 3D tests, music visualizers, etc. If you&#8217;re at all intrigued by the power of CSS Canvas, and are wondering how you can use it on your own site (or Web app), <a href="http://www.canvasdemos.com/" onclick="window.open(this.href); return false;">don&#8217;t hesitate to give their site a look!</a>.</p>
<p>The image above is from Jacob Seidelin&#8217;s music visualizer. The demo creates an image of Thom Yorke to the music of Radiohead&#8217;s Idioteque. <a href="http://www2.nihilogic.dk/labs/canvas_music_visualization/" onclick="window.open(this.href); return false;">It&#8217;s worth checking out.</a></p>
<p><strong>&mdash; Ryan</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/www.sinceriously.com/p=236</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Crossword Web App, Part 6</title>
		<link>http://www.sinceriously.com/2009/03/crossword-web-app-part-6/</link>
		<comments>http://www.sinceriously.com/2009/03/crossword-web-app-part-6/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 20:31:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Game Designment]]></category>
		<category><![CDATA[crossword]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web app]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.sinceriously.com/?p=217</guid>
		<description><![CDATA[Although it&#8217;s easy to get Javascript to read from an XML file, pulling out the appropriate data can sometimes be tricky. Here are some tips to help you tame the XML beast. Part 6: Taming XML Let&#8217;s look at a typical XMLHttpRequest again. var url = 'xml/070814.xml';var xmlhttp = new XMLHttpRequest();&#160;if (xmlhttp != null) {xmlhttp.onreadystatechange [...]]]></description>
			<content:encoded><![CDATA[<p>Although it&#8217;s easy to get Javascript to read from an XML file, pulling out the appropriate data can sometimes be tricky. Here are some tips to help you tame the XML beast.</p>
<h1>Part 6: Taming XML</h1>
<p></p>
<p>Let&#8217;s look at a typical <code>XMLHttpRequest</code> again.</p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout">var url = 'xml/070814.xml';</code><code class="code-breakout">var xmlhttp = new XMLHttpRequest();</code><code class="code-breakout">&nbsp;</code><code class="code-breakout">if (xmlhttp != null) {</code><code class="code-breakout" style="margin-left:18px;">xmlhttp.onreadystatechange = stateChange;</code><code class="code-breakout" style="margin-left:18px;">xmlhttp.open('GET', url, true);</code><code class="code-breakout" style="margin-left:18px;">xmlhttp.send(null);</code><code class="code-breakout">} else {</code><code class="code-breakout" style="margin-left:18px;">alert('Your browser does not support XMLHTTP.'); }</code><code class="code-breakout">}</code><code class="code-breakout">&nbsp;</code><code class="code-breakout">function stateChange() {</code><code class="code-breakout" style="margin-left:18px;">if (xmlhttp.readyState == 4) {</code><code class="code-breakout" style="margin-left:36px;">if (xmlhttp.status == 200) {</code><code class="code-breakout" style="margin-left:54px;">/*</code><code class="code-breakout" style="margin-left:54px;">A status of 200 means that the XML file was</code><code class="code-breakout" style="margin-left:54px;">loaded and parsed without error. At this point</code><code class="code-breakout" style="margin-left:54px;">you'll want to sort through all of the data so</code><code class="code-breakout" style="margin-left:54px;">that it can be used by your program. I'll give</code><code class="code-breakout" style="margin-left:54px;">you some tips on how to do this in the next</code><code class="code-breakout" style="margin-left:54px;">update.</code><code class="code-breakout" style="margin-left:54px;">*/</code><code class="code-breakout" style="margin-left:36px;">} else {</code><code class="code-breakout" style="margin-left:54px;">alert('Problem retrieving XML data.');</code><code class="code-breakout" style="margin-left:36px;">}</code><code class="code-breakout" style="margin-left:18px;">}</code><code class="code-breakout">}</code></div>
<p><span>Figure 1. The basic structure of an XMLHttpRequest</span></div>
<p></p>
<p><span id="more-217"></span></p>
<p>If the request succeeds without error, then we can use the <code>xmlhttp</code> object to access the contents of the loaded XML file. To understand how to work with an <code>XMLHttpRequest</code> object, let&#8217;s relate it to something a little more familiar to Web coders: the Javascript <code>Document</code> object.</p>
<p><code>document.getElementsByName('across')</code> will return an array containing all of the elements on your Web page whose <code>name</code> <em>attribute</em> is &#8220;across.&#8221; For example, <code>&lt;div name="across"&gt;</code>.</p>
<p><code>xmlhttp.responseXML.getElementsByTagName('across')</code> will return an array containing all of the &#8220;across&#8221; XML nodes. For example, <code>&lt;across&gt;Data&lt;/across&gt;</code>.</p>
<p>Nodes can have both <em>attributes</em> and <em>values</em>. Review Figure 2.</p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</code><code class="code-breakout">&lt;editor&gt;Timothy Parker&lt;/editor&gt;</code><code class="code-breakout">&lt;across&gt;</code><code class="code-breakout" style="margin-left:18px;">&lt;a1 a="POET" c="Burns or Byron" n="1" cn="1" /&gt;</code><code class="code-breakout">&lt;/across&gt;</code></div>
<p><span>Figure 2. <strong>c</strong> is an attribute of the <strong>a1</strong> node.<br />&#8220;Timothy Parker&#8221; is the value of the <strong>editor</strong> node.</span></div>
<p></p>
<p><code>getElementsByTagName</code> will always return an array. In the example above there is only one <code>a1</code> node, therefore there&#8217;s no reason to keep an <em>array</em> of <code>a1</code> nodes. Instead, using the code below, we can save only the first returned node (since that&#8217;s all that exists).</p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout">var a1Node = xmlhttp.responseXML.getElementsByTagName('a1')[0];</code></div>
<p><span>Figure 3. Save a reference to the <strong>a1</strong> XML node in a variable named <strong>a1Node</strong>.</span></div>
<p></p>
<p>Now that we&#8217;ve captured the <code>a1</code> node specifically, we can access its <code>c</code> <em>attribute</em> using this simple code: <code>var c = a1.getAttribute('c');</code>.</p>
<p>Accessing node <em>attributes</em> is easy, but accessing node <em>values</em> is a little more confusing. Figure 4 demonstrates how to access the <em>value</em> of the <code>editor</code> node.</p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout">var editor = xmlhttp.responseXML.getElementsByTagName('editor')[0];</code><code class="code-breakout">var editorValue = editor.firstChild.nodeValue;</code></div>
<p><span>Figure 4. Accessing the value of the <strong>editor</strong> node.</span></div>
<p></p>
<p>The <code>firstChild</code> method returns the first child of a node, duh. But the <code>editor</code> node does not appear to have any children. Well, it apparently (or not so apparently) does. When attempting to access the <em>value</em> of a node, imagine the value text as being a node itself. Access the <code>nodeValue</code> of the &#8220;text node&#8221; and you&#8217;ll get the result you&#8217;re looking for. Or, in more simple terms, always use <code>.firstChild.nodeValue</code> to access the value of a node.</p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</code><code class="code-breakout">&lt;across&gt;</code><code class="code-breakout" style="margin-left:18px;">&lt;a1 a="POET" c="Burns or Byron" n="1" cn="1" /&gt;</code><code class="code-breakout" style="margin-left:18px;">&lt;a2 a="BLAB" c="Give everything away" n="6" cn="5" /&gt;</code><code class="code-breakout" style="margin-left:18px;">&lt;a3 a="TALKS" c="Gives everything away" n="11" cn="9" /&gt;</code><code class="code-breakout" style="margin-left:18px;">&lt;a4 a="ALSO" c="Too" n="16" cn="14" /&gt;</code><code class="code-breakout" style="margin-left:18px;">&lt;a5 a="YOHO" c="Exclamation by Captain Jack Sparrow" n="21" cn="15" /&gt;</code><code class="code-breakout" style="margin-left:18px;">&lt;a6 a="ELIOT" c="'A Cooking Egg' writer" n="26" cn="16" /&gt;</code><code class="code-breakout" style="margin-left:18px;">&lt;a7 a="LIAR" c="Ananias, for one" n="31" cn="17" /&gt;</code><code class="code-breakout" style="margin-left:18px;">&lt;a8 a="PREY" c="Target in the wild" n="36" cn="18" /&gt;</code><code class="code-breakout" style="margin-left:18px;">&lt;a9 a="ALONE" c="In isolation" n="41" cn="19" /&gt;</code><code class="code-breakout">&lt;/across&gt;</code></div>
<p><span>Figure 5. Another XML example.</span></div>
<p></p>
<p>In the above example, all of the <code>across</code> child nodes are named differently, so it would be cumbersome to <code>getElementsByTagName</code> each one separately. Instead, take advantage of the <code>childNodes</code> collection to return an array of the nodes.</p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout"> var acrossNodes = xmlhttp.responseXML.getElementsByTagName('across')[0].childNodes;</code></div>
<p><span>Figure 6. Save all of the <strong>across</strong> child nodes to an array.</span></div>
<p></p>
<p>There is more to learn about <code>XMLHttpRequest</code>, but by simply knowing how to use the <code>getElementsByTagName</code>, <code>getAttribute</code>, <code>firstChild</code> and <code>nodeValue</code> methods and the <code>childNodes</code> collection, you&#8217;ll have an easy time retrieving all types of data from XML documents.</p>
<p>Before I close this lengthy post, there is one more thing I&#8217;d like to mention with regards to XML files. It appears that you can not use Javascript to access local XML files using XMLHttpRequest, you can only access files found on a domain. I am completely perplexed as to why this is and if anyone  has knowledge of the reason, or knows a workaround, I&#8217;d love to hear from you.</p>
<p><strong>&mdash; Ryan</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/www.sinceriously.com/p=217</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Artist Spotlight: David Lanham</title>
		<link>http://www.sinceriously.com/2009/03/artist-spotlight-david-lanham/</link>
		<comments>http://www.sinceriously.com/2009/03/artist-spotlight-david-lanham/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 06:56:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Artists]]></category>
		<category><![CDATA[david lanham]]></category>
		<category><![CDATA[frenzic]]></category>
		<category><![CDATA[iconfactory]]></category>
		<category><![CDATA[twitterrific]]></category>

		<guid isPermaLink="false">http://www.sinceriously.com/?p=209</guid>
		<description><![CDATA[Although I’m preparing Part 6 of the crossword web app feature for tomorrow (after an unfortunate two week posting hiatus), I wanted to quickly point out the new “inspirations” module, included in the sidebar. For years now I’ve admired the works of many of today’s top visual designers. Through regular visits to the Iconfactory, an [...]]]></description>
			<content:encoded><![CDATA[<p>Although I’m preparing Part 6 of the crossword web app feature for tomorrow (after an unfortunate two week posting hiatus), I wanted to quickly point out the new “inspirations” module, included in the sidebar.</p>
<p>For years now I’ve admired the works of many of today’s top visual designers. Through regular visits to the <a href=”http://www.iconfactory.com/” onclick="window.open(this.href); return false;">Iconfactory</a>, an icon design house, I’ve come to appreciate the illustrative styles of a select group of visual designers. David Lanham is one of these incredible designers. Lanham’s designs are remarkably otherworldy. Though his creations are born from fantasy and bewilderment, his attention to detail is uncompromised. David’s contributions to the Iconfactory can most publicly be seen in icon and title art he created for the Frenzic iPhone/Mac game and the Twitterrific application.</p>
<p>I’ve included one of his vector pieces, Samurai Monkey, above. On his site Lanham writes, “Most of my work is made to be fun and enjoyable, which works out well since I have a really good time creating it.” And that simply is what good design is all about. Making magic and having a fun time doing it!</p>
<p>To view more of David Lanham’s art, <a href=”http://www.dlanham.com/” onclick="window.open(this.href); return false;">visit his Web site at www.dlanham.com</a>. You can also <a href=”http://www.twitter.com/dlanham/” onclick="window.open(this.href); return false;">follow him on Twitter at dlanham</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/www.sinceriously.com/p=209</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crossword Web App, Part 5</title>
		<link>http://www.sinceriously.com/2009/03/crossword-web-app-part-5/</link>
		<comments>http://www.sinceriously.com/2009/03/crossword-web-app-part-5/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 21:33:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Game Designment]]></category>
		<category><![CDATA[crossword]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web app]]></category>

		<guid isPermaLink="false">http://www.sinceriously.com/?p=196</guid>
		<description><![CDATA[When I first started developing this crossword tutorial, I wanted the end game to access USA Today’s crossword XML feed directly and offer a new game each day. Sadly, their feed is secured. Although I can track it down, view its source in a Web browser, save to a local file and upload to my [...]]]></description>
			<content:encoded><![CDATA[<p>When I first started developing this crossword tutorial, I wanted the end game to access USA Today’s crossword XML feed directly and offer a new game each day. Sadly, their feed is secured. Although I can track it down, view its source in a Web browser, save to a local file and upload to my server, I cannot get my code to access the file directly from their server. Keep that in mind when we reach the end of this tutorial. You’ll be able to play one completed game, but don’t get too attached. There’s not much replayability.</p>
<h1>Part 5: Importing From XML</h1>
<p></p>
<p>Most programs, including games, require data. More often than not this data must be updated regularly so as to sustain the usefulness of the application. This type of data is usually stored externally (out of the application&#8217;s main code) since it makes very little sense to require the application&#8217;s user to download a new version of the program every day in order to receive the latest and greatest data. Therefore, with respect to our game, it makes a great deal of sense to store the data for each crossword puzzle in an external XML file. This way each puzzle can easily be loaded individually by referencing a different XML file.</p>
<p><span id="more-196"></span></p>
<p>To import data from an XML file, we use the XMLHttpRequest Javascript object as follows.</p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout">var url = 'xml/070814.xml';</code><code class="code-breakout">var xmlhttp = new XMLHttpRequest(); </code><code class="code-breakout">&nbsp;</code><code class="code-breakout">if (xmlhttp != null) {</code><code class="code-breakout" style="margin-left:18px;">xmlhttp.onreadystatechange = stateChange;</code><code class="code-breakout" style="margin-left:18px;">xmlhttp.open('GET', url, true);</code><code class="code-breakout" style="margin-left:18px;">xmlhttp.send(null);</code><code class="code-breakout">} else {</code><code class="code-breakout" style="margin-left:18px;">alert('Your browser does not support XMLHTTP.'); }</code><code class="code-breakout">}</code><code class="code-breakout">&nbsp;</code><code class="code-breakout">function stateChange() {</code><code class="code-breakout" style="margin-left:18px;">if (xmlhttp.readyState == 4) {</code><code class="code-breakout" style="margin-left:36px;">if (xmlhttp.status == 200) {</code><code class="code-breakout" style="margin-left:54px;">/*</code><code class="code-breakout" style="margin-left:54px;">A status of 200 means that the XML file was</code><code class="code-breakout" style="margin-left:54px;">loaded and parsed without error. At this point</code><code class="code-breakout" style="margin-left:54px;">you'll want to sort through all of the data so</code><code class="code-breakout" style="margin-left:54px;">that it can be used by your program. I'll give</code><code class="code-breakout" style="margin-left:54px;">you some tips on how to do this in the next</code><code class="code-breakout" style="margin-left:54px;">update.</code><code class="code-breakout" style="margin-left:54px;">*/</code><code class="code-breakout" style="margin-left:36px;">} else {</code><code class="code-breakout" style="margin-left:54px;">alert('Problem retrieving XML data.');</code><code class="code-breakout" style="margin-left:36px;">}</code><code class="code-breakout" style="margin-left:18px;">}</code><code class="code-breakout">}</code></div>
<p><span>Figure 1. Using XMLHttpRequest to load and read an XML file</span></div>
<p></p>
<p>We&#8217;ll talk more about reading from XML files in the next update.</p>
<p><strong>&mdash;Ryan</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/www.sinceriously.com/p=196</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Favicon!</title>
		<link>http://www.sinceriously.com/2009/03/favicon/</link>
		<comments>http://www.sinceriously.com/2009/03/favicon/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 20:32:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[favicon]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.sinceriously.com/?p=183</guid>
		<description><![CDATA[No, it&#8217;s not the latest and greatest place to meet Sailor Moon-costumed babes and stuff bag after Watchmen-themed bag with useless, but free, tchotchkes. Favicons are the neat little Web site icons that appear in the address bar of your browser, and I finally got around to creating one. Pretty, isn&#8217;t it? Did you know [...]]]></description>
			<content:encoded><![CDATA[<p>No, it&#8217;s not the latest and greatest place to meet Sailor Moon-costumed babes and stuff bag after Watchmen-themed bag with useless, but free, tchotchkes. <em><a href="http://en.wikipedia.org/wiki/Favicon">Favicons</a></em> are the neat little Web site icons that appear in the address bar of your browser, and I finally got around to creating one.</p>
<p>Pretty, isn&#8217;t it? Did you know that Microsoft pioneered <em>favicons</em> in the release of Internet Explorer 5 as a way to spice up dreary bookmark menus? This was back when Microsoft actually contributed to the forward momentum of positive Internet change instead of holding it back. It wasn&#8217;t until later that <em>favicons</em> were incorporated into browsers&#8217; address bars.</p>
<p>Most people know the purpose of a <em>favicon</em> and even understand how to implement one. Still, there are some unique things to keep in mind when generating the image itself.</p>
<p><span id="more-183"></span></p>
<p>A <em>favicon</em> should be appropriately sized at 16&#215;16 pixels. You can design them to be larger, but most Web browsers are going to scale them back down to 16&#215;16 (or smaller), so test your image to ensure it will still appear acceptably if scaled.</p>
<p>When originally introduced, Web designers were required to name their icon <code>favicon.ico</code> (thus the name) and place it in the root directory of their Web site. Internet Explorer 5 would then instinctually find the icon and use the image. Today&#8217;s browsers provided a little more flexibility by allowing you to specify a path for the file and an image format. Simply place a <code>&lt;link rel="icon" type="image/png" href="/path/image.png" /&gt;</code> tag in the <code>&lt;head&gt;</code> of your page.</p>
<p>However, later versions of Microsoft Internet Explorer only truly support icons that have a legitimate <code>.ico</code> extension and that are exported in the icon file format. Many designers have changed their preferred image&#8217;s extension to <code>.ico</code> without first actually converting them to Microsoft Icon Files. This creates a conflict that Microsoft Internet Explorer cannot resolve; such icon images will not be displayed.</p>
<p>So how do you create an <code>.ico</code> file? <a href="http://www.favicon.cc/">Well, I used favicon.cc</a>. Go to the site, upload your image, generate a <code>favicon.ico</code> file and upload it to the root directory of your Web site. Easy as pie. The site even provides a preview of what the image will look like in an address bar, which is very convenient indeed.</p>
<p><strong>&mdash;Ryan</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/www.sinceriously.com/p=183</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crossword Web App, Part 4</title>
		<link>http://www.sinceriously.com/2009/03/crossword-web-app-part-4/</link>
		<comments>http://www.sinceriously.com/2009/03/crossword-web-app-part-4/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 21:35:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Game Designment]]></category>
		<category><![CDATA[crossword]]></category>
		<category><![CDATA[css sprites]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[preload images]]></category>
		<category><![CDATA[uri kitchen]]></category>
		<category><![CDATA[web app]]></category>

		<guid isPermaLink="false">http://www.sinceriously.com/?p=169</guid>
		<description><![CDATA[Unlike desktop applications, or native iPhone apps, whose code is pre-compiled with assets prepped and readily available in nearby bundles, Web apps are burdened with the task of downloading their assets (HTML, CSS, images, scripts, etc) in real time, as a user is attempting to interact with the app. In this context I&#8217;m referring to [...]]]></description>
			<content:encoded><![CDATA[<p><span>Unlike desktop applications, or native iPhone apps, whose code is pre-compiled with assets prepped and readily available in nearby bundles, Web apps are burdened with the task of downloading their assets (HTML, CSS, images, scripts, etc) in real time, as a user is attempting to interact with the app.</span> <span class="note">In this context I&#8217;m referring to a Web site as an &#8220;app&#8221; since so many of today&#8217;s Web 2.0 sites are robust enough to be considered applications. Also, Apple has often referred to iPhone Web sites as Web apps.</span> <span>HTML, CSS and scripts are generally low weight files, a couple of kilobytes a piece (some are larger, but most aren&#8217;t) and can be downloaded quickly. Images, on the other hand, can be very large&mdash;upwards of 100K in some instances. Downloading large images can be time consuming, especially on mobile devices, therefore you can improve your application&#8217;s user experience by downloading images ahead of time.</span></p>
<p>This part of the tutorial is actually not going to explain proper procedures for preloading images. There are a number of methods available, all of which can be found by doing a simple <a href="http://www.google.com/search?client=safari&#038;rls=en-us&#038;q=preload+images&#038;ie=UTF-8&#038;oe=UTF-8" onclick="window.open(this.href); return false;">Google search for &#8220;preload images&#8221;</a>. This article will instead concentrate on ways to reduce the necessity of preloading altogether by means of self-contained data and CSS Sprites.</p>
<p>I&#8217;ll start off by briefing explaining the importance of CSS Sprites (since Part 4 below will explain how to use self-contained data). <a href="http://www.alistapart.com/articles/sprites" onclick="window.open(this.href); return false;">An in-depth discussion of CSS Sprites can be read on A List Apart.</a> In a nutshell, a sprite map is a collection of smaller images mapped onto one large image. By combining images, you will reduce server requests and speed up download times. CSS Sprites especially come in handy when dealing with hovers.</p>
<p><span id="more-169"></span></p>
<p>Without sprites, displaying a different image for the hover state of an element requires making an extra call to the server for the new asset. This results in another download (at the time of mouseover), which can take time and create jerky mouseover experiences (especially in Internet Explorer). If a sprite map is used instead, the sprite can be setup to contain images for both the default state as well as the hover state. The sprite is downloaded as the page loads (if the element which will use the sprite is initially embedded on the page), and voil&aacute;, the hover state is downloaded with it and ready for use.</p>
<p>I&#8217;ve used sprites a couple of times on this site. To demonstrate how easy they are to use, let&#8217;s take a look at the &#8220;press&#8221; button at the bottom of the page.</p>
<div class="illustration"><img src="http://www.sinceriously.com/wp-content/themes/FREEmium/post-img/sprite_example.gif" alt="Example sprite image" width="286" height="106" /><span>Figure 1. Example sprite image</span><br />&nbsp;</div>
<p></p>
<p>The sprite is illustrated above. <span class="note">The actual image is a PNG and contains elements which would be hard to decipher on a light grey background. The turquoise box was added to make things more viewable.</span> Using an anchor tag as a button, we can crop out the backgrounds we need for the default and hover states using the following CSS.</p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout">#press { background:url("img/press.png"); width:50px; height:50px; display:block; text-indent:-200em; overflow:hidden; }</code><code class="code-breakout">#press:hover { background-position:0 -50px; }</code></div>
<p><span>Figure 2. &#8220;Press&#8221; Button CSS</span></div>
<p></p>
<p><em>Background, width and height styles:</em> Because we are cropping the button to a width and height of 50 pixels, it is not necessary to specify a background position for the default state. Why? The default background appears at the top of our sprite. So as long as we assign a width and height that are the exact dimensions of the default background, the remainder of the background will extended past the boundaries of the button and will not be seen.</p>
<p><em>Display style:</em> By default, anchor tags display inline, so in order to represent the anchor as a button (and specify things like width and height), we need to force the anchor to display as a block element.</p>
<p><em>Text-indent and overflow styles:</em> If, in your markup, you include text within the anchor tag (for example: <code>&lt;a id="press" href="javascript:void(0)" onclick="dropBlock()"&gt;Press&lt;/a&gt;</code>), you can hide the text by assigning a negative text indent and hiding overflow.</p>
<p><em>The hover state:</em> Now, all we need to do in order to fire up the hover state of the button is offset the top background position of the background enough so that the hover image is used instead of the default image. In this case, we need to offset by 50 pixels. <span class="note">When a sprite map only includes two image states, the offset can be either positive or negative. Both will achieve the same result. When dealing with sprites with three or more states, I recommend strictly using negative values. You&#8217;ll understand why as you experiment more with sprites.</span></p>
<p>And that&#8217;s CSS Sprites in a nutshell. Now on to the actual Part 4 update where I&#8217;ll discuss self-contained data.</p>
<h1>Part 4: &#8216;Preloading&#8217; Commonly Used Game Assets</h1>
<p></p>
<p>If you&#8217;ve ever used Dreamweaver, you&#8217;re probably familiar with the code that&#8217;s used to preload images:</p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout previous-code">function simplePreload() {</code><code class="code-breakout previous-code" style="margin-left:18px;">var args = simplePreload.arguments;</code><code class="code-breakout previous-code" style="margin-left:18px;">document.imageArray = new Array(args.length);</code><code class="code-breakout previous-code" style="margin-left:18px;">for (var i = 0; i < args.length; i++) {</code></code><code class="code-breakout" style="margin-left:36px;">document.imageArray[i] = new Image;</code><code class="code-breakout previous-code" style="margin-left:36px;">document.imageArray[i].src = args[i];</code><code class="code-breakout previous-code" style="margin-left:18px;">}</code><code class="code-breakout previous-code">}</code></div>
<p><span>Figure 3. Dreamweaver preload script</span></div>
<p></p>
<p>Look at the highlighted line. In Javascript you can create Image objects. By doing so, you can store images in the DOM&#8217;s (Document Object Model) memory and quickly access them later. But preloading images in this fashion still requires an HTTP call out to the image so that it can be downloaded. When designing games for the iPhone, we want to limit the number of HTTP requests as much as possible. There&#8217;s actually a way to embed some of your images in your Javascript file so that there&#8217;s no need to download them.</p>
<p>If you&#8217;ve ever tried to open a GIF or JPEG in a text editor you&#8217;ll notice that the guts of the image are a bunch of letters, numbers and symbols. There&#8217;s a free program online, called the URI Kitchen that will read an image and print out the letter/number/symbol/gremlin guts for you.</p>
<p>To use the program, go to <a href="http://software.hixie.ch/utilities/cgi/data/data" onclick="window.open(this.href); return false;">URI Kitchen</a>, upload a file and then copy the resulting data from the address bar. Here&#8217;s the data I get when feeding the program a graphic of the number 5 (one of the numbers used to mark the crossword grid):</p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout">data:image/gif;base64,R0lGODlhAwAFAIAAAP%2F%2F%2F39%2FfyH5B AAAAAAALAAAAAADAAUAAAIFjANgqVsAOw%3D%3D</code></div>
<p><span>Figure 4. URI Kitchen image data</span></div>
<p></p>
<p>Pretty, huh? Now, take that data, and use it as follows:</p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout">var five = new Image();</code><code class="code-breakout">five.src = 'data:image/gif;base64,R0lGODlhAwAFAIAAAP%2F%2F%2F39%2FfyH5B AAAAAAALAAAAAADAAUAAAIFjANgqVsAOw%3D%3D'; </code></div>
<p><span>Figure 5. Using self-contained data to generate an image</span></div>
<p></p>
<p>I can now access <code>five</code> anytime I want to load that image in my game, and since it&#8217;s embedded in the code there&#8217;s no need to run off to the Internet to fetch it. I can draw the image to the canvas (at coordinate 100, 50) like this: <code>ctx.drawImage(questionMark, 100, 50)</code>.</p>
<p>Now, you won&#8217;t want to use this approach for every image in your game. You&#8217;ll still have to elegantly handle load times for large images. But this approach works great for smaller, commonly used images. What are the most commonly used assets in a crossword puzzle? The numbers used to label the grid, and the letters that will spell out each word. And those are the exact images that we&#8217;ll &#8220;preload&#8221; into Javascript using this method.</p>
<p>And this has officially been the longest blog post I&#8217;ve ever written. I hope you&#8217;ve enjoyed it!</p>
<p><strong>&mdash;Ryan</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/www.sinceriously.com/p=169</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Noby Noby Boy Shirts</title>
		<link>http://www.sinceriously.com/2009/03/noby-noby-boy-shirts/</link>
		<comments>http://www.sinceriously.com/2009/03/noby-noby-boy-shirts/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 18:02:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[designment]]></category>
		<category><![CDATA[noby]]></category>
		<category><![CDATA[panic]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.sinceriously.com/?p=165</guid>
		<description><![CDATA[It&#8217;s been a couple of days since my last post and though I plan to update with part four of the crossword feature later today I thought I&#8217;d bring attention to these t-shirts I found on Panic&#8217;s site. The Noby shirts are the first eight at the top of the page. I love them. In [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a couple of days since my last post and though I plan to update with part four of the crossword feature later today I thought I&#8217;d bring attention to these <a href="http://www.panic.com/goods/" onclick="window.open(this.href); return false;">t-shirts I found on Panic&#8217;s site</a>. The Noby shirts are the first eight at the top of the page. I love them. In fact I love most crazy Japanese nonsense. Anyway, take a look and enjoy.</p>
<p><img src="/wp-content/themes/FREEmium/post-img/nobu.gif" width="160" height="160" style="display:block; margin:0 auto;" alt="Noby Noby Boy Shirts" /></p>
<p>Also, if you use Twitter and would like to be updated whenever I post something new, please follow <a href="http://twitter.com/designment">designment</a>. I wanted &#8220;sinceriously,&#8221; but it was taken&#8230; by someone who doesn&#8217;t even use it. Hate. Anyway, happy Friday!</p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/www.sinceriously.com/p=165</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crossword Web App, Part 3</title>
		<link>http://www.sinceriously.com/2009/03/crossword-web-app-part-3/</link>
		<comments>http://www.sinceriously.com/2009/03/crossword-web-app-part-3/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 05:15:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Game Designment]]></category>
		<category><![CDATA[crossword]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[web app]]></category>

		<guid isPermaLink="false">http://www.sinceriously.com/?p=120</guid>
		<description><![CDATA[This part of the tutorial makes mention of the canvas tag. When Mac OS X 10.4 was released, Safari began supporting a new feature called the canvas. The canvas (refered to as CSS Canvas on the Safari 4 features page) provides a method for drawing arbitrary content in a Web page. This extension lets you [...]]]></description>
			<content:encoded><![CDATA[<p>This part of the tutorial makes mention of the <code>canvas</code> tag. When Mac OS X 10.4 was released, Safari began supporting a new feature called the canvas. The canvas (refered to as CSS Canvas on the <a href="http://www.apple.com/safari/features.html" onclick="window.open(this.href); return false;">Safari 4 features page</a>) provides a method for drawing arbitrary content in a Web page. This extension lets you reserve an area of your web page or widget and use rendering calls like those found in Quartz (or ActionScript) to paint complex paths and shapes in that area. CSS Canvas was heavily utilized by the initial offering of Dashboard widgets released by Apple.</p>
<p>Safari, Firefox, Dashboard, and all other <a href="http://webkit.org/" onclick="window.open(this.href); return false;">WebKit</a>-based applications, including Safari for the iPhone, support CSS Canvas. There&#8217;s even <a href="http://www.geeksmack.net/microsoft/106-rumor-ie-9-to-use-webkit.html" onclick="window.open(this.href); return false;">rumor that Internet Explorer 9 will use WebKit</a>, allowing it access to CSS Canvas as well. So it really makes a lot of sense to start learning how to use CSS Canvas now, so that you can build really cool Web sites that take advantage of it later.</p>
<h1>Part 3: Jumping Into Code</h1>
<p></p>
<p>Let&#8217;s start programming this game. The <code>canvas</code> tag, supported by Firefox and Safari, is a really great way to draw to (or animate) a Web page. Since the iPhone <a href="http://www.macrumors.com/2008/02/11/adobe-flash-support-for-iphone-coming-alongside-sdk/" onclick="window.open(this.href); return false;">does not yet support Flash</a>, utilizing the canvas makes a lot of sense. Since more qualified people than ! have already written great tutorials on <a href="http://developer.mozilla.org/en/docs/Canvas_tutorial" onclick="window.open(this.href); return false;">how to use the canvas</a>, it may behoove you to read up a bit if you become confused with what follows.</p>
<p><span id="more-120"></span></p>
<p>Let&#8217;s code the grid. There are two ways we can display it. We can use the canvas to draw the grid. Or we can create 225 17&#215;17 pixel <strong>div</strong> elements and float them all to the left within a 270&#215;270 pixel parent <strong>div</strong>. The first option sounds easier, but we&#8217;re actually going to do a little of both.</p>
<p><span class="note"><strong>Note:</strong> Yesterday&#8217;s illustration stated that the grid takes up 271&#215;271 pixels, yet we mention here that the outer <strong>div</strong> that holds all of the inner squares is 270&#215;270 pixels. This is because the inner squares do not include the outer stroke that surrounds the grid. The outer stroke (and all inner grid lines) are part of the background image. The inner squares have a 1px left margin to separate them from one another, so: (1+17)*15 = 270.</span></p>
<p>First we&#8217;ll use the canvas to draw the visual part of the grid. Here is some simplified code:</p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout">&lt;div id="squares"&gt;&lt;/div&gt;</code><code class="code-breakout">&lt;canvas id="crossword" width="269" height="269"&gt;&lt;/canvas&gt;</code></div>
<p><span>Figure 1. Simplified CSS Canvas implementation</span></div>
<p></p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout">var ctx = document.getElementById('crossword').getContext('2d');</code><code class="code-breakout">ctx.fillStyle = '#ffffff';</code><code class="code-breakout">for (var i = 0; i < 225; i++) {</code></code><code class="code-breakout" style="margin-left:18px;">ctx.fillRect((i-Math.floor(i/15)*15)*18, Math.floor(i/15)*18, 17, 17);</code><code class="code-breakout">}</code></div>
<p><span>Figure 2. JavaScript to draw the grid to the canvas</span></div>
<p></p>
<p>The code above will simply draw out 225 white squares, positioned exactly where we want them on the grid. It does not yet determine which squares should be black (the regions of the grid that are not part of the puzzle). We&#8217;re ultimately going to read from an XML file to understand which squares are white and which are black. We&#8217;ll get to that later.</p>
<p>The user will be interacting with the grid in order to read and solve clues, so we also need a separate clickable region for each of the 225 inner squares. Let&#8217;s add that logic to the for loop.</p>
<div class="illustration">
<div class="code-wrap"><code class="code-breakout previous-code">for (var i = 0; i < 225; i++) {</code></code><code class="code-breakout previous-code" style="margin-left:18px;">ctx.fillRect((i-Math.floor(i/15)*15)*18, Math.floor(i/15)*18, 17, 17);</code><code class="code-breakout" style="margin-left:18px;">var newSquare = document.createElement('div');</code><code class="code-breakout" style="margin-left:18px;">document.getElementById('squares').appendChild(newSquare);</code><code class="code-breakout" style="margin-left:18px;">newSquare.className = 'square';</code><code class="code-breakout" style="margin-left:18px;">newSquare.id = i;</code><code class="code-breakout" style="margin-left:18px;">newSquare.name = i;</code><code class="code-breakout" style="margin-left:18px;">newSquare.onclick = function() {</code><code class="code-breakout" style="margin-left:36px;">// code to execute onclick</code><code class="code-breakout" style="margin-left:18px;">};</code><code class="code-breakout previous-code">}</code></div>
<p><span>Figure 3. JavaScript to create clickable (touchable) squares for the grid</span></div>
<p></p>
<p>We&#8217;ve given each &#8220;touchable&#8221; <strong>div</strong> an <em>id</em> and <em>name</em> so that, when touched, we can figure out which clues they belong to. More on that later.</p>
<p>For today, that is all. Tomorrow I&#8217;ll provide a neat trick for embedding images directly into a Web page. It&#8217;s a great way to &#8220;preload&#8221; images. Very cool indeed.</p>
<p><strong>&mdash;Ryan</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/www.sinceriously.com/p=120</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Crossword Web App, Part 2</title>
		<link>http://www.sinceriously.com/2009/03/crossword-web-app-part-2/</link>
		<comments>http://www.sinceriously.com/2009/03/crossword-web-app-part-2/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 06:23:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Game Designment]]></category>
		<category><![CDATA[crossword]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[web app]]></category>

		<guid isPermaLink="false">http://www.sinceriously.com/?p=110</guid>
		<description><![CDATA[When I originally posted part two of this tutorial last year, I prefaced it with news of an &#8220;imminent&#8221; release of Adobe&#8217;s Flash for the iPhone. Well, a year has passed and still no Flash. Around a month ago, MacRumors announced a collaboration with Adobe and Apple on a Flash solution, but I&#8217;ve since read [...]]]></description>
			<content:encoded><![CDATA[<p>When I originally posted part two of this tutorial last year, I prefaced it with news of an &#8220;imminent&#8221; release of Adobe&#8217;s Flash for the iPhone. Well, a year has passed and still no Flash. Around a month ago, MacRumors announced <a href="http://www.macrumors.com/2009/01/31/adobe-and-apple-working-on-flash-for-iphone/" onclick="window.open(this.href); return false;">a collaboration with Adobe and Apple on a Flash solution</a>, but I&#8217;ve since read that business negotiations are delaying that initiative. So we&#8217;re still a no go.</p>
<p>I mention Flash because it would seem that the inclusion of the plug-in would open the door to many established and seasoned Flash developers who are not savvy with HTML/CSS/JavaScript or Objective-C (for SDK development). But with the <a href="http://www.macrumors.com/2009/02/06/css-animation-coming-to-safari-already-in-iphone-less-dependence-on-flash/" onclick="window.open(this.href); return false;">introduction of CSS animation</a>, which the iPhone (and now Safari 4 beta) already support, creating visually intriguing web user interfaces (for games or other web apps) is more plausible than ever before, even without Flash.</p>
<p>It may not seem realistic to create iPhone web app <strong>games</strong> anymore, since the release of the SDK over a year ago, but iPhone Web designers and developers can still strive to create visually impressive web experiences. And some of these tips may help towards that cause.</p>
<h1>Part 2: Design Considerations</h1>
<p></p>
<p>When designing web app games for the iPhone keep in mind that although the screen&#8217;s resolution is 320&#215;480 pixels, some of the vertical pixels are lost to the status bar, address bar and lower toolbar&#8230; 64 pixels to be exact. So, if you want your entire game to display &#8220;above the fold,&#8221; design it to be 320&#215;416 pixels. (Above the fold is a reference web designers throw around a lot to appear cool. It refers to the topmost part of a Web page. The area that is initially viewable. The content that shows up as you scroll down the page is &#8220;below the fold.&#8221;)</p>
<p><span id="more-110"></span></p>
<div class="illustration"><img src="http://www.sinceriously.com/wp-content/themes/FREEmium/post-img/crossword_illo2.gif" alt="Crossword puzzle user interface components" width="426" height="451" /><span>Figure 1. Crossword puzzle user interface components</span><br />&nbsp;</div>
<p></p>
<p>If you look at a printed crossword puzzle you&#8217;ll notice that the game consists of two main parts: the grid, and the &#8220;across&#8221; and &#8220;down&#8221; clues. Both take up a lot of real estate. So how do we fit everything onto the iPhone screen?</p>
<p>First let&#8217;s discuss the grid (or board, whatever you&#8217;d like to call it). The squares that make up the grid need to be small enough so that a 15&#215;15 matrix will fit within the design. They also need to be large enough so that even a person with “fat fingers” can press a single square. After mocking up a number of grid sizes I realized that although I could theoretically size each individual square at 19&#215;19 pixels and still fit all 225 (15 rows x 15 columns) on the screen, I didn&#8217;t have much room for anything else. So I settled on 17&#215;17. This means that we loose 271&#215;271 pixels to the grid.</p>
<p>Since a title also accompanies each puzzle, very little room is left for the clues. It will be impossible to display them all at once, so instead let&#8217;s display relevant clues when the user clicks on a particular row/column. We&#8217;ll talk about how this is going to work later.</p>
<p>That&#8217;s all for today. We’ll start coding tomorrow.</p>
<p><strong>&mdash;Ryan</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://js-kit.com/rss/www.sinceriously.com/p=110</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
