mirror of
https://github.com/photonstorm/phaser
synced 2024-11-14 00:47:29 +00:00
Merge pull request #1614 from clark-stevenson/dev
Updated to 11 Feb 22:30. Make greater use of Union Types.
This commit is contained in:
commit
a672e4adca
2 changed files with 129 additions and 106 deletions
234
typescript/phaser.d.ts
vendored
234
typescript/phaser.d.ts
vendored
|
@ -1,6 +1,6 @@
|
|||
/// <reference path="pixi.d.ts" />
|
||||
|
||||
// Type definitions for Phaser dev2.2.0 RC12 2015-07-01
|
||||
// Type definitions for Phaser dev2.3.0 2015-11-02
|
||||
// Project: https://github.com/photonstorm/phaser
|
||||
|
||||
declare class Phaser {
|
||||
|
@ -48,7 +48,7 @@ declare module Phaser {
|
|||
|
||||
class Animation {
|
||||
|
||||
constructor(game: Phaser.Game, parent: Phaser.Sprite, name: string, frameData: Phaser.FrameData, frames: any[], frameRate?: number, loop?: boolean);
|
||||
constructor(game: Phaser.Game, parent: Phaser.Sprite, name: string, frameData: Phaser.FrameData, frames: number[]|string[], frameRate?: number, loop?: boolean);
|
||||
|
||||
currentFrame: Phaser.Frame;
|
||||
delay: number;
|
||||
|
@ -79,7 +79,7 @@ declare module Phaser {
|
|||
play(frameRate?: number, loop?: boolean, killOnComplete?: boolean): Phaser.Animation;
|
||||
previous(quantity?: number): void;
|
||||
restart(): void;
|
||||
setFrame(frameId?: any, useLocalFrameIndex?: boolean): void;
|
||||
setFrame(frameId?: string|number, useLocalFrameIndex?: boolean): void;
|
||||
stop(resetFrame?: boolean, dispatchComplete?: boolean): void;
|
||||
update(): boolean;
|
||||
updateFrameData(frameData: FrameData): void;
|
||||
|
@ -103,8 +103,8 @@ declare module Phaser {
|
|||
sprite: Phaser.Sprite;
|
||||
updateIfVisible: boolean;
|
||||
|
||||
add(name: string, frames?: any[], frameRate?: number, loop?: boolean, useNumericIndex?: boolean): Phaser.Animation;
|
||||
copyFrameData(frameData: Phaser.FrameData, frame: any): boolean;
|
||||
add(name: string, frames?: number[]|string[], frameRate?: number, loop?: boolean, useNumericIndex?: boolean): Phaser.Animation;
|
||||
copyFrameData(frameData: Phaser.FrameData, frame: string|number): boolean;
|
||||
destroy(): void;
|
||||
getAnimation(name: string): Phaser.Animation;
|
||||
next(quantity?: number): void;
|
||||
|
@ -301,41 +301,36 @@ declare module Phaser {
|
|||
|
||||
class Button extends Phaser.Image {
|
||||
|
||||
constructor(game: Phaser.Game, x?: number, y?: number, key?: string, callback?: Function, callbackContext?: any, overFrame?: any, outFrame?: any, downFrame?: any, upFrame?: any);
|
||||
constructor(game: Phaser.Game, x?: number, y?: number, key?: string, callback?: Function, callbackContext?: any, overFrame?: string|number, outFrame?: string|number, downFrame?: string|number, upFrame?: string|number);
|
||||
|
||||
forceOut: boolean;
|
||||
freezeFrames: boolean;
|
||||
onDownSound: any;
|
||||
onDownSound: Phaser.Sound|Phaser.AudioSprite;
|
||||
onDownSoundMarker: string;
|
||||
onInputDown: Phaser.Signal;
|
||||
onInputOut: Phaser.Signal;
|
||||
onInputOver: Phaser.Signal;
|
||||
onInputUp: Phaser.Signal;
|
||||
onOutSound: any;
|
||||
onOutSound: Phaser.Sound|Phaser.AudioSprite;
|
||||
onOutSoundMarker: string;
|
||||
onOverSound: any;
|
||||
onOverSound: Phaser.Sound|Phaser.AudioSprite;
|
||||
onOverSoundMarker: string;
|
||||
onOverMouseOnly: boolean;
|
||||
onUpSound: any;
|
||||
onUpSound: Phaser.Sound|Phaser.AudioSprite;
|
||||
onUpSoundMaker: string;
|
||||
type: number;
|
||||
|
||||
clearFrames(): void;
|
||||
setDownSound(sound: Phaser.Sound, marker?: string): void;
|
||||
setDownSound(sound: Phaser.AudioSprite, marker?: string): void;
|
||||
setFrames(overFrame?: any, outFrame?: any, downFrame?: any, upFrame?: any): void;
|
||||
setDownSound(sound: Phaser.Sound|Phaser.AudioSprite, marker?: string): void;
|
||||
setFrames(overFrame?: string|number, outFrame?: string|number, downFrame?: string|number, upFrame?: string|number): void;
|
||||
onInputDownHandler(sprite: Phaser.Button, pointer: Phaser.Pointer): void;
|
||||
onInputUpHandler(sprite: Phaser.Button, pointer: Phaser.Pointer, isOver: boolean): void;
|
||||
removedFromWorld(): void;
|
||||
setOutSound(sound: Phaser.Sound, marker?: string): void;
|
||||
setOutSound(sound: Phaser.AudioSprite, marker?: string): void;
|
||||
setOverSound(sound: Phaser.Sound, marker?: string): void;
|
||||
setOverSound(sound: Phaser.AudioSprite, marker?: string): void;
|
||||
setSounds(overSound?: Phaser.Sound, overMarker?: string, downSound?: Phaser.Sound, downMarker?: string, outSound?: Phaser.Sound, outMarker?: string, upSound?: Phaser.Sound, upMarker?: string): void;
|
||||
setSounds(overSound?: Phaser.AudioSprite, overMarker?: string, downSound?: Phaser.AudioSprite, downMarker?: string, outSound?: Phaser.AudioSprite, outMarker?: string, upSound?: Phaser.AudioSprite, upMarker?: string): void;
|
||||
setOutSound(sound: Phaser.Sound|Phaser.AudioSprite, marker?: string): void;
|
||||
setOverSound(sound: Phaser.Sound|Phaser.AudioSprite, marker?: string): void;
|
||||
setSounds(overSound?: Phaser.Sound|Phaser.AudioSprite, overMarker?: string, downSound?: Phaser.Sound|Phaser.AudioSprite, downMarker?: string, outSound?: Phaser.Sound|Phaser.AudioSprite, outMarker?: string, upSound?: Phaser.Sound|Phaser.AudioSprite, upMarker?: string): void;
|
||||
setState(newState: number): void;
|
||||
setUpSound(sound: Phaser.Sound, marker?: string): void;
|
||||
setUpSound(sound: Phaser.AudioSprite, marker?: string): void;
|
||||
setUpSound(sound: Phaser.Sound|Phaser.AudioSprite, marker?: string): void;
|
||||
|
||||
}
|
||||
|
||||
|
@ -470,7 +465,7 @@ declare module Phaser {
|
|||
y: number;
|
||||
|
||||
checkBounds(): void;
|
||||
focusOn(displayObject: any): void;
|
||||
focusOn(displayObject: PIXI.DisplayObject): void;
|
||||
focusOnXY(x: number, y: number): void;
|
||||
follow(target: Phaser.Sprite, style?: number): void;
|
||||
reset(): void;
|
||||
|
@ -484,7 +479,7 @@ declare module Phaser {
|
|||
|
||||
class Canvas {
|
||||
|
||||
static addToDOM(canvas: HTMLCanvasElement, parent: any, overflowHidden?: boolean): HTMLCanvasElement;
|
||||
static addToDOM(canvas: HTMLCanvasElement, parent: HTMLElement, overflowHidden?: boolean): HTMLCanvasElement;
|
||||
static create(width?: number, height?: number, id?: string): HTMLCanvasElement;
|
||||
static getAspectRatio(canvas: HTMLCanvasElement): number;
|
||||
static getOffset(element: HTMLElement, point?: Phaser.Point): Phaser.Point;
|
||||
|
@ -574,21 +569,6 @@ declare module Phaser {
|
|||
|
||||
}
|
||||
|
||||
class ComplexPrimitiveShader {
|
||||
|
||||
//where is WebGLContext in TypeScript? "any" is used
|
||||
constructor(gl: any);
|
||||
|
||||
gl: any;
|
||||
program: any;
|
||||
fragmentSrc: any[];
|
||||
vertexSrc: any[];
|
||||
|
||||
destroy(): void;
|
||||
init(): void;
|
||||
|
||||
}
|
||||
|
||||
interface CursorKeys {
|
||||
|
||||
up: Phaser.Key;
|
||||
|
@ -1126,7 +1106,7 @@ declare module Phaser {
|
|||
camera: Phaser.Camera;
|
||||
canvas: HTMLCanvasElement;
|
||||
config: IGameConfig;
|
||||
context: any;
|
||||
context: CanvasRenderingContext2D;
|
||||
count: number;
|
||||
debug: Phaser.Utils.Debug;
|
||||
device: Phaser.Device;
|
||||
|
@ -1414,7 +1394,7 @@ declare module Phaser {
|
|||
|
||||
class Group extends PIXI.DisplayObjectContainer {
|
||||
|
||||
constructor(game: Phaser.Game, parent?: any, name?: string, addToStage?: boolean, enableBody?: boolean, physicsBodyType?: number);
|
||||
constructor(game: Phaser.Game, parent?: PIXI.DisplayObjectContainer, name?: string, addToStage?: boolean, enableBody?: boolean, physicsBodyType?: number);
|
||||
|
||||
static RETURN_CHILD: number;
|
||||
static RETURN_NONE: number;
|
||||
|
@ -1507,12 +1487,12 @@ declare module Phaser {
|
|||
|
||||
class Image extends PIXI.Sprite {
|
||||
|
||||
constructor(game: Phaser.Game, x: number, y: number, key: any, frame: any);
|
||||
constructor(game: Phaser.Game, x: number, y: number, key: string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture, frame: string|number);
|
||||
|
||||
alive: boolean;
|
||||
angle: number;
|
||||
anchor: Phaser.Point;
|
||||
animations: Phaser.AnimationManager;
|
||||
animations: Phaser.AnimationManager;
|
||||
autoCull: boolean;
|
||||
cameraOffset: Phaser.Point;
|
||||
cropRect: Phaser.Rectangle;
|
||||
|
@ -1524,28 +1504,28 @@ declare module Phaser {
|
|||
events: Phaser.Events;
|
||||
exists: boolean;
|
||||
fixedToCamera: boolean;
|
||||
frame: any;
|
||||
frame: string|number;
|
||||
frameName: string;
|
||||
game: Phaser.Game;
|
||||
inCamera: boolean;
|
||||
input: Phaser.InputHandler;
|
||||
inputEnabled: boolean;
|
||||
inWorld: boolean;
|
||||
key: any;
|
||||
key: string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture;
|
||||
name: string;
|
||||
position: Phaser.Point;
|
||||
renderOrderID: number;
|
||||
scale: Phaser.Point;
|
||||
smoothed: boolean;
|
||||
type: number;
|
||||
world: Phaser.Point;
|
||||
world: Phaser.Point;
|
||||
z: number;
|
||||
|
||||
bringToTop(): Phaser.Image;
|
||||
crop(rect: Phaser.Rectangle, copy?: boolean): void;
|
||||
destroy(destroyChildren?: boolean): void;
|
||||
kill(): Phaser.Image;
|
||||
loadTexture(key: any, frame: any): void;
|
||||
loadTexture(key: string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture, frame: string|number): void;
|
||||
postUpdate(): void;
|
||||
preUpdate(): void;
|
||||
reset(x: number, y: number): Phaser.Image;
|
||||
|
@ -1634,7 +1614,7 @@ declare module Phaser {
|
|||
getPointer(isActive?: boolean): Phaser.Pointer;
|
||||
getPointerFromId(pointerID: number): Phaser.Pointer;
|
||||
getPointerFromIdentifier(identifier: number): Phaser.Pointer;
|
||||
hitTest(displayObject: any, pointer: Phaser.Pointer, localPoint: Phaser.Point): void;
|
||||
hitTest(displayObject: PIXI.DisplayObject, pointer: Phaser.Pointer, localPoint: Phaser.Point): void;
|
||||
reset(hard?: boolean): void;
|
||||
resetSpeed(x: number, y: number): void;
|
||||
startPointer(event: any): Phaser.Pointer;
|
||||
|
@ -1654,6 +1634,8 @@ declare module Phaser {
|
|||
boundsSprite: Phaser.Sprite;
|
||||
bringToTop: boolean;
|
||||
consumePointerEvent: boolean;
|
||||
dragOffset: Phaser.Point;
|
||||
dragFromCenter: boolean;
|
||||
draggable: boolean;
|
||||
enabled: boolean;
|
||||
game: Phaser.Game;
|
||||
|
@ -1951,10 +1933,12 @@ declare module Phaser {
|
|||
static TEXTURE_ATLAS_XML_STARLING: number;
|
||||
|
||||
baseURL: string;
|
||||
crossOrigin: any;
|
||||
crossOrigin: boolean|string;
|
||||
enableParallel: boolean;
|
||||
game: Phaser.Game;
|
||||
hasLoaded: boolean;
|
||||
isLoading: boolean;
|
||||
maxParallelDownloads: number;
|
||||
onFileStart: Phaser.Signal;
|
||||
onFileComplete: Phaser.Signal;
|
||||
onFileError: Phaser.Signal;
|
||||
|
@ -1964,36 +1948,46 @@ declare module Phaser {
|
|||
preloadSprite: any;
|
||||
progress: number;
|
||||
progressFloat: number;
|
||||
resetLocked: boolean;
|
||||
useXDomainRequest: boolean;
|
||||
|
||||
addToFileList(type: string, key: string, url: string, properties: any): void;
|
||||
asyncComplete(file: any, errorMessage?: string): void;
|
||||
addSyncPoint(type: string, key: string): Phaser.Loader;
|
||||
addToFileList(type: string, key: string, url: string, properties: any, overwrite: boolean): void;
|
||||
atlas(key: string, textureURL: string, atlasURL?: string, atlasData?: any, format?: number): Phaser.Loader;
|
||||
atlasJSONArray(key: string, textureURL: string, atlasURL?: string, atlasData?: any): Phaser.Loader;
|
||||
atlasJSONHash(key: string, textureURL: string, atlasURL?: string, atlasData?: any): Phaser.Loader;
|
||||
atlasXML(key: string, textureURL: string, atlasURL?: string, atlasData?: any): Phaser.Loader;
|
||||
audio(key: string, urls: any, autoDecode?: boolean): Phaser.Loader;
|
||||
audiosprite(key: string, urls: any, atlasurl: string): Phaser.Loader;
|
||||
binary(key: string, url: string, callback?: Function, callbackContext?: Function): Phaser.Loader;
|
||||
audio(key: string, urls: string|string[]|any, autoDecode?: boolean): Phaser.Loader;
|
||||
audiosprite(key: string, urls: string[], jsonURL?: string, jsonData?: string|any, autoDecode?: boolean): Phaser.Loader;
|
||||
binary(key: string, url: string, callback?: Function, callbackContext?: any): Phaser.Loader;
|
||||
bitmapFont(key: string, textureURL: string, xmlURL?: string, xmlData?: any, xSpacing?: number, ySpacing?: number): Phaser.Loader;
|
||||
checkKeyExists(type: string, key: string): boolean;
|
||||
csvLoadComplete(index: number): void;
|
||||
dataLoadError(index: number): void;
|
||||
fileComplete(index: number): void;
|
||||
fileError(index: number): void;
|
||||
csvLoadComplete(file: any, xhr: XMLHttpRequest): void;
|
||||
fileComplete(file: any, xhr: XMLHttpRequest): void;
|
||||
fileError(file: any, xhr: XMLHttpRequest, reason: string): void;
|
||||
finishedLoading(abnormal?: boolean): void;
|
||||
getAsset(type: string, key: string): any;
|
||||
getAssetIndex(type: string, key: string): number;
|
||||
getAudioURL(urls: any[]): void;
|
||||
image(key: string, url: string, overwrite?: boolean): Phaser.Loader;
|
||||
json(key: string, url: string, overwrite?: boolean): Phaser.Loader;
|
||||
jsonLoadComplete(index: number): void;
|
||||
jsonLoadComplete(file: any, xhr: XMLHttpRequest): void;
|
||||
loadAudioTag(file: any): void;
|
||||
loadFile(file: any): void;
|
||||
loadImageTag(file: any): void;
|
||||
pack(key: string, url?: string, data?: any, callbackContext?: any): Phaser.Loader;
|
||||
parseXml(data: string): XMLDocument;
|
||||
physics(key: string, url?: string, data?: any, format?: string): Phaser.Loader;
|
||||
processLoadQueue(): void;
|
||||
processPack(pack: any): void;
|
||||
removeAll(): void;
|
||||
removeFile(key: string, type: string): void;
|
||||
removeFile(type: string, key: string): void;
|
||||
replaceInFileList(type: string, key: string, url: string, properties: any): void;
|
||||
reset(): void;
|
||||
reset(hard?: boolean, clearEvents?: boolean): void;
|
||||
resize(): void;
|
||||
script(key: string, url: String, callback?: Function, callbackContext?: any): Phaser.Loader;
|
||||
setPreloadSprite(sprite: Phaser.Sprite, direction?: number): void;
|
||||
setPreloadSprite(sprite: Phaser.Sprite|Phaser.Image, direction?: number): void;
|
||||
spritesheet(key: string, url: string, frameWidth: number, frameHeight: number, frameMax?: number, margin?: number, spacing?: number): Phaser.Loader;
|
||||
start(): void;
|
||||
text(key: string, url: string, overwrite?: boolean): Phaser.Loader;
|
||||
|
@ -2002,8 +1996,13 @@ declare module Phaser {
|
|||
totalLoadedPacks(): number;
|
||||
totalQueuedFiles(): number;
|
||||
totalQueuedPacks(): number;
|
||||
transformUrl(url: string): string;
|
||||
updateProgress(): void;
|
||||
withSyncPoint(callback: Function, callbackContext?: any): Phaser.Loader;
|
||||
xml(key: string, url: string, overwrite?: boolean): Phaser.Loader;
|
||||
xmlLoadComplete(index: number): void;
|
||||
xhrLoad(file: any, url: string, type: string, onload: Function, onerror?: Function): void;
|
||||
xhrLoadWithXDR(file: any, url: string, type: string, onload: Function, onerror?: Function): void;
|
||||
xmlLoadComplete(file: any, xhr: XMLHttpRequest): void;
|
||||
|
||||
}
|
||||
|
||||
|
@ -2074,7 +2073,7 @@ declare module Phaser {
|
|||
static roundTo(value: number, place?: number, base?: number): number;
|
||||
static shear(n: number): number;
|
||||
static shift(stack: any[]): any;
|
||||
static shuffleArray(array: any[]): any[];
|
||||
static shuffleArray<T>(array: T[]): T[];
|
||||
static sign(x: number): number;
|
||||
static sinCosGenerator(length: number, sinAmplitude?: number, cosAmplitude?: number, frequency?: number): { sin: number[]; cos: number[]; };
|
||||
static smootherstep(x: number, min: number, max: number): number;
|
||||
|
@ -2158,16 +2157,23 @@ declare module Phaser {
|
|||
|
||||
constructor(game: Phaser.Game);
|
||||
|
||||
button: number;
|
||||
capture: boolean;
|
||||
callbackContext: any;
|
||||
event: MSPointerEvent;
|
||||
disabled: boolean;
|
||||
game: Phaser.Game;
|
||||
|
||||
onPointerDown(event: MSPointerEvent): void;
|
||||
onPointerMove(event: MSPointerEvent): void;
|
||||
onPointerUp(event: MSPointerEvent): void;
|
||||
mouseDownCallback(event: MSPointerEvent): void;
|
||||
mouseMoveCallback(event: MSPointerEvent): void;
|
||||
mouseUpCallback(event: MSPointerEvent): void;
|
||||
onPointerDown: (event: MSPointerEvent) => void;
|
||||
onPointerMove: (event: MSPointerEvent) => void;
|
||||
onPointerUp: (event: MSPointerEvent) => void;
|
||||
mouseDownCallback: (event: MSPointerEvent) => void;
|
||||
mouseMoveCallback: (event: MSPointerEvent) => void;
|
||||
mouseUpCallback: (event: MSPointerEvent) => void;
|
||||
pointerDownCallback: (event: MSPointerEvent) => void;
|
||||
pointerMoveCallback: (event: MSPointerEvent) => void;
|
||||
pointerUpCallback: (event: MSPointerEvent) => void;
|
||||
|
||||
start(): void;
|
||||
stop(): void;
|
||||
|
||||
|
@ -2388,6 +2394,7 @@ declare module Phaser {
|
|||
embedded: boolean;
|
||||
enable: boolean;
|
||||
facing: number;
|
||||
friction: Phaser.Point;
|
||||
game: Phaser.Game;
|
||||
gravity: Phaser.Point;
|
||||
halfWidth: number;
|
||||
|
@ -2574,7 +2581,7 @@ declare module Phaser {
|
|||
COL_OTHER: number;
|
||||
|
||||
body: Phaser.Physics.Ninja.Body;
|
||||
circleTileProjections: { [index: number]: ((x: number, y: number, oH: number, oV: number, obj: Phaser.Physics.Ninja.Circle, t: Phaser.Physics.Ninja.Tile) => number); } ;
|
||||
circleTileProjections: { [index: number]: ((x: number, y: number, oH: number, oV: number, obj: Phaser.Physics.Ninja.Circle, t: Phaser.Physics.Ninja.Tile) => number); };
|
||||
oldPos: Phaser.Point;
|
||||
height: number;
|
||||
pos: Phaser.Point;
|
||||
|
@ -2616,11 +2623,13 @@ declare module Phaser {
|
|||
|
||||
body: Phaser.Physics.Ninja.Body;
|
||||
bottom: number;
|
||||
flipped: boolean;
|
||||
height: number;
|
||||
id: number;
|
||||
oldpos: Phaser.Point;
|
||||
pos: Phaser.Point;
|
||||
right: number;
|
||||
rotation: number;
|
||||
system: Phaser.Physics.Ninja;
|
||||
type: Phaser.Physics.Ninja.TileType;
|
||||
velocity: Phaser.Point;
|
||||
|
@ -2975,7 +2984,7 @@ declare module Phaser {
|
|||
|
||||
class Plugin implements IStateCycle {
|
||||
|
||||
constructor(game: Phaser.Game, parent: any);
|
||||
constructor(game: Phaser.Game, parent: PIXI.DisplayObject);
|
||||
|
||||
active: boolean;
|
||||
game: Phaser.Game;
|
||||
|
@ -2984,7 +2993,7 @@ declare module Phaser {
|
|||
hasPreUpdate: boolean;
|
||||
hasRender: boolean;
|
||||
hasUpdate: boolean;
|
||||
parent: any;
|
||||
parent: PIXI.DisplayObject;
|
||||
visible: boolean;
|
||||
|
||||
destroy(): void;
|
||||
|
@ -3005,9 +3014,9 @@ declare module Phaser {
|
|||
static DISTANCE_MANHATTEN: string;
|
||||
static DISTANCE_EUCLIDIAN: string;
|
||||
|
||||
constructor(parent: any);
|
||||
constructor(parent: PIXI.DisplayObject);
|
||||
|
||||
parent: any;
|
||||
parent: PIXI.DisplayObject;
|
||||
version: string;
|
||||
|
||||
findPath(startPoint: Phaser.Point, goalPoint: Phaser.Point): Phaser.Plugin.AStar.AStarPath;
|
||||
|
@ -3057,7 +3066,7 @@ declare module Phaser {
|
|||
|
||||
class CSS3Filters extends Phaser.Plugin {
|
||||
|
||||
constructor(parent: any);
|
||||
constructor(parent: PIXI.DisplayObject);
|
||||
|
||||
blur: number;
|
||||
brightness: number;
|
||||
|
@ -3108,7 +3117,7 @@ declare module Phaser {
|
|||
|
||||
class SamplePlugin extends Phaser.Plugin {
|
||||
|
||||
constructor(game: Phaser.Game, parent: any);
|
||||
constructor(game: Phaser.Game, parent: PIXI.DisplayObject);
|
||||
|
||||
addSprite(sprite: Phaser.Sprite): void;
|
||||
update(): void;
|
||||
|
@ -3149,7 +3158,7 @@ declare module Phaser {
|
|||
|
||||
class Webcam extends Phaser.Plugin {
|
||||
|
||||
constructor(game: Phaser.Game, parent: any);
|
||||
constructor(game: Phaser.Game, parent: PIXI.DisplayObject);
|
||||
|
||||
active: boolean;
|
||||
context: any;
|
||||
|
@ -3167,9 +3176,9 @@ declare module Phaser {
|
|||
class Juicy extends Phaser.Plugin {
|
||||
|
||||
constructor(game: Phaser.Game);
|
||||
|
||||
createScreenFlash(color?: string) : Phaser.Plugin.Juicy.ScreenFlash;
|
||||
createTrail(length?: number, color?:number): Phaser.Plugin.Juicy.Trail;
|
||||
|
||||
createScreenFlash(color?: string): Phaser.Plugin.Juicy.ScreenFlash;
|
||||
createTrail(length?: number, color?: number): Phaser.Plugin.Juicy.Trail;
|
||||
overScale(object: Phaser.Sprite, scale?: number, initialScale?: Phaser.Point): void;
|
||||
jelly(object: Phaser.Sprite, strength?: number, delay?: number, initialScale?: Phaser.Point): void;
|
||||
mouseStretch(object: Phaser.Sprite, strength?: number, initialScale?: Phaser.Point): void;
|
||||
|
@ -3199,7 +3208,7 @@ declare module Phaser {
|
|||
|
||||
constructor(game: Phaser.Game, color?: string);
|
||||
|
||||
flash(maxAlpha?: number, duration?: number);
|
||||
flash(maxAlpha?: number, duration?: number): void;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -3345,15 +3354,19 @@ declare module Phaser {
|
|||
|
||||
class Polygon {
|
||||
|
||||
constructor(points: any[]);
|
||||
constructor(points: Phaser.Point[]|number[]);
|
||||
constructor(...points: Phaser.Point[]);
|
||||
constructor(...points: number[]);
|
||||
|
||||
area: number;
|
||||
points: any[]; //number : point
|
||||
points: number[]|Phaser.Point[];
|
||||
type: number;
|
||||
|
||||
clone(output: Phaser.Polygon): Phaser.Polygon;
|
||||
contains(x: number, y: number): boolean;
|
||||
setTo(points: any[]): void;
|
||||
setTo(points: Phaser.Point[]|number[]): void;
|
||||
setTo(...points: Phaser.Point[]): void;
|
||||
setTo(...points: number[]): void;
|
||||
|
||||
}
|
||||
|
||||
|
@ -3553,7 +3566,7 @@ declare module Phaser {
|
|||
|
||||
class Rope extends PIXI.Rope {
|
||||
|
||||
constructor(game: Phaser.Game, x: number, y: number, key: any, frame?: any, points?: Phaser.Point[]);
|
||||
constructor(game: Phaser.Game, x: number, y: number, key: string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture, frame?: string|number, points?: Phaser.Point[]);
|
||||
|
||||
angle: number;
|
||||
animations: AnimationManager;
|
||||
|
@ -3565,12 +3578,12 @@ declare module Phaser {
|
|||
exists: boolean;
|
||||
events: Phaser.Events;
|
||||
fixedToCamera: boolean;
|
||||
frame: number;
|
||||
frame: string|number;
|
||||
frameName: string;
|
||||
game: Phaser.Game;
|
||||
input: Phaser.InputHandler;
|
||||
inputEnabled: boolean;
|
||||
key: any;
|
||||
key: string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture;
|
||||
name: string;
|
||||
points: Phaser.Point[];
|
||||
position: Phaser.Point;
|
||||
|
@ -3583,7 +3596,7 @@ declare module Phaser {
|
|||
z: number;
|
||||
|
||||
destroy(destroyChildren?: boolean): void;
|
||||
loadTexture(key: any, frame?: any): void;
|
||||
loadTexture(key: string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture, frame?: string|number): void;
|
||||
play(): void;
|
||||
preUpdate(): void;
|
||||
postUpdate(): void;
|
||||
|
@ -3682,6 +3695,7 @@ declare module Phaser {
|
|||
duration: number;
|
||||
durationMS: number;
|
||||
externalNode: any;
|
||||
fadeTween: Phaser.Tween;
|
||||
game: Phaser.Game;
|
||||
gainNode: any;
|
||||
isDecoded: boolean;
|
||||
|
@ -3717,9 +3731,10 @@ declare module Phaser {
|
|||
|
||||
addMarker(name: string, start: number, duration: number, volume?: number, loop?: boolean): void;
|
||||
destroy(): void;
|
||||
fadeIn(duration?: number, loop?: boolean): void;
|
||||
fadeIn(duration?: number, loop?: boolean, marker?: string): void;
|
||||
fadeOut(duration?: number): void;
|
||||
fadeTo(duration?: number, volume?: number): void;
|
||||
loopFull(volume?: number): Phaser.Sound;
|
||||
pause(): void;
|
||||
play(marker?: string, position?: number, volume?: number, loop?: boolean, forceRestart?: boolean): Phaser.Sound;
|
||||
removeMarker(name: string): void;
|
||||
|
@ -3757,6 +3772,7 @@ declare module Phaser {
|
|||
remove(sound: Phaser.Sound): boolean;
|
||||
removeByKey(key: string): number;
|
||||
resumeAll(): void;
|
||||
setDecodedCallback(files: string[]|Phaser.Sound[], callback: Function, callbackContext: any): void;
|
||||
stopAll(): void;
|
||||
unlock(): void;
|
||||
update(): void;
|
||||
|
@ -3765,7 +3781,7 @@ declare module Phaser {
|
|||
|
||||
class Sprite extends PIXI.Sprite {
|
||||
|
||||
constructor(game: Phaser.Game, x: number, y: number, key?: any, frame?: any);
|
||||
constructor(game: Phaser.Game, x: number, y: number, key?: string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture, frame?: string|number);
|
||||
|
||||
alive: boolean;
|
||||
anchor: Phaser.Point;
|
||||
|
@ -3784,7 +3800,7 @@ declare module Phaser {
|
|||
events: Phaser.Events;
|
||||
exists: boolean;
|
||||
fixedToCamera: boolean;
|
||||
frame: number;
|
||||
frame: string|number;
|
||||
frameName: string;
|
||||
game: Phaser.Game;
|
||||
health: number;
|
||||
|
@ -3792,7 +3808,7 @@ declare module Phaser {
|
|||
input: Phaser.InputHandler;
|
||||
inputEnabled: boolean;
|
||||
inWorld: boolean;
|
||||
key: any;
|
||||
key: string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture;
|
||||
lifespan: number;
|
||||
name: string;
|
||||
outOfBoundsKill: boolean;
|
||||
|
@ -3815,8 +3831,8 @@ declare module Phaser {
|
|||
destroy(destroyChildren?: boolean): void;
|
||||
drawPolygon(): void;
|
||||
kill(): Phaser.Sprite;
|
||||
loadTexture(key: any, frame: any, stopAnimation?: boolean): void;
|
||||
overlap(displayObject: any): boolean;
|
||||
loadTexture(key: string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture, frame: string|number, stopAnimation?: boolean): void;
|
||||
overlap(displayObject: PIXI.DisplayObject): boolean;
|
||||
play(name: string, frameRate?: number, loop?: boolean, killOnComplete?: boolean): Phaser.Animation;
|
||||
postUpdate(): void;
|
||||
preUpdate(): void;
|
||||
|
@ -3832,7 +3848,7 @@ declare module Phaser {
|
|||
|
||||
class SpriteBatch extends Phaser.Group {
|
||||
|
||||
constructor(game: Phaser.Game, parent: any, name?: string, addedToStage?: boolean);
|
||||
constructor(game: Phaser.Game, parent: PIXI.DisplayObjectContainer, name?: string, addedToStage?: boolean);
|
||||
|
||||
type: number;
|
||||
|
||||
|
@ -3856,8 +3872,7 @@ declare module Phaser {
|
|||
parseConfig(config: any): void;
|
||||
postUpdate(): void;
|
||||
preUpdate(): void;
|
||||
setBackgroundColor(backgroundColor: number): void;
|
||||
setBackgroundColor(backgroundColor: string): void;
|
||||
setBackgroundColor(backgroundColor: number|string): void;
|
||||
update(): void;
|
||||
updateTransform(): void;
|
||||
visibilityChange(event: any): void;
|
||||
|
@ -3870,8 +3885,7 @@ declare module Phaser {
|
|||
|
||||
class ScaleManager {
|
||||
|
||||
constructor(game: Phaser.Game, width: number, height: number);
|
||||
constructor(game: Phaser.Game, width: string, height: string);
|
||||
constructor(game: Phaser.Game, width: number|string, height: number|string);
|
||||
|
||||
static EXACT_FIT: number;
|
||||
static NO_SCALE: number;
|
||||
|
@ -4073,14 +4087,17 @@ declare module Phaser {
|
|||
angle: number;
|
||||
cameraOffset: Phaser.Point;
|
||||
colors: string[];
|
||||
cssFont: string;
|
||||
destroyPhase: boolean;
|
||||
events: Phaser.Events;
|
||||
exists: boolean;
|
||||
fill: any;
|
||||
fixedToCamera: boolean;
|
||||
font: string;
|
||||
fontSize: number;
|
||||
fontSize: number|string;
|
||||
fontWeight: string;
|
||||
fontStyle: string;
|
||||
fontVariant: string;
|
||||
game: Phaser.Game;
|
||||
input: Phaser.InputHandler;
|
||||
inputEnabled: boolean;
|
||||
|
@ -4103,14 +4120,17 @@ declare module Phaser {
|
|||
|
||||
addColor(color: string, position: number): void;
|
||||
clearColors(): void;
|
||||
componentsToFont(components: any): string;
|
||||
destroy(destroyChildren?: boolean): void;
|
||||
fontToComponents(font: string): any;
|
||||
postUpdate(): void;
|
||||
preUpdate(): void;
|
||||
setShadow(x?: number, y?: number, color?: any, blur?: number): void;
|
||||
setStyle(style?: { font?: string; fill?: any; align?: string; stroke?: string; strokeThickness?: number; wordWrap?: boolean; wordWrapWidth?: number; shadowOffsetX?: number; shadowOffsetY?: number; shadowColor?: string; shadowBlur?: number; }): void;
|
||||
update(): void;
|
||||
updateFont(components: any): void;
|
||||
updateTexture(): void;
|
||||
updateLine(text:string, x?:number, y?:number): void;
|
||||
updateLine(text: string, x?: number, y?: number): void;
|
||||
|
||||
}
|
||||
|
||||
|
@ -4268,7 +4288,7 @@ declare module Phaser {
|
|||
map: Phaser.Tilemap;
|
||||
name: string;
|
||||
rayStepRate: number;
|
||||
renderSettings: { enableScrollDelta: boolean; overdrawRatio: number; };
|
||||
renderSettings: { enableScrollDelta: boolean; overdrawRatio: number; copyCanvas: any; };
|
||||
scrollFactorX: number;
|
||||
scrollFactorY: number;
|
||||
scrollX: number;
|
||||
|
@ -4288,6 +4308,7 @@ declare module Phaser {
|
|||
render(): void;
|
||||
resizeWorld(): void;
|
||||
resetTilesetCache(): void;
|
||||
setScale(xScale?: number, yScale?: number): void;
|
||||
updateMax(): void;
|
||||
|
||||
}
|
||||
|
@ -4326,7 +4347,7 @@ declare module Phaser {
|
|||
|
||||
class TileSprite extends PIXI.TilingSprite {
|
||||
|
||||
constructor(game: Phaser.Game, x: number, y: number, width: number, height: number, key?: any, frame?: any);
|
||||
constructor(game: Phaser.Game, x: number, y: number, width: number, height: number, key?: string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture, frame?: string|number);
|
||||
|
||||
alive: boolean;
|
||||
angle: number;
|
||||
|
@ -4339,12 +4360,12 @@ declare module Phaser {
|
|||
events: Phaser.Events;
|
||||
exists: boolean;
|
||||
fixedToCamera: boolean;
|
||||
frame: number;
|
||||
frame: string|number;
|
||||
frameName: string;
|
||||
game: Phaser.Game;
|
||||
input: Phaser.InputHandler;
|
||||
inputEnabled: boolean;
|
||||
key: any;
|
||||
key: string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture;
|
||||
name: string;
|
||||
position: Phaser.Point;
|
||||
type: number;
|
||||
|
@ -4352,8 +4373,8 @@ declare module Phaser {
|
|||
z: number;
|
||||
|
||||
autoScroll(x: number, y: number): void;
|
||||
destroy(destroyChildren: boolean): void;
|
||||
loadTexture(key: any, frame: any): void;
|
||||
destroy(destroyChildren?: boolean): void;
|
||||
loadTexture(key: string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture, frame: string|number): void;
|
||||
play(name: string, frameRate?: number, loop?: boolean, killOnComplete?: boolean): Phaser.Animation;
|
||||
postUpdate(): void;
|
||||
preUpdate(): void;
|
||||
|
@ -4670,6 +4691,7 @@ declare module Phaser {
|
|||
centerY: number;
|
||||
game: Phaser.Game;
|
||||
height: number;
|
||||
isPaused: boolean;
|
||||
randomX: number;
|
||||
randomY: number;
|
||||
width: number;
|
||||
|
|
1
typescript/pixi.d.ts
vendored
1
typescript/pixi.d.ts
vendored
|
@ -1165,6 +1165,7 @@ declare module PIXI {
|
|||
tileScale: Point;
|
||||
tileScaleOffset: Point;
|
||||
|
||||
destroy(): void;
|
||||
generateTilingTexture(forcePowerOfTwo: boolean): void;
|
||||
setTexture(texture: Texture): void;
|
||||
|
||||
|
|
Loading…
Reference in a new issue