zntg/ui/renderer.go

38 lines
975 B
Go
Raw Normal View History

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)
2020-05-12 21:03:43 +00:00
CreateTexture(m image.Image) (Texture, error)
CreateTexturePath(path string) (Texture, error)
CreateTextureSize(w, h float32) (Texture, error)
DefaultTarget() Texture
DrawTexture(t Texture, p geom.PointF32)
DrawTextureOptions(t Texture, p geom.PointF32, opts DrawOptions)
FillRectangle(r geom.RectangleF32, c color.Color)
Font(name string) Font
Rectangle(r geom.RectangleF32, c color.Color, thickness float32)
RegisterFont(name, path string, size int) error
2020-05-12 21:03:43 +00:00
RenderTo(Texture)
RenderToDisplay()
2019-03-11 16:30:41 +00:00
SetMouseCursor(c MouseCursor)
Size() geom.PointF32
2020-05-12 21:03:43 +00:00
Target() Texture
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)
}