RSS

Actionscript 3 Marker Helper Class

This entry was posted on Apr 15 2009

markerclass

It’s a pain to try and keep track of item registration points when placing them on the stage. So to help my debug efforts, I create the Marker class. It draws a crosshair where ever you need one. You can use them to keep track of any specific point.

Using the class is dead easy, you just need to add a new instance of the class to the display tree and configure it appropriately.

 

1
2
3
4
5
6
7
8
9
10
import Marker;

// adds a marker that will snap to the center of the stage (even when the stage is resized)
addChild(new Marker(true));

// adds a Marker instance at 50,50 point
addChild(new Marker(50,50));

// adds a Marker instance at 100,100 and sets the Marker's color to 0x00FF00
addChild(new Marker(100,100, 0x00FF00));

Download Marker.as


One Response to “Actionscript 3 Marker Helper Class”

  1. Nice class, seems simple enough but effective.


Post a Comment