microstateregistry

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package microstateregistry provides types and loading for micro (10x2) avatar definitions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Height

func Height() int

Height returns the micro avatar height

func ListStates

func ListStates() []string

ListStates returns all state names

func Width

func Width() int

Width returns the micro avatar width

Types

type MicroDefinition

type MicroDefinition struct {
	Name      string       `json:"name"`
	Width     int          `json:"width"`
	Height    int          `json:"height"`
	BaseFrame MicroFrame   `json:"base_frame"`
	States    []MicroState `json:"states"`
}

MicroDefinition represents a complete micro avatar definition with base frame and states.

var DefaultDefinition *MicroDefinition

DefaultDefinition is the global micro avatar definition loaded from embedded JSON

func Get

func Get() *MicroDefinition

Get returns the default micro definition

func LoadEmbedded

func LoadEmbedded() (*MicroDefinition, error)

LoadEmbedded loads the micro definition from the embedded JSON file

type MicroFrame

type MicroFrame struct {
	Name  string   `json:"name,omitempty"`
	Lines []string `json:"lines"`
}

MicroFrame represents a single frame in a micro avatar animation.

func GetBaseFrame

func GetBaseFrame() MicroFrame

GetBaseFrame returns the base frame from the default definition

type MicroState

type MicroState struct {
	Name   string       `json:"name"`
	FPS    int          `json:"fps,omitempty"`
	Frames []MicroFrame `json:"frames"`
}

MicroState represents an animation state with multiple frames.

func GetState

func GetState(name string) *MicroState

GetState retrieves a specific state by name

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL