| Package | starling.rendering |
| Class | public class BatchToken |
| Inheritance | BatchToken Object |
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
| Property | Defined 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 | ||
| Method | Defined 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 | ||
| batchID | property |
public var batchID:intThe ID of the current MeshBatch.
| indexID | property |
public var indexID:intThe ID of the next index within the current MeshBatch.
| vertexID | property |
public var vertexID:intThe ID of the next vertex within the current MeshBatch.
| BatchToken | () | Constructor |
public function BatchToken(batchID:int = 0, vertexID:int = 0, indexID:int = 0)Creates a new BatchToken.
ParametersbatchID:int (default = 0) | |
vertexID:int (default = 0) | |
indexID:int (default = 0) |
| copyFrom | () | method |
public function copyFrom(token:BatchToken):voidCopies the properties from the given token to this instance.
Parameters
token:BatchToken |
| equals | () | method |
public function equals(other:BatchToken):BooleanIndicates if this token contains the same values as the given one.
Parameters
other:BatchToken |
Boolean |
| reset | () | method |
public function reset():voidResets all properties to zero.
| setTo | () | method |
public function setTo(batchID:int = 0, vertexID:int = 0, indexID:int = 0):voidChanges all properties at once.
Parameters
batchID:int (default = 0) | |
vertexID:int (default = 0) | |
indexID:int (default = 0) |
| toString | () | method |
public function toString():StringCreates a String representation of this instance.
ReturnsString |