import { Vector, Bounds } from './geometry'; export declare class Render { engine: any; mouse: any; private world; canvas: HTMLCanvasElement; context: CanvasRenderingContext2D; scale: Vector; offset: Vector; bounds: Bounds; frameRequestId: number; pixelRatio: number; options: any; /** * Creates 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. * @method create * @param {object} [options] * @return {render} A new renderer */ constructor(engine: any, element: HTMLElement, options?: any); clear(): void; showingMessage: string | null; show(message: string, time?: number): void; /** * Continuously updates the render canvas on the `requestAnimationFrame` event. * @method run * @param {render} this */ run(message?: string): void; /** * Ends execution of `Render.run` on the given `render`, by canceling the animation frame request event loop. * @method stop * @param {render} render */ stop(message?: string): void; /** * Sets the pixel ratio of the renderer and updates the canvas. * To automatically detect the correct ratio, pass the string `'auto'` for `pixelRatio`. * @method setPixelRatio * @param {render} this * @param {number} pixelRatio */ private setPixelRatio; /** * Positions and sizes the viewport around the given object bounds. * Objects must have at least one of the following properties: * - `object.bounds` * - `object.position` * - `object.min` and `object.max` * - `object.x` and `object.y` * @method lookAt * @param {render} this * @param {object[]} objects * @param {vector} [padding] * @param {bool} [center=true] */ lookAt(bounds: Bounds, padding?: Vector, center?: boolean): void; /** * Applies viewport transforms based on `render.bounds` to a render context. * @method startViewTransform * @param {render} this */ private startViewTransform; /** * Resets all transforms on the render context. * @method endViewTransform * @param {render} render */ private endViewTransform; /** * Renders the given `engine`'s `Matter.World` object. * This is the entry point for all rendering and should be called every time the scene changes. * @method world * @param {render} this */ private globalAlpha; private currentBackground; draw(): void; /** * Applies the background to the canvas using CSS. * @method applyBackground * @private * @param {render} render * @param {string} background */ private applyBackground; private debugString; private debugTimestamp; /** * Description * @private * @method debug * @param {render} this * @param {RenderingContext} context */ private debug; /** * Description * @private * @method constraints * @param {constraint[]} constraints * @param {RenderingContext} context */ private static constraints; /** * Description * @private * @method bodyShadows * @param {render} render * @param {body[]} bodies * @param {RenderingContext} context */ private bodyShadows; /** * Description * @private * @method bodies * @param {render} render * @param {body[]} bodies * @param {RenderingContext} context */ private bodies; /** * Optimised method for drawing body wireframes in one pass * @private * @method bodyWireframes * @param {render} this * @param {body[]} bodies * @param {RenderingContext} context */ private bodyWireframes; /** * Optimised method for drawing body convex hull wireframes in one pass * @private * @method bodyConvexHulls * @param {render} this * @param {body[]} bodies * @param {RenderingContext} context */ private bodyConvexHulls; /** * Renders body vertex numbers. * @private * @method vertexNumbers * @param {render} render * @param {body[]} bodies * @param {RenderingContext} context */ private vertexNumbers; /** * Renders mouse position. * @private * @method mousePosition * @param {render} render * @param {mouse} mouse * @param {RenderingContext} context */ private mousePosition; /** * Draws body bounds * @private * @method bodyBounds * @param {render} render * @param {body[]} bodies * @param {RenderingContext} context */ private bodyBounds; /** * Draws body angle indicators and axes * @private * @method bodyAxes * @param {render} render * @param {body[]} bodies * @param {RenderingContext} context */ private bodyAxes; /** * Draws body positions * @private * @method bodyPositions * @param {render} render * @param {body[]} bodies * @param {RenderingContext} context */ private bodyPositions; /** * Draws body velocity * @private * @method bodyVelocity * @param {render} this * @param {body[]} bodies * @param {RenderingContext} context */ private bodyVelocity; /** * Draws body ids * @private * @method bodyIds * @param {render} this * @param {body[]} bodies * @param {RenderingContext} context */ private bodyIds; /** * Description * @private * @method collisions * @param {render} render * @param {pair[]} pairs * @param {RenderingContext} context */ private collisions; /** * Description * @private * @method separations * @param {render} render * @param {pair[]} pairs * @param {RenderingContext} context */ private separations; /** * Description * @private * @method grid * @param {render} this * @param {grid} grid * @param {RenderingContext} context */ private grid; /** * Description * @private * @method inspector * @param {inspector} inspector * @param {RenderingContext} context */ private inspector; }