mirror of
https://github.com/wassname/phaser.git
synced 2026-08-08 11:23:41 +08:00
Merged N+ physics in and tidied up the Docs folder and logos.
This commit is contained in:
@@ -54,6 +54,19 @@ var Phaser;
|
||||
return colors;
|
||||
};
|
||||
|
||||
ColorUtils.hexToRGB = function (h) {
|
||||
var hex16 = (h.charAt(0) == "#") ? h.substring(1, 7) : h;
|
||||
var r = parseInt(hex16.substring(0, 2), 16);
|
||||
var g = parseInt(hex16.substring(2, 4), 16);
|
||||
var b = parseInt(hex16.substring(4, 6), 16);
|
||||
|
||||
return {
|
||||
r: r,
|
||||
g: g,
|
||||
b: b
|
||||
};
|
||||
};
|
||||
|
||||
ColorUtils.getComplementHarmony = /**
|
||||
* Returns a Complementary Color Harmony for the given color.
|
||||
* <p>A complementary hue is one directly opposite the color given on the color wheel</p>
|
||||
|
||||
@@ -59,6 +59,21 @@ module Phaser {
|
||||
|
||||
}
|
||||
|
||||
public static hexToRGB(h: string) {
|
||||
|
||||
var hex16 = (h.charAt(0) == "#") ? h.substring(1, 7) : h;
|
||||
var r = parseInt(hex16.substring(0, 2), 16);
|
||||
var g = parseInt(hex16.substring(2, 4), 16);
|
||||
var b = parseInt(hex16.substring(4, 6), 16);
|
||||
|
||||
return {
|
||||
r: r,
|
||||
g: g,
|
||||
b: b
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Complementary Color Harmony for the given color.
|
||||
* <p>A complementary hue is one directly opposite the color given on the color wheel</p>
|
||||
|
||||
@@ -183,6 +183,11 @@ var Phaser;
|
||||
Phaser.DebugUtils.line('bottom: ' + sprite.worldView.bottom + ' right: ' + sprite.worldView.right.toFixed(1));
|
||||
};
|
||||
|
||||
DebugUtils.renderSpriteWorldViewBounds = function (sprite, color) {
|
||||
if (typeof color === "undefined") { color = 'rgba(0,255,0,0.3)'; }
|
||||
Phaser.DebugUtils.renderRectangle(sprite.worldView, color);
|
||||
};
|
||||
|
||||
DebugUtils.renderSpriteInfo = /**
|
||||
* Render debug infos. (including name, bounds info, position and some other properties)
|
||||
* @param x {number} X position of the debug info to be rendered.
|
||||
|
||||
Reference in New Issue
Block a user