zntg/ui/renderer.go
Sander Schobers ff51378aff Added button types.
Go image can be reconstructed from ui.Image/allg5.Bitmap.
Changed allg5.Scale from interface to struct.
2019-03-13 19:49:00 +01:00

36 lines
802 B
Go

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