mirror of
https://github.com/photonstorm/phaser
synced 2025-02-26 12:27:09 +00:00
Re-format optional parameters.
This commit is contained in:
parent
be8c1618d4
commit
82c5b767c6
20 changed files with 192 additions and 191 deletions
|
@ -108,7 +108,7 @@ module Phaser {
|
|||
* Checks for Line to Line intersection and returns an IntersectResult object containing the results of the intersection.
|
||||
* @param line1 The first Line object to check
|
||||
* @param line2 The second Line object to check
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static lineToLine(line1: Line, line2: Line, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -129,7 +129,7 @@ module Phaser {
|
|||
* Checks for Line to Line Segment intersection and returns an IntersectResult object containing the results of the intersection.
|
||||
* @param line The Line object to check
|
||||
* @param seg The Line segment object to check
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static lineToLineSegment(line: Line, seg: Line, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -164,7 +164,7 @@ module Phaser {
|
|||
* @param y1 The start y coordinate of the raw segment
|
||||
* @param x2 The end x coordinate of the raw segment
|
||||
* @param y2 The end y coordinate of the raw segment
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static lineToRawSegment(line: Line, x1: number, y1: number, x2: number, y2: number, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -196,7 +196,7 @@ module Phaser {
|
|||
* Checks for Line to Ray intersection and returns the result in an IntersectResult object.
|
||||
* @param line1 The Line object to check
|
||||
* @param ray The Ray object to check
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static lineToRay(line1: Line, ray: Line, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -229,7 +229,7 @@ module Phaser {
|
|||
* Check if the Line and Circle objects intersect
|
||||
* @param line The Line object to check
|
||||
* @param circle The Circle object to check
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static lineToCircle(line: Line, circle: Circle, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -248,7 +248,7 @@ module Phaser {
|
|||
* Check if the Line intersects each side of the Rectangle
|
||||
* @param line The Line object to check
|
||||
* @param rect The Rectangle object to check
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static lineToRectangle(line: Line, rect: Rectangle, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -288,7 +288,7 @@ module Phaser {
|
|||
* Check if the two Line Segments intersect and returns the result in an IntersectResult object.
|
||||
* @param line1 The first Line Segment to check
|
||||
* @param line2 The second Line Segment to check
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static lineSegmentToLineSegment(line1: Line, line2: Line, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -311,7 +311,7 @@ module Phaser {
|
|||
* Check if the Line Segment intersects with the Ray and returns the result in an IntersectResult object.
|
||||
* @param line The Line Segment to check.
|
||||
* @param ray The Ray to check.
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static lineSegmentToRay(line: Line, ray: Line, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -335,7 +335,7 @@ module Phaser {
|
|||
* Check if the Line Segment intersects with the Circle and returns the result in an IntersectResult object.
|
||||
* @param seg The Line Segment to check.
|
||||
* @param circle The Circle to check
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static lineSegmentToCircle(seg: Line, circle: Circle, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -372,7 +372,7 @@ module Phaser {
|
|||
* Check if the Line Segment intersects with the Rectangle and returns the result in an IntersectResult object.
|
||||
* @param seg The Line Segment to check.
|
||||
* @param rect The Rectangle to check.
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static lineSegmentToRectangle(seg: Line, rect: Rectangle, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -422,7 +422,7 @@ module Phaser {
|
|||
* Check for Ray to Rectangle intersection and returns the result in an IntersectResult object.
|
||||
* @param ray The Ray to check.
|
||||
* @param rect The Rectangle to check.
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static rayToRectangle(ray: Line, rect: Rectangle, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -445,7 +445,7 @@ module Phaser {
|
|||
* @param lineY1
|
||||
* @param lineX2
|
||||
* @param lineY2
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static rayToLineSegment(rayX1, rayY1, rayX2, rayY2, lineX1, lineY1, lineX2, lineY2, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -484,7 +484,7 @@ module Phaser {
|
|||
* Determines whether the specified point is contained within the rectangular region defined by the Rectangle object and returns the result in an IntersectResult object.
|
||||
* @param point The Point or MicroPoint object to check, or any object with x and y properties.
|
||||
* @param rect The Rectangle object to check the point against
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static pointToRectangle(point, rect: Rectangle, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -501,7 +501,7 @@ module Phaser {
|
|||
* Check whether two axis aligned Rectangles intersect and returns the intersecting rectangle dimensions in an IntersectResult object if they do.
|
||||
* @param rect1 The first Rectangle object.
|
||||
* @param rect2 The second Rectangle object.
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static rectangleToRectangle(rect1: Rectangle, rect2: Rectangle, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -529,7 +529,7 @@ module Phaser {
|
|||
* Checks if the Rectangle and Circle objects intersect and returns the result in an IntersectResult object.
|
||||
* @param rect The Rectangle object to check
|
||||
* @param circle The Circle object to check
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static rectangleToCircle(rect: Rectangle, circle: Circle, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -542,7 +542,7 @@ module Phaser {
|
|||
* Checks if the two Circle objects intersect and returns the result in an IntersectResult object.
|
||||
* @param circle1 The first Circle object to check
|
||||
* @param circle2 The second Circle object to check
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static circleToCircle(circle1: Circle, circle2: Circle, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -557,7 +557,7 @@ module Phaser {
|
|||
* Checks if the Circle object intersects with the Rectangle and returns the result in an IntersectResult object.
|
||||
* @param circle The Circle object to check
|
||||
* @param rect The Rectangle object to check
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static circleToRectangle(circle: Circle, rect: Rectangle, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
@ -576,7 +576,7 @@ module Phaser {
|
|||
* Checks if the Point object is contained within the Circle and returns the result in an IntersectResult object.
|
||||
* @param circle The Circle object to check
|
||||
* @param point A Point or MicroPoint object to check, or any object with x and y properties
|
||||
* @param output An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @param [output] An optional IntersectResult object to store the intersection values in. One is created if none given.
|
||||
* @returns {IntersectResult=} An IntersectResult object containing the results of the intersection
|
||||
*/
|
||||
public static circleContainsPoint(circle: Circle, point, output?: IntersectResult = new IntersectResult): IntersectResult {
|
||||
|
|
|
@ -415,8 +415,8 @@ module Phaser {
|
|||
/**
|
||||
* Switch to a new State.
|
||||
* @param state {State} The state you want to switch to.
|
||||
* @param clearWorld {boolean} Optional, clear everything in the world? (Default to true)
|
||||
* @param clearCache {boolean} Optional, clear asset cache? (Default to false and ONLY available when clearWorld=true)
|
||||
* @param [clearWorld] {boolean} clear everything in the world? (Default to true)
|
||||
* @param [clearCache] {boolean} clear asset cache? (Default to false and ONLY available when clearWorld=true)
|
||||
*/
|
||||
public switchState(state, clearWorld: bool = true, clearCache: bool = false) {
|
||||
|
||||
|
@ -655,9 +655,9 @@ module Phaser {
|
|||
* @param key {string} Key for tileset image.
|
||||
* @param mapData {string} Data of this tilemap.
|
||||
* @param format {number} Format of map data. (Tilemap.FORMAT_CSV or Tilemap.FORMAT_TILED_JSON)
|
||||
* @param resizeWorld {boolean} Optional, resize the world to make same as tilemap?
|
||||
* @param tileWidth {number} Optional, width of each tile.
|
||||
* @param tileHeight {number} Optional, height of each tile.
|
||||
* @param [resizeWorld] {boolean} resize the world to make same as tilemap?
|
||||
* @param [tileWidth] {number} width of each tile.
|
||||
* @param [tileHeight] {number} height of each tile.
|
||||
* @return {Tilemap} The newly created tilemap object.
|
||||
*/
|
||||
public createTilemap(key: string, mapData: string, format: number, resizeWorld: bool = true, tileWidth?: number = 0, tileHeight?: number = 0): Tilemap {
|
||||
|
|
|
@ -166,7 +166,7 @@ module Phaser {
|
|||
*
|
||||
* @param input - the value to snap
|
||||
* @param gap - the interval gap of the grid
|
||||
* @param start - optional starting offset for gap
|
||||
* @param [start] - optional starting offset for gap
|
||||
*/
|
||||
public snapTo(input: number, gap: number, start: number = 0): number {
|
||||
if (gap == 0) return input;
|
||||
|
@ -183,7 +183,7 @@ module Phaser {
|
|||
*
|
||||
* @param input - the value to snap
|
||||
* @param gap - the interval gap of the grid
|
||||
* @param start - optional starting offset for gap
|
||||
* @param [start] - optional starting offset for gap
|
||||
*/
|
||||
public snapToFloor(input: number, gap: number, start: number = 0): number {
|
||||
if (gap == 0) return input;
|
||||
|
@ -200,7 +200,7 @@ module Phaser {
|
|||
*
|
||||
* @param input - the value to snap
|
||||
* @param gap - the interval gap of the grid
|
||||
* @param start - optional starting offset for gap
|
||||
* @param [start] - optional starting offset for gap
|
||||
*/
|
||||
public snapToCeil(input: number, gap: number, start: number = 0): number {
|
||||
if (gap == 0) return input;
|
||||
|
|
|
@ -502,7 +502,7 @@ module Phaser {
|
|||
* Call this function to retrieve the first object with exists == false in the group.
|
||||
* This is handy for recycling in general, e.g. respawning enemies.
|
||||
*
|
||||
* @param ObjectClass An optional parameter that lets you narrow the results to instances of this particular class.
|
||||
* @param [ObjectClass] An optional parameter that lets you narrow the results to instances of this particular class.
|
||||
*
|
||||
* @return A <code>Basic</code> currently flagged as not existing.
|
||||
*/
|
||||
|
|
|
@ -121,8 +121,8 @@ module Phaser {
|
|||
* Add a new texture atlas loading request.
|
||||
* @param key {string} Unique asset key of the texture atlas file.
|
||||
* @param url {string} URL of texture atlas file.
|
||||
* @param jsonURL {string} Optional, url of JSON data file.
|
||||
* @param jsonData {object} Optional, JSON data object.
|
||||
* @param [jsonURL] {string} url of JSON data file.
|
||||
* @param [jsonData] {object} JSON data object.
|
||||
*/
|
||||
public addTextureAtlas(key: string, url: string, jsonURL?: string = null, jsonData? = null) {
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ module Phaser {
|
|||
* Decode a sound with its assets key.
|
||||
* @param key {string} Assets key of the sound to be decoded.
|
||||
* @param callback {function} This will be invoked when finished decoding.
|
||||
* @param sound {Sound} Optional, its bufer will be set to decoded data.
|
||||
* @param [sound] {Sound} its bufer will be set to decoded data.
|
||||
*/
|
||||
public decode(key: string, callback = null, sound?: Sound = null) {
|
||||
|
||||
|
@ -122,8 +122,8 @@ module Phaser {
|
|||
/**
|
||||
* Play a sound with its assets key.
|
||||
* @param key {string} Assets key of the sound you want to play.
|
||||
* @param volume {number} Optional, volume of the sound you want to play.
|
||||
* @param loop {boolean} Optional, loop when it finished playing? (Default to false)
|
||||
* @param [volume] {number} volume of the sound you want to play.
|
||||
* @param [loop] {boolean} loop when it finished playing? (Default to false)
|
||||
* @return {Sound} The playing sound object.
|
||||
*/
|
||||
public play(key: string, volume?: number = 1, loop?: bool = false): Sound {
|
||||
|
|
|
@ -155,7 +155,7 @@ module Phaser {
|
|||
*
|
||||
* @param x {number} X position of the new sprite.
|
||||
* @param y {number} Y position of the new sprite.
|
||||
* @param key {string} Optinal, key for the sprite sheet you want it to use.
|
||||
* @param key {string} [optional] key for the sprite sheet you want it to use.
|
||||
* @returns {Sprite} The newly created sprite object.
|
||||
*/
|
||||
public createSprite(x: number, y: number, key?: string = ''): Sprite {
|
||||
|
@ -176,7 +176,7 @@ module Phaser {
|
|||
/**
|
||||
* Create a new object container.
|
||||
*
|
||||
* @param MaxSize {number} Optinal, capacity of this group.
|
||||
* @param MaxSize {number} [optional] capacity of this group.
|
||||
* @returns {Group} The newly created group.
|
||||
*/
|
||||
public createGroup(MaxSize?: number = 0): Group {
|
||||
|
@ -195,9 +195,9 @@ module Phaser {
|
|||
/**
|
||||
* Create a new Emitter.
|
||||
*
|
||||
* @param x {number} Optinal, x position of the emitter.
|
||||
* @param y {number} Optinal, y position of the emitter.
|
||||
* @param size {number} Optinal, size of this emitter.
|
||||
* @param x {number} [optional] x position of the emitter.
|
||||
* @param y {number} [optional] y position of the emitter.
|
||||
* @param size {number} [optional] size of this emitter.
|
||||
* @return {Emitter} The newly created emitter object.
|
||||
*/
|
||||
public createEmitter(x?: number = 0, y?: number = 0, size?: number = 0): Emitter {
|
||||
|
@ -224,9 +224,9 @@ module Phaser {
|
|||
* @param key {string} Key for tileset image.
|
||||
* @param mapData {string} Data of this tilemap.
|
||||
* @param format {number} Format of map data. (Tilemap.FORMAT_CSV or Tilemap.FORMAT_TILED_JSON)
|
||||
* @param resizeWorld {boolean} Optinal, resize the world to make same as tilemap?
|
||||
* @param tileWidth {number} Optinal, width of each tile.
|
||||
* @param tileHeight number} Optinal, height of each tile.
|
||||
* @param resizeWorld {boolean} [optional] resize the world to make same as tilemap?
|
||||
* @param tileWidth {number} [optional] width of each tile.
|
||||
* @param tileHeight number} [optional] height of each tile.
|
||||
* @return {Tilemap} The newly created tilemap object.
|
||||
*/
|
||||
public createTilemap(key: string, mapData: string, format: number, resizeWorld: bool = true, tileWidth?: number = 0, tileHeight?: number = 0): Tilemap {
|
||||
|
|
|
@ -102,7 +102,7 @@ module Phaser {
|
|||
*
|
||||
* @param width {number} New width of the world.
|
||||
* @param height {number} New height of the world.
|
||||
* @param updateCameraBounds {boolean} Optinal, update camera bounds automatically or not. Default to true.
|
||||
* @param [updateCameraBounds] {boolean} update camera bounds automatically or not. Default to true.
|
||||
*/
|
||||
public setSize(width: number, height: number, updateCameraBounds: bool = true) {
|
||||
|
||||
|
@ -189,7 +189,7 @@ module Phaser {
|
|||
*
|
||||
* @param x {number} X position of the new sprite.
|
||||
* @param y {number} Y position of the new sprite.
|
||||
* @param key {string} Optinal, key for the sprite sheet you want it to use.
|
||||
* @param [key] {string} key for the sprite sheet you want it to use.
|
||||
* @returns {Sprite} The newly created sprite object.
|
||||
*/
|
||||
public createSprite(x: number, y: number, key?: string = ''): Sprite {
|
||||
|
@ -221,7 +221,7 @@ module Phaser {
|
|||
/**
|
||||
* Create a new object container.
|
||||
*
|
||||
* @param MaxSize {number} Optinal, capacity of this group.
|
||||
* @param [MaxSize] {number} capacity of this group.
|
||||
* @returns {Group} The newly created group.
|
||||
*/
|
||||
public createGroup(MaxSize?: number = 0): Group {
|
||||
|
@ -248,9 +248,9 @@ module Phaser {
|
|||
* @param key {string} Key for tileset image.
|
||||
* @param mapData {string} Data of this tilemap.
|
||||
* @param format {number} Format of map data. (Tilemap.FORMAT_CSV or Tilemap.FORMAT_TILED_JSON)
|
||||
* @param resizeWorld {boolean} Optinal, resize the world to make same as tilemap?
|
||||
* @param tileWidth {number} Optinal, width of each tile.
|
||||
* @param tileHeight {number} Optinal, height of each tile.
|
||||
* @param [resizeWorld] {boolean} resize the world to make same as tilemap?
|
||||
* @param [tileWidth] {number} width of each tile.
|
||||
* @param [tileHeight] {number} height of each tile.
|
||||
* @return {Tilemap} The newly created tilemap object.
|
||||
*/
|
||||
public createTilemap(key: string, mapData: string, format: number, resizeWorld: bool = true, tileWidth?: number = 0, tileHeight?: number = 0): Tilemap {
|
||||
|
@ -269,9 +269,9 @@ module Phaser {
|
|||
/**
|
||||
* Create a new Emitter.
|
||||
*
|
||||
* @param x {number} Optinal, x position of the emitter.
|
||||
* @param y {number} Optinal, y position of the emitter.
|
||||
* @param size {number} Optinal, size of this emitter.
|
||||
* @param [x] {number} x position of the emitter.
|
||||
* @param [y] {number} y position of the emitter.
|
||||
* @param [size] {number} size of this emitter.
|
||||
* @return {Emitter} The newly created emitter object.
|
||||
*/
|
||||
public createEmitter(x?: number = 0, y?: number = 0, size?: number = 0): Emitter {
|
||||
|
|
|
@ -19,7 +19,7 @@ module Phaser {
|
|||
*
|
||||
* @param X {number} The X position of the emitter.
|
||||
* @param Y {number} The Y position of the emitter.
|
||||
* @param Size {number} Optional, specifies a maximum capacity for this emitter.
|
||||
* @param [Size] {number} specifies a maximum capacity for this emitter.
|
||||
*/
|
||||
constructor(game: Game, X: number = 0, Y: number = 0, Size: number = 0) {
|
||||
super(game, Size);
|
||||
|
|
|
@ -19,10 +19,10 @@ module Phaser {
|
|||
* Create a new <code>GameObject</code> object at specific position with
|
||||
* specific width and height.
|
||||
*
|
||||
* @param x {number} Optinal, the x position of the object.
|
||||
* @param y {number} Optinal, the y position of the object.
|
||||
* @param width {number} Optinal, the width of the object.
|
||||
* @param height {number} Optinal, the height of the object.
|
||||
* @param [x] {number} The x position of the object.
|
||||
* @param [y] {number} The y position of the object.
|
||||
* @param [width] {number} The width of the object.
|
||||
* @param [height] {number} The height of the object.
|
||||
*/
|
||||
constructor(game: Game, x?: number = 0, y?: number = 0, width?: number = 16, height?: number = 16) {
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ module Phaser {
|
|||
* Create a new <code>GeomSprite</code>.
|
||||
*
|
||||
* @param game {Phaser.Game} Current game instance.
|
||||
* @param x {number} Optional, the initial x position of the sprite.
|
||||
* @param y {number} Optional, the initial y position of the sprite.
|
||||
* @param [x] {number} the initial x position of the sprite.
|
||||
* @param [y] {number} the initial y position of the sprite.
|
||||
*/
|
||||
constructor(game: Game, x?: number = 0, y?: number = 0) {
|
||||
|
||||
|
@ -468,7 +468,7 @@ module Phaser {
|
|||
* @param point {Point} Position of the point.
|
||||
* @param offsetX {number} X offset to its position.
|
||||
* @param offsetY {number} Y offset to its position.
|
||||
* @param size {number} Optional, point size.
|
||||
* @param [size] {number} point size.
|
||||
*/
|
||||
public renderPoint(point, offsetX?: number = 0, offsetY?: number = 0, size?: number = 1) {
|
||||
|
||||
|
@ -480,7 +480,7 @@ module Phaser {
|
|||
* Render debug infos. (this method does not work now)
|
||||
* @param x {number} X position of the debug info to be rendered.
|
||||
* @param y {number} Y position of the debug info to be rendered.
|
||||
* @param color {number} Optional, color of the debug info to be rendered. (format is css color string)
|
||||
* @param [color] {number} color of the debug info to be rendered. (format is css color string)
|
||||
*/
|
||||
public renderDebugInfo(x: number, y: number, color?: string = 'rgb(255,255,255)') {
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ module Phaser {
|
|||
* @param key {string} Asset key for image texture of this object.
|
||||
* @param x {number} X position in world coordinate.
|
||||
* @param y {number} Y position in world coordinate.
|
||||
* @param width {number} Optional, width of this object.
|
||||
* @param height {number} Optional, height of this object.
|
||||
* @param [width] {number} width of this object.
|
||||
* @param [height] {number} height of this object.
|
||||
*/
|
||||
constructor(game: Game, key:string, x: number = 0, y: number = 0, width?: number = 0, height?: number = 0) {
|
||||
|
||||
|
@ -113,8 +113,8 @@ module Phaser {
|
|||
* @param y {number} Y position of the new region.
|
||||
* @param width {number} Width of the new region.
|
||||
* @param height {number} Height of the new region.
|
||||
* @param speedX {number} Optional, x-axis scrolling speed.
|
||||
* @param speedY {number} Optional, y-axis scrolling speed.
|
||||
* @param [speedX] {number} x-axis scrolling speed.
|
||||
* @param [speedY] {number} y-axis scrolling speed.
|
||||
* @return {ScrollRegion} The newly added region.
|
||||
*/
|
||||
public addRegion(x: number, y: number, width: number, height: number, speedX?:number = 0, speedY?:number = 0):ScrollRegion {
|
||||
|
|
|
@ -19,9 +19,9 @@ module Phaser {
|
|||
* Create a new <code>Sprite</code>.
|
||||
*
|
||||
* @param game {Phaser.Game} Current game instance.
|
||||
* @param x {number} Optional, the initial x position of the sprite.
|
||||
* @param y {number} Optional, the initial y position of the sprite.
|
||||
* @param key {string} Optional, Key of the graphic you want to load for this sprite.
|
||||
* @param [x] {number} the initial x position of the sprite.
|
||||
* @param [y] {number} the initial y position of the sprite.
|
||||
* @param [key] {string} Key of the graphic you want to load for this sprite.
|
||||
*/
|
||||
constructor(game: Game, x?: number = 0, y?: number = 0, key?: string = null) {
|
||||
|
||||
|
@ -140,7 +140,7 @@ module Phaser {
|
|||
* This function creates a flat colored square image dynamically.
|
||||
* @param width {number} The width of the sprite you want to generate.
|
||||
* @param height {number} The height of the sprite you want to generate.
|
||||
* @param color {number} Optional, specifies the color of the generated block. (format is 0xAARRGGBB)
|
||||
* @param [color] {number} specifies the color of the generated block. (format is 0xAARRGGBB)
|
||||
* @return {Sprite} Sprite instance itself.
|
||||
*/
|
||||
public makeGraphic(width: number, height: number, color: number = 0xffffffff): Sprite {
|
||||
|
@ -413,7 +413,7 @@ module Phaser {
|
|||
* Render debug infos. (including name, bounds info, position and some other properties)
|
||||
* @param x {number} X position of the debug info to be rendered.
|
||||
* @param y {number} Y position of the debug info to be rendered.
|
||||
* @param color {number} Optional, color of the debug info to be rendered. (format is css color string)
|
||||
* @param [color] {number} color of the debug info to be rendered. (format is css color string)
|
||||
*/
|
||||
public renderDebugInfo(x: number, y: number, color?: string = 'rgb(255,255,255)') {
|
||||
|
||||
|
|
|
@ -315,7 +315,7 @@ module Phaser {
|
|||
* Get the tile located at specific position and layer.
|
||||
* @param x {number} X position of this tile located.
|
||||
* @param y {number} Y position of this tile located.
|
||||
* @param layer {number} Optional, layer of this tile located.
|
||||
* @param [layer] {number} layer of this tile located.
|
||||
* @return {Tile} The tile with specific properties.
|
||||
*/
|
||||
public getTile(x: number, y: number, layer?: number = 0):Tile {
|
||||
|
@ -328,7 +328,7 @@ module Phaser {
|
|||
* Get the tile located at specific position (in world coordinate) and layer. (thus you give a position of a point which is within the tile)
|
||||
* @param x {number} X position of the point in target tile.
|
||||
* @param x {number} Y position of the point in target tile.
|
||||
* @param layer {number} Optional, layer of this tile located.
|
||||
* @param [layer] {number} layer of this tile located.
|
||||
* @return {Tile} The tile with specific properties.
|
||||
*/
|
||||
public getTileFromWorldXY(x: number, y: number, layer?: number = 0):Tile {
|
||||
|
@ -417,7 +417,7 @@ module Phaser {
|
|||
* @param x {number} X position of this tile.
|
||||
* @param y {number} Y position of this tile.
|
||||
* @param index {number} The index of this tile type in the core map data.
|
||||
* @param layer {number} Optional, which layer you want to set the tile to.
|
||||
* @param [layer] {number} which layer you want to set the tile to.
|
||||
*/
|
||||
public putTile(x: number, y: number, index: number, layer?: number = 0) {
|
||||
|
||||
|
|
|
@ -14,8 +14,9 @@ module Phaser {
|
|||
* Creates a new Circle object with the center coordinate specified by the x and y parameters and the diameter specified by the diameter parameter. If you call this function without parameters, a circle with x, y, diameter and radius properties set to 0 is created.
|
||||
* @class Circle
|
||||
* @constructor
|
||||
* @param {Number} x The x coordinate of the center of the circle.
|
||||
* @param {Number} y The y coordinate of the center of the circle.
|
||||
* @param {Number} [x] The x coordinate of the center of the circle.
|
||||
* @param {Number} [y] The y coordinate of the center of the circle.
|
||||
* @param {Number} [diameter] The diameter of the circle.
|
||||
* @return {Circle} This circle object
|
||||
**/
|
||||
constructor(x: number = 0, y: number = 0, diameter: number = 0) {
|
||||
|
@ -287,7 +288,7 @@ module Phaser {
|
|||
/**
|
||||
* Returns a new Circle object with the same values for the x, y, width, and height properties as the original Circle object.
|
||||
* @method clone
|
||||
* @param {Circle} output Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned.
|
||||
* @param {Circle} [optional] output Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned.
|
||||
* @return {Phaser.Circle}
|
||||
**/
|
||||
public clone(output?: Circle = new Circle): Circle {
|
||||
|
@ -364,7 +365,7 @@ module Phaser {
|
|||
* Returns the distance from the center of this Circle object to the given object (can be Circle, Point or anything with x/y values)
|
||||
* @method distanceFrom
|
||||
* @param {Circle/Point} target - The destination Point object.
|
||||
* @param {Boolean} round - Round the distance to the nearest integer (default false)
|
||||
* @param {Boolean} [optional] round - Round the distance to the nearest integer (default false)
|
||||
* @return {Number} The distance between this Point object and the destination Point object.
|
||||
**/
|
||||
public distanceTo(target: any, round?: bool = false): number {
|
||||
|
@ -418,9 +419,9 @@ module Phaser {
|
|||
/**
|
||||
* Returns a Point object containing the coordinates of a point on the circumference of this Circle based on the given angle.
|
||||
* @method circumferencePoint
|
||||
* @param {Number} The angle in radians (unless asDegrees is true) to return the point from.
|
||||
* @param {Boolean} Is the given angle in radians (false) or degrees (true)?
|
||||
* @param {Phaser.Point} An optional Point object to put the result in to. If none specified a new Point object will be created.
|
||||
* @param {Number} angle The angle in radians (unless asDegrees is true) to return the point from.
|
||||
* @param {Boolean} asDegrees Is the given angle in radians (false) or degrees (true)?
|
||||
* @param {Phaser.Point} [optional] output An optional Point object to put the result in to. If none specified a new Point object will be created.
|
||||
* @return {Phaser.Point} The Point object holding the result.
|
||||
**/
|
||||
public circumferencePoint(angle: number, asDegrees: bool = false, output?: Point = new Point): Point {
|
||||
|
|
|
@ -196,7 +196,7 @@ module Phaser {
|
|||
/**
|
||||
* Tells this camera object what sprite to track.
|
||||
* @param target {Sprite} The object you want the camera to track. Set to null to not follow anything.
|
||||
* @param style {number} Optional, Leverage one of the existing "deadzone" presets. If you use a custom deadzone, ignore this parameter and manually specify the deadzone after calling follow().
|
||||
* @param [style] {number} Leverage one of the existing "deadzone" presets. If you use a custom deadzone, ignore this parameter and manually specify the deadzone after calling follow().
|
||||
*/
|
||||
public follow(target: Sprite, style?: number = Camera.STYLE_LOCKON) {
|
||||
|
||||
|
@ -497,7 +497,7 @@ module Phaser {
|
|||
/**
|
||||
* Set camera background texture.
|
||||
* @param key {string} Asset key of the texture.
|
||||
* @param repeat {string} Optional, what kind of repeat will this texture used for background.
|
||||
* @param [repeat] {string} what kind of repeat will this texture used for background.
|
||||
*/
|
||||
public setTexture(key: string, repeat?: string = 'repeat') {
|
||||
|
||||
|
@ -537,7 +537,7 @@ module Phaser {
|
|||
* Render debug infos. (including id, position, rotation, scrolling factor, bounds and some other properties)
|
||||
* @param x {number} X position of the debug info to be rendered.
|
||||
* @param y {number} Y position of the debug info to be rendered.
|
||||
* @param color {number} Optional, color of the debug info to be rendered. (format is css color string)
|
||||
* @param [color] {number} color of the debug info to be rendered. (format is css color string)
|
||||
*/
|
||||
public renderDebugInfo(x: number, y: number, color?: string = 'rgb(255,255,255)') {
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ module Phaser {
|
|||
* @param context {object} The AudioContext instance.
|
||||
* @param gainNode {object} Gain node instance.
|
||||
* @param data {object} Sound data.
|
||||
* @param volume {number} Optional, volume of this sound when playing.
|
||||
* @param loop {boolean} Optional, loop this sound when playing? (Default to false)
|
||||
* @param [volume] {number} volume of this sound when playing.
|
||||
* @param [loop] {boolean} loop this sound when playing? (Default to false)
|
||||
*/
|
||||
constructor(context, gainNode, data, volume?: number = 1, loop?: bool = false) {
|
||||
|
||||
|
|
|
@ -189,10 +189,10 @@ module Phaser {
|
|||
* Swap tiles with 2 kinds of indexes.
|
||||
* @param tileA {number} First tile index.
|
||||
* @param tileB {number} Second tile index.
|
||||
* @param x {number} Optional, specify a rectangle of tiles to operate. The x position in tiles of rectangle's left-top corner.
|
||||
* @param y {number} Optional, specify a rectangle of tiles to operate. The y position in tiles of rectangle's left-top corner.
|
||||
* @param width {number} Optional, specify a rectangle of tiles to operate. The width in tiles.
|
||||
* @param height {number} Optional, specify a rectangle of tiles to operate. The height in tiles.
|
||||
* @param [x] {number} specify a rectangle of tiles to operate. The x position in tiles of rectangle's left-top corner.
|
||||
* @param [y] {number} specify a rectangle of tiles to operate. The y position in tiles of rectangle's left-top corner.
|
||||
* @param [width] {number} specify a rectangle of tiles to operate. The width in tiles.
|
||||
* @param [height] {number} specify a rectangle of tiles to operate. The height in tiles.
|
||||
*/
|
||||
public swapTile(tileA: number, tileB: number, x?: number = 0, y?: number = 0, width?: number = this.widthInTiles, height?: number = this.heightInTiles) {
|
||||
|
||||
|
@ -227,10 +227,10 @@ module Phaser {
|
|||
/**
|
||||
* Fill a tile block with a specific tile index.
|
||||
* @param index {number} Index of tiles you want to fill with.
|
||||
* @param x {number} Optional, x position (in tiles) of block's left-top corner.
|
||||
* @param y {number} Optional, y position (in tiles) of block's left-top corner.
|
||||
* @param width {number} Optional, width of block.
|
||||
* @param height {number} Optional, height of block.
|
||||
* @param [x] {number} x position (in tiles) of block's left-top corner.
|
||||
* @param [y] {number} y position (in tiles) of block's left-top corner.
|
||||
* @param [width] {number} width of block.
|
||||
* @param [height] {number} height of block.
|
||||
*/
|
||||
public fillTile(index: number, x?: number = 0, y?: number = 0, width?: number = this.widthInTiles, height?: number = this.heightInTiles) {
|
||||
|
||||
|
@ -246,10 +246,10 @@ module Phaser {
|
|||
/**
|
||||
* Set random tiles to a specific tile block.
|
||||
* @param tiles {number[]} Tiles with indexes in this array will be randomly set to the given block.
|
||||
* @param x {number} Optional, x position (in tiles) of block's left-top corner.
|
||||
* @param y {number} Optional, y position (in tiles) of block's left-top corner.
|
||||
* @param width {number} Optional, width of block.
|
||||
* @param height {number} Optional, height of block.
|
||||
* @param [x] {number} x position (in tiles) of block's left-top corner.
|
||||
* @param [y] {number} y position (in tiles) of block's left-top corner.
|
||||
* @param [width] {number} width of block.
|
||||
* @param [height] {number} height of block.
|
||||
*/
|
||||
public randomiseTiles(tiles: number[], x?: number = 0, y?: number = 0, width?: number = this.widthInTiles, height?: number = this.heightInTiles) {
|
||||
|
||||
|
@ -266,10 +266,10 @@ module Phaser {
|
|||
* Replace one kind of tiles to another kind.
|
||||
* @param tileA {number} Index of tiles you want to replace.
|
||||
* @param tileB {number} Index of tiles you want to set.
|
||||
* @param x {number} Optional, x position (in tiles) of block's left-top corner.
|
||||
* @param y {number} Optional, y position (in tiles) of block's left-top corner.
|
||||
* @param width {number} Optional, width of block.
|
||||
* @param height {number} Optional, height of block.
|
||||
* @param [x] {number} x position (in tiles) of block's left-top corner.
|
||||
* @param [y] {number} y position (in tiles) of block's left-top corner.
|
||||
* @param [width] {number} width of block.
|
||||
* @param [height] {number} height of block.
|
||||
*/
|
||||
public replaceTile(tileA: number, tileB: number, x?: number = 0, y?: number = 0, width?: number = this.widthInTiles, height?: number = this.heightInTiles) {
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ module Phaser {
|
|||
/**
|
||||
* Config the tween result.
|
||||
* @param properties {object} Propertis you want to tween.
|
||||
* @param duration {number} Optional, duration of this tween.
|
||||
* @param [duration] {number} duration of this tween.
|
||||
* @param ease {any} Easing function.
|
||||
* @param autoStart {boolean} Whether this tween will start automatically or not.
|
||||
* @return {Tween} Itself.
|
||||
|
|
|
@ -105,7 +105,7 @@ module Phaser {
|
|||
* Get ranges of frames in an array.
|
||||
* @param start {number} Start index of frames you want.
|
||||
* @param end {number} End index of frames you want.
|
||||
* @param output {Frame[]} Optional, result will be added into this array.
|
||||
* @param [output] {Frame[]} result will be added into this array.
|
||||
* @return {Frame[]} Ranges of specific frames in an array.
|
||||
*/
|
||||
public getFrameRange(start: number, end: number, output?: Frame[] = []): Frame[] {
|
||||
|
@ -121,7 +121,7 @@ module Phaser {
|
|||
|
||||
/**
|
||||
* Get all indexes of frames by giving their name.
|
||||
* @param output {number[]} Optional, result will be added into this array.
|
||||
* @param [output] {number[]} result will be added into this array.
|
||||
* @return {number[]} Indexes of specific frames in an array.
|
||||
*/
|
||||
public getFrameIndexes(output?: number[] = []): number[] {
|
||||
|
@ -139,7 +139,7 @@ module Phaser {
|
|||
|
||||
/**
|
||||
* Get all names of frames by giving their indexes.
|
||||
* @param output {number[]} Optional, result will be added into this array.
|
||||
* @param [output] {number[]} result will be added into this array.
|
||||
* @return {number[]} Names of specific frames in an array.
|
||||
*/
|
||||
public getFrameIndexesByName(input: string[]): number[] {
|
||||
|
|
Loading…
Add table
Reference in a new issue