mirror of
https://github.com/photonstorm/phaser
synced 2024-12-21 10:33:35 +00:00
1 line
10 KiB
JSON
1 line
10 KiB
JSON
|
{"class":{"name":"PIXI.RenderTexture","extends":"PIXI.Texture","static":false,"constructor":true,"parameters":[{"name":"width","type":["number"],"help":"The width of the render texture","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height of the render texture","optional":false,"default":null},{"name":"renderer","type":["PIXI.CanvasRenderer","PIXI.WebGLRenderer"],"help":"The renderer used for this RenderTexture","optional":false,"default":null},{"name":"scaleMode","type":["number"],"help":"Should be one of the PIXI.scaleMode consts","optional":false,"default":null},{"name":"resolution","type":["number"],"help":"The resolution of the texture being generated","optional":false,"default":null}],"help":"A RenderTexture is a special texture that allows any Pixi display object to be rendered to it.\\n\\n__Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.\\n\\nA RenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:\\n\\nvar renderTexture = new PIXI.RenderTexture(800, 600);\\nvar sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\\nsprite.position.x = 800\/2;\\nsprite.position.y = 600\/2;\\nsprite.anchor.x = 0.5;\\nsprite.anchor.y = 0.5;\\nrenderTexture.render(sprite);\\n\\nThe Sprite in this case will be rendered to a position of 0,0. To render this sprite at its actual position a DisplayObjectContainer should be used:\\n\\nvar doc = new PIXI.DisplayObjectContainer();\\ndoc.addChild(sprite);\\nrenderTexture.render(doc); \/\/ Renders to center of renderTexture"},"consts":[],"methods":{"public":[{"name":"addTextureToCache","static":true,"returns":null,"help":"Adds a texture to the global PIXI.TextureCache. This cache is shared across the whole PIXI object.","line":292,"public":true,"protected":false,"private":false,"parameters":[{"name":"texture","type":["PIXI.Texture"],"help":"The Texture to add to the cache.","optional":false,"default":null},{"name":"id","type":["string"],"help":"The id that the texture will be stored against.","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Texture"},{"name":"clear","static":false,"returns":null,"help":"Clears the RenderTexture.","line":176,"public":true,"protected":false,"private":false,"parameters":[],"inherited":true,"inheritedFrom":"Phaser.RenderTexture"},{"name":"destroy","static":false,"returns":null,"help":"Destroys this texture","line":155,"public":true,"protected":false,"private":false,"parameters":[{"name":"destroyBase","type":["boolean"],"help":"Whether to destroy the base texture as well","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Texture"},{"name":"fromCanvas","static":true,"returns":{"types":[],"help":[]},"help":"Helper function that creates a new a Texture based on the given canvas element.","line":276,"public":true,"protected":false,"private":false,"parameters":[{"name":"canvas","type":["PIXI.Canvas"],"help":"The canvas element source of the texture","optional":false,"default":null},{"name":"scaleMode","type":["number"],"help":"Should be one of the PIXI.scaleMode consts","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Texture"},{"name":"fromFrame","static":true,"returns":{"types":[],"help":[]},"help":"Helper function that returns a Texture objected based on the given frame id.\\nIf the frame id is not in the texture cache an error will be thrown.","line":260,"public":true,"protected":false,"private":false,"parameters":[{"name":"frameId","type":["string"],"help":"The frame id of the texture","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Texture"},{"name":"fromImage","static":true,"returns":{"types":[],"help":[]},"help":"Helper function that creates a Texture object from the given image url.\\nIf the image is not in the texture cache it will be created and loaded.","line":238,"public":true,"protected":false,"private":false,"parameters":[{"nam
|