1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-07 18:57:18 -05:00
OpenDiablo2/d2core/d2ui/drawable.go
juander 627bc8ec65 d2ui: Add WidgetGroup
this allows us to groups screens together, such that they can be
de-/activated by de-/activating the group instead of every ui element by
hand.

Before we were deactivating buttons and stopped rendering to deactivate ui
elements. This tied the renderer to these elements.
2020-11-09 18:13:17 +01:00

20 lines
484 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) error
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)
}