assets

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Player *ebiten.Image = MustLoadPNG("entity/player")
	Tree   *ebiten.Image = MustLoadPNG("object/tree")

	Icon16  *ebiten.Image = MustLoadPNG("icon/icon16")
	Icon22  *ebiten.Image = MustLoadPNG("icon/icon22")
	Icon24  *ebiten.Image = MustLoadPNG("icon/icon24")
	Icon32  *ebiten.Image = MustLoadPNG("icon/icon32")
	Icon48  *ebiten.Image = MustLoadPNG("icon/icon48")
	Icon64  *ebiten.Image = MustLoadPNG("icon/icon64")
	Icon128 *ebiten.Image = MustLoadPNG("icon/icon128")
	Icon256 *ebiten.Image = MustLoadPNG("icon/icon256")
	Icon512 *ebiten.Image = MustLoadPNG("icon/icon512")

	Berries TextureCache = NewTextureCache()

	Fonts TextureCache = NewTextureCache()
)

Functions

func LoadPNG added in v0.0.3

func LoadPNG(file string) (*ebiten.Image, error)

func MustLoadPNG added in v0.1.1

func MustLoadPNG(file string) *ebiten.Image

Types

type Font added in v0.1.1

type Font struct {
	CharHeight     int        `json:"height"`
	CharWidth      int        `json:"width"`
	YShift         int        `json:"y-shift"`
	Spacing        int        `json:"spacing"`
	Rows           int        `json:"rows"`
	Cols           int        `json:"columns"`
	TexturePath    string     `json:"texture"`
	UnicodeMapping [][]string `json:"mapping"`

	Height int
	// contains filtered or unexported fields
}

A monospace bitmap font

var (
	DefaultFont Font = MustLoadFont("default")
)

func LoadFont added in v0.1.1

func LoadFont(file string) (Font, error)

func MustLoadFont added in v0.1.1

func MustLoadFont(file string) Font

func (Font) GetRuneCoords added in v0.1.1

func (f Font) GetRuneCoords(r rune) (image.Point, error)

func (*Font) UpdateResources added in v0.1.1

func (f *Font) UpdateResources() error

func (Font) Validate added in v0.1.1

func (f Font) Validate() error

type TextureCache added in v0.1.1

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

func NewTextureCache added in v0.1.1

func NewTextureCache() TextureCache

func (*TextureCache) GetTexture added in v0.1.1

func (t *TextureCache) GetTexture(id string) *ebiten.Image

func (TextureCache) String added in v0.1.1

func (t TextureCache) String() string

type Textures added in v0.1.0

type Textures struct {
	Mapping map[string]string `json:"states"`
}
var (
	BerryStates Textures = MustLoadTextureMapping("berries")
)

func LoadTextureMapping added in v0.1.0

func LoadTextureMapping(file string) (Textures, error)

func MustLoadTextureMapping added in v0.1.1

func MustLoadTextureMapping(file string) Textures

func (Textures) GetTexturePath added in v0.1.0

func (t Textures) GetTexturePath(textureKey string) (string, error)

Jump to

Keyboard shortcuts

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