mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-16 09:25:57 -05:00
3990df3bac
* Fixes #496 using ebiten.SubImage to Render Section of a Surface. I had to add matching functions to both animation and sprite to get it to be called for a sprite object. * Fixed linter warning on comments for Sprite and Animation. * Removing what's remaining of the old Sprite re-generation and caching.
31 lines
793 B
Go
31 lines
793 B
Go
package d2interface
|
|
|
|
import (
|
|
"image"
|
|
"image/color"
|
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
|
)
|
|
|
|
// Surface represents a renderable surface.
|
|
type Surface interface {
|
|
Clear(color color.Color) error
|
|
DrawRect(width, height int, color color.Color)
|
|
DrawLine(x, y int, color color.Color)
|
|
DrawText(format string, params ...interface{})
|
|
GetSize() (width, height int)
|
|
GetDepth() int
|
|
Pop()
|
|
PopN(n int)
|
|
PushColor(color color.Color)
|
|
PushCompositeMode(mode d2enum.CompositeMode)
|
|
PushFilter(filter Filter)
|
|
PushTranslation(x, y int)
|
|
PushBrightness(brightness float64)
|
|
Render(surface Surface) error
|
|
// Renders a section of the surface enclosed by bounds
|
|
RenderSection(surface Surface, bound image.Rectangle) error
|
|
ReplacePixels(pixels []byte) error
|
|
Screenshot() *image.RGBA
|
|
}
|