Documentation ¶
Index ¶
- Constants
- Variables
- type AlignMode
- type CustomCursor
- type Driver
- func (d *Driver) ConfigureSlider(id string, steps map[int]int) error
- func (d *Driver) Cursor() (*ebiten.Image, *ebiten.DrawImageOptions, error)
- func (d *Driver) Dialogues() []string
- func (d *Driver) Draw(screen *ebiten.Image) error
- func (d *Driver) HideDialogue()
- func (d *Driver) IsInDialogue() bool
- func (d *Driver) OnClick(id string, f func()) error
- func (d *Driver) SetActive(locator string, value bool) error
- func (d *Driver) SetFreeze(id string, value bool) error
- func (d *Driver) SetValue(id, value string) error
- func (d *Driver) SetValueBool(id string, value bool) error
- func (d *Driver) SetValueInt(id string, value int) error
- func (d *Driver) ShowDialogue(locator string) error
- func (d *Driver) ToggleActive(locator string) error
- func (d *Driver) Update(screenX, screenY int) error
- func (d *Driver) Value(id string, into *string) error
- func (d *Driver) ValueBool(id string, into *bool) error
- func (d *Driver) ValueInt(id string, into *int) error
- type Game
- type Widget
- type Window
- func (w *Window) Draw(screen *ebiten.Image)
- func (w *Window) Layout(_, _ int) (int, int)
- func (w *Window) OnKeyUp(key ebiten.Key, f func())
- func (w *Window) OnMouseClick(f func())
- func (w *Window) OnMouseWheel(f func(x, y float64))
- func (w *Window) Run() error
- func (w *Window) Update() (outErr error)
- func (w *Window) WhileKeyDown(key ebiten.Key, f func())
Constants ¶
const ( OriginalX = 640.0 OriginalY = 480.0 )
Variables ¶
var (
SpeedDivisor = 2
)
Functions ¶
This section is empty.
Types ¶
type CustomCursor ¶
type CustomCursor interface { // The cursor draw operation Cursor() (*ebiten.Image, *ebiten.DrawImageOptions, error) }
type Driver ¶
type Driver struct { Name string // contains filtered or unexported fields }
Driver acts as an interface between the main loop and the widgets specified in a menu.
Menu assets assume a 640x480 screen; Driver is responsible for scaling to the actual screen size when drawing.
TODO: move scaling responsibilities to Window?
func NewDriver ¶
func NewDriver(assets *assetstore.AssetStore, menu *assetstore.Menu) (*Driver, error)
func (*Driver) ConfigureSlider ¶
FIXME: HURK. Surely I'm missing something? steps is value:offset
func (*Driver) HideDialogue ¶
func (d *Driver) HideDialogue()
func (*Driver) IsInDialogue ¶
func (*Driver) ShowDialogue ¶
func (*Driver) ToggleActive ¶
type Window ¶
type Window struct { Title string KeyUpHandlers map[ebiten.Key]func() MouseWheelHandler func(float64, float64) MouseClickHandler func() WhileKeyDownHandlers map[ebiten.Key]func() // contains filtered or unexported fields }
TODO: move all scaling into Window, so drivers only need to cope with one coordinate space. This will allow us to draw custom mouse cursors in the window, rather than in the driver.
func NewWindow ¶
0,0 is the *top left* of the window
ebiten assumes a single window, so only call this once...
func (*Window) OnKeyUp ¶
func (w *Window) OnKeyUp(key ebiten.Key, f func())
TODO: multiple handlers for the same key?
func (*Window) OnMouseClick ¶
func (w *Window) OnMouseClick(f func())
func (*Window) OnMouseWheel ¶
func (*Window) Run ¶
TODO: a stop or other cancellation mechanism
Note that this must be called on the main OS thread
func (*Window) WhileKeyDown ¶
func (w *Window) WhileKeyDown(key ebiten.Key, f func())