Namespace: video

me. video

video functions There is no constructor function for me.video
Source:
video.js, line 8

Classes

Error

Namespaces

shader

Members

<static> AUTO :Number

Auto-select the renderer (Attempt WebGL first, with fallback to Canvas)
Type:
  • Number
Source:
video.js, line 99

<static> CANVAS :Number

Select the HTML5 Canvas renderer
Type:
  • Number
Source:
video.js, line 81

<static> renderer :me.Renderer|me.CanvasRenderer|me.WebGLRenderer

A reference to the current video renderer
Type:
Source:
video.js, line 241

<static> WEBGL :Number

Select the WebGL renderer
Type:
  • Number
Source:
video.js, line 90

Methods

<static> createCanvas(width, height, screencanvas) → {Canvas}

Create and return a new Canvas
Parameters:
Name Type Argument Default Description
width Number width
height Number height
screencanvas Boolean <optional>
false set to true if this canvas renders directly to the screen
Source:
video.js, line 316
Returns:
Type
Canvas

<static> getPos(canvas) → {me.Vector2d}

return the relative (to the page) position of the specified Canvas
Parameters:
Name Type Argument Description
canvas Canvas <optional>
system one if none specified
Source:
video.js, line 282
Returns:
Type
me.Vector2d

<static> getWrapper() → {Document}

return a reference to the wrapper
Source:
video.js, line 344
Returns:
Type
Document

<static> init(width, height, options) → {Boolean}

Initialize the "video" system (create a canvas based on the given arguments, and the related renderer).
melonJS support various scaling mode :
- `fit` : Letterboxed; content is scaled to design aspect ratio
- `fill-max` : Canvas is resized to fit maximum design resolution; content is scaled to design aspect ratio
- `flex-height` : Canvas height is resized to fit; content is scaled to design aspect ratio
- `flex-width` : Canvas width is resized to fit; content is scaled to design aspect ratio
- `stretch` : Canvas is resized to fit; content is scaled to screen aspect ratio
Parameters:
Name Type Argument Description
width Number the width of the canvas viewport
height Number the height of the canvas viewport
options Object <optional>
The optional video/renderer parameters.
(see Renderer(s) documentation for further specific options)
Properties
Name Type Argument Default Description
wrapper String <optional>
document.body the "div" element name to hold the canvas in the HTML file
renderer Number <optional>
me.video.CANVAS renderer to use.
doubleBuffering Boolean <optional>
false enable/disable double buffering
scale Number | String <optional>
1.0 enable scaling of the canvas ('auto' for automatic scaling)
scaleMethod String <optional>
"fit" ('fit','fill-min','fill-max','flex','flex-width','flex-height','stretch') screen scaling modes
useParentDOMSize Boolean <optional>
false on browser devices, limit the canvas width and height to its parent container dimensions as returned by getBoundingClientRect(), as opposed to the browser window dimensions
transparent Boolean <optional>
false whether to allow transparent pixels in the front buffer (screen)
antiAlias Boolean <optional>
false whether to enable or not video scaling interpolation
Source:
video.js, line 108
See:
Returns:
false if initialization failed (canvas not supported)
Type
Boolean
Example
// init the video with a 640x480 canvas
me.video.init(640, 480, {
    wrapper : "screen",
    renderer : me.video.CANVAS,
    scale : "auto",
    scaleMethod : "fit",
    doubleBuffering : true
});

<static> setMaxSize(width, height)

set the max canvas display size (when scaling)
Parameters:
Name Type Description
width Number width
height Number height
Source:
video.js, line 298

<static> updateDisplaySize(scaleX, scaleY)

Modify the "displayed" canvas size
Parameters:
Name Type Description
scaleX Number X scaling multiplier
scaleY Number Y scaling multiplier
Source:
video.js, line 469
Copyright © 2011 - 2017, Olivier Biot, Jason Oster, Aaron McLeod
Documentation generated by JSDoc 3.4.0 on 2017-02-28T11:37:42+08:00 using the DocStrap template modified by codename-.