BitmapData + Color updates mostly.

This commit is contained in:
clark-stevenson 2014-04-26 01:34:19 +01:00
parent b0afc562b5
commit 8b01abfbec

70
build/phaser.d.ts vendored
View file

@ -1110,20 +1110,41 @@ declare module Phaser {
}
class ArrayList {
first: Object;
list: any[];
next: Object;
position: number;
total: number;
add(child: Object): Object;
callAll(callback: Function, ...parameters: any[]);
exists(child: Object): boolean;
getIndex(child: Object): number;
remove(child: Object): Object;
reset(): void;
}
class BitmapData {
constructor(game: Phaser.Game, key: string, width?: number, height?: number);
baseTexture: PIXI.BaseTexture;
buffer: ArrayBuffer;
canvas: HTMLCanvasElement;
context: CanvasRenderingContext2D;
ctx: CanvasRenderingContext2D;
data: Uint8Array;
dirty: boolean;
disableTextureUpload: boolean;
game: Phaser.Game;
height: number;
imageData: any[];
imageData: ImageData;
key: string;
pixels: number;
pixels: Uint32Array;
texture: PIXI.Texture;
textureFrame: Phaser.Frame;
type: number;
@ -1134,15 +1155,23 @@ declare module Phaser {
clear(): void;
cls(): void;
copyPixels(source: any, area: Phaser.Rectangle, destX: number, destY: number): void;
draw(source: any, destX: number, destY: number): void;
getPixel(x: number, y: number): number;
draw(source: any, x: number, y: number): void;
drawSprite(sprite: any, x?: number, y?: number): void;
fill(r: number, g: number, b: number, a?: number): void;
getPixel(x: number, y: number, out?: Object): number;
getPixelRGB(x: number, y: number, out?: Object, hsl?: boolean, hsv?: boolean): Object;
getPixel32(x: number, y: number): number;
getPixels(rect: Phaser.Rectangle): number[];
refreshBuffer(): void;
getPixels(rect: Phaser.Rectangle): ImageData;
processPixel(callback: Function, callbackContext: Object, x?: number, y?: Number, width?: number, height?: number): void;
processPixelRGB(callback: Function, callbackContext: Object, x?: number, y?: Number, width?: number, height?: number): void;
refreshBuffer(x?: number, y?: number, width?: number, height?: number): void;
render(): void;
replaceRGB(r1: number, g1: number, b1: number, a1: number, r2: number, g2: number, b2: number, a2: number, region: Phaser.Rectangle): void;
resize(width: number, height: number): void;
setPixel(x: number, y: number, red: number, green: number, blue: number): void;
setPixel32(x: number, y: number, red: number, green: number, blue: number, alpha: number): void;
shiftHSL(h?: number, s?: number, l?: number, region?: Phaser.Rectangle): void;
setHSL(h?: number, s?: number, l?: number, region?: Phaser.Rectangle): void;
setPixel(x: number, y: number, red: number, green: number, blue: number, immediate?: boolean): void;
setPixel32(x: number, y: number, red: number, green: number, blue: number, alpha: number, immediate?: boolean): void;
}
@ -1380,6 +1409,9 @@ declare module Phaser {
class Color {
static colorToHexstring(color: number): string;
static componentToHex(color: number): string;
static createColor(r?: number, g?: number, b?: number, a?: number, h?: number, s?: number, l?: number, v?: number): Object;
static fromRGBA(rgba: number, out?: Object): Object;
static getAlpha(color: number): number;
static getAlphaFloat(color: number): number;
static getBlue(color: number): number;
@ -1392,11 +1424,21 @@ declare module Phaser {
static getRGB(color: number): Object;
static getWebRGB(color: number): string;
static hexToRGB(h: string): number;
static hexToColor(hex: string, out?: Object): Object;
static HSLtoRGB(h: number, s: number, l: number, out?: Object): Object;
static HSVtoRGB(h: number, s: number, v: number, out?: Object): Object;
static hueToColor(p: number, q: number, t: number): number;
static interpolateColor(color1: number, color2: number, steps: number, currentStep: number, alpha: number): number;
static interpolateColorWithRGB(color: number, r: number, g: number, b: number, steps: number, currentStep: number): number;
static interpolateRGB(r1: number, g1: number, b1: number, r2: number, g2: number, b2: number, steps: number, currentStep: number): number;
static packPixel(r: number, g: number, b: number, a: number): number;
static RGBtoHSL(r: number, g: number, b: number, out?: Object): Object;
static RGBtoHSV(r: number, g: number, b: number, out?: Object): Object;
static RGBtoString(r: number, g: number, b: number, a?: number, prefix?: string): string;
static RGBtoHexstring(color: number): string;
static RGBtoWebstring(color: number): string;
static toRGBA(r: number, g: number, b: number, a: number): number;
static unpackPixel(rgba: number, out?: Object, hsl?: boolean, hsv?: boolean): Object;
}
@ -1411,6 +1453,8 @@ declare module Phaser {
class Device {
static LITTLE_ENDIAN: boolean;
constructor(game: Phaser.Game);
android: boolean;
@ -1457,6 +1501,7 @@ declare module Phaser {
requestFullScreen: string;
safari: boolean;
silk: boolean;
support32bit: boolean;
touch: boolean;
trident: boolean;
tridentVersion: number;
@ -2067,7 +2112,7 @@ declare module Phaser {
hitCanvas: HTMLCanvasElement;
hitContext: CanvasRenderingContext2D;
holdRate: number;
interactiveItems: Phaser.LinkedList;
interactiveItems: Phaser.ArrayList;
justPressedRate: number;
justReleasedRate: number;
keyboard: Phaser.Keyboard;
@ -2507,6 +2552,7 @@ declare module Phaser {
static isOdd(n: number): boolean;
static linear(p0: number, p1: number, t: number): number;
static linearInterpolation(v: number[], k: number): number;
static limitValue(value: number, min: number, max: number): number;
static mapLinear(x: number, a1: number, a2: number, b1: number, b2: number): number;
static max(...numbers: number[]): number;
static maxAdd(value: number, amount: number, max: number): number;
@ -3072,6 +3118,7 @@ declare module Phaser {
onEndContact: Phaser.Signal;
onSpringAdded: Phaser.Signal;
onSpringRemoved: Phaser.Signal;
paused: boolean;
restitution: number;
solveConstraints: boolean;
time: any;
@ -3110,14 +3157,16 @@ declare module Phaser {
hitTest(worldPoint: Phaser.Point, bodies?: any[], precision?: number, filterStatic?: boolean): Phaser.Physics.P2.Body[];
mpx(v: number): number;
mpxi(v: number): number;
pause(): void;
preUpdate(): void;
pxm(v: number): number;
pxmi(v: number): number;
preUpdate(): void;
removeBody(body: Phaser.Physics.P2.Body): Phaser.Physics.P2.Body;
removeBodyNextStep(body: Phaser.Physics.P2.Body): void;
removeConstraint(constraint: any): any;
removeContactMaterial(material: Phaser.Physics.P2.ContactMaterial);
removeSpring(spring: Phaser.Physics.P2.Spring): Phaser.Physics.P2.Spring;
resume(): void;
setBounds(x: number, y: number, width: number, height: number, left?: Boolean, right?: boolean, top?: boolean, bottom?: boolean, setCollisionGroup?: boolean): void;
setBoundsToWorld(left?: boolean, right?: boolean, top?: boolean, bottom?: boolean, setCollisionGroup?: boolean): void;
setCollisionGroup(object: Object, group: Phaser.Physics.P2.CollisionGroup): void;
@ -4564,6 +4613,7 @@ declare module Phaser {
start(x?: number, y?: number, color?: string, columnWidth?: number): void;
stop(): void;
text(text: string, x: number, y: number, color?: string, font?: string): void;
timer(timer: Phaser.Timer, x: number, y: number, color?: string): void;
}