Show / Hide Table of Contents

Interface ITextured

The Filled object type for the shape drawing fluent interface Each of the object's methods represent a possible shape type for shape drawing The fluent type interface is designed for simple, rapid, iterative shape drawing

Namespace: Yak2D
Assembly: Yak2D.Api.dll
Syntax
public interface ITextured

Methods

Line(Vector2, Vector2, Single)

A line

Declaration
ILine Line(Vector2 from, Vector2 too, float width)
Parameters
Type Name Description
Vector2 from

Start point of the line

Vector2 too

End point of the line

System.Single width

Width (thickness) of the line

Returns
Type Description
ILine

Poly(Vector2, Int32, Single)

A regular polygon (equal side lengths). Can approximate a circle with a high enough number of sides

Declaration
IShape Poly(Vector2 position, int numSides, float radius)
Parameters
Type Name Description
Vector2 position

Centre position of shape

System.Int32 numSides

The number of sides (all equal length). Large n --> circle

System.Single radius

The shape radius (distance of each point on the outside from the centre)

Returns
Type Description
IShape

Poly(Vector2[], Int32[])

A polygon built out of user defined vertices and indices To render properly, the index referenced vertices must form a list of triangles If texture mapped, the texture coordinates are automatically generated If texture mapping is for a tiled texture, the centre point between all the shapes will be taken as the centre of the texture

Declaration
IShape Poly(Vector2[] vertices, int[] indices)
Parameters
Type Name Description
Vector2[] vertices
System.Int32[] indices
Returns
Type Description
IShape

Poly(Vector2[], Int32[], Vector2[])

A polygon built out of user defined vertices, indices and texture coordiantes To render properly, the index referenced vertices must form a list of triangles

Declaration
IShape Poly(Vector2[] vertices, int[] indices, Vector2[] texCoords)
Parameters
Type Name Description
Vector2[] vertices
System.Int32[] indices
Vector2[] texCoords
Returns
Type Description
IShape

Quad(Vector2, Single, Single)

A quad (rectangle/square) made of two triangles

Declaration
IShape Quad(Vector2 position, float width, float height)
Parameters
Type Name Description
Vector2 position

Centre position of shape

System.Single width

Width of shape

System.Single height

Height of shape

Returns
Type Description
IShape

RoundedLine(Vector2, Vector2, Single, Int32, Boolean)

A line with rounded ends The radius of the end rounding is equal to the line width (thickness)

Declaration
ILine RoundedLine(Vector2 from, Vector2 too, float width, int numberOfCurveSegments, bool centreOfCurveRadiusAtLineEndPoints = true)
Parameters
Type Name Description
Vector2 from

Start point of the line

Vector2 too

End point of the line

System.Single width

Width (thickness) of the line

System.Int32 numberOfCurveSegments

Rounded ends will be rendered by this number of segments (minimum 2)

System.Boolean centreOfCurveRadiusAtLineEndPoints

If true, the 'from' and 'too' line positions will be positioned in the centre of the theoretical end rounding circles (the rounded ends will spill over the end points of the lines)

Returns
Type Description
ILine
In This Article
Back to top yak2D - Alex Paterson