1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-12 10:40:42 +00:00
OpenDiablo2/d2common/d2interface/animation.go
Ziemas e2e8a303c2
Use our own DrawEffects enum for draw effects (#564)
* Add PushEffect, handle effects in renderer

* Set effects instead of blend

* Stop using PushCompositeMode, use PushEffect

* Remove remaining composite mode things
2020-07-08 21:57:35 -04:00

42 lines
1001 B
Go

package d2interface
import (
"image"
"image/color"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
)
// Animation is an animation
type Animation interface {
Clone() Animation
SetSubLoop(startFrame, EndFrame int)
Advance(elapsed float64) error
Render(target Surface) error
RenderFromOrigin(target Surface) error
RenderSection(sfc Surface, bound image.Rectangle) error
GetFrameSize(frameIndex int) (int, int, error)
GetCurrentFrameSize() (int, int)
GetFrameBounds() (int, int)
GetCurrentFrame() int
GetFrameCount() int
IsOnFirstFrame() bool
IsOnLastFrame() bool
GetDirectionCount() int
SetDirection(directionIndex int) error
GetDirection() int
SetCurrentFrame(frameIndex int) error
Rewind()
PlayForward()
PlayBackward()
Pause()
SetPlayLoop(loop bool)
SetPlaySpeed(playSpeed float64)
SetPlayLength(playLength float64)
SetPlayLengthMs(playLengthMs int)
SetColorMod(colorMod color.Color)
GetPlayedCount() int
ResetPlayedCount()
SetEffect(effect d2enum.DrawEffect)
}