mirror of
https://github.com/photonstorm/phaser
synced 2024-12-19 09:34:02 +00:00
1 line
8.7 KiB
JSON
1 line
8.7 KiB
JSON
|
{"class":{"name":"Phaser.Canvas","extends":"","static":true,"constructor":false,"parameters":[],"help":"The Canvas class handles everything related to creating the `canvas` DOM tag that Phaser will use, including styles, offset and aspect ratio."},"consts":[],"methods":{"public":[{"name":"addToDOM","static":false,"returns":{"types":["HTMLCanvasElement"],"help":"Returns the source canvas."},"help":"Adds the given canvas element to the DOM. The canvas will be added as a child of the given parent.\\nIf no parent is given it will be added as a child of the document.body.","line":166,"public":true,"protected":false,"private":false,"parameters":[{"name":"canvas","type":["HTMLCanvasElement"],"help":"The canvas to be added to the DOM.","optional":false,"default":null},{"name":"parent","type":["string","HTMLElement"],"help":"The DOM element to add the canvas to.","optional":false,"default":null},{"name":"overflowHidden","type":["boolean"],"help":"If set to true it will add the overflow='hidden' style to the parent DOM element.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"create","static":false,"returns":{"types":["HTMLCanvasElement"],"help":"The newly created canvas element."},"help":"Creates a `canvas` DOM element. The element is not automatically added to the document.","line":24,"public":true,"protected":false,"private":false,"parameters":[{"name":"width","type":["number"],"help":"The width of the canvas element.","optional":true,"default":"256"},{"name":"height","type":["number"],"help":"The height of the canvas element..","optional":true,"default":"256"},{"name":"id","type":["string"],"help":"If given this will be set as the ID of the canvas element, otherwise no ID will be set.","optional":true,"default":"''"}],"inherited":false,"inheritedFrom":""},{"name":"getAspectRatio","static":false,"returns":{"types":["number"],"help":"The ratio between canvas' width and height."},"help":"Returns the aspect ratio of the given canvas.","line":90,"public":true,"protected":false,"private":false,"parameters":[{"name":"canvas","type":["HTMLCanvasElement"],"help":"The canvas to get the aspect ratio from.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getOffset","static":false,"returns":{"types":["Phaser.Point"],"help":"- A point objet with the offsetX and Y as its properties."},"help":"Get the DOM offset values of any given element","line":52,"public":true,"protected":false,"private":false,"parameters":[{"name":"element","type":["HTMLElement"],"help":"The targeted element that we want to retrieve the offset.","optional":false,"default":null},{"name":"point","type":["Phaser.Point"],"help":"The point we want to take the x\/y values of the offset.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getSmoothingEnabled","static":false,"returns":{"types":["boolean"],"help":"True if the given context has image smoothing enabled, otherwise false."},"help":"Returns `true` if the given context has image smoothing enabled, otherwise returns `false`.","line":270,"public":true,"protected":false,"private":false,"parameters":[{"name":"context","type":["CanvasRenderingContext2D"],"help":"The context to check for smoothing on.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"removeFromDOM","static":false,"returns":null,"help":"Removes the given canvas element from the DOM.","line":209,"public":true,"protected":false,"private":false,"parameters":[{"name":"canvas","type":["HTMLCanvasElement"],"help":"The canvas to be removed from the DOM.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setBackgroundColor","static":false,"returns":{"types":["HTMLCanvasElement"],"help":"Returns the source canvas."},"help":"Sets the background color behind the canvas. This changes the canvas style property.","line":102,"public":true,"protected":false,"private":false,"parameters":[{"name":"canvas","type":["HTMLCanvasElement"],"help":"The canvas to set the background color on.","optional":false,"default":null},{"
|