Header menu logo Nu

SpriteBatch Module

Types

Type Description

SpriteBatchEnv

The environment that contains the internal state required for batching sprites.

Functions and values

Function or value Description

SpriteBatch.BeginSpriteBatchFrame (viewProjection2dAbsolute, viewProjection2dRelative, viewProjectionClipAbsolute, viewProjectionClipRelative, env)

Full Usage: SpriteBatch.BeginSpriteBatchFrame (viewProjection2dAbsolute, viewProjection2dRelative, viewProjectionClipAbsolute, viewProjectionClipRelative, env)

Parameters:

Beging a new sprite batch frame3.

viewProjection2dAbsolute : inref<Matrix4x4>
viewProjection2dRelative : inref<Matrix4x4>
viewProjectionClipAbsolute : inref<Matrix4x4>
viewProjectionClipRelative : inref<Matrix4x4>
env : SpriteBatchEnv

SpriteBatch.CreateSpriteBatchEnv ()

Full Usage: SpriteBatch.CreateSpriteBatchEnv ()

Parameters:
    () : unit

Returns: SpriteBatchEnv

Destroy the given sprite batch environment.

() : unit
Returns: SpriteBatchEnv

SpriteBatch.DestroySpriteBatchEnv env

Full Usage: SpriteBatch.DestroySpriteBatchEnv env

Parameters:

Destroy the given sprite batch environment.

env : SpriteBatchEnv

SpriteBatch.EndSpriteBatchFrame env

Full Usage: SpriteBatch.EndSpriteBatchFrame env

Parameters:
Returns: SpriteBatchEnv -> unit

End the current sprite batch frame, if any.

env : Viewport
Returns: SpriteBatchEnv -> unit

SpriteBatch.InterruptSpriteBatchFrame fn viewport env

Full Usage: SpriteBatch.InterruptSpriteBatchFrame fn viewport env

Parameters:

Forcibly end the current sprite batch frame, if any, run the given fn, then restart the sprite batch frame.

fn : unit -> unit
viewport : Viewport
env : SpriteBatchEnv

SpriteBatch.ReloadShaders env

Full Usage: SpriteBatch.ReloadShaders env

Parameters:

Reload the shaders used by the environment.

env : SpriteBatchEnv

SpriteBatch.SubmitSpriteBatchSprite (absolute, min, size, pivot, rotation, texCoords, clipOpt, color, bfs, bfd, beq, texture, viewport, env)

Full Usage: SpriteBatch.SubmitSpriteBatchSprite (absolute, min, size, pivot, rotation, texCoords, clipOpt, color, bfs, bfd, beq, texture, viewport, env)

Parameters:

Submit a sprite to the appropriate sprite batch.

absolute : bool
min : Vector2
size : Vector2
pivot : Vector2
rotation : single
texCoords : inref<Box2>
clipOpt : inref<Box2 voption>
color : inref<Color>
bfs : BlendingFactor
bfd : BlendingFactor
beq : BlendEquationMode
texture : Texture
viewport : Viewport
env : SpriteBatchEnv

Type something to start searching.