mirror of
https://github.com/wassname/phaser.git
synced 2026-08-06 13:31:05 +08:00
Tilemap had the wrong @method signatures so most were missing from the docs.
This commit is contained in:
+91
-5
@@ -182,6 +182,10 @@
|
||||
<a href="Phaser.Group.html">Group</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Image.html">Image</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Input.html">Input</a>
|
||||
</li>
|
||||
@@ -398,6 +402,36 @@
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
|
||||
class="caret"></b></a>
|
||||
|
||||
<ul class="dropdown-menu ">
|
||||
|
||||
<li>
|
||||
<a href="global.html#canUseNewCanvasBlendModes">canUseNewCanvasBlendModes</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="global.html#getNextPowerOfTwo">getNextPowerOfTwo</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="global.html#hex2rgb">hex2rgb</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="global.html#hitTest">hitTest</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="global.html#rgb2hex">rgb2hex</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -614,12 +648,64 @@ Phaser.Utils = {
|
||||
|
||||
};
|
||||
|
||||
function HEXtoRGB(hex) {
|
||||
/**
|
||||
* Converts a hex color number to an [R, G, B] array
|
||||
*
|
||||
* @method hex2rgb
|
||||
* @param hex {Number}
|
||||
*/
|
||||
PIXI.hex2rgb = function(hex) {
|
||||
return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255];
|
||||
}
|
||||
};
|
||||
|
||||
PIXI.hex2rgb = function hex2rgb(hex) {
|
||||
return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255];
|
||||
/**
|
||||
* Converts a color as an [R, G, B] array to a hex number
|
||||
*
|
||||
* @method rgb2hex
|
||||
* @param rgb {Array}
|
||||
*/
|
||||
PIXI.rgb2hex = function(rgb) {
|
||||
return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255);
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks whether the Canvas BlendModes are supported by the current browser
|
||||
*
|
||||
* @method canUseNewCanvasBlendModes
|
||||
* @return {Boolean} whether they are supported
|
||||
*/
|
||||
PIXI.canUseNewCanvasBlendModes = function()
|
||||
{
|
||||
var canvas = document.createElement('canvas');
|
||||
canvas.width = 1;
|
||||
canvas.height = 1;
|
||||
var context = canvas.getContext('2d');
|
||||
context.fillStyle = '#000';
|
||||
context.fillRect(0,0,1,1);
|
||||
context.globalCompositeOperation = 'multiply';
|
||||
context.fillStyle = '#fff';
|
||||
context.fillRect(0,0,1,1);
|
||||
return context.getImageData(0,0,1,1).data[0] === 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Given a number, this function returns the closest number that is a power of two
|
||||
* this function is taken from Starling Framework as its pretty neat ;)
|
||||
*
|
||||
* @method getNextPowerOfTwo
|
||||
* @param number {Number}
|
||||
* @return {Number} the closest number that is a power of two
|
||||
*/
|
||||
PIXI.getNextPowerOfTwo = function(number)
|
||||
{
|
||||
if (number > 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj
|
||||
return number;
|
||||
else
|
||||
{
|
||||
var result = 1;
|
||||
while (result < number) result <<= 1;
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -689,7 +775,7 @@ if (!Array.isArray) {
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
|
||||
on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Sat Feb 08 2014 07:19:40 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user