abitofcode

January 27, 2012
by Chris
1 Comment

Cocos2d Cookbook

Nathan Burba has done a fantastic job of pulling together a great collection of recipes for the cocod2d cookbook covering everything from Bullets to Speech recognition.
Once Sketchshare is fully launched I plan on doing a review of the book in some detail. In the meantime it’s perfect for the Inquisitive/Intermediate programmer and covers a wide variety of techniques. For further detail check out Nathans site http://cocos2dcookbook.com/ which has videos detailing the techniques covered in the book.

January 18, 2012
by Chris
0 comments

We’ve open sourced the Sketchshare colour picker

The color picker was commented on a number of times during beta testing so we’ve decided to give it away :) It’s written in cocos2d and uses the CCControl approach suggested by YannickL on the forum. Color pickers can be fiddly at the best of times so Stu (@creativewax) designed this one to give a much larger color selection area, particularly useful on mobile devices.
Sketchshare Color picker
You can get further details and the source code from here at the moment, it’ll be moving onto github once we have a little more time.

November 19, 2011
by Chris
0 comments

Export Flash library items as PNG’s with JSFL

After last weeks news from Adobe I’m happy I held back on upgrading from Flash CS3. Flash though is still a valuable tool in the development process allowing the quick prototyping of game mechanics.

What I’ve ended up doing on more than one occasion however is prototyping something in Flash, then finding I need to get the information out of flash into a form I can use elsewhere e.g for iOS development. Flash comes with an extension language called JSFL (JavaScript Flash) that allows scripted manipulation of the authoring environment, Adobe in their infinite wisdom decided that producing decent documentation for this killer feature was not worth the effort. Fortunately Keith Peters and Todd Yard filled the void with the book ‘Extending Flash MX 2004‘ it’s still a valid book today.

In a recent project I needed to run through an .fla used to generate a swc and export all the items in the library that had a linkageIdentifier as separate PNG images. It took longer than it should have as I made all the mistakes I’d made on previous JSFL projects, so this time I commented the code and jotted down the issues for future reference. Another source of useful information is Writing a JSFL component for Flash AS3 where there is a link to a comprehensive API specification for JSFL in pdf format.

The following JSFL scripts have been tested with Flash CS3 on Lion (OSX)
Continue Reading →

October 28, 2011
by Chris
0 comments

TotalTerminal color fix

Finally made the upgrade to Lion on my work laptop. Missing Front row a bit, the reverse scroll thing I’m getting on with and not sure what happened to spaces but losing the colour in TotalTerminal (http://totalterminal.binaryage.com/) is something I can’t deal with. For the themes like Homebrew etc it’s an easy fix, open preferences and go to Settings > Advanced > Declare terminal as: and change the value to xterm-color.

Change xterm256-color to xterm-color to get some colour back

Alternatively download the much nicer IR_Black colour scheme and follow the instructions to install.

If the colour listings don’t work when using ls add an alias to your .bash_profile;

alias ls=’ls -GFh’

To reload your profile after the update;

source ~/.bash_profile

July 12, 2011
by Chris
0 comments

Some useful Unicode and Hex Keyboard symbols

⌘ – ⌘ – ⌘ – the Command Key symbol
⌥ – ⌥ – ⌥ – the Option Key symbol
⇧ – ⇧ – ⇧ – the Shift Key
⇥ – ⇥ – ⇥ – the Tab Key symbol
⏎ – ⏎ – ⏎ – the Return Key symbol
⌫ – ⌫ – ⌫ – the Delete Key symbol

Source: The Journeyler

July 8, 2011
by Chris
4 Comments

Simple interactive depth of field effect

Writing the Irregular touch detection post brought to mind another Lingo/Flash workaround that makes use of Photoshop. The effect is a depth of field that can be adjusted between the foreground and background without having to apply any sort of blurring effect in real time.

Fig 1. Select your image wisely, grass equals pain

Continue Reading →