Class me.video
Defined in: <build/melonJS-0.9.3.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
me.video()
video functions
There is no constructor function for me.video
|
| Method Attributes | Method Name and Description |
|---|---|
|
applyRGBFilter(object, effect, option)
apply the specified filter to the main canvas
and return a new canvas object with the modified output
(!) Due to the internal usage of getImageData to manipulate pixels, this function will throw a Security Exception with FF if used locally |
|
|
render the main framebuffer on screen
|
|
|
clearSurface(context, col)
Clear the specified context with the given color
|
|
|
createCanvasSurface(width, height)
allocate and return a new Canvas 2D surface
|
|
|
return the height of the display canvas (before scaling)
|
|
|
getPos(canvas)
return the relative (to the page) position of the specified Canvas
|
|
|
return a reference of the display canvas
|
|
|
return a reference to the screen framebuffer
|
|
|
getWidth()
return the width of the display canvas (before scaling)
|
|
|
return a reference to the wrapper
|
|
|
init(wrapper, width, height, double_buffering, scale)
init the "video" part
return false if initialization failed (canvas not supported) |
|
|
scale(context, scale)
scale & keep canvas centered
usefull for zooming effect |
|
|
setAlpha(context, enable)
enable/disable Alpha for the specified context
|
|
|
updateDisplaySize(scale)
change the display scaling factor
|
Method Detail
{Context2D}
applyRGBFilter(object, effect, option)
apply the specified filter to the main canvas
and return a new canvas object with the modified output
(!) Due to the internal usage of getImageData to manipulate pixels, this function will throw a Security Exception with FF if used locally
(!) Due to the internal usage of getImageData to manipulate pixels, this function will throw a Security Exception with FF if used locally
- Parameters:
- {Object} object
- Canvas or Image Object on which to apply the filter
- {String} effect
- "b&w", "brightness", "transparent"
- {String} option
- : level [0...1] (for brightness), color to be replaced (for transparent)
- Returns:
- {Context2D} context object
blitSurface()
render the main framebuffer on screen
clearSurface(context, col)
Clear the specified context with the given color
- Parameters:
- {Context2D} context
- {Color} col
{Context2D}
createCanvasSurface(width, height)
allocate and return a new Canvas 2D surface
- Parameters:
- {Int} width
- canvas width
- {Int} height
- canvas height
- Returns:
- {Context2D}
{Int}
getHeight()
return the height of the display canvas (before scaling)
- Returns:
- {Int}
{me.Vector2d}
getPos(canvas)
return the relative (to the page) position of the specified Canvas
- Parameters:
- {Canvas} canvas Optional
- system one if none specified
- Returns:
- {me.Vector2d}
{Canvas}
getScreenCanvas()
return a reference of the display canvas
- Returns:
- {Canvas}
{Context2D}
getScreenFrameBuffer()
return a reference to the screen framebuffer
- Returns:
- {Context2D}
{Int}
getWidth()
return the width of the display canvas (before scaling)
- Returns:
- {Int}
{Document}
getWrapper()
return a reference to the wrapper
- Returns:
- {Document}
{Boolean}
init(wrapper, width, height, double_buffering, scale)
init the "video" part
return false if initialization failed (canvas not supported)
// init the video with a 480x320 canvas
if (!me.video.init('jsapp', 480, 320))
{
alert("Sorry but your browser does not support html 5 canvas !");
return;
}
- Parameters:
- {String} wrapper
- the "div" element id to hold the canvas in the HTML file (if null document.body will be used)
- {Int} width
- game width
- {Int} height
- game height
- {Boolean} double_buffering Optional
- enable/disable double buffering
- {Number} scale Optional
- enable scaling of the canvas (note : if scale is used, double_buffering must be enabled)
- Returns:
- {Boolean}
scale(context, scale)
scale & keep canvas centered
usefull for zooming effect
- Parameters:
- {Context2D} context
- {scale} scale
setAlpha(context, enable)
enable/disable Alpha for the specified context
- Parameters:
- {Context2D} context
- {Boolean} enable
updateDisplaySize(scale)
change the display scaling factor
- Parameters:
- {Number} scale
- scaling value