mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-04 17:27:16 -05:00
c148941194
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)
20 lines
478 B
Go
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)
|
|
}
|