Packagestarling.styles
Classpublic class MultiTextureStyle
InheritanceMultiTextureStyle Inheritance MeshStyle Inheritance EventDispatcher Inheritance Object

Provides a way to batch up to 4 different textures in one draw call, at the cost of more complex custom Fragment Shaders To use this, set Mesh.defaultStyle to MultiTextureStyle (ideally before Starling is initialised!)



Public Properties
 PropertyDefined By
 Inheritedcolor : uint
Changes the color of all vertices to the same value.
MeshStyle
  maxTextures : int
[static] Maximum number of textures to be batched, default 2.
MultiTextureStyle
 Inheritedtarget : Mesh
[read-only] The target the style is currently assigned to.
MeshStyle
 Inheritedtexture : Texture
The texture that is mapped to the mesh (or null, if there is none).
MeshStyle
 InheritedtextureRepeat : Boolean
Indicates if pixels at the edges will be repeated or clamped.
MeshStyle
 InheritedtextureSmoothing : String
The smoothing filter that is used for the texture.
MeshStyle
 Inheritedtype : Class
[read-only] The actual class of this style.
MeshStyle
 InheritedvertexFormat : VertexDataFormat
[read-only] The format used to store the vertices.
MeshStyle
Protected Properties
 PropertyDefined By
 InheritedindexData : IndexData
[read-only] Returns a reference to the index data of the assigned target (or null if there is no target).
MeshStyle
 InheritedvertexData : VertexData
[read-only] Returns a reference to the vertex data of the assigned target (or null if there is no target).
MeshStyle
Public Methods
 MethodDefined By
  
MultiTextureStyle
 Inherited
addEventListener(type:String, listener:Function):void
[override]
MeshStyle
 Inherited
batchIndexData(targetStyle:MeshStyle, targetIndexID:int = 0, offset:int = 0, indexID:int = 0, numIndices:int = -1):void
Copies the index data of the style's current target to the target of another style.
MeshStyle
 Inherited
batchVertexData(targetStyle:MeshStyle, targetVertexID:int = 0, matrix:Matrix = null, vertexID:int = 0, numVertices:int = -1):void
Copies the vertex data of the style's current target to the target of another style.
MeshStyle
 Inherited
canBatchWith(meshStyle:MeshStyle):Boolean
Indicates if the current instance can be batched with the given style.
MeshStyle
 Inherited
Creates a clone of this instance.
MeshStyle
 Inherited
copyFrom(meshStyle:MeshStyle):void
Copies all properties of the given style to the current instance (or a subset, if the classes don't match).
MeshStyle
 Inherited
Creates the effect that does the actual, low-level rendering.
MeshStyle
 Inherited
dispatchEvent(event:Event):void
Dispatches an event to all objects that have registered listeners for its type.
EventDispatcher
 Inherited
dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void
Dispatches an event with the given parameters to all objects that have registered listeners for the given type.
EventDispatcher
 Inherited
getTexCoords(vertexID:int, out:Point = null):Point
Returns the texture coordinates of the vertex at the specified index.
MeshStyle
 Inherited
getVertexAlpha(vertexID:int):Number
Returns the alpha value of the vertex at the specified index.
MeshStyle
 Inherited
getVertexColor(vertexID:int):uint
Returns the RGB color of the vertex at the specified index.
MeshStyle
 Inherited
getVertexPosition(vertexID:int, out:Point = null):Point
The position of the vertex at the specified index, in the mesh's local coordinate system.
MeshStyle
 Inherited
hasEventListener(type:String, listener:Function = null):Boolean
If called with one argument, figures out if there are any listeners registered for the given event type.
EventDispatcher
 Inherited
removeEventListener(type:String, listener:Function):void
[override]
MeshStyle
 Inherited
removeEventListeners(type:String = null):void
Removes all event listeners with a certain type, or all of them if type is null.
EventDispatcher
 Inherited
setTexCoords(vertexID:int, u:Number, v:Number):void
Sets the texture coordinates of the vertex at the specified index to the given values.
MeshStyle
 Inherited
setVertexAlpha(vertexID:int, alpha:Number):void
Sets the alpha value of the vertex at the specified index to a certain value.
MeshStyle
 Inherited
setVertexColor(vertexID:int, color:uint):void
Sets the RGB color of the vertex at the specified index to a certain value.
MeshStyle
 Inherited
setVertexPosition(vertexID:int, x:Number, y:Number):void
MeshStyle
 Inherited
updateEffect(effect:MeshEffect, state:RenderState):void
Updates the settings of the given effect to match the current style.
MeshStyle
Protected Methods
 MethodDefined By
 Inherited
onTargetAssigned(target:Mesh):void
Called when assigning a target mesh.
MeshStyle
 Inherited
Call this method when the index data changed.
MeshStyle
 Inherited
Call this method if the target needs to be redrawn.
MeshStyle
 Inherited
Call this method when the vertex data changed.
MeshStyle
Events
 Event Summary Defined By
 InheritedDispatched every frame on styles assigned to display objects connected to the stage.MeshStyle
Public Constants
 ConstantDefined By
  MAX_NUM_TEXTURES : int = 5
[static] Maximum number of textures that can be batched.
MultiTextureStyle
  VERTEX_FORMAT : VertexDataFormat
[static] The vertex format expected by this style.
MultiTextureStyle
Property Detail
maxTexturesproperty
maxTextures:int

Maximum number of textures to be batched, default 2.


Implementation
    public static function get maxTextures():int
    public static function set maxTextures(value:int):void
Constructor Detail
MultiTextureStyle()Constructor
public function MultiTextureStyle()



Constant Detail
MAX_NUM_TEXTURESConstant
public static const MAX_NUM_TEXTURES:int = 5

Maximum number of textures that can be batched.

VERTEX_FORMATConstant 
public static const VERTEX_FORMAT:VertexDataFormat

The vertex format expected by this style.