Skip to content

Commit

Permalink
update dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
obiot committed Aug 21, 2022
1 parent adb8668 commit 77004cc
Show file tree
Hide file tree
Showing 4 changed files with 205 additions and 52 deletions.
107 changes: 86 additions & 21 deletions dist/melonjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10111,11 +10111,55 @@

/** @ignore */
Point.prototype.onResetEvent = function onResetEvent (x, y) {
if ( x === void 0 ) x = 0;
if ( y === void 0 ) y = 0;
if ( x === void 0 ) x = 0;
if ( y === void 0 ) y = 0;

this.x = x;
this.y = y;
this.set(x, y);
};

/**
* set the Point x and y properties to the given values
* @param {number} x
* @param {number} y
* @returns {Point} Reference to this object for method chaining
*/
Point.prototype.set = function set (x, y) {
if ( x === void 0 ) x = 0;
if ( y === void 0 ) y = 0;

this.x = x;
this.y = y;
return this;
};

/**
* return true if the two points are the same
* @name equals
* @memberof Point
* @method
* @param {Point} point
* @returns {boolean}
*/
/**
* return true if this point is equal to the given values
* @name equals
* @memberof Point
* @param {number} x
* @param {number} y
* @returns {boolean}
*/
Point.prototype.equals = function equals () {
var _x, _y;
if (arguments.length === 2) {
// x, y
_x = arguments[0];
_y = arguments[1];
} else {
// point
_x = arguments[0].x;
_y = arguments[0].y;
}
return ((this.x === _x) && (this.y === _y));
};

/**
Expand Down Expand Up @@ -18219,18 +18263,6 @@
*/
this.mask = undefined;

/**
* define a tint for this renderable. a (255, 255, 255) r, g, b value will remove the tint effect.
* @type {Color}
* @default (255, 255, 255)
* @example
* // add a red tint to this renderable
* this.tint.setColor(255, 128, 128);
* // remove the tint
* this.tint.setColor(255, 255, 255);
*/
this.tint = pool.pull("Color", 255, 255, 255, 1.0);

/**
* the blend mode to be applied to this renderable (see renderer setBlendMode for available blend mode)
* @type {string}
Expand Down Expand Up @@ -18282,7 +18314,7 @@
Renderable.prototype = Object.create( Rect && Rect.prototype );
Renderable.prototype.constructor = Renderable;

var prototypeAccessors = { isFloating: { configurable: true },inViewport: { configurable: true },isFlippedX: { configurable: true },isFlippedY: { configurable: true } };
var prototypeAccessors = { isFloating: { configurable: true },tint: { configurable: true },inViewport: { configurable: true },isFlippedX: { configurable: true },isFlippedY: { configurable: true } };

/**
* Whether the renderable object is floating, or contained in a floating container
Expand All @@ -18293,6 +18325,34 @@
return this.floating === true || (typeof this.ancestor !== "undefined" && this.ancestor.floating === true);
};

/**
* define a tint for this renderable. a (255, 255, 255) r, g, b value will remove the tint effect.
* @type {Color}
* @default (255, 255, 255)
* @example
* // add a red tint to this renderable
* this.tint.setColor(255, 128, 128);
* // remove the tint
* this.tint.setColor(255, 255, 255);
*/
prototypeAccessors.tint.get = function () {
if (typeof this._tint === "undefined") {
this._tint = pool.pull("Color", 255, 255, 255, 1.0);
}
return this._tint;
};
prototypeAccessors.tint.set = function (value) {
if (typeof this._tint === "undefined") {
this._tint = pool.pull("Color", 255, 255, 255, 1.0);
}
if (value instanceof Color) {
this._tint.copy(value);
} else {
// string (#RGB, #ARGB, #RRGGBB, #AARRGGBB)
this._tint.parseCSS(value);
}
};

