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 (viewProjectionAbsolute, viewProjectionRelative, env)

Full Usage: SpriteBatch.BeginSpriteBatchFrame (viewProjectionAbsolute, viewProjectionRelative, env)

Parameters:

Beging a new sprite batch frame3.

viewProjectionAbsolute : inref<Matrix4x4>
viewProjectionRelative : inref<Matrix4x4>
env : SpriteBatchEnv

SpriteBatch.CreateSpriteBatchEnv shaderFilePath

Full Usage: SpriteBatch.CreateSpriteBatchEnv shaderFilePath

Parameters:
    shaderFilePath : string

Returns: SpriteBatchEnv

Destroy the given sprite batch environment.

shaderFilePath : string
Returns: SpriteBatchEnv

SpriteBatch.CreateSpriteBatchShader shaderFilePath

Full Usage: SpriteBatch.CreateSpriteBatchShader shaderFilePath

Parameters:
    shaderFilePath : string

Returns: int * int * int * int * int * int * int * uint32

Create a sprite batch shader.

shaderFilePath : string
Returns: int * int * int * int * int * int * int * uint32

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.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.