FlxGridOverlay

@link http://www.photonstorm.com

Static methods

@:value({ Color2 : 0xffd9d5d5, Color1 : 0xffe7e6e6, Alternate : true, Height : -1, Width : -1 })staticcreate(CellWidth:Int, CellHeight:Int, Width:Int = -1, Height:Int = -1, Alternate:Bool = true, Color1:FlxColor = 0xffe7e6e6, Color2:FlxColor = 0xffd9d5d5):FlxSprite

Creates a FlxSprite of the given width and height filled with a checkerboard pattern. Each grid cell is the specified width and height, and alternates between two colors. If alternate is true each row of the pattern will be offset, for a proper checkerboard style. If false each row will be the same colour, creating a striped-pattern effect. So to create an 8x8 grid you'd call create(8,8)

Parameters:

CellWidth

The grid cell width

CellHeight

The grid cell height

Width

The width of the FlxSprite. If -1 it will be the size of the game (FlxG.width)

Height

The height of the FlxSprite. If -1 it will be the size of the game (FlxG.height)

Alternate

Should the pattern alternate on each new row? Default true = checkerboard effect. False = vertical stripes

Color1

The first fill colour in 0xAARRGGBB format

Color2

The second fill colour in 0xAARRGGBB format

Returns:

FlxSprite of given width/height

staticcreateGrid(CellWidth:Int, CellHeight:Int, Width:Int, Height:Int, Alternate:Bool, Color1:FlxColor, Color2:FlxColor):BitmapData

@:value({ Color2 : 0x88d9d5d5, Color1 : 0x88e7e6e6, Alternate : true, Height : -1, Width : -1 })staticoverlay(Sprite:FlxSprite, CellWidth:Int, CellHeight:Int, Width:Int = -1, Height:Int = -1, Alternate:Bool = true, Color1:FlxColor = 0x88e7e6e6, Color2:FlxColor = 0x88d9d5d5):FlxSprite

Creates a checkerboard pattern of the given width/height and overlays it onto the given FlxSprite. Each grid cell is the specified width and height, and alternates between two colors. If alternate is true each row of the pattern will be offset, for a proper checkerboard style. If false each row will be the same colour, creating a striped-pattern effect. So to create an 8x8 grid you'd call create(8,8,

Parameters:

Sprite

The FlxSprite you wish to draw the grid on-top of. This updates its pixels value, not just the current frame (don't use animated sprites!)

CellWidth

The grid cell width

CellHeight

The grid cell height

Width

The width of the FlxSprite. If -1 it will be the size of the game (FlxG.width)

Height

The height of the FlxSprite. If -1 it will be the size of the game (FlxG.height)

Alternate

Should the pattern alternate on each new row? Default true = checkerboard effect. False = vertical stripes

Color1

The first fill colour in 0xAARRGGBB format

Color2

The second fill colour in 0xAARRGGBB format

Returns:

The modified source FlxSprite