anim

package
v0.0.0-...-59843aa Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anim

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

动画

func NewAnim

func NewAnim(engine *g2d.Engine, count, rate int) (anim Anim)

新建

func NewFromAnim

func NewFromAnim(engine *g2d.Engine, data []byte) (anim Anim, err error)

新建

func (*Anim) Draw

func (a *Anim) Draw()

func (*Anim) GetAlpha

func (a *Anim) GetAlpha() float64

获取旋转

func (*Anim) GetCentre

func (a *Anim) GetCentre() (x, y int)

获取中点

func (*Anim) GetCount

func (a *Anim) GetCount() int

设置帧率

func (*Anim) GetCurrentFrame

func (a *Anim) GetCurrentFrame() int

获取当前帧

func (*Anim) GetOffset

func (a *Anim) GetOffset() (x, y int)

设置偏移

func (*Anim) GetRate

func (a *Anim) GetRate() int

获取帧率

func (*Anim) GetRotate

func (a *Anim) GetRotate() float64

获取旋转

func (*Anim) GetScale

func (a *Anim) GetScale() (x, y float64)

获取缩放

func (*Anim) GetTag

func (a *Anim) GetTag() string

获取标签

func (*Anim) SetAlpha

func (a *Anim) SetAlpha(alpha float64)

设置透明

func (*Anim) SetCentre

func (a *Anim) SetCentre(x, y int)

设置中点

func (*Anim) SetDraw

func (a *Anim) SetDraw(start, count int)

设置渲染

func (*Anim) SetEventCallback

func (a *Anim) SetEventCallback(cfun event.AnimEventFunc)

事件回调

func (*Anim) SetFrameFromData

func (a *Anim) SetFrameFromData(index int, data []byte) (err error)

设置图片

func (*Anim) SetFrameFromImage

func (a *Anim) SetFrameFromImage(index int, img image.Image) (err error)

设置图片

func (*Anim) SetOffset

func (a *Anim) SetOffset(x, y int)

获取偏移

func (*Anim) SetRate

func (a *Anim) SetRate(rate int)

设置帧率

func (*Anim) SetRotate

func (a *Anim) SetRotate(rotate float64)

设置旋转

func (*Anim) SetScale

func (a *Anim) SetScale(x, y float64)

设置缩放

func (*Anim) SetTag

func (a *Anim) SetTag(tag string)

设置标签

Jump to

Keyboard shortcuts

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