Static Protected _cancelStatic Protected _goodStatic Protected _goodStatic Protected _requestStatic Protected _applyApplies the background to the canvas using CSS.
applyBackground
Static Protected _createStatic Protected _getStatic Protected _getGets the requested texture (an Image) via its path
texture
_getTexture
Static Protected _meanStatic Protected _updateUpdates render timing.
Optional time: number_updateTiming
Static Protected bodiesStatic Protected bodyStatic Protected bodyStatic Protected bodyStatic Protected bodyStatic Protected bodyStatic Protected bodyStatic Protected bodyStatic Protected collisionsStatic Protected constraintsDescription
constraints
Static createCreates a new renderer. The options parameter is an object that specifies any properties you wish to override the defaults.
All properties have default values, and many are pre-calculated automatically based on other properties.
See the properties section below for detailed information on what you can pass via the options object.
A new renderer
create
Static endResets all transforms on the render context.
endViewTransform
Static Protected inspectorDescription
inspector
Static lookStatic Protected mouseStatic Protected performanceRenders engine and render performance information.
performance
Static runContinuously updates the render canvas on the requestAnimationFrame event.
run
Static Protected separationsStatic setSets the pixel ratio of the renderer and updates the canvas.
To automatically detect the correct ratio, pass the string 'auto' for pixelRatio.
setPixelRatio
Static setSets the render width and height.
Updates the canvas accounting for render.options.pixelRatio.
Updates the bottom right render bound render.bounds.max relative to the provided width and height.
The top left render bound render.bounds.min isn't changed.
Follow this call with Render.lookAt if you need to change the render bounds.
See also Render.setPixelRatio.
The width (in CSS pixels)
The height (in CSS pixels)
setSize
Static startApplies viewport transforms based on render.bounds to a render context.
startViewTransform
Static Protected statsRenders statistics about the engine and world useful for debugging.
Optional _time: numberstats
Static Protected statusRenders a label, indicator and a chart.
status
Static stopEnds execution of Render.run on the given render, by canceling the animation frame request event loop.
stop
Static Protected vertexStatic worldRenders the given engine's Matter.World object.
This is the entry point for all rendering and should be called every time the scene changes.
Optional _time: numberworld
Generated using TypeDoc
The
Matter.Rendermodule is a simple canvas based renderer for visualising instances ofMatter.Engine. It is intended for development and debugging purposes, but may also be suitable for simple games. It includes a number of drawing options including wireframe, vector with support for sprites and viewports.