sprite

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImageTypePNG  = "png"
	ImageTypeJPEG = "jpeg"
	ImageTypeJPG  = "jpg"
)
View Source
const SpritesSchemaStr = `` /* 798-byte string literal not displayed */

Variables

This section is empty.

Functions

func NewSpritesType

func NewSpritesType() (resource.Type, error)

func Types

func Types() []resource.Type

Types

type Image

type Image struct {
	Image *ebiten.Image
}

func LoadImage

func LoadImage(path string) (*Image, error)

func (*Image) Initialize

func (img *Image) Initialize(mgr resource.Manager) error

type ImageType

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

func (*ImageType) Load

func (t *ImageType) Load(path string) (resource.Resource, error)

func (*ImageType) Name

func (t *ImageType) Name() string

type Sprite

type Sprite struct {
	Start topdown.Point[int] `json:"start"`
	Size  topdown.Size[int]  `json:"size"`
	Tags  []string           `json:"tags,omitempty"`

	Image *ebiten.Image
}

func (*Sprite) Initialize

func (c *Sprite) Initialize(parent *ebiten.Image)

type SpriteSet

type SpriteSet struct {
	ImageRef string    `json:"imageRef"`
	Sprites  []*Sprite `json:"sprites"`
}

func NewSpriteSet

func NewSpriteSet(imageRef string, sprites ...*Sprite) *SpriteSet

func (*SpriteSet) FindSprite

func (s *SpriteSet) FindSprite(start topdown.Point[int]) (*ebiten.Image, *Sprite, bool)

func (*SpriteSet) Initialize

func (s *SpriteSet) Initialize(mgr resource.Manager) error

func (*SpriteSet) Tags

func (s *SpriteSet) Tags() []string

type SpritesType

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

func (*SpritesType) Load

func (pt *SpritesType) Load(path string) (resource.Resource, error)

func (*SpritesType) Name

func (pt *SpritesType) Name() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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