Skip to content
Jul 15 10

Particle Play

by Colin

First stages of my first personal iPhone/iPad App.

Red circles are touch points.
Double tap to change from creating gravitational fields to adding particles.

Originally written in Processing, Particle Play has been converted to C++ using OpenGL and openFrameworks.

Jul 5 10

Xcode 3.2.3 Problems and Solutions

by Colin

Upgrading to Xcode 3.2.3 can give you a few problems at first, but here's how I've found out how to fix those issues.
read more...

Jun 10 10

Google Code

by Colin

I now have a Google Code page to offer open-source classes.

Jun 9 10

Flash Filters

by Colin

I recently was working on a project where most Display Object's on my stage had an outer glow with an Add blend mode. In this instance, I got quite lucky because each object's filter settings were the same. It made a lot of sense to code the filter rather than duplicate the setting for the dozens of objects that were spread apart the project. Here's the basis of what I used:

/**
 * Adds the universal glow to the display object.
 * @param displayObject The display object to receive the glow.
 * @param container The container to hold the newly created snapshot.GlowMC.PAGE_VECTOR.
 */
public static function addGlow( displayObject:DisplayObject, container:DisplayObjectContainer ):void
{
	// Capture an instance of the displayObject
	var rect:Rectangle = new Rectangle( -1, -1, displayObject.width + 2, displayObject.width + 2 );
	var bmd:BitmapData = new BitmapData( displayObject.width + 2, displayObject.height + 2, true, 0xFF );
	bmd.draw( displayObject, null, null, null, rect, true );
 
	// Apply the Capture
	var bitmap:Bitmap = new Bitmap( bmd );
	var filters:Array = container.filters;
	var glowFilter:GlowFilter = new GlowFilter();
	glowFilter.blurX = glowFilter.blurY = 10;
	glowFilter.inner = false;
	glowFilter.knockout = true;
	glowFilter.strength = 1;
	glowFilter.quality = 2;
	glowFilter.color = 0xFFFFFF;
 
	// Set
	filters[filters.length] = glowFilter;
	bitmap.filters = filters;
	bitmap.blendMode = "add";
	container.addChild( bitmap );
 
	// Clear vars
	rect = null;
	bmd = null;
	bitmap = null;
	filters = null;
	glowFilter = null;
}
 

Also, it's best to add the filter object into a container so the blend mode works properly.

May 4 10

ANT and Flex

by Colin

While writing my framework about 6 months ago, I wanted to create ASDocs for it so anyone using the framework would know how to work with it. I also love the idea of compiling all the source into a SWC file to make sending that source very easy to do. It's a very cumbersome process to create ASDocs and compile to a SWC through the executable files by itself, and upon research discovered ANT.
read more...