mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 12:43:26 +00:00
TypeScript file updated, now compiles without error in VS and FlashDevelop.
This commit is contained in:
parent
886618c056
commit
13a03f3620
2 changed files with 25 additions and 25 deletions
47
build/phaser.d.ts
vendored
47
build/phaser.d.ts
vendored
|
@ -1,7 +1,7 @@
|
||||||
declare class Phaser {
|
declare class Phaser {
|
||||||
static VERSION: string;
|
static VERSION: string;
|
||||||
static DEV_VERSION: string;
|
static DEV_VERSION: string;
|
||||||
static GAMES: Array;
|
static GAMES: Array<Phaser.Game>;
|
||||||
static AUTO: number;
|
static AUTO: number;
|
||||||
static CANVAS: number;
|
static CANVAS: number;
|
||||||
static WEBGL: number;
|
static WEBGL: number;
|
||||||
|
@ -62,7 +62,6 @@ declare module Phaser {
|
||||||
stage: Phaser.Stage;
|
stage: Phaser.Stage;
|
||||||
math: Phaser.Math;
|
math: Phaser.Math;
|
||||||
sound: Phaser.SoundManager;
|
sound: Phaser.SoundManager;
|
||||||
stage: Phaser.Stage;
|
|
||||||
time: Phaser.Time;
|
time: Phaser.Time;
|
||||||
tweens: Phaser.TweenManager;
|
tweens: Phaser.TweenManager;
|
||||||
world: Phaser.World;
|
world: Phaser.World;
|
||||||
|
@ -144,8 +143,8 @@ declare module Phaser {
|
||||||
constructor(signal: Phaser.Signal, listener: Function, isOnce: boolean, listenerContext: Object, priority?: number);
|
constructor(signal: Phaser.Signal, listener: Function, isOnce: boolean, listenerContext: Object, priority?: number);
|
||||||
context: Object;
|
context: Object;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
params: Array;
|
params: Array<any>;
|
||||||
execute(paramsArr?: Array): void;
|
execute(paramsArr?: Array<any>): void;
|
||||||
detach(): Function;
|
detach(): Function;
|
||||||
isBound(): boolean;
|
isBound(): boolean;
|
||||||
isOnce(): boolean;
|
isOnce(): boolean;
|
||||||
|
@ -901,13 +900,13 @@ declare module Phaser {
|
||||||
}
|
}
|
||||||
|
|
||||||
class RandomDataGenerator {
|
class RandomDataGenerator {
|
||||||
constructor(seeds: Array);
|
constructor(seeds: Array<number>);
|
||||||
c: number;
|
c: number;
|
||||||
s0: number;
|
s0: number;
|
||||||
s1: number;
|
s1: number;
|
||||||
s2: number;
|
s2: number;
|
||||||
rnd(): number;
|
rnd(): number;
|
||||||
sow(seeds: Array): void;
|
sow(seeds: Array<any>): void;
|
||||||
hash(data: any): number;
|
hash(data: any): number;
|
||||||
integer(): number;
|
integer(): number;
|
||||||
frac(): number;
|
frac(): number;
|
||||||
|
@ -968,8 +967,8 @@ declare module Phaser {
|
||||||
static floor(value: number): number;
|
static floor(value: number): number;
|
||||||
static ceil(value: number): number;
|
static ceil(value: number): number;
|
||||||
static sinCosGenerator(length: number, sinAmplitude?: number, cosAmplitude?: number, frequency?: number): { sin: number[]; cos: number[]; };
|
static sinCosGenerator(length: number, sinAmplitude?: number, cosAmplitude?: number, frequency?: number): { sin: number[]; cos: number[]; };
|
||||||
static shift(stack: Array): any;
|
static shift(stack: Array<any>): any;
|
||||||
static shuffleArray(array: Array): Array;
|
static shuffleArray(array: Array<any>): Array<any>;
|
||||||
static distance(x1: number, y1: number, x2: number, y2: number): number;
|
static distance(x1: number, y1: number, x2: number, y2: number): number;
|
||||||
static distanceRounded(x1: number, y1: number, x2: number, y2: number): number;
|
static distanceRounded(x1: number, y1: number, x2: number, y2: number): number;
|
||||||
static clamp(x: number, a: number, b: number): number;
|
static clamp(x: number, a: number, b: number): number;
|
||||||
|
@ -999,12 +998,12 @@ declare module Phaser {
|
||||||
right: number;
|
right: number;
|
||||||
bottom: number;
|
bottom: number;
|
||||||
};
|
};
|
||||||
objects: Array;
|
objects: Array<any>;
|
||||||
nodes: Array;
|
nodes: Array<any>;
|
||||||
split(): void;
|
split(): void;
|
||||||
insert(body: Object): void;
|
insert(body: Object): void;
|
||||||
getIndex(rect: Object): number;
|
getIndex(rect: Object): number;
|
||||||
retrieve(sprite: Object): Array;
|
retrieve(sprite: Object): Array<any>;
|
||||||
clear(): void;
|
clear(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1260,8 +1259,8 @@ declare module Phaser {
|
||||||
frame: number;
|
frame: number;
|
||||||
frameName: string;
|
frameName: string;
|
||||||
loadFrameData(frameData: Phaser.Animation.FrameData): void;
|
loadFrameData(frameData: Phaser.Animation.FrameData): void;
|
||||||
add(name: string, frames?: Array, frameRate?: number, loop?: boolean, useNumericIndex?: boolean): Phaser.Animation;
|
add(name: string, frames?: Array<any>, frameRate?: number, loop?: boolean, useNumericIndex?: boolean): Phaser.Animation;
|
||||||
validateFrames(frames: Array, useNumericIndex?: boolean): boolean;
|
validateFrames(frames: Array<any>, useNumericIndex?: boolean): boolean;
|
||||||
play(name: string, frameRate?: number, loop?: boolean): Phaser.Animation;
|
play(name: string, frameRate?: number, loop?: boolean): Phaser.Animation;
|
||||||
stop(name?: string, resetFrame?: boolean): void;
|
stop(name?: string, resetFrame?: boolean): void;
|
||||||
update(): boolean;
|
update(): boolean;
|
||||||
|
@ -1317,9 +1316,9 @@ declare module Phaser {
|
||||||
getFrame(index: number): Frame;
|
getFrame(index: number): Frame;
|
||||||
getFrameByName(name: string): Frame;
|
getFrameByName(name: string): Frame;
|
||||||
checkFrame(name: string): boolean;
|
checkFrame(name: string): boolean;
|
||||||
getFrameRange(start: number, end: number, output: Array): Array;
|
getFrameRange(start: number, end: number, output: Array<Frame>): Array<Frame>;
|
||||||
getFrames(frames: Array, useNumericIndex?: boolean, output?: Array): Array;
|
getFrames(frames: Array<number>, useNumericIndex?: boolean, output?: Array<Frame>): Array<Frame>;
|
||||||
getFrameIndexes(frames: Array, useNumericIndex?: boolean, output?: Array): Array;
|
getFrameIndexes(frames: Array<number>, useNumericIndex?: boolean, output?: Array<number>): Array<number>;
|
||||||
total: number;
|
total: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1365,7 +1364,7 @@ declare module Phaser {
|
||||||
isSoundReady(key: string): boolean;
|
isSoundReady(key: string): boolean;
|
||||||
isSpriteSheet(key: string): boolean;
|
isSpriteSheet(key: string): boolean;
|
||||||
getText(key: string): Object;
|
getText(key: string): Object;
|
||||||
getKeys(array: Array): Array;
|
getKeys(array: Array<string>): Array<string>;
|
||||||
getImageKeys(): string[];
|
getImageKeys(): string[];
|
||||||
getSoundKeys(): string[];
|
getSoundKeys(): string[];
|
||||||
getTextKeys(): string[];
|
getTextKeys(): string[];
|
||||||
|
@ -1396,7 +1395,7 @@ declare module Phaser {
|
||||||
setPreloadSprite(sprite: Phaser.Sprite, direction?: number): void;
|
setPreloadSprite(sprite: Phaser.Sprite, direction?: number): void;
|
||||||
checkKeyExists(key: string): boolean;
|
checkKeyExists(key: string): boolean;
|
||||||
reset(): void;
|
reset(): void;
|
||||||
addToFileList(type: string, key: string, url: string, properties: Array): void;
|
addToFileList(type: string, key: string, url: string, properties: Array<any>): void;
|
||||||
image(key: string, url: string, overwrite?: boolean): void;
|
image(key: string, url: string, overwrite?: boolean): void;
|
||||||
text(key: string, url: string, overwrite?: boolean): void;
|
text(key: string, url: string, overwrite?: boolean): void;
|
||||||
spritesheet(key: string, url: string, frameWidth: number, frameHeight: number, frameMax: number): void;
|
spritesheet(key: string, url: string, frameWidth: number, frameHeight: number, frameMax: number): void;
|
||||||
|
@ -1733,8 +1732,8 @@ declare module Phaser {
|
||||||
collisionCallback: Function;
|
collisionCallback: Function;
|
||||||
exists: boolean;
|
exists: boolean;
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
tiles: Array;
|
tiles: Array<any>;
|
||||||
layers: Array;
|
layers: Array<TilemapLayer>;
|
||||||
position: Phaser.Point;
|
position: Phaser.Point;
|
||||||
type: number;
|
type: number;
|
||||||
renderer: Phaser.TilemapRenderer;
|
renderer: Phaser.TilemapRenderer;
|
||||||
|
@ -1753,7 +1752,7 @@ declare module Phaser {
|
||||||
getTile(x: number, y: number, layer?: number): Tile;
|
getTile(x: number, y: number, layer?: number): Tile;
|
||||||
getTileFromWorldXY(x: number, y: number, layer?: number): Tile;
|
getTileFromWorldXY(x: number, y: number, layer?: number): Tile;
|
||||||
getTileFromInputXY(layer?: number): Tile;
|
getTileFromInputXY(layer?: number): Tile;
|
||||||
getTileOverlaps(object: Object): Array;
|
getTileOverlaps(object: Object): Array<any>;
|
||||||
collide(objectOrGroup: any, callback: Function, context: Object): boolean;
|
collide(objectOrGroup: any, callback: Function, context: Object): boolean;
|
||||||
collideGameObject(object: Object): boolean;
|
collideGameObject(object: Object): boolean;
|
||||||
putTile(x: number, y: number, index: number, layer?: number): void;
|
putTile(x: number, y: number, index: number, layer?: number): void;
|
||||||
|
@ -1787,7 +1786,7 @@ declare module Phaser {
|
||||||
baseTexture: any;
|
baseTexture: any;
|
||||||
texture: any;
|
texture: any;
|
||||||
sprite: Phaser.Sprite;
|
sprite: Phaser.Sprite;
|
||||||
mapData: Array;
|
mapData: Array<any>;
|
||||||
alpha: number;
|
alpha: number;
|
||||||
putTileWorldXY(x: number, y: number, index: number): void;
|
putTileWorldXY(x: number, y: number, index: number): void;
|
||||||
putTile(x: number, y: number, index: number): void;
|
putTile(x: number, y: number, index: number): void;
|
||||||
|
@ -1795,9 +1794,9 @@ declare module Phaser {
|
||||||
fillTile(index: number, x?: number, y?: number, width?: number, height?: number): void;
|
fillTile(index: number, x?: number, y?: number, width?: number, height?: number): void;
|
||||||
randomiseTiles(tiles: number[], x?: number, y?: number, width?: number, height?: number): void;
|
randomiseTiles(tiles: number[], x?: number, y?: number, width?: number, height?: number): void;
|
||||||
replaceTile(tileA: number, tileB: number, x?: number, y?: number, width?: number, height?: number): void;
|
replaceTile(tileA: number, tileB: number, x?: number, y?: number, width?: number, height?: number): void;
|
||||||
getTileBlock(x: number, y: number, width: number, height: number): Array;
|
getTileBlock(x: number, y: number, width: number, height: number): Array<Tile>;
|
||||||
getTileFromWorldXY(x: number, y: number): Tile;
|
getTileFromWorldXY(x: number, y: number): Tile;
|
||||||
getTileOverlaps(object: Object): Array;
|
getTileOverlaps(object: Object): Array<Tile>;
|
||||||
getTempBlock(x: number, y: number, width: number, height: number, collisionOnly?: boolean): void;
|
getTempBlock(x: number, y: number, width: number, height: number, collisionOnly?: boolean): void;
|
||||||
getTileIndex(x: number, y: number): number;
|
getTileIndex(x: number, y: number): number;
|
||||||
addColumn(column: string[]): void;
|
addColumn(column: string[]): void;
|
||||||
|
|
|
@ -33,7 +33,8 @@ function create() {
|
||||||
layer = game.add.tilemapLayer(0, 0, 400, 600, null, map, 0);
|
layer = game.add.tilemapLayer(0, 0, 400, 600, null, map, 0);
|
||||||
|
|
||||||
// layer2 = game.add.tilemapLayer(0, 0, 400, 600, null, map, 0);
|
// layer2 = game.add.tilemapLayer(0, 0, 400, 600, null, map, 0);
|
||||||
layer.cameraOffset.x = 400;
|
// layer.cameraOffset.x = 400;
|
||||||
|
layer.alpha = 0.5;
|
||||||
|
|
||||||
// tileset = game.add.tileset('tilesNes');
|
// tileset = game.add.tileset('tilesNes');
|
||||||
// layer = game.add.tilemapLayer(0, 0, map.layers[0].width*tilesetNes.tileWidth, 600, tileset, map, 0);
|
// layer = game.add.tilemapLayer(0, 0, map.layers[0].width*tilesetNes.tileWidth, 600, tileset, map, 0);
|
||||||
|
|
Loading…
Reference in a new issue