mirror of
https://github.com/photonstorm/phaser
synced 2024-12-21 02:23:29 +00:00
1 line
No EOL
8.7 KiB
JSON
1 line
No EOL
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},{"name":"color","type":["string"],"help":"The color to set. Can be in the format 'rgb(r,g,b)', or '#RRGGBB' or any valid CSS color.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setImageRenderingBicubic","static":false,"returns":{"types":["HTMLCanvasElement"],"help":"Returns the source canvas."},"help":"Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto').\\nNote that if this doesn't given the desired result then see the CanvasUtils.setSmoothingEnabled method.","line":306,"public":true,"protected":false,"private":false,"parameters":[{"name":"canvas","type":["HTMLCanvasElement"],"help":" The canvas to set image-rendering bicubic on.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setImageRenderingCrisp","static":false,"returns":{"types":["HTMLCanvasElement"],"help":"Returns the source canvas."},"help":"Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast' on webkit).\\nNote that if this doesn't given the desired result then see the setSmoothingEnabled.","line":284,"public":true,"protected":false,"private":false,"parameters":[{"name":"canvas","type":["HTMLCanvasElement"],"help":"The canvas to set image-rendering crisp on.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setSmoothingEnabled","static":false,"returns":{"types":["CanvasRenderingContext2D"],"help":"Returns the source context."},"help":"Sets the Image Smoothing property on the given context. Set to false to disable image smoothing.\\nBy default browsers have image smoothing enabled, which isn't always what you visually want, especially\\nwhen using pixel art in a game. Note that this sets the property on the context itself, so that any image\\ndrawn to the context will be affected. This sets the property across all current browsers but support is\\npatchy on earlier browsers, especially on mobile.","line":251,"public":true,"protected":false,"private":false,"parameters":[{"name":"context","type":["CanvasRenderingContext2D"],"help":"The context to enable or disable the image smoothing on.","optional":false,"default":null},{"name":"value","type":["boolean"],"help":"If set to true it will enable image smoothing, false will disable it.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setTouchAction","static":false,"returns":{"types":["HTMLCanvasElement"],"help":"The source canvas."},"help":"Sets the touch-action property on the canvas style. Can be used to disable default browser touch actions.","line":120,"public":true,"protected":false,"private":false,"parameters":[{"name":"canvas","type":["HTMLCanvasElement"],"help":"The canvas to set the touch action on.","optional":false,"default":null},{"name":"value","type":["string"],"help":"The touch action to set. Defaults to 'none'.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setTransform","static":false,"returns":{"types":["CanvasRenderingContext2D"],"help":"Returns the source context."},"help":"Sets the transform of the given canvas to the matrix values provided.","line":231,"public":true,"protected":false,"private":false,"parameters":[{"name":"context","type":["CanvasRenderingContext2D"],"help":"The context to set the transform on.","optional":false,"default":null},{"name":"translateX","type":["number"],"help":"The value to translate horizontally by.","optional":false,"default":null},{"name":"translateY","type":["number"],"help":"The value to translate vertically by.","optional":false,"default":null},{"name":"scaleX","type":["number"],"help":"The value to scale horizontally by.","optional":false,"default":null},{"name":"scaleY","type":["number"],"help":"The value to scale vertically by.","optional":false,"default":null},{"name":"skewX","type":["number"],"help":"The value to skew horizontaly by.","optional":false,"default":null},{"name":"skewY","type":["number"],"help":"The value to skew vertically by.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"setUserSelect","static":false,"returns":{"types":["HTMLCanvasElement"],"help":"The source canvas."},"help":"Sets the user-select property on the canvas style. Can be used to disable default browser selection actions.","line":140,"public":true,"protected":false,"private":false,"parameters":[{"name":"canvas","type":["HTMLCanvasElement"],"help":"The canvas to set the touch action on.","optional":false,"default":null},{"name":"value","type":["string"],"help":"The touch action to set. Defaults to 'none'.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""}],"protected":[],"private":[],"static":[]},"properties":{"public":[],"protected":[],"private":[]}} |