From 4c47190e53bf61091ff9cbb1c093e2477fbe4333 Mon Sep 17 00:00:00 2001 From: David Asmuth Date: Sat, 30 Jan 2016 21:10:08 +0100 Subject: [PATCH 1/3] corrected method spelling Body.setInertia; corrected Method signature of Body.setParts --- matter-js/matter-js.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matter-js/matter-js.d.ts b/matter-js/matter-js.d.ts index ed5412b52..c49633ba9 100644 --- a/matter-js/matter-js.d.ts +++ b/matter-js/matter-js.d.ts @@ -612,7 +612,7 @@ declare module Matter { * @param {body} body * @param {number} inertia */ - static setInterna(body: Body, interna: number): void; + static setInertia(body: Body, interna: number): void; /** * Sets the body's vertices and updates body properties accordingly, including inertia, area and mass (with respect to `body.density`). * Vertices will be automatically transformed to be orientated around their centre of mass as the origin. @@ -636,7 +636,7 @@ declare module Matter { * @param [body] parts * @param {bool} [autoHull=true] */ - static setParts(body: Body, parts: Body, autoHull: boolean): void; + static setParts(body: Body, parts: Body[], autoHull?: boolean): void; /** * Sets the position of the body instantly. Velocity, angle, force etc. are unchanged. * @method setPosition From 6faa4c6e0830373dadd08a560b0aed7485e547de Mon Sep 17 00:00:00 2001 From: David Asmuth Date: Sat, 30 Jan 2016 23:19:15 +0100 Subject: [PATCH 2/3] fixed event inputs --- matter-js/matter-js.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/matter-js/matter-js.d.ts b/matter-js/matter-js.d.ts index c49633ba9..2f42dd667 100644 --- a/matter-js/matter-js.d.ts +++ b/matter-js/matter-js.d.ts @@ -2959,7 +2959,7 @@ declare module Matter { * @param {} event.source The source object of the event * @param {} event.name The name of the event */ - static on(obj: Engine, name: "sleepStart", callback: (e: IEvent) => void): void; + static on(obj: Body, name: "sleepStart", callback: (e: IEvent) => void): void; /** * Fired when a body ends sleeping (where `this` is the body). * @@ -2969,7 +2969,7 @@ declare module Matter { * @param {} event.source The source object of the event * @param {} event.name The name of the event */ - static on(obj: Engine, name: "sleepEnd", callback: (e: IEvent) => void): void; + static on(obj: Body, name: "sleepEnd", callback: (e: IEvent) => void): void; /** * Fired when a call to `Composite.add` is made, before objects have been added. @@ -3158,7 +3158,7 @@ declare module Matter { * @param name * @param callback */ - static on(obj: Engine, name: "mousedown", callback: (e: any) => void): void; + static on(obj: MouseConstraint, name: "mousedown", callback: (e: any) => void): void; /** * Fired when the mouse has moved (or a touch moves) during the last step @@ -3166,7 +3166,7 @@ declare module Matter { * @param name * @param callback */ - static on(obj: Engine, name: "mousemove", callback: (e: any) => void): void; + static on(obj: MouseConstraint, name: "mousemove", callback: (e: any) => void): void; /** * Fired when the mouse is up (or a touch has ended) during the last step @@ -3174,10 +3174,10 @@ declare module Matter { * @param name * @param callback */ - static on(obj: Engine, name: "mouseup", callback: (e: any) => void): void; + static on(obj: MouseConstraint, name: "mouseup", callback: (e: any) => void): void; - static on(obj: Engine, name: string, callback: (e: any) => void): void; + static on(obj: any, name: string, callback: (e: any) => void): void; /** * Removes the given event callback. If no callback, clears all callbacks in eventNames. If no eventNames, clears all events. From faeb49883ad3fdb963b41e9eae40e69daa7e635f Mon Sep 17 00:00:00 2001 From: David Asmuth Date: Thu, 18 Feb 2016 23:44:22 +0100 Subject: [PATCH 3/3] Updated API to version 0.9.1 --- matter-js/matter-js.d.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/matter-js/matter-js.d.ts b/matter-js/matter-js.d.ts index 2f42dd667..6a53e6eb7 100644 --- a/matter-js/matter-js.d.ts +++ b/matter-js/matter-js.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Matter.js - EDGE +// Type definitions for Matter.js - 0.9.1 // Project: https://github.com/liabru/matter-js // Definitions by: Ivane Gegia , // David Asmuth @@ -491,16 +491,17 @@ declare module Matter { */ lineWidth: number; - - /** * A String that defines the stroke style to use when rendering the body outline (if a sprite is not defined). It is the same as when using a canvas, so it accepts CSS style property values. Default: a random colour */ strokeStyle: string; - - - + + + /* + * Sets the opacity. 1.0 is fully opaque. 0.0 is fully translucent + */ + opacity: number; } export interface IBodyRenderOptionsSprite {