Class: RenderTarget

Tiny. RenderTarget

new Tiny.RenderTarget(gl, width, height, scaleMode, resolution, root)

Name Type Default Description
gl WebGLRenderingContext

The current WebGL drawing context

width number 0 optional

the horizontal range of the filter

height number 0 optional

the vertical range of the filter

scaleMode number Tiny.settings.SCALE_MODE optional

See Tiny.SCALE_MODES for possible values

resolution number 1 optional

The current resolution / device pixel ratio

root boolean false optional

Whether this object is the root element or not

Members

clearColorArray.<number>

The background colour of this render target, as an array of [r,g,b,a] values

defaultFrameglCore.GLBuffer

The stencil buffer stores masking data for the render target

filterDataArray.<object>

Stores filter data for the render target

The frame.

frameBufferTiny.glCore.GLFramebuffer

A frame buffer

glWebGLRenderingContext

The current WebGL drawing context.

projectionMatrixTiny.Matrix

The projection matrix

resolutionnumber

The current resolution / device pixel ratio

Default Value:
  • 1

rootboolean

Whether this object is the root element or not

scaleModenumber

The scale mode.

Default Value:
  • Tiny.settings.SCALE_MODE
See:

The size of the object as a rectangle

stencilBufferglCore.GLBuffer

The stencil buffer stores masking data for the render target

stencilMaskStackArray.<Tiny.Graphics>

The data structure for the stencil masks

textureTiny.glCore.GLTexture

The texture

transformTiny.Matrix

The object's transform

Methods

Binds the buffers and initialises the viewport.

Binds the stencil buffer.

calculateProjection(destinationFrame, sourceFrame)

Updates the projection matrix based on a projection frame (which is a rectangle)

Name Type Description
destinationFrame Rectangle

The destination frame.

sourceFrame Rectangle

The source frame.

Clears the filter texture.

Name Type Default Description
clearColor Array.<number> this.clearColor optional

Array of [r,g,b,a] to clear the framebuffer

Destroys the render target.

Resizes the texture to the specified width and height

Name Type Description
width number

the new width of the texture

height number

the new height of the texture

setFrame(destinationFrame, sourceFrame)

Sets the frame of the render target.

Name Type Description
destinationFrame Rectangle

The destination frame.

sourceFrame Rectangle

The source frame.

Documentation generated by JSDoc 3.4.3 on Mon Dec 03 2018 17:48:52 GMT+0800 (CST)