clips

package
v0.0.0-...-38191d5 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clip

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

Clip is a set of frames

func New

func New(sprite *sprites.Sprite, name string, x, y int) *Clip

New creates a new sprite based clip

func NewScaled

func NewScaled(sprite *sprites.Sprite, name string, x, y, width, height int) *Clip

NewScaled creates a new 9 slice scaled sprite based clip

func (*Clip) Draw

func (c *Clip) Draw(screen *ebiten.Image)

Draw draws the clip

func (*Clip) GetName

func (c *Clip) GetName() string

GetName gets the name of the clip

func (*Clip) GotoFrame

func (c *Clip) GotoFrame(frame int)

GotoFrame goes to a frame of the clip

func (*Clip) IsHovered

func (c *Clip) IsHovered() bool

IsHovered returns whether or not the cursor is hovering the clip

func (*Clip) IsTouched

func (c *Clip) IsTouched(touchID ebiten.TouchID) bool

IsTouched returns whether or not the touch hits the clip

func (*Clip) IsTouchedPreviously

func (c *Clip) IsTouchedPreviously(touchID ebiten.TouchID) bool

IsTouched returns whether or not the touch hits the clip

func (*Clip) OnLongPress

func (c *Clip) OnLongPress(handler func())

OnLongPress sets the click handler function

func (*Clip) OnPress

func (c *Clip) OnPress(handler func())

OnPress sets the click handler function

func (*Clip) OnRelease

func (c *Clip) OnRelease(handler func())

OnRelease sets the click handler function

func (*Clip) OnReleaseOutside

func (c *Clip) OnReleaseOutside(handler func())

OnReleaseOutside sets the click handler function

func (*Clip) Update

func (c *Clip) Update() (err error)

Update updates the clip

type ClipJSON

type ClipJSON struct {
	Name          string
	Sprite        string
	Repeat        string
	X, Y          string
	Width, Height string
}

ClipJSON is a clip in JSON

Jump to

Keyboard shortcuts

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