nitro

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package nitro provides functionality for reading Nitro assets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animation

type Animation struct {
	Layers       map[int]AnimationLayer `json:"layers"`
	TransitionTo *int
}

type AnimationFrame

type AnimationFrame struct {
	Id int `json:"id"`
}

type AnimationLayer

type AnimationLayer struct {
	LoopCount      float64               `json:"loopCount"`
	FrameRepeat    float64               `json:"frameRepeat"`
	Random         float64               `json:"random"`
	FrameSequences map[int]FrameSequence `json:"frameSequences"`
}

type Archive

type Archive struct {
	Files map[string]File
}

type Asset

type Asset struct {
	Source string  `json:"source"`
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
	FlipH  bool    `json:"flipH"`
	FlipV  bool    `json:"flipV"`
}

type Color

type Color struct {
	Layers map[int]Layer `json:"layers"`
}

type Dimensions

type Dimensions struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
	Z float64 `json:"z"`
}

type Direction

type Direction struct {
	Layers map[int]Layer `json:"layers"`
}

type File

type File struct {
	Name string
	Data []byte
}

type FrameSequence

type FrameSequence struct {
	Frames map[int]AnimationFrame `json:"frames"`
}

type Furni

type Furni struct {
	Name              string           `json:"name"`
	LogicType         string           `json:"logicType"`
	VisualizationType string           `json:"visualizationType"`
	Assets            map[string]Asset `json:"assets"`
	Logic             Logic            `json:"logic"`
	Visualizations    []Visualization  `json:"visualizations"`
	Spritesheet       Spritesheet      `json:"spritesheet"`
}

type Layer

type Layer struct {
	Z           float64 `json:"z"`
	Ink         string  `json:"ink"`
	Alpha       int     `json:"alpha"`
	Color       int     `json:"color"`
	IgnoreMouse bool    `json:"ignoreMouse"`
}

type Logic

type Logic struct {
	Model           Model            `json:"model"`
	ParticleSystems []ParticleSystem `json:"particleSystems"`
}

type Meta

type Meta struct {
	Image  string  `json:"image"`
	Format string  `json:"format"`
	Size   Size    `json:"size"`
	Scale  float64 `json:"scale"`
}

func (*Meta) UnmarshalJSON

func (m *Meta) UnmarshalJSON(data []byte) (err error)

type Model

type Model struct {
	Dimensions Dimensions `json:"dimensions"`
	Directions []int      `json:"directions"`
}

type ParticleSystem

type ParticleSystem struct {
	Size int `json:"size"`
}

type Pivot

type Pivot struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(r io.Reader) *Reader

func (*Reader) ReadArchive

func (r *Reader) ReadArchive() (archive Archive, err error)

func (*Reader) ReadFile

func (r *Reader) ReadFile() (file File, err error)

type Size

type Size struct {
	X int `json:"x"`
	Y int `json:"y"`
	W int `json:"w"`
	H int `json:"h"`
}

type SpriteFrame

type SpriteFrame struct {
	Frame            Size  `json:"frame"`
	Rotated          bool  `json:"rotated"`
	Trimmed          bool  `json:"trimmed"`
	SpriteSourceSize Size  `json:"spriteSourceSize"`
	SourceSize       Size  `json:"sourceSize"`
	Pivot            Pivot `json:"pivot"`
}

type Spritesheet

type Spritesheet struct {
	Frames map[string]SpriteFrame `json:"frames"`
	Meta   Meta                   `json:"meta"`
}

type Visualization

type Visualization struct {
	Angle      int               `json:"angle"`
	LayerCount int               `json:"layerCount"`
	Size       int               `json:"size"`
	Layers     map[int]Layer     `json:"layers"`
	Directions map[int]Direction `json:"directions"`
	Colors     map[int]Color     `json:"colors"`
	Animations map[int]Animation `json:"animations"`
}

Jump to

Keyboard shortcuts

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