mirror of
https://github.com/photonstorm/phaser
synced 2024-12-25 12:33:38 +00:00
1 line
No EOL
21 KiB
JSON
1 line
No EOL
21 KiB
JSON
{"class":{"name":"Phaser.GameObjectCreator","extends":"","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"A reference to the currently running game.","optional":false,"default":null}],"help":"The Game Object Creator is a quick way to create all of the different sorts of core objects that Phaser uses, but not add them to the game world.\\nUse the GameObjectFactory to create and add the objects into the world."},"consts":[],"methods":{"public":[{"name":"audio","static":false,"returns":{"types":["Phaser.Sound"],"help":"The newly created text object."},"help":"Creates a new Sound object.","line":122,"public":true,"protected":false,"private":false,"parameters":[{"name":"key","type":["string"],"help":"The Game.cache key of the sound that this object will use.","optional":false,"default":null},{"name":"volume","type":["number"],"help":"The volume at which the sound will be played.","optional":true,"default":"1"},{"name":"loop","type":["boolean"],"help":"Whether or not the sound will loop.","optional":true,"default":"false"},{"name":"connect","type":["boolean"],"help":"Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"audioSprite","static":false,"returns":{"types":["Phaser.AudioSprite"],"help":"The newly created AudioSprite object."},"help":"Creates a new AudioSprite object.","line":135,"public":true,"protected":false,"private":false,"parameters":[{"name":"key","type":["string"],"help":"The Game.cache key of the sound that this object will use.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"bitmapData","static":false,"returns":{"types":["Phaser.BitmapData"],"help":"The newly created BitmapData object."},"help":"A BitmapData object which can be manipulated and drawn to like a traditional Canvas object and used to texture Sprites.","line":360,"public":true,"protected":false,"private":false,"parameters":[{"name":"width","type":["number"],"help":"The width of the BitmapData in pixels.","optional":true,"default":"256"},{"name":"height","type":["number"],"help":"The height of the BitmapData in pixels.","optional":true,"default":"256"},{"name":"key","type":["string"],"help":"Asset key for the BitmapData when stored in the Cache (see addToCache parameter).","optional":true,"default":"''"},{"name":"addToCache","type":["boolean"],"help":"Should this BitmapData be added to the Game.Cache? If so you can retrieve it with Cache.getBitmapData(key)","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"bitmapText","static":false,"returns":{"types":["Phaser.BitmapText"],"help":"The newly created bitmapText object."},"help":"Create a new BitmapText object.","line":298,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position of the new bitmapText object.","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the new bitmapText object.","optional":false,"default":null},{"name":"font","type":["string"],"help":"The key of the BitmapText font as stored in Game.Cache.","optional":false,"default":null},{"name":"text","type":["string"],"help":"The actual text that will be rendered. Can be set later via BitmapText.text.","optional":true,"default":null},{"name":"size","type":["number"],"help":"The size the font will be rendered in, in pixels.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"button","static":false,"returns":{"types":["Phaser.Button"],"help":"The newly created button object."},"help":"Creates a new Button object.","line":224,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":" X position of the new button object.","optional":true,"default":null},{"name":"y","type":["number"],"help":" Y position of the new button object.","optional":true,"default":null},{"name":"key","type":["string"],"help":" The image key as defined in the Game.Cache to use as the texture for this button.","optional":true,"default":null},{"name":"callback","type":["function"],"help":" The function to call when this button is pressed","optional":true,"default":null},{"name":"callbackContext","type":["object"],"help":" The context in which the callback will be called (usually 'this')","optional":true,"default":null},{"name":"overFrame","type":["string","number"],"help":" This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name.","optional":true,"default":null},{"name":"outFrame","type":["string","number"],"help":" This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name.","optional":true,"default":null},{"name":"downFrame","type":["string","number"],"help":" This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name.","optional":true,"default":null},{"name":"upFrame","type":["string","number"],"help":" This is the frame or frameName that will be set when this button is in an up state. Give either a number to use a frame ID or a string for a frame name.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"emitter","static":false,"returns":{"types":["Phaser.Emitter"],"help":"The newly created emitter object."},"help":"Emitter is a lightweight particle emitter. It can be used for one-time explosions or for\\ncontinuous effects like rain and fire. All it really does is launch Particle objects out\\nat set intervals, and fixes their positions and velocities accorindgly.","line":255,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The x coordinate within the Emitter that the particles are emitted from.","optional":true,"default":"0"},{"name":"y","type":["number"],"help":"The y coordinate within the Emitter that the particles are emitted from.","optional":true,"default":"0"},{"name":"maxParticles","type":["number"],"help":"The total number of particles in this emitter.","optional":true,"default":"50"}],"inherited":false,"inheritedFrom":""},{"name":"filter","static":false,"returns":{"types":["Phaser.Filter"],"help":"The newly created Phaser.Filter object."},"help":"A WebGL shader\/filter that can be applied to Sprites.","line":384,"public":true,"protected":false,"private":false,"parameters":[{"name":"filter","type":["string"],"help":"The name of the filter you wish to create, for example HueRotate or SineWave.","optional":false,"default":null},{"name":"-","type":["any"],"help":" Whatever parameters are needed to be passed to the filter init function.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"graphics","static":false,"returns":{"types":["Phaser.Graphics"],"help":"The newly created graphics object."},"help":"Creates a new Graphics object.","line":238,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position of the new graphics object.","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the new graphics object.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"group","static":false,"returns":{"types":["Phaser.Group"],"help":"The newly created Group."},"help":"A Group is a container for display objects that allows for fast pooling, recycling and collision checks.","line":88,"public":true,"protected":false,"private":false,"parameters":[{"name":"parent","type":["any"],"help":"The parent Group or DisplayObjectContainer that will hold this group, if any.","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"},{"name":"enableBody","type":["boolean"],"help":"If true all Sprites created with `Group.create` or `Group.createMulitple` will have a physics body created on them. Change the body type with physicsBodyType.","optional":true,"default":"false"},{"name":"physicsBodyType","type":["number"],"help":"If enableBody is true this is the type of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2, Phaser.Physics.NINJA, etc.","optional":true,"default":"0"}],"inherited":false,"inheritedFrom":""},{"name":"image","static":false,"returns":null,"help":"Create a new `Image` object. An Image is a light-weight object you can use to display anything that doesn't need physics or animation.\\nIt can still rotate, scale, crop and receive input events. This makes it perfect for logos, backgrounds, simple buttons and other non-Sprite graphics.","line":42,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position of the image.","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the image.","optional":false,"default":null},{"name":"key","type":["string","Phaser.RenderTexture","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 the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"renderTexture","static":false,"returns":{"types":["Phaser.RenderTexture"],"help":"The newly created RenderTexture object."},"help":"A dynamic initially blank canvas to which images can be drawn.","line":334,"public":true,"protected":false,"private":false,"parameters":[{"name":"width","type":["number"],"help":"the width of the RenderTexture.","optional":true,"default":"100"},{"name":"height","type":["number"],"help":"the height of the RenderTexture.","optional":true,"default":"100"},{"name":"key","type":["string"],"help":"Asset key for the RenderTexture when stored in the Cache (see addToCache parameter).","optional":true,"default":"''"},{"name":"addToCache","type":["boolean"],"help":"Should this RenderTexture be added to the Game.Cache? If so you can retrieve it with Cache.getTexture(key)","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"retroFont","static":false,"returns":{"types":["Phaser.RetroFont"],"help":"The newly created RetroFont texture which can be applied to an Image or Sprite."},"help":"Create a new RetroFont object to be used as a texture for an Image or Sprite and optionally add it to the Cache.\\nA RetroFont uses a bitmap which contains fixed with characters for the font set. You use character spacing to define the set.\\nIf you need variable width character support then use a BitmapText object instead. The main difference between a RetroFont and a BitmapText\\nis that a RetroFont creates a single texture that you can apply to a game object, where-as a BitmapText creates one Sprite object per letter of text.\\nThe texture can be asssigned or one or multiple images\/sprites, but note that the text the RetroFont uses will be shared across them all,\\ni.e. if you need each Image to have different text in it, then you need to create multiple RetroFont objects.","line":281,"public":true,"protected":false,"private":false,"parameters":[{"name":"font","type":["string"],"help":"The key of the image in the Game.Cache that the RetroFont will use.","optional":false,"default":null},{"name":"characterWidth","type":["number"],"help":"The width of each character in the font set.","optional":false,"default":null},{"name":"characterHeight","type":["number"],"help":"The height of each character in the font set.","optional":false,"default":null},{"name":"chars","type":["string"],"help":"The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements.","optional":false,"default":null},{"name":"charsPerRow","type":["number"],"help":"The number of characters per row in the font set.","optional":false,"default":null},{"name":"xSpacing","type":["number"],"help":"If the characters in the font set have horizontal spacing between them set the required amount here.","optional":true,"default":"0"},{"name":"ySpacing","type":["number"],"help":"If the characters in the font set have vertical spacing between them set the required amount here.","optional":true,"default":"0"},{"name":"xOffset","type":["number"],"help":"If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.","optional":true,"default":"0"},{"name":"yOffset","type":["number"],"help":"If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.","optional":true,"default":"0"}],"inherited":false,"inheritedFrom":""},{"name":"rope","static":false,"returns":{"types":["Phaser.Rope"],"help":"The newly created rope object."},"help":"Creates a new Rope object.","line":187,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The x coordinate (in world space) to position the Rope at.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate (in world space) to position the Rope at.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width of the Rope.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height of the Rope.","optional":false,"default":null},{"name":"key","type":["string","Phaser.RenderTexture","Phaser.BitmapData","PIXI.Texture"],"help":"This is the image or texture used by the TileSprite 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 Rope 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}],"inherited":false,"inheritedFrom":""},{"name":"sound","static":false,"returns":{"types":["Phaser.Sound"],"help":"The newly created text object."},"help":"Creates a new Sound object.","line":151,"public":true,"protected":false,"private":false,"parameters":[{"name":"key","type":["string"],"help":"The Game.cache key of the sound that this object will use.","optional":false,"default":null},{"name":"volume","type":["number"],"help":"The volume at which the sound will be played.","optional":true,"default":"1"},{"name":"loop","type":["boolean"],"help":"Whether or not the sound will loop.","optional":true,"default":"false"},{"name":"connect","type":["boolean"],"help":"Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"sprite","static":false,"returns":null,"help":"Create a new Sprite with specific position and sprite sheet key.","line":58,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position of the new sprite.","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the new sprite.","optional":false,"default":null},{"name":"key","type":["string","Phaser.RenderTexture","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 the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"spriteBatch","static":false,"returns":{"types":["Phaser.Group"],"help":"The newly created group."},"help":"A Group is a container for display objects that allows for fast pooling, recycling and collision checks.","line":103,"public":true,"protected":false,"private":false,"parameters":[{"name":"parent","type":["any"],"help":"The parent Group or DisplayObjectContainer that will hold this group, if any.","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"}],"inherited":false,"inheritedFrom":""},{"name":"text","static":false,"returns":{"types":["Phaser.Text"],"help":"The newly created text object."},"help":"Creates a new Text object.","line":203,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"X position of the new text object.","optional":false,"default":null},{"name":"y","type":["number"],"help":"Y position of the new text object.","optional":false,"default":null},{"name":"text","type":["string"],"help":"The actual text that will be written.","optional":false,"default":null},{"name":"style","type":["object"],"help":"The style object containing style attributes like font, font size , etc.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"tileSprite","static":false,"returns":{"types":["Phaser.TileSprite"],"help":"The newly created tileSprite object."},"help":"Creates a new TileSprite object.","line":169,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The x coordinate (in world space) to position the TileSprite at.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The y coordinate (in world space) to position the TileSprite at.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width of the TileSprite.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height of the TileSprite.","optional":false,"default":null},{"name":"key","type":["string","Phaser.RenderTexture","Phaser.BitmapData","PIXI.Texture"],"help":"This is the image or texture used by the TileSprite 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 TileSprite 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}],"inherited":false,"inheritedFrom":""},{"name":"tilemap","static":false,"returns":null,"help":"Creates a new Phaser.Tilemap object. The map can either be populated with data from a Tiled JSON file or from a CSV file.\\nTo do this pass the Cache key as the first parameter. When using Tiled data you need only provide the key.\\nWhen using CSV data you must provide the key and the tileWidth and tileHeight parameters.\\nIf creating a blank tilemap to be populated later, you can either specify no parameters at all and then use `Tilemap.create` or pass the map and tile dimensions here.\\nNote that all Tilemaps use a base tile size to calculate dimensions from, but that a TilemapLayer may have its own unique tile size that overrides it.","line":318,"public":true,"protected":false,"private":false,"parameters":[{"name":"key","type":["string"],"help":"The key of the tilemap data as stored in the Cache. If you're creating a blank map either leave this parameter out or pass `null`.","optional":true,"default":null},{"name":"tileWidth","type":["number"],"help":"The pixel width of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data.","optional":true,"default":"32"},{"name":"tileHeight","type":["number"],"help":"The pixel height of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data.","optional":true,"default":"32"},{"name":"width","type":["number"],"help":"The width of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this.","optional":true,"default":"10"},{"name":"height","type":["number"],"help":"The height of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this.","optional":true,"default":"10"}],"inherited":false,"inheritedFrom":""},{"name":"tween","static":false,"returns":{"types":["Phaser.Tween"],"help":"The Tween object."},"help":"Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite.","line":71,"public":true,"protected":false,"private":false,"parameters":[{"name":"obj","type":["object"],"help":"Object the tween will be run on.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"protected":[],"private":[],"static":[]},"properties":{"public":[{"name":"game","type":["Phaser.Game"],"help":"","inlineHelp":"A reference to the currently running Game.","line":20,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"world","type":["Phaser.World"],"help":"","inlineHelp":"A reference to the game world.","line":25,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[]}} |