Header menu logo Mibo.Raylib

SpriteSheet Module

Functions for creating sprite sheets from various sources.

These are factory functions intended for use at initialization time.

Functions and values

Function or value Description

animationNames sheet

Full Usage: animationNames sheet

Parameters:
Returns: string seq

Get the list of animation names in this sheet.

sheet : SpriteSheet
Returns: string seq

fromFrames texture origin animations

Full Usage: fromFrames texture origin animations

Parameters:
Returns: SpriteSheet

Create a sprite sheet from explicit frame rectangles.

texture : Texture2D
origin : Vector2
animations : (string * Animation)[]
Returns: SpriteSheet

fromGrid texture frameWidth frameHeight columns animations

Full Usage: fromGrid texture frameWidth frameHeight columns animations

Parameters:
Returns: SpriteSheet

Create a sprite sheet from a uniform grid layout.

texture : Texture2D
frameWidth : int
frameHeight : int
columns : int
animations : GridAnimationDef[]
Returns: SpriteSheet

single texture frames fps loop

Full Usage: single texture frames fps loop

Parameters:
Returns: SpriteSheet

Create a single-animation sprite sheet.

texture : Texture2D
frames : Rectangle[]
fps : float32
loop : bool
Returns: SpriteSheet

static' texture sourceRect

Full Usage: static' texture sourceRect

Parameters:
Returns: SpriteSheet

Create a sprite sheet for a single static frame (no animation).

texture : Texture2D
sourceRect : Rectangle
Returns: SpriteSheet

tryGetAnimationIndex name sheet

Full Usage: tryGetAnimationIndex name sheet

Parameters:
Returns: int voption
Modifiers: inline

Try to get the index for an animation name.

Use at load time to resolve animation names to indices for zero-allocation playback.

name : string
sheet : SpriteSheet
Returns: int voption

withNormalMap nm sheet

Full Usage: withNormalMap nm sheet

Parameters:
Returns: SpriteSheet

Add a normal map to an existing sprite sheet.

nm : Texture2D
sheet : SpriteSheet
Returns: SpriteSheet

Type something to start searching.