mirror of
https://github.com/photonstorm/phaser
synced 2024-12-24 20:13:35 +00:00
1 line
52 KiB
JSON
1 line
52 KiB
JSON
|
{"class":{"name":"Phaser.Button","extends":"Phaser.Image","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":" Current game instance.","optional":false,"default":null},{"name":"x","type":["number"],"help":"X position of the Button.","optional":true,"default":"0"},{"name":"y","type":["number"],"help":"Y position of the Button.","optional":true,"default":"0"},{"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}],"help":"Create a new `Button` object. A Button is a special type of Sprite that is set-up to handle Pointer events automatically. The four states a Button responds to are:\\n\\n* 'Over' - when the Pointer moves over the Button. This is also commonly known as 'hover'.\\n* 'Out' - when the Pointer that was previously over the Button moves out of it.\\n* 'Down' - when the Pointer is pressed down on the Button. I.e. touched on a touch enabled device or clicked with the mouse.\\n* 'Up' - when the Pointer that was pressed down on the Button is released again.\\n\\nYou can set a unique texture frame and Sound for any of these states."},"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":["Phaser.Image"],"help":"This instance."},"help":"Brings the Image to the top of the display list it is a child of. Images that are members of a Phaser.Group are only\\nbought to the top of that Group, not the entire display list.","line":619,"public":true,"protected":false,"private":false,"parameters":[],"inherited":true,"inheritedFrom":"Phaser.Image"},{"name":"clearFrames","static":false,"returns":null,"help":"Clears all of the frames set on this Button.","line":215,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"click","static
|