<?xml version="1.0" encoding="ISO-8859-1"?>
<rdf:RDF
	xmlns="http://purl.org/rss/1.0/"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel rdf:about="http://feeds.garagegames.com/rss/blogs/developer/22782/">
		<title>Blog for Mark McCoy at GarageGames.com</title>
		<description>Blog feeds for Gamers and Developers in the GarageGames community.</description>
		<link>http://www.garagegames.com/</link>
		<image rdf:resource="http://www.garagegames.com/images/GarageGames_logo_small_w.gif" />
		<dc:date>2008-11-22T04:27:21+00:00</dc:date>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/22782/11527"/>
				<rdf:li rdf:resource="http://www.garagegames.com/blogs/22782/10671"/>
			</rdf:Seq>
		</items>
	</channel>
	<item rdf:about="http://www.garagegames.com/blogs/22782/11527">
		<dc:format>text/html</dc:format>
		<dc:date>2006-11-01T22:56:29+00:00</dc:date>
		<dc:creator>Mark McCoy</dc:creator>
		<title>Laying out celled sprites &amp;amp; Photoshop automation</title>
		<link>http://www.garagegames.com/blogs/22782/11527</link>
		<description>Lately I've been making sprites from 3d renders. The brutal bottleneck in this process has been getting my directory full of rendered files all laid out into a sheet of celled sprites.&lt;br&gt;&lt;br&gt;So last night I did some tinkering with Photoshop's javascript interface.&lt;br&gt;&lt;br&gt;The idea was to take a Photoshop file that has all the sprite cells as layers and convert it into a sprite sheet. Like so:&lt;br&gt;&lt;br&gt;&lt;img src='http://ezupa.com/gg/layerstosprites.jpg'  alt=&quot;&quot;&gt;&lt;br&gt;&lt;br&gt;The initial layered file can be easily made using ImageReady's &amp;quot;Import folder as frames&amp;quot; menu option. Move back into PS (crop the file if needed) run the script and you have yourself a celled animated sprite.&lt;br&gt;&lt;br&gt;Set the number of columns at the top of the script with the 'cols' variable. (Currently set to 5.) The script figures out the rest (based on the current size of the canvas). Bonus points to anyone who wants to script a little UI to allow user input. &lt;br&gt;&lt;br&gt;Install it in on your machine in C:\Program Files\Adobe\Photoshop\Presets\Scripts\layersToSprite.js&lt;br&gt;In Photoshop run it by going to File &amp;gt; Automate &amp;gt; Scripts: layersToSprite.js&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='codeblock'&gt;&lt;pre&gt;    // Put this file in Program Files\Adobe\Photoshop\Presets\Scripts\layersToSprite.js&lt;br&gt;    // Run in PhotoShop: File &amp;gt; Automate &amp;gt; Scripts: layersToSprite.js&lt;br&gt;&lt;br&gt;    // Arrange layers into a sprite sheet.&lt;br&gt;&lt;br&gt;    if (documents.length &amp;gt; 0)&lt;br&gt;    {&lt;br&gt;        var cols = 5;&lt;br&gt;       &lt;br&gt;        // --------------------------&lt;br&gt;        docRef = activeDocument;   &lt;br&gt;        var activeLayer = docRef.activeLayer;&lt;br&gt;&lt;br&gt;        numLayers = docRef.artLayers.length;    &lt;br&gt;       &lt;br&gt;        var rows = Math.ceil(numLayers/cols);&lt;br&gt;       &lt;br&gt;         var spriteX = docRef.width;&lt;br&gt;         var spriteY = docRef.height;   &lt;br&gt;       &lt;br&gt;        // put things in order&lt;br&gt;        app.preferences.rulerUnits = Units.PIXELS;&lt;br&gt;       &lt;br&gt;        // resize the canvas&lt;br&gt;         newX = spriteX * cols;&lt;br&gt;         newY = spriteY * rows;&lt;br&gt;        &lt;br&gt;         docRef.resizeCanvas( newX, newY, AnchorPosition.TOPLEFT );&lt;br&gt;             &lt;br&gt;        // move the layers around&lt;br&gt;         var rowi = 0;&lt;br&gt;         var coli = 0;&lt;br&gt;        &lt;br&gt;         for (i=(numLayers - 1); i &amp;gt;= 0; i--)&lt;br&gt;         {    &lt;br&gt;             docRef.artLayers[i].visible = 1;&lt;br&gt;            &lt;br&gt;              var movX = spriteX*coli;&lt;br&gt;              var movY = spriteY*rowi;&lt;br&gt;             &lt;br&gt;             docRef.artLayers[i].translate(movX, movY);&lt;br&gt;            &lt;br&gt;             coli++;&lt;br&gt;             if (coli &amp;gt; (cols - 1))&lt;br&gt;             {&lt;br&gt;                 rowi++;&lt;br&gt;                 coli = 0;&lt;br&gt;             }&lt;br&gt;         }&lt;br&gt;    }&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;This script assumes that the only layers you have in the file are sprites, and that all sprites will be the same size. Also I assume that the bottom layer is the first cell and the top layer is the last cell. &lt;br&gt;&lt;br&gt;It's not the most robust tool in the world but it'll save me some time, so I thought I'd share. For those who just want a zip file, it can be found here: &lt;a href='http://ezupa.com/gg/layersToSpirte.zip' target=_blank&gt;layersToSpirte.zip&lt;/a&gt;&lt;br&gt;&lt;br&gt;Will work with CS, may work with 7 if you have the scripting plugin installed. &lt;br&gt;&lt;br&gt;Feel free to modify, expand and share any improvements (or alternative tools).</description>
	</item>
	<item rdf:about="http://www.garagegames.com/blogs/22782/10671">
		<dc:format>text/html</dc:format>
		<dc:date>2006-06-09T23:37:01+00:00</dc:date>
		<dc:creator>Mark McCoy</dc:creator>
		<title>RIP: Eric Elwell 2005 - 2006. We hardly knew you...</title>
		<link>http://www.garagegames.com/blogs/22782/10671</link>
		<description>&lt;img src='http://ezupa.com/gg/EricWorkingHard.gif'  alt=&quot;&quot;&gt;&lt;img src='http://ezupa.com/gg/spacer15px.gif'  alt=&quot;&quot;&gt;&lt;img src='http://ezupa.com/gg/eric_tattoo_small.jpg'  alt=&quot;&quot;&gt;&lt;img src='http://ezupa.com/gg/spacer15px.gif'  alt=&quot;&quot;&gt;&lt;img src='http://ezupa.com/gg/TimAsteOrbzMiniGame2.gif'  alt=&quot;&quot;&gt;&lt;img src='http://ezupa.com/gg/spacer15px.gif'  alt=&quot;&quot;&gt;&lt;img src='http://ezupa.com/gg/patriotic_chick_small.jpg'  alt=&quot;&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Eric Elwell: Intern, artist, friend. Rest in peace buddy. We hope you have gone on to a better place. &lt;br&gt;&lt;br&gt;Captions for above from left to right: &lt;br&gt;&lt;br&gt;1. Eric hard at work getting the Mighty Fist demo ready for GDC. &lt;br&gt;&lt;br&gt;2. Eric shows his love for Marble Blast Ultra. &lt;br&gt;&lt;br&gt;3. Eric and fellow intern Anthony Fullmer play the 'Tim Aste Orbz mini game.' The innovative game play involves the player scrolling through the high-score list and trying to get it to come to rest on score #37: TIM. As in Tim from Tim Aste's content packs. Part game, part performance art, the sounds effects for the game are performed live. &lt;br&gt;&lt;br&gt;4. A random picture from the GG whiteboards. &lt;br&gt;&lt;br&gt;Pictured below: The memorial set up in Eric's honor as seen above the desk where he once sat while creating a mix of game ready art assets and random comments. Not pictured: The memorial of the unknown intern and the eternal flame set up in honor of Eric and all the other interns that have moved on to the big contracting gig in the sky. &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;img src='http://ezupa.com/gg/eric_portrait.jpg'  alt=&quot;&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Eric Elwell, Intern: 2005 - 2006.</description>
	</item>
</rdf:RDF>
