2020-07-05 13:01:44 -04:00
|
|
|
package d2interface
|
|
|
|
|
|
|
|
import (
|
|
|
|
"image"
|
|
|
|
"image/color"
|
2020-07-08 21:57:35 -04:00
|
|
|
|
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
2020-07-05 13:01:44 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
// Animation is an animation
|
|
|
|
type Animation interface {
|
2020-10-28 14:17:42 -04:00
|
|
|
BindRenderer(Renderer)
|
2020-07-05 13:01:44 -04:00
|
|
|
Clone() Animation
|
|
|
|
SetSubLoop(startFrame, EndFrame int)
|
|
|
|
Advance(elapsed float64) error
|
2020-11-13 15:03:30 -05:00
|
|
|
GetCurrentFrameSurface() Surface
|
2020-10-28 14:17:42 -04:00
|
|
|
Render(target Surface)
|
|
|
|
RenderFromOrigin(target Surface, shadow bool)
|
|
|
|
RenderSection(sfc Surface, bound image.Rectangle)
|
2020-07-05 13:01:44 -04:00
|
|
|
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)
|
|
|
|
SetColorMod(colorMod color.Color)
|
|
|
|
GetPlayedCount() int
|
|
|
|
ResetPlayedCount()
|
2020-07-08 21:57:35 -04:00
|
|
|
SetEffect(effect d2enum.DrawEffect)
|
2020-08-16 14:59:34 -04:00
|
|
|
SetShadow(shadow bool)
|
2020-07-05 13:01:44 -04:00
|
|
|
}
|