phaser/v2/resources/docgen/output/Phaser.Sprite.json

1 line
46 KiB
JSON
Raw Normal View History

{"class":{"name":"Phaser.Sprite","extends":"PIXI.Sprite","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"A reference to the currently running game.","optional":false,"default":null},{"name":"x","type":["number"],"help":"The x coordinate (in world space) to position the Sprite at.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate (in world space) to position the Sprite at.","optional":false,"default":null},{"name":"key","type":["string","Phaser.RenderTexture","Phaser.BitmapData","PIXI.Texture"],"help":"This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.","optional":false,"default":null},{"name":"frame","type":["string","number"],"help":"If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.","optional":false,"default":null}],"help":"Sprites are the lifeblood of your game, used for nearly everything visual.\\n\\nAt its most basic a Sprite consists of a set of coordinates and a texture that is rendered to the canvas.\\nThey also contain additional properties allowing for physics motion (via Sprite.body), input handling (via Sprite.input),\\nevents (via Sprite.events), animation (via Sprite.animations), camera culling and more. Please see the Examples for use cases."},"consts":[],"methods":{"public":[{"name":"addChild","static":false,"returns":{"types":["PIXI.DisplayObject"],"help":"The child that was added."},"help":"Adds a child to the container.","line":93,"public":true,"protected":false,"private":false,"parameters":[{"name":"child","type":["PIXI.DisplayObject"],"help":"The DisplayObject to add to the container","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Sprite"},{"name":"addChildAt","static":false,"returns":{"types":["PIXI.DisplayObject"],"help":"The child that was added."},"help":"Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown","line":106,"public":true,"protected":false,"private":false,"parameters":[{"name":"child","type":["PIXI.DisplayObject"],"help":"The child to add","optional":false,"default":null},{"name":"index","type":["number"],"help":"The index to place the child in","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Sprite"},{"name":"bringToTop","static":false,"returns":{"types":[],"help":[]},"help":"Brings the Sprite to the top of the display list it is a child of. Sprites that are members of a Phaser.Group are only\\nbought to the top of that Group, not the entire display list.","line":797,"public":true,"protected":false,"private":false,"parameters":[],"inherited":true,"inheritedFrom":"Phaser.Sprite"},{"name":"click","static":false,"returns":null,"help":"A callback that is used when the users clicks on the displayObject with their mouse's left button","line":238,"public":true,"protected":false,"private":false,"parameters":[{"name":"interactionData","type":["PIXI.InteractionData"],"help":"","optional":false,"default":null}],"inherited":true,"inheritedFrom":"PIXI.Sprite"},{"name":"crop","static":false,"returns":null,"help":"Crop allows you to crop the texture used to display this Sprite.\\nThis modifies the core Sprite texture frame, so the Sprite width\/height properties will adjust accordingly.\\n\\nCropping takes place from the top-left of the Sprite and can be modified in real-time by either providing an updated rectangle object to Sprite.crop,\\nor by modifying Sprite.cropRect (or a reference to it) and then calling Sprite.updateCrop.\\n\\nThe rectangle object given to this method can be either a Phaser.Rectangle or any object so long as it has public x, y, width and height properties.\\nA reference to the rectangle is stored in Sprite.cropRect unless the `copy` parameter is `true` in which case the values are duplicated to a local object.","line":512,"public":true,"protected":false,"private":false,"parame