Documentation ¶
Overview ¶
Package vector provides functions for vector graphics rendering.
This package is under experiments and the API might be changed with breaking backward compatibility.
Index ¶
- type Direction
- type Path
- func (p *Path) AppendVerticesAndIndicesForFilling(vertices []ebiten.Vertex, indices []uint16) ([]ebiten.Vertex, []uint16)
- func (p *Path) Arc(x, y, radius, startAngle, endAngle float32, dir Direction)
- func (p *Path) ArcTo(x1, y1, x2, y2, radius float32)
- func (p *Path) CubicTo(x1, y1, x2, y2, x3, y3 float32)
- func (p *Path) LineTo(x, y float32)
- func (p *Path) MoveTo(x, y float32)
- func (p *Path) QuadTo(x1, y1, x2, y2 float32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Direction ¶ added in v2.2.0
type Direction int
Direction represents clockwise or counterclockwise.
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path represents a collection of path segments.
func (*Path) AppendVerticesAndIndicesForFilling ¶ added in v2.2.0
func (p *Path) AppendVerticesAndIndicesForFilling(vertices []ebiten.Vertex, indices []uint16) ([]ebiten.Vertex, []uint16)
AppendVerticesAndIndicesForFilling appends vertices and indices to fill this path and returns them. AppendVerticesAndIndicesForFilling works in a similar way to the built-in append function. If the arguments are nils, AppendVerticesAndIndices returns new slices.
The returned vertice's SrcX and SrcY are 0, and ColorR, ColorG, ColorB, and ColorA are 1.
The returned values are intended to be passed to DrawTriangles or DrawTrianglesShader with EvenOdd fill mode in order to render a complex polygon like a concave polygon, a polygon with holes, or a self-intersecting polygon.
func (*Path) Arc ¶ added in v2.2.0
Arc adds an arc to the path. (x, y) is the center of the arc.
Arc updates the current position to the end of the arc.
func (*Path) ArcTo ¶ added in v2.2.0
ArcTo adds an arc curve to the path. (x1, y1) is the control point, and (x2, y2) is the destination.
ArcTo updates the current position to (x2, y2).
func (*Path) CubicTo ¶
CubicTo adds a cubic Bézier curve to the path. (x1, y1) and (x2, y2) are the control points, and (x3, y3) is the destination.
CubicTo updates the current position to (x3, y3).
func (*Path) LineTo ¶
LineTo adds a line segument to the path, which starts from the current position and ends to the given position (x, y).
LineTo updates the current position to (x, y).