io

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AudioExtensions = map[string]AudioType{
	".wav": AudioTypeWav,
	".ogg": AudioTypeOgg,
	".mp3": AudioTypeMP3,
}

Functions

func ReadFile

func ReadFile(name string, s Filesystem) ([]byte, error)

Types

type AnimG added in v0.3.0

type AnimG struct {
	Name string
	Anim graphics.Animation
}

type Atlas

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

func ParseAtlas

func ParseAtlas(b []byte) (*Atlas, error)

func (*Atlas) GetAnimClip added in v0.3.0

func (a *Atlas) GetAnimClip(name string) graphics.AnimationClip

func (*Atlas) GetAnimClips added in v0.3.0

func (a *Atlas) GetAnimClips() []ClipG

func (*Atlas) GetAnimation added in v0.3.0

func (a *Atlas) GetAnimation(name string) graphics.Animation

func (*Atlas) GetAnimations added in v0.3.0

func (a *Atlas) GetAnimations() []AnimG

func (*Atlas) GetSubImage added in v0.3.0

func (a *Atlas) GetSubImage(name string) *Sprite

func (*Atlas) GetSubImages added in v0.3.0

func (a *Atlas) GetSubImages() []*Sprite

type AudioBuffer added in v0.7.0

type AudioBuffer struct {
	*bytes.Reader
}

func (*AudioBuffer) Close added in v0.7.0

func (b *AudioBuffer) Close() error

type AudioStream added in v0.7.0

type AudioStream struct {
	Data   audio.ReadSeekCloser
	Length int64
}

func ParseAudioStream added in v0.7.0

func ParseAudioStream(name string, b []byte) (*AudioStream, error)

type AudioType added in v0.7.0

type AudioType int
const (
	AudioTypeWav AudioType = 1
	AudioTypeOgg AudioType = 2
	AudioTypeMP3 AudioType = 3
)

type ClipG added in v0.3.0

type ClipG struct {
	Name     string
	AnimClip graphics.AnimationClip
}

type Container

type Container interface {
	Len() int64
	FS() Filesystem
	Load(name string) chan struct{}
	Unload(name string) (bool, error)
	LoadAll(names []string) (progress chan float64, done chan struct{})
	UnloadAll()
	Get(name string) ([]byte, error)
	GetImage(name string) (image.Image, error)
	GetAtlas(name string) (*Atlas, error)
	GetAudioStream(name string) (*AudioStream, error)
	GetAudioBytes(name string) ([]byte, error)
	GetXMLDOM(name string) ([]dom.Node, error)
}

func NewContainer

func NewContainer(ctx context.Context, fs Filesystem) Container

type Error added in v0.7.0

type Error string
const (
	ErrUnsupportedAudioType Error = "unsupported audio type and/or extension"
)

func (Error) Error added in v0.7.0

func (e Error) Error() string

type File

type File interface {
	io.Closer
	io.Reader
	io.Seeker
	Stat() (FileInfo, error)
}

File interface is almost a copy of http.File

type FileInfo

type FileInfo interface {
	Size() int64
	IsDir() bool
}

FileInfo interface

type Filesystem

type Filesystem interface {
	Open(name string) (File, error)
	Stat(name string) (FileInfo, error)
}

Filesystem interface

type Sprite added in v0.3.0

type Sprite struct {
	Name  string
	Image *ebiten.Image
	Pivot image.Point
}

type SubImageG added in v0.3.0

type SubImageG struct {
	Name     string
	SubImage *ebiten.Image
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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