#

API Docs for: 2.0.0
Show: Inherited Protected Private Deprecated

# WebGLGraphics Class

Defined in: `src/pixi/renderers/webgl/utils/WebGLGraphics.js:5`
Module: PIXI

A set of functions used by the webGL renderer to draw the primitive graphics data

- Index
- Methods

## Item Index

### Methods

- buildCircle static
- buildComplexPoly static
- buildLine static
- buildPoly static
- buildRectangle static
- buildRoundedRectangle static
- quadraticBezierCurve static
- renderGraphics static
- switchMode static
- updateGraphics static

## Methods

### `buildCircle`

(

- `graphicsData`
- `webGLData`

)
private static

Defined in `src/pixi/renderers/webgl/utils/WebGLGraphics.js:420`

Builds a circle to draw

#### Parameters:

- `graphicsData` Graphics

  The graphics object to draw

- `webGLData` Object

### `buildComplexPoly`

(

- `graphicsData`
- `webGLData`

)
private static

Defined in `src/pixi/renderers/webgl/utils/WebGLGraphics.js:715`

Builds a complex polygon to draw

#### Parameters:

- `graphicsData` Graphics

  The graphics object containing all the necessary properties

- `webGLData` Object

### `buildLine`

(

- `graphicsData`
- `webGLData`

)
private static

Defined in `src/pixi/renderers/webgl/utils/WebGLGraphics.js:503`

Builds a line to draw

#### Parameters:

- `graphicsData` Graphics

  The graphics object containing all the necessary properties

- `webGLData` Object

### `buildPoly`

(

- `graphicsData`
- `webGLData`

)
private static

Defined in `src/pixi/renderers/webgl/utils/WebGLGraphics.js:777`

Builds a polygon to draw

#### Parameters:

- `graphicsData` Graphics

  The graphics object containing all the necessary properties

- `webGLData` Object

### `buildRectangle`

(

- `graphicsData`
- `webGLData`

)
private static

Defined in `src/pixi/renderers/webgl/utils/WebGLGraphics.js:233`

Builds a rectangle to draw

#### Parameters:

- `graphicsData` Graphics

  The graphics object containing all the necessary properties

- `webGLData` Object

### `buildRoundedRectangle`

(

- `graphicsData`
- `webGLData`

)
private static

Defined in `src/pixi/renderers/webgl/utils/WebGLGraphics.js:301`

Builds a rounded rectangle to draw

#### Parameters:

- `graphicsData` Graphics

  The graphics object containing all the necessary properties

- `webGLData` Object

### `quadraticBezierCurve`

(

- `fromX`
- `fromY`
- `cpX`
- `cpY`
- `toX`
- `toY`

)
Array private static

Defined in `src/pixi/renderers/webgl/utils/WebGLGraphics.js:368`

Calculate the points for a quadratic bezier curve. (helper function..) Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c

#### Parameters:

- `fromX` Number

  Origin point x

- `fromY` Number

  Origin point x

- `cpX` Number

  Control point x

- `cpY` Number

  Control point y

- `toX` Number

  Destination point x

- `toY` Number

  Destination point y

#### Returns:

Array:

### `renderGraphics`

(

- `graphics`
- `renderSession`

)
private static

Defined in `src/pixi/renderers/webgl/utils/WebGLGraphics.js:16`

Renders the graphics object

#### Parameters:

- `graphics` Graphics
- `renderSession` Object

### `switchMode`

(

- `webGL`
- `type`

)
private static

Defined in `src/pixi/renderers/webgl/utils/WebGLGraphics.js:199`

#### Parameters:

- `webGL` WebGLContext
- `type` Number

### `updateGraphics`

(

- `graphicsData`
- `gl`

)
private static

Defined in `src/pixi/renderers/webgl/utils/WebGLGraphics.js:84`

Updates the graphics object

#### Parameters:

- `graphicsData` Graphics

  The graphics object to update

- `gl` WebGLContext

  the current WebGL drawing context