mirror of
https://github.com/photonstorm/phaser
synced 2024-12-25 12:33:38 +00:00
1 line
No EOL
10 KiB
JSON
1 line
No EOL
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":[{"name":"imageUrl","type":["string"],"help":"The image url of the texture","optional":false,"default":null},{"name":"crossorigin","type":["boolean"],"help":"Whether requests should be treated as crossorigin","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":"getBase64","static":false,"returns":{"types":["string"],"help":"A base64 encoded string of the texture."},"help":"Will return a a base64 encoded string of this texture. It works by calling RenderTexture.getCanvas and then running toDataURL on that.","line":294,"public":true,"protected":false,"private":false,"parameters":[],"inherited":true,"inheritedFrom":"Phaser.RenderTexture"},{"name":"getCanvas","static":false,"returns":{"types":["HTMLCanvasElement"],"help":"A Canvas element with the texture rendered on."},"help":"Creates a Canvas element, renders this RenderTexture to it and then returns it.","line":305,"public":true,"protected":false,"private":false,"parameters":[],"inherited":true,"inheritedFrom":"Phaser.RenderTexture"},{"name":"getImage","static":false,"returns":{"types":["Image"],"help":""},"help":"Will return a HTML Image of the texture","line":281,"public":true,"protected":false,"private":false,"parameters":[],"inherited":true,"inheritedFrom":"Phaser.RenderTexture"},{"name":"removeTextureFromCache","static":true,"returns":{"types":["PIXI.Texture"],"help":"The texture that was removed"},"help":"Remove a texture from the global PIXI.TextureCache.","line":305,"public":true,"protected":false,"private":false,"parameters":[{"name":"id","type":["string"],"help":"The id of the texture to be removed","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Texture"},{"name":"resize","static":false,"returns":null,"help":"Resizes the RenderTexture.","line":145,"public":true,"protected":false,"private":false,"parameters":[{"name":"width","type":["number"],"help":"The width to resize to.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height to resize to.","optional":false,"default":null},{"name":"updateBase","type":["boolean"],"help":"Should the baseTexture.width and height values be resized as well?","optional":false,"default":null}],"inherited":true,"inheritedFrom":"Phaser.RenderTexture"},{"name":"setFrame","static":false,"returns":null,"help":"Specifies the region of the baseTexture that this texture will use.","line":168,"public":true,"protected":false,"private":false,"parameters":[{"name":"frame","type":["Phaser.Rectangle"],"help":"The frame of the texture to set it to","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Texture"}],"protected":[],"private":[{"name":"renderCanvas","static":false,"returns":null,"help":"This function will draw the display object to the texture.","line":246,"public":false,"protected":false,"private":true,"parameters":[{"name":"displayObject","type":["PIXI.DisplayObject"],"help":"The display object to render this texture on","optional":false,"default":null},{"name":"[matrix]","type":["PIXI.Matrix"],"help":"Optional matrix to apply to the display object before rendering.","optional":false,"default":null},{"name":"[clear]","type":["boolean"],"help":"If true the texture will be cleared before the displayObject is drawn","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"renderWebGL","static":false,"returns":null,"help":"This function will draw the display object to the texture.","line":197,"public":false,"protected":false,"private":true,"parameters":[{"name":"displayObject","type":["PIXI.DisplayObject"],"help":"The display object to render this texture on","optional":false,"default":null},{"name":"[matrix]","type":["PIXI.Matrix"],"help":"Optional matrix to apply to the display object before rendering.","optional":false,"default":null},{"name":"[clear]","type":["boolean"],"help":"If true the texture will be cleared before the displayObject is drawn","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"static":[]},"properties":{"public":[{"name":"baseTexture","type":["PIXI.BaseTexture"],"help":"The base texture object that this texture uses","inlineHelp":"","line":84,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"crop","type":["Phaser.Rectangle"],"help":"This is the area of the BaseTexture image to actually copy to the Canvas \/ WebGL when rendering,\\nirrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)","inlineHelp":"","line":76,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"frame","type":["Phaser.Rectangle"],"help":"The framing rectangle of the render texture","inlineHelp":"","line":67,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"height","type":["number"],"help":"The height of the render texture","inlineHelp":"","line":51,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"noFrame","type":["boolean"],"help":"Does this Texture have any frame data assigned to it?","inlineHelp":"","line":30,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"renderer","type":["PIXI.CanvasRenderer","PIXI.WebGLRenderer"],"help":"The renderer this RenderTexture uses. A RenderTexture can only belong to one renderer at the moment if its webGL.","inlineHelp":"","line":105,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"requiresUpdate","type":["boolean"],"help":"This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)","inlineHelp":"","line":81,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"resolution","type":["number"],"help":"The Resolution of the texture.","inlineHelp":"","line":59,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"trim","type":["Phaser.Rectangle"],"help":"The texture trim data.","inlineHelp":"","line":65,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"valid","type":["boolean"],"help":"","inlineHelp":"","line":129,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"width","type":["number"],"help":"The with of the render texture","inlineHelp":"","line":43,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[]}} |