Back to

Package sprite

Latest Go to latest

The latest major version is .

Published: Dec 29, 2019 | License: MIT | Module:



const (
	SpriteDirectoryBase = "sprite"

func DebugWatch

func DebugWatch()

func DebugWriteSpriteConfig

func DebugWriteSpriteConfig(spr *Sprite)

func GetRawFrame

func GetRawFrame(spriteIndex SpriteIndex, index int) *ebiten.Image

NOTE(Jake): 2018-06-17

This is called by draw_nonheadless.go in the parent package so that it can draw the image.

func InitSpriteGeneratedData

func InitSpriteGeneratedData(indexToName []string, nameToIndex map[string]SpriteIndex, indexToPath []string)

InitSpriteGeneratedData is used by code generated by gmlgo so you can query a sprite by index or name

func SpriteCollisionMask

func SpriteCollisionMask(spriteIndex SpriteIndex) geom.Rect

func SpriteLoad

func SpriteLoad(index SpriteIndex)

func SpriteNames

func SpriteNames() []string

type CollisionMask

type CollisionMask struct {
	Kind CollisionMaskKind
	Rect geom.Rect

func GetCollisionMask

func GetCollisionMask(spriteIndex SpriteIndex, imageIndex int, kind int) *CollisionMask

type CollisionMaskKind

type CollisionMaskKind int
const (
	CollisionMaskInherit CollisionMaskKind = 0 + iota

type Sprite

type Sprite struct {
	// contains filtered or unexported fields

func (*Sprite) Name

func (spr *Sprite) Name() string

type SpriteFrame

type SpriteFrame struct {
	// contains filtered or unexported fields

func (*SpriteFrame) Size

func (frame *SpriteFrame) Size() (width int, height int)

type SpriteIndex

type SpriteIndex int32
const SprUndefined SpriteIndex = 0

func SpriteLoadByName

func SpriteLoadByName(name string) SpriteIndex

SpriteLoadByName is used internally by the room editor, animation editor, live-sprite reloading watcher and more

func (SpriteIndex) ImageSpeed

func (spriteIndex SpriteIndex) ImageSpeed() float64

func (SpriteIndex) Name

func (spriteIndex SpriteIndex) Name() string

func (SpriteIndex) Size

func (spriteIndex SpriteIndex) Size() geom.Vec

type SpriteState

type SpriteState struct {
	ImageScale geom.Vec
	// contains filtered or unexported fields

func (*SpriteState) ImageIndex

func (state *SpriteState) ImageIndex() float64

func (*SpriteState) ImageNumber

func (state *SpriteState) ImageNumber() float64

func (*SpriteState) ImageSpeed

func (state *SpriteState) ImageSpeed() float64

func (*SpriteState) ImageUpdate

func (state *SpriteState) ImageUpdate()

func (*SpriteState) SetImageIndex

func (state *SpriteState) SetImageIndex(imageIndex float64)

func (*SpriteState) SetSprite

func (state *SpriteState) SetSprite(spriteIndex SpriteIndex)

func (*SpriteState) SpriteIndex

func (state *SpriteState) SpriteIndex() SpriteIndex

func (SpriteState) UnsafeSnapshotMarshalBinary

func (state SpriteState) UnsafeSnapshotMarshalBinary(buf *bytes.Buffer) error

func (*SpriteState) UnsafeSnapshotUnmarshalBinary

func (state *SpriteState) UnsafeSnapshotUnmarshalBinary(buf *bytes.Buffer) error

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier