Documentation ¶
Overview ¶
Package draw2dgl provides a graphic context that can draw vector graphics and text on OpenGL.
Index ¶
- Constants
- type GraphicContext
- func (gc *GraphicContext) Clear()
- func (gc *GraphicContext) ClearRect(x1, y1, x2, y2 int)
- func (gc *GraphicContext) DrawImage(img image.Image)
- func (gc *GraphicContext) Fill(paths ...*draw2d.Path)
- func (gc *GraphicContext) FillString(text string) (width float64)
- func (gc *GraphicContext) FillStringAt(text string, x, y float64) (width float64)
- func (gc *GraphicContext) FillStroke(paths ...*draw2d.Path)
- func (gc *GraphicContext) Stroke(paths ...*draw2d.Path)
- func (gc *GraphicContext) StrokeString(text string) (width float64)
- func (gc *GraphicContext) StrokeStringAt(text string, x, y float64) (width float64)
- type Painter
Constants ¶
View Source
const M16 uint32 = 1<<16 - 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GraphicContext ¶
type GraphicContext struct { *draw2dbase.StackGraphicContext // contains filtered or unexported fields }
func NewGraphicContext ¶
func NewGraphicContext(width, height int) *GraphicContext
NewGraphicContext creates a new Graphic context from an image.
func (*GraphicContext) Fill ¶
func (gc *GraphicContext) Fill(paths ...*draw2d.Path)
func (*GraphicContext) FillString ¶
func (gc *GraphicContext) FillString(text string) (width float64)
FillString draws the text at point (0, 0)
func (*GraphicContext) FillStringAt ¶
func (gc *GraphicContext) FillStringAt(text string, x, y float64) (width float64)
FillStringAt draws the text at the specified point (x, y)
func (*GraphicContext) FillStroke ¶
func (gc *GraphicContext) FillStroke(paths ...*draw2d.Path)
func (*GraphicContext) Stroke ¶
func (gc *GraphicContext) Stroke(paths ...*draw2d.Path)
func (*GraphicContext) StrokeString ¶
func (gc *GraphicContext) StrokeString(text string) (width float64)
StrokeString draws the contour of the text at point (0, 0)
func (*GraphicContext) StrokeStringAt ¶
func (gc *GraphicContext) StrokeStringAt(text string, x, y float64) (width float64)
StrokeStringAt draws the contour of the text at point (x, y)
type Painter ¶
type Painter struct { // The Porter-Duff composition operator. Op draw.Op // contains filtered or unexported fields }
func NewPainter ¶
func NewPainter() *Painter
NewRGBAPainter creates a new RGBAPainter for the given image.
Click to show internal directories.
Click to hide internal directories.