/**
* Whether the renderable object is visible and within the viewport
* @type {boolean}
Expand Down Expand Up @@ -18746,9 +18806,9 @@
this.mask = undefined;
}

if (typeof this.tint !== "undefined") {
pool.push(this.tint);
this.tint = undefined;
if (typeof this._tint !== "undefined") {
pool.push(this._tint);
this._tint = undefined;
}

this.ancestor = undefined;
Expand Down Expand Up @@ -29195,7 +29255,12 @@
}

if (typeof (settings.tint) !== "undefined") {
this.tint.setColor(settings.tint);
if (settings.tint instanceof Color) {
this.tint.copy(settings.tint);
} else {
// string (#RGB, #ARGB, #RRGGBB, #AARRGGBB)
this.tint.parseCSS(settings.tint);
}
}

// set the sprite name if specified
Expand Down
4 changes: 2 additions & 2 deletions dist/melonjs.min.js

Large diffs are not rendered by default.

48 changes: 37 additions & 11 deletions dist/melonjs.module.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4893,6 +4893,30 @@ export class Point {
public y: number;
/** @ignore */
onResetEvent(x?: number, y?: number): void;
/**
* set the Point x and y properties to the given values
* @param {number} x
* @param {number} y
* @returns {Point} Reference to this object for method chaining
*/
set(x?: number, y?: number): Point;
/**
* return true if the two points are the same
* @name equals
* @memberof Point
* @method
* @param {Point} point
* @returns {boolean}
*/
/**
* return true if this point is equal to the given values
* @name equals
* @memberof Point
* @param {number} x
* @param {number} y
* @returns {boolean}
*/
equals(...args: any[]): boolean;
/**
* clone this Point
* @name clone
Expand Down Expand Up @@ -5812,17 +5836,6 @@ export class Renderable extends Rect {
* ]);
*/
mask: Rect | RoundRect | Polygon | Line | Ellipse;
/**
* define a tint for this renderable. a (255, 255, 255) r, g, b value will remove the tint effect.
* @type {Color}
* @default (255, 255, 255)
* @example
* // add a red tint to this renderable
* this.tint.setColor(255, 128, 128);
* // remove the tint
* this.tint.setColor(255, 255, 255);
*/
tint: Color;
/**
* the blend mode to be applied to this renderable (see renderer setBlendMode for available blend mode)
* @type {string}
Expand Down Expand Up @@ -5860,6 +5873,19 @@ export class Renderable extends Rect {
* @type {boolean}
*/
get isFloating(): boolean;
set tint(arg: Color);
/**
* define a tint for this renderable. a (255, 255, 255) r, g, b value will remove the tint effect.
* @type {Color}
* @default (255, 255, 255)
* @example
* // add a red tint to this renderable
* this.tint.setColor(255, 128, 128);
* // remove the tint
* this.tint.setColor(255, 255, 255);
*/
get tint(): Color;
_tint: any;
set inViewport(arg: boolean);
/**
* Whether the renderable object is visible and within the viewport
Expand Down
98 changes: 80 additions & 18 deletions dist/melonjs.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -10087,8 +10087,49 @@ class Point {

/** @ignore */
onResetEvent(x = 0, y = 0) {
this.x = x;
this.y = y;
this.set(x, y);
}

/**
* set the Point x and y properties to the given values
* @param {number} x
* @param {number} y
* @returns {Point} Reference to this object for method chaining
*/
set(x = 0, y = 0) {
this.x = x;
this.y = y;
return this;
}

/**
* return true if the two points are the same
* @name equals
* @memberof Point
* @method
* @param {Point} point
* @returns {boolean}
*/
/**
* return true if this point is equal to the given values
* @name equals
* @memberof Point
* @param {number} x
* @param {number} y
* @returns {boolean}
*/
equals() {
var _x, _y;
if (arguments.length === 2) {
// x, y
_x = arguments[0];
_y = arguments[1];
} else {
// point
_x = arguments[0].x;
_y = arguments[0].y;
}
return ((this.x === _x) && (this.y === _y));
}

/**
Expand Down Expand Up @@ -18162,18 +18203,6 @@ class Renderable extends Rect {
*/
this.mask = undefined;

/**
* define a tint for this renderable. a (255, 255, 255) r, g, b value will remove the tint effect.
* @type {Color}
* @default (255, 255, 255)
* @example
* // add a red tint to this renderable
* this.tint.setColor(255, 128, 128);
* // remove the tint
* this.tint.setColor(255, 255, 255);
*/
this.tint = pool.pull("Color", 255, 255, 255, 1.0);

/**
* the blend mode to be applied to this renderable (see renderer setBlendMode for available blend mode)
* @type {string}
Expand Down Expand Up @@ -18230,6 +18259,34 @@ class Renderable extends Rect {
return this.floating === true || (typeof this.ancestor !== "undefined" && this.ancestor.floating === true);
}

/**
* define a tint for this renderable. a (255, 255, 255) r, g, b value will remove the tint effect.
* @type {Color}
* @default (255, 255, 255)
* @example
* // add a red tint to this renderable
* this.tint.setColor(255, 128, 128);
* // remove the tint
* this.tint.setColor(255, 255, 255);
*/
get tint() {
if (typeof this._tint === "undefined") {
this._tint = pool.pull("Color", 255, 255, 255, 1.0);
}
return this._tint;
}
set tint(value) {
if (typeof this._tint === "undefined") {
this._tint = pool.pull("Color", 255, 255, 255, 1.0);
}
if (value instanceof Color) {
this._tint.copy(value);
} else {
// string (#RGB, #ARGB, #RRGGBB, #AARRGGBB)
this._tint.parseCSS(value);
}
}

/**
* Whether the renderable object is visible and within the viewport
* @type {boolean}
Expand Down Expand Up @@ -18679,9 +18736,9 @@ class Renderable extends Rect {
this.mask = undefined;
}

if (typeof this.tint !== "undefined") {
pool.push(this.tint);
this.tint = undefined;
if (typeof this._tint !== "undefined") {
pool.push(this._tint);
this._tint = undefined;
}

this.ancestor = undefined;
Expand Down Expand Up @@ -29115,7 +29172,12 @@ class Sprite extends Renderable {
}

if (typeof (settings.tint) !== "undefined") {
this.tint.setColor(settings.tint);
if (settings.tint instanceof Color) {
this.tint.copy(settings.tint);
} else {
// string (#RGB, #ARGB, #RRGGBB, #AARRGGBB)
this.tint.parseCSS(settings.tint);
}
}

// set the sprite name if specified
Expand Down

0 comments on commit 77004cc

Please sign in to comment.