1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-18 02:16:23 -05:00
OpenDiablo2/d2core/d2ui/drawable.go
juander c148941194 d2ui/drawable: Refactor render() method to not return error
this simplifies error handling statements all over the ui code. Before
we had to write:

if err := foo.Render(target); err != nil {
    return err
}

which simplifies now to foo.Render(target)
2020-11-11 14:55:59 +01:00

20 lines
478 B
Go

package d2ui
import (
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2interface"
)
// Drawable represents an instance that can be drawn
type Drawable interface {
Render(target d2interface.Surface)
Advance(elapsed float64) error
GetSize() (width, height int)
SetPosition(x, y int)
GetPosition() (x, y int)
OffsetPosition(xo, yo int)
GetVisible() bool
SetVisible(visible bool)
SetRenderPriority(priority RenderPriority)
GetRenderPriority() (priority RenderPriority)
}