Updated DynamicTexture.setPixel, added GameMath.shuffleArray, fixed Animation.frame and created a few new tests

This commit is contained in:
Richard Davey
2013-05-18 03:05:28 +01:00
parent 55568592b5
commit 53aa43566e
21 changed files with 529 additions and 95 deletions
+7 -10
View File
@@ -120,8 +120,8 @@ module Phaser {
public lineColor: string = 'rgb(0,255,0)';
/**
* Width of outline. (default is 1)
* @type {number}
* The color of the filled area in rgb or rgba string format
* @type {string} Defaults to rgb(0,100,0) - a green color
*/
public fillColor: string = 'rgb(0,100,0)';
@@ -341,13 +341,6 @@ module Phaser {
this._dw = this.bounds.width * this.scale.x;
this._dh = this.bounds.height * this.scale.y;
// Circles are drawn center based
if (this.type == GeomSprite.CIRCLE)
{
this._dx += this.circle.radius;
this._dy += this.circle.radius;
}
// Apply camera difference
if (this.scrollFactor.x !== 1.0 || this.scrollFactor.y !== 1.0)
{
@@ -391,7 +384,11 @@ module Phaser {
{
this.context.beginPath();
this.context.arc(this._dx, this._dy, this.circle.radius, 0, Math.PI * 2);
this.context.stroke();
if (this.renderOutline)
{
this.context.stroke();
}
if (this.renderFill)
{
+7 -1
View File
@@ -33,6 +33,7 @@ module Phaser {
if (key !== null)
{
this.cacheKey = key;
this.loadGraphic(key);
}
else
@@ -70,6 +71,11 @@ module Phaser {
*/
public animations: AnimationManager;
/**
* The cache key that was used for this texture (if any)
*/
public cacheKey: string;
/**
* Render bound of this sprite for debugging? (default to false)
* @type {boolean}
@@ -95,7 +101,7 @@ module Phaser {
public renderDebugPointColor: string = 'rgba(255,255,255,1)';
/**
* Flip the graphic vertically? (default to false)
* Flip the graphic horizontally? (defaults to false)
* @type {boolean}
*/
public flipped: bool = false;