Graphics Class

The static class that carries out graphics processing.

Item Index

Methods Properties

Methods

canPlayVideoType ( type ) Boolean [static]

Checks whether the browser can play the specified video type.

Parameters:

  • type String

    The video type to test support for

Returns:

Boolean:
True if the browser can play the specified video type

canUseDifferenceBlend () Boolean [static]

Checks whether the canvas blend mode 'difference' is supported.

Returns:

Boolean:
True if the canvas blend mode 'difference' is supported

canUseSaturationBlend () Boolean [static]

Checks whether the canvas blend mode 'saturation' is supported.

Returns:

Boolean:
True if the canvas blend mode 'saturation' is supported

endLoading () [static]

Erases the "Now Loading" image.

hasWebGL () Boolean [static]

Checks whether the current browser supports WebGL.

Returns:

Boolean:
True if the current browser supports WebGL.

hideFps () [static]

Hides the FPSMeter element.

initialize ( width , height , type ) [static]

Initializes the graphics system.

Parameters:

  • width Number

    The width of the game screen

  • height Number

    The height of the game screen

  • type String

    The type of the renderer. 'canvas', 'webgl', or 'auto'.

isFontLoaded ( name ) Boolean [static]

Checks whether the font file is loaded.

Parameters:

  • name String

    The face name of the font

Returns:

Boolean:
True if the font file is loaded

isInsideCanvas ( x , y ) Boolean [static]

Checks whether the specified point is inside the game canvas area.

Parameters:

  • x Number

    The x coordinate on the canvas area

  • y Number

    The y coordinate on the canvas area

Returns:

Boolean:
True if the specified point is inside the game canvas area

isVideoPlaying () Boolean [static]

Checks whether the video is playing.

Returns:

Boolean:
True if the video is playing

isWebGL () Boolean [static]

Checks whether the renderer type is WebGL.

Returns:

Boolean:
True if the renderer type is WebGL

loadFont ( name , url ) [static]

Loads a font file.

Parameters:

  • name String

    The face name of the font

  • url String

    The url of the font file

pageToCanvasX ( x ) Number [static]

Converts an x coordinate on the page to the corresponding x coordinate on the canvas area.

Parameters:

  • x Number

    The x coordinate on the page to be converted

Returns:

Number:
The x coordinate on the canvas area

pageToCanvasY ( y ) Number [static]

Converts a y coordinate on the page to the corresponding y coordinate on the canvas area.

Parameters:

  • y Number

    The y coordinate on the page to be converted

Returns:

Number:
The y coordinate on the canvas area

playVideo ( src ) [static]

Starts playback of a video.

Parameters:

  • src String
printError ( name , message ) [static]

Displays the error text to the screen.

Parameters:

  • name String

    The name of the error

  • message String

    The message of the error

render ( stage ) [static]

Renders the stage to the game screen.

Parameters:

  • stage Stage

    The stage object to be rendered

setLoadingImage () [static]

Sets the source of the "Now Loading" image.

showFps () [static]

Shows the FPSMeter element.

startLoading () [static]

Initializes the counter for displaying the "Now Loading" image.

tickEnd () [static]

Marks the end of each frame for FPSMeter.

tickStart () [static]

Marks the beginning of each frame for FPSMeter.

updateLoading ()  [static]

Increments the loading counter and displays the "Now Loading" image if necessary.

Properties

BLEND_ADD Number [final] [static]

The alias of PIXI.blendModes.ADD.

BLEND_MULTIPLY Number [final] [static]

The alias of PIXI.blendModes.MULTIPLY.

BLEND_NORMAL Number [final] [static]

The alias of PIXI.blendModes.NORMAL.

BLEND_SCREEN Number [final] [static]

The alias of PIXI.blendModes.SCREEN.

boxHeight Number [static]

The height of the window display area.

boxWidth Number [static]

The width of the window display area.

frameCount Number [static]

The total frame count of the game screen.

height Number [static]

The height of the game screen.

scale Number [static]

The zoom scale of the game screen.

width Number [static]

The width of the game screen.