The
Grid class is a utility class that draws a grid overlay with a specified number of columns and gutter width.
alphas:Array [read-write]Implementation
public function get alphas():Array
public function set alphas(value:Array):void
color:uint [read-write]Implementation
public function get color():uint
public function set color(value:uint):void
colorHEX:String [read-only]Implementation
public function get colorHEX():String
columnPositions:Array [read-only]Implementation
public function get columnPositions():Array
columns:int [read-write]Implementation
public function get columns():int
public function set columns(value:int):void
columnW:Number [read-only]Implementation
public function get columnW():Number
gridH:int [read-write]Implementation
public function get gridH():int
public function set gridH(value:int):void
gridW:int [read-write]Implementation
public function get gridW():int
public function set gridW(value:int):void
gutterW:int [read-write]Implementation
public function get gutterW():int
public function set gutterW(value:int):void
showText:Boolean [write-only]Implementation
public function set showText(value:Boolean):void
useRounding:Boolean [write-only]Implementation
public function set useRounding(value:Boolean):void
public function Grid(args:Object = null)
The args object allows you to pass various properties to the Grid class on instance declaration.
Properties Summary:
| Parameter | Definition |
| columns:int | (defualt = 4) Total number of columns within grid. |
| gutterW:int | (defualt = 25) Width of the gutter between grid. |
| color:uint | (defualt = #ff0000) Color of grid overlay. |
| alphas:Array | (defualt = [.5, .35]) The alphas property allows for alternating column alphas for zebra stripping effect. Only two values can be passed within array. |
| gridW:int | (defualt = stage.stageWidth) Total width of grid. |
| gridH:int | (defualt = stage.stageHeight) Total height of grid. |
| showText:Boolean | (defualt = true) If true, column x-position and number text is displayed within each column. |
| useRounding:Boolean | (defualt = false) If false, column's width will display decimal point if applicable. If true, column's width is round to nearest whole number. |
USAGE EXAMPLES:
import com.mikethenderson.util.Grid;
var myGrid:Grid = new Grid({
columns : 4,
gutterW : 10,
color : 0x3366ff,
gridH : 250,
useRounding : true
});
addChild( myGrid );
Parameters
| args:Object (default = null) |
public function drawGrid():void
drawGrid method allows you to update the grid after intance declaration.
USAGE EXAMPLES:
import com.mikethenderson.util.Grid;
var myGrid:Grid = new Grid({
columns : 4,
gutterW : 10,
color : 0x3366ff,
gridH : 250,
useRounding : true
});
addChild( myGrid );
myGrid.gutterW = 25;
myGrid.drawGrid();