Packagecom.mth.util
Classpublic class Grid
InheritanceGrid Inheritance flash.display.Sprite

The Grid class is a utility class that draws a grid overlay with a specified number of columns and gutter width.



Public Properties
 PropertyDefined by
  alphas : Array
Grid
  color : uint
Grid
  colorHEX : String
[read-only]
Grid
  columnPositions : Array
[read-only]
Grid
  columns : int
Grid
  columnW : Number
[read-only]
Grid
  gridH : int
Grid
  gridW : int
Grid
  gutterW : int
Grid
  showText : Boolean
[write-only]
Grid
  useRounding : Boolean
[write-only]
Grid
Public Methods
 MethodDefined by
  
Grid(args:Object = null)
The args object allows you to pass various properties to the Grid class on instance declaration.
Grid
  
drawGrid():void
drawGrid method allows you to update the grid after intance declaration.
Grid
Property detail
alphasproperty
alphas:Array  [read-write]Implementation
    public function get alphas():Array
    public function set alphas(value:Array):void
colorproperty 
color:uint  [read-write]Implementation
    public function get color():uint
    public function set color(value:uint):void
colorHEXproperty 
colorHEX:String  [read-only]Implementation
    public function get colorHEX():String
columnPositionsproperty 
columnPositions:Array  [read-only]Implementation
    public function get columnPositions():Array
columnsproperty 
columns:int  [read-write]Implementation
    public function get columns():int
    public function set columns(value:int):void
columnWproperty 
columnW:Number  [read-only]Implementation
    public function get columnW():Number
gridHproperty 
gridH:int  [read-write]Implementation
    public function get gridH():int
    public function set gridH(value:int):void
gridWproperty 
gridW:int  [read-write]Implementation
    public function get gridW():int
    public function set gridW(value:int):void
gutterWproperty 
gutterW:int  [read-write]Implementation
    public function get gutterW():int
    public function set gutterW(value:int):void
showTextproperty 
showText:Boolean  [write-only]Implementation
    public function set showText(value:Boolean):void
useRoundingproperty 
useRounding:Boolean  [write-only]Implementation
    public function set useRounding(value:Boolean):void
Constructor detail
Grid()constructor
public function Grid(args:Object = null)

The args object allows you to pass various properties to the Grid class on instance declaration.

Properties Summary:

ParameterDefinition
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)
Method detail
drawGrid()method
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();