zntg/ui/renderer.go
Sander Schobers 19daffd110 Added UI elements.
Reversed order of operands when comparing with nil/0 .
2019-03-05 21:52:18 +01:00

33 lines
697 B
Go

package ui
import (
"image"
"image/color"
"opslag.de/schobers/geom"
)
type Renderer interface {
// Events
PushEvents(t EventTarget, wait bool)
// 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
DrawImage(p geom.PointF32, im Image)
FillRectangle(r geom.RectangleF32, c color.Color)
Font(font string) Font
Rectangle(r geom.RectangleF32, c color.Color, thickness float32)
RenderTo(Image)
RenderToDisplay()
Size() geom.PointF32
Target() Image
Text(p geom.PointF32, font string, color color.Color, text string)
}