Package | starling.core |
Class | public class RenderSupport |
Inheritance | RenderSupport ![]() |
Property | Defined By | ||
---|---|---|---|
backBufferHeight : int The height of the back buffer, as it was configured in the last call to
'RenderSupport.configureBackBuffer()'. | RenderSupport | ||
backBufferWidth : int The width of the back buffer, as it was configured in the last call to
'RenderSupport.configureBackBuffer()'. | RenderSupport | ||
blendMode : String The blend mode to be used on rendering. | RenderSupport | ||
drawCount : int [read-only] Indicates the number of stage3D draw calls. | RenderSupport | ||
modelViewMatrix : Matrix [read-only] Returns the current modelview matrix. | RenderSupport | ||
mvpMatrix : Matrix [read-only] Calculates the product of modelview and projection matrix. | RenderSupport | ||
mvpMatrix3D : Matrix3D [read-only] Calculates the product of modelview and projection matrix and saves it in a 3D matrix. | RenderSupport | ||
projectionMatrix : Matrix [read-only] Returns the current projection matrix. | RenderSupport | ||
renderTarget : Texture The texture that is currently being rendered into, or 'null' to render into the
back buffer. | RenderSupport | ||
scissorRectangle : Rectangle The scissor rectangle can be used to limit rendering in the current render target to
a certain area. | RenderSupport |
Method | Defined By | ||
---|---|---|---|
Creates a new RenderSupport object with an empty matrix stack. | RenderSupport | ||
applyBlendMode(premultipliedAlpha:Boolean):void Activates the current blend mode on the active rendering context. | RenderSupport | ||
assembleAgal(vertexShader:String, fragmentShader:String, resultProgram:Program3D = null):Program3D [static] Assembles fragment- and vertex-shaders, passed as Strings, to a Program3D. | RenderSupport | ||
Adds a quad to the current batch of unrendered quads. | RenderSupport | ||
clear(rgb:uint = 0, alpha:Number = 0.0):void Clears the render context with a certain color and alpha value. | RenderSupport | ||
clear(rgb:uint = 0, alpha:Number = 0.0):void [static] Clears the render context with a certain color and alpha value. | RenderSupport | ||
configureBackBuffer(width:int, height:int, antiAlias:int, enableDepthAndStencil:Boolean):void Configures the back buffer on the current context3D. | RenderSupport | ||
dispose():void Disposes all quad batches. | RenderSupport | ||
finishQuadBatch():void Renders the current quad batch and resets it. | RenderSupport | ||
loadIdentity():void Changes the modelview matrix to the identity matrix. | RenderSupport | ||
nextFrame():void Resets matrix stack, blend mode, quad batch index, and draw count. | RenderSupport | ||
popMatrix():void Restores the modelview matrix that was last pushed to the stack. | RenderSupport | ||
prependMatrix(matrix:Matrix):void Prepends a matrix to the modelview matrix by multiplying it another matrix. | RenderSupport | ||
pushMatrix():void Pushes the current modelview matrix to a stack from which it can be restored later. | RenderSupport | ||
raiseDrawCount(value:uint = 1):void Raises the draw count by a specific value. | RenderSupport | ||
resetMatrix():void Empties the matrix stack, resets the modelview matrix to the identity matrix. | RenderSupport | ||
rotateMatrix(angle:Number):void Prepends a rotation (angle in radians) to the modelview matrix. | RenderSupport | ||
scaleMatrix(sx:Number, sy:Number):void Prepends an incremental scale change to the modelview matrix. | RenderSupport | ||
setBlendFactors(premultipliedAlpha:Boolean, blendMode:String = normal):void [static] Sets up the blending factors that correspond with a certain blend mode. | RenderSupport | ||
setDefaultBlendFactors(premultipliedAlpha:Boolean):void [static] Deprecated. | RenderSupport | ||
setOrthographicProjection(x:Number, y:Number, width:Number, height:Number):void Sets up the projection matrix for ortographic 2D rendering. | RenderSupport | ||
transformMatrix(object:DisplayObject):void Prepends translation, scale and rotation of an object to the modelview matrix. | RenderSupport | ||
transformMatrixForObject(matrix:Matrix, object:DisplayObject):void [static] Prepends translation, scale and rotation of an object to a custom matrix. | RenderSupport | ||
translateMatrix(dx:Number, dy:Number):void Prepends a translation to the modelview matrix. | RenderSupport |
backBufferHeight | property |
backBufferHeight:int
The height of the back buffer, as it was configured in the last call to 'RenderSupport.configureBackBuffer()'. Beware: changing this value does not actually resize the back buffer; the setter should only be used to inform Starling about the size of a back buffer it can't control (shared context situations).
public function get backBufferHeight():int
public function set backBufferHeight(value:int):void
backBufferWidth | property |
backBufferWidth:int
The width of the back buffer, as it was configured in the last call to 'RenderSupport.configureBackBuffer()'. Beware: changing this value does not actually resize the back buffer; the setter should only be used to inform Starling about the size of a back buffer it can't control (shared context situations).
public function get backBufferWidth():int
public function set backBufferWidth(value:int):void
blendMode | property |
blendMode:String
The blend mode to be used on rendering. To apply the factor, you have to manually call 'applyBlendMode' (because the actual blend factors depend on the PMA mode).
public function get blendMode():String
public function set blendMode(value:String):void
drawCount | property |
drawCount:int
[read-only] Indicates the number of stage3D draw calls.
public function get drawCount():int
modelViewMatrix | property |
modelViewMatrix:Matrix
[read-only] Returns the current modelview matrix. CAUTION: not a copy -- use with care!
public function get modelViewMatrix():Matrix
mvpMatrix | property |
mvpMatrix:Matrix
[read-only] Calculates the product of modelview and projection matrix. CAUTION: Don't save a reference to this object! Each call returns the same instance.
public function get mvpMatrix():Matrix
mvpMatrix3D | property |
mvpMatrix3D:Matrix3D
[read-only] Calculates the product of modelview and projection matrix and saves it in a 3D matrix. CAUTION: Don't save a reference to this object! Each call returns the same instance.
public function get mvpMatrix3D():Matrix3D
projectionMatrix | property |
projectionMatrix:Matrix
[read-only] Returns the current projection matrix. CAUTION: not a copy -- use with care!
public function get projectionMatrix():Matrix
renderTarget | property |
renderTarget:Texture
The texture that is currently being rendered into, or 'null' to render into the back buffer. If you set a new target, it is immediately activated.
public function get renderTarget():Texture
public function set renderTarget(value:Texture):void
scissorRectangle | property |
scissorRectangle:Rectangle
The scissor rectangle can be used to limit rendering in the current render target to
a certain area. This method expects the rectangle in stage coordinates
(different to the context3D method with the same name, which expects pixels).
Pass null
to turn off scissoring.
CAUTION: not a copy -- use with care!
public function get scissorRectangle():Rectangle
public function set scissorRectangle(value:Rectangle):void
RenderSupport | () | Constructor |
public function RenderSupport()
Creates a new RenderSupport object with an empty matrix stack.
applyBlendMode | () | method |
public function applyBlendMode(premultipliedAlpha:Boolean):void
Activates the current blend mode on the active rendering context.
Parameters
premultipliedAlpha:Boolean |
assembleAgal | () | method |
public static function assembleAgal(vertexShader:String, fragmentShader:String, resultProgram:Program3D = null):Program3D
Assembles fragment- and vertex-shaders, passed as Strings, to a Program3D. If you pass a 'resultProgram', it will be uploaded to that program; otherwise, a new program will be created on the current Stage3D context.
Parameters
vertexShader:String | |
fragmentShader:String | |
resultProgram:Program3D (default = null )
|
Program3D |
batchQuad | () | method |
public function batchQuad(quad:Quad, parentAlpha:Number, texture:Texture = null, smoothing:String = null):void
Adds a quad to the current batch of unrendered quads. If there is a state change, all previous quads are rendered at once, and the batch is reset.
Parameters
quad:Quad | |
parentAlpha:Number | |
texture:Texture (default = null )
| |
smoothing:String (default = null )
|
clear | () | method |
public function clear(rgb:uint = 0, alpha:Number = 0.0):void
Clears the render context with a certain color and alpha value.
Parameters
rgb:uint (default = 0 )
| |
alpha:Number (default = 0.0 )
|
clear | () | method |
public static function clear(rgb:uint = 0, alpha:Number = 0.0):void
Clears the render context with a certain color and alpha value.
Parameters
rgb:uint (default = 0 )
| |
alpha:Number (default = 0.0 )
|
configureBackBuffer | () | method |
public function configureBackBuffer(width:int, height:int, antiAlias:int, enableDepthAndStencil:Boolean):void
Configures the back buffer on the current context3D. By using this method, Starling can store the size of the back buffer and utilize this information in other methods (e.g. the scissor rectangle property). Back buffer width and height can later be accessed using the properties with the same name.
Parameters
width:int | |
height:int | |
antiAlias:int | |
enableDepthAndStencil:Boolean |
dispose | () | method |
public function dispose():void
Disposes all quad batches.
finishQuadBatch | () | method |
public function finishQuadBatch():void
Renders the current quad batch and resets it.
loadIdentity | () | method |
public function loadIdentity():void
Changes the modelview matrix to the identity matrix.
nextFrame | () | method |
public function nextFrame():void
Resets matrix stack, blend mode, quad batch index, and draw count.
popMatrix | () | method |
public function popMatrix():void
Restores the modelview matrix that was last pushed to the stack.
prependMatrix | () | method |
public function prependMatrix(matrix:Matrix):void
Prepends a matrix to the modelview matrix by multiplying it another matrix.
Parameters
matrix:Matrix |
pushMatrix | () | method |
public function pushMatrix():void
Pushes the current modelview matrix to a stack from which it can be restored later.
raiseDrawCount | () | method |
public function raiseDrawCount(value:uint = 1):void
Raises the draw count by a specific value. Call this method in custom render methods to keep the statistics display in sync.
Parameters
value:uint (default = 1 )
|
resetMatrix | () | method |
public function resetMatrix():void
Empties the matrix stack, resets the modelview matrix to the identity matrix.
rotateMatrix | () | method |
public function rotateMatrix(angle:Number):void
Prepends a rotation (angle in radians) to the modelview matrix.
Parameters
angle:Number |
scaleMatrix | () | method |
public function scaleMatrix(sx:Number, sy:Number):void
Prepends an incremental scale change to the modelview matrix.
Parameters
sx:Number | |
sy:Number |
setBlendFactors | () | method |
public static function setBlendFactors(premultipliedAlpha:Boolean, blendMode:String = normal):void
Sets up the blending factors that correspond with a certain blend mode.
Parameters
premultipliedAlpha:Boolean | |
blendMode:String (default = normal )
|
setDefaultBlendFactors | () | method |
public static function setDefaultBlendFactors(premultipliedAlpha:Boolean):void
Deprecated. Call 'setBlendFactors' instead.
Parameters
premultipliedAlpha:Boolean |
setOrthographicProjection | () | method |
public function setOrthographicProjection(x:Number, y:Number, width:Number, height:Number):void
Sets up the projection matrix for ortographic 2D rendering.
Parameters
x:Number | |
y:Number | |
width:Number | |
height:Number |
transformMatrix | () | method |
public function transformMatrix(object:DisplayObject):void
Prepends translation, scale and rotation of an object to the modelview matrix.
Parameters
object:DisplayObject |
transformMatrixForObject | () | method |
public static function transformMatrixForObject(matrix:Matrix, object:DisplayObject):void
Prepends translation, scale and rotation of an object to a custom matrix.
Parameters
matrix:Matrix | |
object:DisplayObject |
translateMatrix | () | method |
public function translateMatrix(dx:Number, dy:Number):void
Prepends a translation to the modelview matrix.
Parameters
dx:Number | |
dy:Number |