Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a graphics primitive whose parameters are stored on the GPU.

Hierarchy

  • Shape

Index

Constructors

Properties

Methods

Constructors

constructor

  • Construct a new Shape with the given texture and vertices.

    Parameters

    • type: number

      Type of primitive the new Shape will represent.

    • texture: Texture | null

      Texture to use for this shape, or null for no texture.

    • vertices: VertexList

      A vertex list containing vertices for this shape.

    • Optional indices: IndexList

      Optional index list specifying which members of vertices are used in the shape. Omit this to use the entire vertex list.

    Returns Shape

Properties

indexList

indexList: IndexList | null

Index list specifying which elements of vertexList are used in the shape. Set this to null to use all elements of the vertex list in order.

texture

texture: Texture | null

Texture image used to texture the shape when rendered. How the texture is applied is typically determined by the u and v components of each vertex, but may depend on the shader in use. Use null for no texture.

vertexList

vertexList: VertexList

Vertex list containing the vertices used in this shape.

Methods

draw

  • Draw this shape to the backbuffer using an optional transform.

    Parameters

    • Optional transform: Transform

      Transform to be applied before the projection transform.

    Returns void

  • Draw this shape to a given surface using an optional transform.

    Parameters

    • surface: Surface

      Surface the shape will be rendered to.

    • Optional transform: Transform

      Transform to be applied before the projection transform.

    Returns void

Static drawImmediate

  • Render a shape of the given type to the backbuffer.

    Parameters

    • type: ShapeType

      Type of primitive to draw.

    • vertices: Vertex[]

      Array of Vertex objects describing the shape's vertices.

    Returns void

  • Render a textured shape of the given type to the backbuffer.

    Parameters

    • type: ShapeType

      Type of primitive to draw.

    • texture: Texture | null

      Texture to use for the shape, or null for no texture.

    • vertices: Vertex[]

      Array of Vertex objects describing the shape's vertices.

    Returns void

  • Render a shape of the given type to a surface.

    Parameters

    • surface: Surface

      Surface on which to render the shape.

    • type: ShapeType

      Type of primitive to draw.

    • vertices: Vertex[]

      Array of Vertex objects describing the shape's vertices.

    Returns void

  • Render a textured shape of the given type to a surface.

    Parameters

    • surface: Surface

      Surface on which to render the shape.

    • type: ShapeType

      Type of primitive to draw.

    • texture: Texture | null

      Texture to use for the shape, or null for no texture.

    • vertices: Vertex[]

      Array of Vertex objects describing the shape's vertices.

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc