Options
All
  • Public
  • Public/Protected
  • All
Menu

Helper class to create a quad with uvs like in v4

memberof

PIXI

Hierarchy

Index

Constructors

constructor

Properties

attributes

attributes: {}

Type declaration

buffers

buffers: Buffer[]

disposeRunner

disposeRunner: Runner

glVertexArrayObjects

glVertexArrayObjects: {}

Type declaration

  • [key: number]: {}
    • [key: string]: WebGLVertexArrayObject

id

id: number

indexBuffer

indexBuffer: Buffer

instanceCount

instanceCount: number

instanced

instanced: boolean

refCount

refCount: number

uvBuffer

uvBuffer: Buffer

uvs

uvs: Float32Array

vertexBuffer

vertexBuffer: Buffer

vertices

vertices: Float32Array

Methods

addAttribute

  • addAttribute(id: string, buffer: Uint32Array | Float32Array | number[] | Buffer, size?: number, normalized?: boolean, type?: TYPES, stride?: number, start?: number, instance?: boolean): QuadUv
  • Adds an attribute to the geometry Note: stride and start should be undefined if you dont know them, not 0!

    Parameters

    • id: string

      the name of the attribute (matching up to a shader)

    • buffer: Uint32Array | Float32Array | number[] | Buffer

      the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.

    • Optional size: number
    • Optional normalized: boolean
    • Optional type: TYPES
    • Optional stride: number
    • Optional start: number
    • Optional instance: boolean

    Returns QuadUv

    returns self, useful for chaining.

addIndex

  • Adds an index buffer to the geometry The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.

    Parameters

    Returns Geometry

    returns self, useful for chaining.

clone

  • returns a clone of the geometry

    Returns Geometry

    a new clone of this geometry

destroy

  • destroy(): void
  • Destroys the geometry.

    Returns void

dispose

  • dispose(): void
  • disposes WebGL resources that are connected to this geometry

    Returns void

getAttribute

  • returns the requested attribute

    Parameters

    • id: string

      the name of the attribute required

    Returns Attribute

    the attribute requested.

getBuffer

  • getBuffer(id: string): Buffer
  • returns the requested buffer

    Parameters

    • id: string

      the name of the buffer required

    Returns Buffer

    the buffer requested.

getIndex

  • returns the index buffer

    Returns Buffer

    the index buffer.

getSize

  • getSize(): number
  • Returns number

interleave

  • this function modifies the structure so that all current attributes become interleaved into a single buffer This can be useful if your model remains static as it offers a little performance boost

    Returns Geometry

    returns self, useful for chaining.

invalidate

  • legacy upload method, just marks buffers dirty

    Returns QuadUv

    Returns itself.

map

  • Maps two Rectangle to the quad.

    Parameters

    • targetTextureFrame: Rectangle

      the first rectangle

    • destinationFrame: Rectangle

      the second rectangle

    Returns QuadUv

    Returns itself.

Static merge

  • merges an array of geometries into a new single one geometry attribute styles must match for this operation to work

    Parameters

    • geometries: Geometry[]

      array of geometries to merge

    Returns Geometry

    shiny new geometry!

Generated using TypeDoc