behaviour_common

package
v0.0.0-...-dfa9214 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAnimationName = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Animation

type Animation []*Frame

type Animations

type Animations map[string]Animation

type Frame

type Frame struct {
	Image  *ebiten.Image
	Anchor r2.Point
}

func (*Frame) SetAnchorToggle

func (bhvr *Frame) SetAnchorToggle(pos FrameAnchorToggle)

type FrameAnchorToggle

type FrameAnchorToggle int
const (
	Sprite_FrameAnchor_ToggleTopLeft FrameAnchorToggle = iota
	Sprite_FrameAnchor_ToggleTopCenter
	Sprite_FrameAnchor_ToggleTopRight
	Sprite_FrameAnchor_ToggleMiddleLeft
	Sprite_FrameAnchor_ToggleMiddleCenter
	Sprite_FrameAnchor_ToggleMiddleRight
	Sprite_FrameAnchor_ToggleBottomLeft
	Sprite_FrameAnchor_ToggleBottomCenter
	Sprite_FrameAnchor_ToggleBottomRight

	Sprite_FrameAnchor_ToggleDefault = Sprite_FrameAnchor_ToggleMiddleCenter
)

type Sprite

type Sprite struct {
	Animations       Animations
	CurrentAnimation string
	CurrentFrame     int
}

func (*Sprite) GetCurrentFrame

func (bhvr *Sprite) GetCurrentFrame() *Frame

func (*Sprite) Init

func (bhvr *Sprite) Init()

func (*Sprite) InsertFrame

func (bhvr *Sprite) InsertFrame(animationName string, newFrames ...*Frame)

InsertFrame insert frame(s) at the end of the animation named "animationName" by Image. If "animationName" is empty, then it will use default value.

func (*Sprite) InsertFrameByImage

func (bhvr *Sprite) InsertFrameByImage(animationName string, images ...*ebiten.Image)

InsertFrameByImage insert frame(s) at the end of the animation named "animationName" by Image. If "animationName" is empty, then it will use default value.

Jump to

Keyboard shortcuts

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