piskel

package module
v0.0.0-...-c5bcb20 Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: MIT Imports: 6 Imported by: 0

README

go-piskel

Build Status Go Report Card go.dev reference

piskel format loader for Golang

Note

Because there is no official format description I made this loader by creating few sprites and exploring result json.

It is possible that not all features are supported.

What is Piskel?

A simple web-based tool for Spriting and Pixel art.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Piskel

type Piskel struct {
	ModelVersion int           `json:"modelVersion"`
	Content      PiskelContent `json:"piskel"`
}

Piskel top level data

func LoadFromFile

func LoadFromFile(filename string) (*Piskel, error)

LoadFromFile load Piksel format from file

func LoadFromString

func LoadFromString(content string) (*Piskel, error)

LoadFromString load Piksel format from string

type PiskelChunk

type PiskelChunk struct {
	Layout    [][]int `json:"layout"`
	Base64PNG string  `json:"base64PNG"`
	Image     image.Image
}

PiskelChunk chunk data

type PiskelContent

type PiskelContent struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Fps         int      `json"fps"`
	Width       int      `json:"width"`
	Height      int      `json:"height"`
	LayerString []string `json:"layers"`
	Layers      []PiskelLayer
}

PiskelContent piksel sprite data

type PiskelLayer

type PiskelLayer struct {
	Name       string        `json:"name"`
	Opacity    float32       `json:"opacity"`
	FrameCount int           `json:"frameCount"`
	Chunks     []PiskelChunk `json:"chunks"`
}

PiskelLayer layer data

Jump to

Keyboard shortcuts

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