<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2397030648163954548</id><updated>2011-07-07T20:28:50.583-07:00</updated><title type='text'>Michael Forrest Code Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://michaelforrest-code.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2397030648163954548/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://michaelforrest-code.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Michael Forrest</name><uri>http://www.blogger.com/profile/02119796434211161732</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2397030648163954548.post-6968002488694316605</id><published>2009-08-25T09:55:00.000-07:00</published><updated>2009-08-25T09:57:19.132-07:00</updated><title type='text'>Skynet?</title><content type='html'>&lt;script src='http://pastie.org/594309.js'&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2397030648163954548-6968002488694316605?l=michaelforrest-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://michaelforrest-code.blogspot.com/feeds/6968002488694316605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://michaelforrest-code.blogspot.com/2009/08/do-not-run-this-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2397030648163954548/posts/default/6968002488694316605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2397030648163954548/posts/default/6968002488694316605'/><link rel='alternate' type='text/html' href='http://michaelforrest-code.blogspot.com/2009/08/do-not-run-this-code.html' title='Skynet?'/><author><name>Michael Forrest</name><uri>http://www.blogger.com/profile/02119796434211161732</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2397030648163954548.post-4475740574778255135</id><published>2009-03-27T04:16:00.001-07:00</published><updated>2009-03-27T04:16:40.614-07:00</updated><title type='text'>Naming Conventions and Asset Management from Photoshop via Ruby into Flash</title><content type='html'>When I was creating assets for my &lt;a href="http://grimaceworks.com/mf/bread_bin"&gt;Bread Bin game&lt;/a&gt; I made sure to name things usefully at the earliest possible stage.&lt;br /&gt;&lt;br /&gt;So here's how my PSD looked:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_1ShqMKRrc0M/ScyqLTN7U6I/AAAAAAAAAA8/YsW0mUZJ8hM/s1600-h/Picture+12.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 294px;" src="http://3.bp.blogspot.com/_1ShqMKRrc0M/ScyqLTN7U6I/AAAAAAAAAA8/YsW0mUZJ8hM/s320/Picture+12.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5317812371131683746" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This allowed me to use Photoshop's "Export Layers to Files..." script to create a folder of images in my (sprouts-based) Flash project's assets folder.&lt;br /&gt;&lt;br /&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1ShqMKRrc0M/ScyrUCAGzdI/AAAAAAAAABE/61KmCXaWslE/s1600-h/Export+Layers.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 304px; height: 320px;" src="http://1.bp.blogspot.com/_1ShqMKRrc0M/ScyrUCAGzdI/AAAAAAAAABE/61KmCXaWslE/s320/Export+Layers.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5317813620640763346" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1ShqMKRrc0M/Scyrjp-kLmI/AAAAAAAAABM/J78mqRY7M0M/s1600-h/Picture+15.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 310px;" src="http://1.bp.blogspot.com/_1ShqMKRrc0M/Scyrjp-kLmI/AAAAAAAAABM/J78mqRY7M0M/s320/Picture+15.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5317813889069756002" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Note that when exporting to PNG files, the layers can be automatically trimmed, resulting in a folder like this:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_1ShqMKRrc0M/ScysRqxM0FI/AAAAAAAAABU/Xplg1cVMT2Q/s1600-h/Picture+16.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 297px; height: 320px;" src="http://1.bp.blogspot.com/_1ShqMKRrc0M/ScysRqxM0FI/AAAAAAAAABU/Xplg1cVMT2Q/s320/Picture+16.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5317814679556116562" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The next task was to get rid of the leading numbers in the file names (I wanted total purity of file name :) ), a task for a bit of Ruby:&lt;br /&gt;&lt;script src='http://pastie.org/428742.js'&gt;&lt;/script&gt;&lt;br /&gt;That renames all of the files in a folder stripping out the first 6 characters.&lt;br /&gt;&lt;br /&gt;The next step was to resize the assets to something appropriate for my app. I didn't want to do this by hand and I assumed I'd change my mind depending on how the image size affected the gameplay, so I created a rake task in my project's rakefile, like so (you could use Automator, but I like the command line and have Git and ImageMagick installed and working!):&lt;br /&gt;&lt;br /&gt;&lt;script src='http://pastie.org/428750.js'&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;I'd created my folder of large images and committed it to my project's git repository. Then I knew that any time in the future I could revert back to those original images and rescale them using a command like "rake resize_assets scale=40%".&lt;br /&gt;&lt;br /&gt;Next, I needed to embed these assets into my Flash file. Using code all the way, of course (you'll never see me voluntarily start up the Flash IDE...).&lt;br /&gt;&lt;script src='http://pastie.org/428753.js'&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Running "rake assets" produces an AS3 class like this:&lt;br /&gt;&lt;script src='http://pastie.org/428761.js'&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;So then I have Bread class that looks something like this:&lt;br /&gt;&lt;script src='http://pastie.org/428764.js'&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;And now my method that returns a new Bread model with a random asset looks like this:&lt;br /&gt;&lt;script src='http://pastie.org/428765.js'&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;So now, asset management is done on the filesystem, and to 'commit' my asset changes I just run "rake assets" and my ActionScript class is brought up to date, and I get to use the French words for the breads, simply because I was sure to name my original Photoshop layers usefully!&lt;br /&gt;&lt;br /&gt;Here's the game again, anyway: &lt;br /&gt;&lt;a href="http://grimaceworks.com/mf/bread_bin"&gt;Bread Bin game&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2397030648163954548-4475740574778255135?l=michaelforrest-code.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://michaelforrest-code.blogspot.com/feeds/4475740574778255135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://michaelforrest-code.blogspot.com/2009/03/naming-conventions-and-asset-management.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2397030648163954548/posts/default/4475740574778255135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2397030648163954548/posts/default/4475740574778255135'/><link rel='alternate' type='text/html' href='http://michaelforrest-code.blogspot.com/2009/03/naming-conventions-and-asset-management.html' title='Naming Conventions and Asset Management from Photoshop via Ruby into Flash'/><author><name>Michael Forrest</name><uri>http://www.blogger.com/profile/02119796434211161732</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_1ShqMKRrc0M/ScyqLTN7U6I/AAAAAAAAAA8/YsW0mUZJ8hM/s72-c/Picture+12.png' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
