Documentation
¶
Index ¶
- func Clear()
- func ClearColor(color Color)
- func Distance(a, b Point) float64
- func DrawLines(points []Point, color Color)
- func DrawPoint(d Point, r float64, color Color)
- func DrawRect(rect Rect, color Color)
- func DrawTexture(d *Texture)
- func DrawVertexObject(d *VertexObject, color Color)
- func Init(width, height int) error
- type Color
- type Font
- type Point
- type Rect
- type Texture
- type VertexObject
- func (v VertexObject) Bounds() Rect
- func (p *VertexObject) CenterAt(point Point)
- func (v VertexObject) Centroid() (center Point)
- func (p *VertexObject) Move(x, y float64)
- func (v *VertexObject) RotateDeg(angle float64)
- func (v *VertexObject) RotateRad(angle float64)
- func (v *VertexObject) Scale(scale float64)
- func (vo *VertexObject) Triangulate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearColor ¶
func ClearColor(color Color)
func DrawTexture ¶
func DrawTexture(d *Texture)
func DrawVertexObject ¶
func DrawVertexObject(d *VertexObject, color Color)
Types ¶
type Rect ¶
func (Rect) Intersects ¶
type Texture ¶
type Texture struct { *VertexObject // contains filtered or unexported fields }
type VertexObject ¶
func FromVertices ¶
func FromVertices(p []Point) (*VertexObject, error)
Performs triangulation creating new VertexObject.
func Rectangle ¶
func Rectangle(rect Rect) (polygon *VertexObject)
func Triangles ¶
func Triangles(vertices []Point) (polygon *VertexObject)
func (VertexObject) Bounds ¶
func (v VertexObject) Bounds() Rect
Return rectangle approximating bounds of the polygon.
func (*VertexObject) CenterAt ¶
func (p *VertexObject) CenterAt(point Point)
Centers VertexObject at exact point.
func (VertexObject) Centroid ¶
func (v VertexObject) Centroid() (center Point)
Returns geometrical center, center of mass (centroid) of a polygon.
func (*VertexObject) Move ¶
func (p *VertexObject) Move(x, y float64)
Translation of the VertexObject by x, y pixels in the respective directions.
func (*VertexObject) RotateRad ¶
func (v *VertexObject) RotateRad(angle float64)
func (*VertexObject) Triangulate ¶
func (vo *VertexObject) Triangulate() error
Performs triangulation of VertexObject, writing to the Indices field.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.