Graphics Class
The static class that carries out graphics processing.
Item Index
Methods- canPlayVideoType static
- canUseDifferenceBlend static
- canUseSaturationBlend static
- endLoading static
- hasWebGL static
- hideFps static
- initialize static
- isFontLoaded static
- isInsideCanvas static
- isVideoPlaying static
- isWebGL static
- loadFont static
- pageToCanvasX static
- pageToCanvasY static
- playVideo static
- printError static
- render static
- setLoadingImage static
- showFps static
- startLoading static
- tickEnd static
- tickStart static
- updateLoading static
- BLEND_ADD static
- BLEND_MULTIPLY static
- BLEND_NORMAL static
- BLEND_SCREEN static
- boxHeight static
- boxWidth static
- frameCount static
- height static
- scale static
- width static
Methods
canPlayVideoType ( type ) Boolean [static]
Checks whether the browser can play the specified video type.
Parameters:
-
type
StringThe 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
NumberThe width of the game screen
-
height
NumberThe height of the game screen
-
type
StringThe type of the renderer. 'canvas', 'webgl', or 'auto'.
isFontLoaded ( name ) Boolean [static]
Checks whether the font file is loaded.
Parameters:
-
name
StringThe 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
NumberThe x coordinate on the canvas area
-
y
NumberThe 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
StringThe face name of the font
-
url
StringThe 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
NumberThe 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
NumberThe 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
StringThe name of the error
-
message
StringThe message of the error
render ( stage ) [static]
Renders the stage to the game screen.
Parameters:
-
stage
StageThe 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.