assets

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assets

type Assets struct {
	SpriteSheet       *ebiten.Image
	SpriteSheetXMLMap SpriteMap
}

func NewAssets

func NewAssets() *Assets

func (*Assets) GetSprite

func (a *Assets) GetSprite(name string) *ebiten.Image

GetSprite retrieves the sprite image by name from the assets.

Parameters: - name: the name of the sprite to retrieve. Returns: - *ebiten.Image: the sprite image corresponding to the given name.

type SpriteMap

type SpriteMap struct {
	XMLName     xml.Name     `xml:"TextureAtlas"`
	ImagePath   string       `xml:"imagePath,attr"`
	SubTextures []SubTexture `xml:"SubTexture"`
}

type SubTexture

type SubTexture struct {
	XMLName xml.Name `xml:"SubTexture"`
	Name    string   `xml:"name,attr"`
	X       int      `xml:"x,attr"`
	Y       int      `xml:"y,attr"`
	Width   int      `xml:"width,attr"`
	Height  int      `xml:"height,attr"`
}

Jump to

Keyboard shortcuts

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