2019-03-05 20:52:18 +00:00
|
|
|
package ui
|
|
|
|
|
|
|
|
import (
|
|
|
|
"image"
|
|
|
|
"image/color"
|
|
|
|
|
|
|
|
"opslag.de/schobers/geom"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Renderer interface {
|
|
|
|
// Events
|
|
|
|
PushEvents(t EventTarget, wait bool)
|
2019-03-06 17:18:35 +00:00
|
|
|
Refresh()
|
2019-03-05 20:52:18 +00:00
|
|
|
|
|
|
|
// Lifetime
|
|
|
|
Destroy() error
|
|
|
|
|
|
|
|
// Drawing
|
|
|
|
Clear(c color.Color)
|
|
|
|
CreateImage(m image.Image) (Image, error)
|
|
|
|
CreateImagePath(path string) (Image, error)
|
|
|
|
CreateImageSize(w, h float32) (Image, error)
|
|
|
|
DefaultTarget() Image
|
2019-03-13 18:49:00 +00:00
|
|
|
DrawImage(im Image, p geom.PointF32)
|
|
|
|
DrawImageOptions(im Image, p geom.PointF32, opts DrawOptions)
|
2019-03-05 20:52:18 +00:00
|
|
|
FillRectangle(r geom.RectangleF32, c color.Color)
|
2020-05-12 20:46:58 +00:00
|
|
|
Font(name string) Font
|
2019-03-05 20:52:18 +00:00
|
|
|
Rectangle(r geom.RectangleF32, c color.Color, thickness float32)
|
2020-05-12 20:46:58 +00:00
|
|
|
RegisterFont(name, path string, size int) error
|
2019-03-05 20:52:18 +00:00
|
|
|
RenderTo(Image)
|
|
|
|
RenderToDisplay()
|
2019-03-11 16:30:41 +00:00
|
|
|
SetMouseCursor(c MouseCursor)
|
2019-03-05 20:52:18 +00:00
|
|
|
Size() geom.PointF32
|
|
|
|
Target() Image
|
|
|
|
Text(p geom.PointF32, font string, color color.Color, text string)
|
2019-06-24 18:58:14 +00:00
|
|
|
TextAlign(p geom.PointF32, font string, color color.Color, text string, align HorizontalAlignment)
|
2019-03-05 20:52:18 +00:00
|
|
|
}
|