Header menu logo Nu

SpriteBatch Module

Sprite batch operations.

Functions and values

Function or value Description

SpriteBatch.InterruptSpriteBatchFrame fn viewport resolveTexture env

Full Usage: SpriteBatch.InterruptSpriteBatchFrame fn viewport resolveTexture 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
resolveTexture : Texture
env : SpriteBatchEnv

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

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

Parameters:

Begin a new sprite batch frame.

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

SpriteBatch.createSpriteBatchEnv unfilteredSampler filteredSampler resolveTexture context

Full Usage: SpriteBatch.createSpriteBatchEnv unfilteredSampler filteredSampler resolveTexture context

Parameters:
Returns: SpriteBatchEnv

Destroy the given sprite batch environment.

unfilteredSampler : Sampler
filteredSampler : Sampler
resolveTexture : VkFormat
context : VulkanContext
Returns: SpriteBatchEnv

SpriteBatch.destroySpriteBatchEnv env

Full Usage: SpriteBatch.destroySpriteBatchEnv env

Parameters:

Destroy the given sprite batch environment.

env : SpriteBatchEnv

SpriteBatch.endSpriteBatchFrame viewport env

Full Usage: SpriteBatch.endSpriteBatchFrame viewport env

Parameters:
Returns: SpriteBatchEnv -> unit

End the current sprite batch frame, if any.

viewport : Viewport
env : Texture
Returns: SpriteBatchEnv -> unit

SpriteBatch.reloadShaders env context

Full Usage: SpriteBatch.reloadShaders env context

Parameters:

Reload the shaders used by the environment.

env : SpriteBatchEnv
context : VulkanContext

SpriteBatch.submitSpriteBatchSprite (absolute, min, size, pivot, rotation, texCoords, clipOpt, color, blend, texture, viewport, resolveTexture, env)

Full Usage: SpriteBatch.submitSpriteBatchSprite (absolute, min, size, pivot, rotation, texCoords, clipOpt, color, blend, texture, viewport, resolveTexture, 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>
blend : VulkanBlend
texture : Texture
viewport : Viewport
resolveTexture : Texture
env : SpriteBatchEnv

Type something to start searching.