Class SpriteRenderer
Hierarchy
- SpriteRenderer
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Creates a new sprite Renderer
Parameters
engine: ThinEngine
defines the engine the renderer works with
capacity: number
defines the maximum allowed number of sprites
Optional epsilon: number
defines the epsilon value to align texture (0.01 by default)
Optional scene: Nullable<Scene>
defines the hosting scene
Returns SpriteRenderer
Properties
auto Reset AlphaSearch playground for autoResetAlpha
Gets or sets a boolean indicating if alpha mode is automatically reset.
blend ModeSearch playground for blendMode
Blend mode use to render the particle, it can be any of the static Constants.ALPHA_x properties provided in this class. Default value is Constants.ALPHA_COMBINE
cell HeightSearch playground for cellHeight
Defines the default height of a cell in the spritesheet
cell WidthSearch playground for cellWidth
Defines the default width of a cell in the spritesheet
disable Depth WriteSearch playground for disableDepthWrite
Disables writing to the depth buffer when rendering the sprites. It can be handy to disable depth writing when using textures without alpha channel and setting some specific blend modes.
fog EnabledSearch playground for fogEnabled
Gets or sets a boolean indicating if the manager must consider scene fog when rendering
textureSearch playground for texture
Defines the texture of the spritesheet
Accessors
capacity
Gets the capacity of the manager
Returns number
Methods
disposeSearch playground for dispose
Release associated resources
Returns void
rebuildSearch playground for rebuild
Rebuilds the renderer (after a context lost, for eg)
Returns void
renderSearch playground for render
Render all child sprites
Parameters
sprites: ThinSprite[]
defines the list of sprites to render
deltaTime: number
defines the time since last frame
viewMatrix: IMatrixLike
defines the viewMatrix to use to render the sprites
projectionMatrix: IMatrixLike
defines the projectionMatrix to use to render the sprites
Optional customSpriteUpdate: Nullable<((sprite: ThinSprite, baseSize: ISize) => void)>
defines a custom function to update the sprites data before they render
Returns void
Class used to render sprites.
It can be used either to render Sprites or ThinSprites with ThinEngine only.