Packagecom.pblabs.rendering2D.spritesheet
Classpublic class CellCountDivider
InheritanceCellCountDivider Inheritance Object
Implements ISpriteSheetDivider

Divide a spritesheet into cells based on count - ie, 4 cells by 3 cells.



Public Properties
 PropertyDefined By
  frameCount : int
[read-only] How many frames are in this sprite sheet?
CellCountDivider
  owningSheet : SpriteSheetComponent
[write-only] Many times you want to infer information about frames based on data from the sprite sheet.
CellCountDivider
  xCount : int = 1
The number of cells in the x direction.
CellCountDivider
  yCount : int = 1
The number of cells in the y direction.
CellCountDivider
Public Methods
 MethodDefined By
  
The MultiSpriteSheetHelper has to be able to clone dividers.
CellCountDivider
  
getFrameArea(index:int):Rectangle
Return the size of a frame, given the desired index and the source image's dimensions.
CellCountDivider
Property Detail
frameCountproperty
frameCount:int  [read-only]

How many frames are in this sprite sheet?


Implementation
    public function get frameCount():int
owningSheetproperty 
owningSheet:SpriteSheetComponent  [write-only]

Many times you want to infer information about frames based on data from the sprite sheet. When the divider is assigned to a sprite sheet, the sprite sheet passes itself to OwningSheet so you can store it and get information from it.


Implementation
    public function set owningSheet(value:SpriteSheetComponent):void
xCountproperty 
public var xCount:int = 1

The number of cells in the x direction.

yCountproperty 
public var yCount:int = 1

The number of cells in the y direction.

Method Detail
clone()method
public function clone():ISpriteSheetDivider

The MultiSpriteSheetHelper has to be able to clone dividers. So we have a Clone method.

Returns
ISpriteSheetDivider
getFrameArea()method 
public function getFrameArea(index:int):Rectangle

Return the size of a frame, given the desired index and the source image's dimensions.

Parameters

index:int

Returns
Rectangle