Packagestarling.rendering
Classpublic class BatchToken
InheritanceBatchToken Inheritance Object

Points to a location within a list of MeshBatches.

Starling uses these tokens in its render cache. Each call to painter.pushState() or painter.popState() provides a token referencing the current location within the cache. In the next frame, if the relevant part of the display tree has not changed, these tokens can be used to render directly from the cache instead of constructing new MeshBatches.

See also

Painter


Public Properties
 PropertyDefined By
  batchID : int
The ID of the current MeshBatch.
BatchToken
  indexID : int
The ID of the next index within the current MeshBatch.
BatchToken
  vertexID : int
The ID of the next vertex within the current MeshBatch.
BatchToken
Public Methods
 MethodDefined By
  
BatchToken(batchID:int = 0, vertexID:int = 0, indexID:int = 0)
Creates a new BatchToken.
BatchToken
  
copyFrom(token:BatchToken):void
Copies the properties from the given token to this instance.
BatchToken
  
equals(other:BatchToken):Boolean
Indicates if this token contains the same values as the given one.
BatchToken
  
reset():void
Resets all properties to zero.
BatchToken
  
setTo(batchID:int = 0, vertexID:int = 0, indexID:int = 0):void
Changes all properties at once.
BatchToken
  
toString():String
Creates a String representation of this instance.
BatchToken
Property Detail
batchIDproperty
public var batchID:int

The ID of the current MeshBatch.

indexIDproperty 
public var indexID:int

The ID of the next index within the current MeshBatch.

vertexIDproperty 
public var vertexID:int

The ID of the next vertex within the current MeshBatch.

Constructor Detail
BatchToken()Constructor
public function BatchToken(batchID:int = 0, vertexID:int = 0, indexID:int = 0)

Creates a new BatchToken.

Parameters
batchID:int (default = 0)
 
vertexID:int (default = 0)
 
indexID:int (default = 0)
Method Detail
copyFrom()method
public function copyFrom(token:BatchToken):void

Copies the properties from the given token to this instance.

Parameters

token:BatchToken

equals()method 
public function equals(other:BatchToken):Boolean

Indicates if this token contains the same values as the given one.

Parameters

other:BatchToken

Returns
Boolean
reset()method 
public function reset():void

Resets all properties to zero.

setTo()method 
public function setTo(batchID:int = 0, vertexID:int = 0, indexID:int = 0):void

Changes all properties at once.

Parameters

batchID:int (default = 0)
 
vertexID:int (default = 0)
 
indexID:int (default = 0)

toString()method 
public function toString():String

Creates a String representation of this instance.

Returns
String