class
ShapeMeshes2D
Helper class for easily creating common 2D shapes.
Public
Methods
staticSolidQuad
Fills the mesh data with vertices representing a quad (2 triangles).
- area
- Area in which to draw the quad.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticPixelLine
Fills the mesh data with vertices representing a per-pixel line.
- a
- Start point of the line.
- b
- End point of the line.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticQuadLine
Fills the mesh data with vertices representing a line of specific width as a quad.
- a
- Start point of the line.
- b
- End point of the line.
- width
- Width of the line.
- border
- Optional border that will increase the width and the length at both end-points. Useful if you are using some kind of filtering for the line rendering, as the filtered pixels can belong to the border region.
- color
- Color of the line.
- meshData
- Mesh data that will be populated by this method.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticPixelLineList
Fills the mesh data with vertices representing per-pixel lines.
- linePoints
- A list of start and end points for the lines. Must be a multiple of 2.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticQuadLineList
Fills the mesh data with vertices representing a polyline of specific width as a set of quads.
- linePoints
- A list of start and end points for the lines.
- width
- Width of the line.
- border
- Optional border that will increase the width and the length at both end-points. Useful if you are using some kind of filtering for the line rendering, as the filtered pixels can belong to the border region.
- color
- Color of the line.
- meshData
- Mesh data that will be populated by this method.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticQuadLineList
Fills the provided buffers with vertices representing a polyline of specific width as a set of quads (triangle list).
- linePoints
- A list of start and end points for the lines.
- numPoints
- Number of points in the buffer.
- width
- Width of the line.
- border
- Optional border that will increase the width and the length at both end-points. Useful if you are using some kind of filtering for the line rendering, as the filtered pixels can belong to the border region.
- outVertices
- Pre-allocated buffer for the vertices, of size ((numLines * 2) + 2) * if is true, or (numLines * 6) * if false.
- vertexStride
- Distance between two vertices in the output buffer. Must be at least sizeof(Vector2).
- indexed
- If true there will be ((numLines * 2) + 2) vertices generated, assuming an index buffer will be used for rendering. If false then (numLines * 6) vertices will be generated.
Protected
Methods
staticPixelLine
Fills the provided buffers with vertices representing a per-pixel line.
- a
- Start point of the line.
- b
- End point of the line.
- outVertices
- Output buffer that will store the vertex position data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and color buffer)
- outIndices
- Output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticPixelSolidPolygon
Fills the provided buffers with position data and indices representing an inner area of a polygon (basically a normal non-antialiased polygon).
- points
- Points defining the polygon. First point is assumed to be the start and end point.
- outVertices
- Output buffer that will store the vertex position data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and color buffer)
- outIndices
- Output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.