API Docs for: 2.0.0
Show:

WebGLGraphics Class

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

Item Index

Methods

buildCircle

(
  • graphicsData
  • webGLData
)
private static

Builds a circle to draw

Parameters:

  • graphicsData Graphics

    The graphics object to draw

  • webGLData Object

buildComplexPoly

(
  • graphicsData
  • webGLData
)
private static

Builds a complex polygon to draw

Parameters:

  • graphicsData Graphics

    The graphics object containing all the necessary properties

  • webGLData Object

buildLine

(
  • graphicsData
  • webGLData
)
private static

Builds a line to draw

Parameters:

  • graphicsData Graphics

    The graphics object containing all the necessary properties

  • webGLData Object

buildPoly

(
  • graphicsData
  • webGLData
)
private static

Builds a polygon to draw

Parameters:

  • graphicsData Graphics

    The graphics object containing all the necessary properties

  • webGLData Object

buildRectangle

(
  • graphicsData
  • webGLData
)
private static

Builds a rectangle to draw

Parameters:

  • graphicsData Graphics

    The graphics object containing all the necessary properties

  • webGLData Object

buildRoundedRectangle

(
  • graphicsData
  • webGLData
)
private static

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

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

Renders the graphics object

Parameters:

  • graphics Graphics
  • renderSession Object

switchMode

(
  • webGL
  • type
)
private static

Parameters:

  • webGL WebGLContext
  • type Number

updateGraphics

(
  • graphicsData
  • gl
)
private static

Updates the graphics object

Parameters:

  • graphicsData Graphics

    The graphics object to update

  • gl WebGLContext

    the current WebGL drawing context