mirror of
https://github.com/photonstorm/phaser
synced 2024-12-22 19:13:37 +00:00
1 line
68 KiB
JSON
1 line
68 KiB
JSON
|
{"class":{"name":"Phaser.SpriteBatch","extends":"Phaser.Group","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"A reference to the currently running game.","optional":false,"default":null},{"name":"parent","type":["Phaser.Group","Phaser.Sprite","null"],"help":"The parent Group, DisplayObject or DisplayObjectContainer that this Group will be added to. If `undefined` or `null` it will use game.world.","optional":false,"default":null},{"name":"name","type":["string"],"help":"A name for this Group. Not used internally but useful for debugging.","optional":true,"default":"group"},{"name":"addToStage","type":["boolean"],"help":"If set to true this Group will be added directly to the Game.Stage instead of Game.World.","optional":true,"default":"false"}],"help":"The SpriteBatch class is a really fast version of the DisplayObjectContainer built purely for speed, so use when you need a lot of sprites or particles.\\nIt's worth mentioning that by default sprite batches are used through-out the renderer, so you only really need to use a SpriteBatch if you have over\\n1000 sprites that all share the same texture (or texture atlas). It's also useful if running in Canvas mode and you have a lot of un-rotated or un-scaled\\nSprites as it skips all of the Canvas setTransform calls, which helps performance, especially on mobile devices."},"consts":[],"methods":{"public":[{"name":"add","static":false,"returns":{"types":["any"],"help":"The child that was added to the Group."},"help":"Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object.\\nThe child is automatically added to the top of the Group, so renders on-top of everything else within the Group. If you need to control\\nthat then see the addAt method.","line":209,"public":true,"protected":false,"private":false,"parameters":[{"name":"child","type":["any"],"help":"An instance of Phaser.Sprite, Phaser.Button or any other display object.","optional":false,"default":null},{"name":"silent","type":["boolean"],"help":"If the silent parameter is `true` the child will not dispatch the onAddedToGroup event.","optional":true,"default":"false"}],"inherited":true,"inheritedFrom":"Phaser.Group"},{"name":"addAll","static":false,"returns":null,"help":"Adds the amount to the given property on all children in this Group.\\nGroup.addAll('x', 10) will add 10 to the child.x value.","line":956,"public":true,"protected":false,"private":false,"parameters":[{"name":"property","type":["string"],"help":"The property to increment, for example 'body.velocity.x' or 'angle'.","optional":false,"default":null},{"name":"amount","type":["number"],"help":"The amount to increment the property by. If child.x = 10 then addAll('x', 40) would make child.x = 50.","optional":false,"default":null},{"name":"checkAlive","type":["boolean"],"help":"If true the property will only be changed if the child is alive.","optional":false,"default":null},{"name":"checkVisible","type":["boolean"],"help":"If true the property will only be changed if the child is visible.","optional":false,"default":null}],"inherited":true,"inheritedFrom":"Phaser.Group"},{"name":"addAt","static":false,"returns":{"types":["any"],"help":"The child that was added to the Group."},"help":"Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object.\\nThe child is added to the Group at the location specified by the index value, this allows you to control child ordering.","line":273,"public":true,"protected":false,"private":false,"parameters":[{"name":"child","type":["any"],"help":"An instance of Phaser.Sprite, Phaser.Button or any other display object..","optional":false,"default":null},{"name":"index","type":["number"],"help":"The index within the Group to insert the child to.","optional":false,"default":null},{"name":"silent","type":["boolean"],"help":"If the silent parameter is `true` the child will not dispatch the onAddedToGroup event.","optional":true,"default":"false"}],"inh
|