spr

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: BSD-2-Clause, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SourceData

type SourceData struct {
	File   string  `json:"file"`
	Width  float64 `json:"width"`
	Height float64 `json:"height"`
}

type SpriteDef

type SpriteDef struct {
	Version  string          `json:"version"`
	Source   *SourceData     `json:"source,omitempty"`
	Position Vec2            `json:"position"`
	Size     Vec2            `json:"size"`
	Origin   Vec2            `json:"origin"`
	Metadata json.RawMessage `json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func NewSpriteDef

func NewSpriteDef(name string, meta interface{}) *SpriteDef

func ReadSpriteDefFile

func ReadSpriteDefFile(name string) (*SpriteDef, error)

func (*SpriteDef) Filename

func (sd *SpriteDef) Filename() string

func (*SpriteDef) WriteToFile

func (sd *SpriteDef) WriteToFile(name string, perm os.FileMode) error

type SpriteDefVersion

type SpriteDefVersion string
const (
	SpriteV1 SpriteDefVersion = "1"
)

type Vec2

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

Jump to

Keyboard shortcuts

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