Graphics fixes and other changes

This commit is contained in:
Richard Davey 2013-09-22 22:55:34 +01:00
parent 02723d4774
commit 093bf8343d
4 changed files with 16 additions and 76 deletions

View file

@ -38,7 +38,15 @@ Change Log
Version 1.0.6 (in progress)
* Added check into Pointer.move to always consider a Sprite that has pixelPerfect enabled, regardless of render ID.
* BUG Found: The pixel perfect click check doesn't work if the sprite is part of a texture atlas yet.
* BUG: The pixel perfect click check doesn't work if the sprite is part of a texture atlas yet.
* Fixed issue with anti-alias in the Game constructor not being set correctly (thanks luizbills)
* Added support for the Graphics game object back in and two examples (thanks earok for spotting)
* New: Tweens can now be chained via multiple to() calls + example created (thanks to powerfear for adding)
* Fixed Math.wrap (thanks TheJare)
* New: When loading a Sprite Sheet you can now pass negative values for the frame sizes which specifies the number of rows/columns to load instead (thanks TheJare)
* New: BitmapText now supports anchor and has fixed box dimensions (thanks TheJare)
* Fixed bug where if a State contains an empty Preloader the Update will not be called (thanks TheJare)
Version 1.0.5 (September 20th 2013)

View file

@ -1,5 +1,5 @@
<?php
$title = "Canvas Smoothing";
$title = "Graphics";
require('../head.php');
?>
@ -9,14 +9,7 @@
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('atari1', 'assets/sprites/atari130xe.png');
}
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { create: create });
function create() {
@ -27,12 +20,12 @@
graphics.lineStyle(10, 0xffd900, 1);
// draw a shape
graphics.moveTo(50,50);
graphics.moveTo(0,50);
graphics.lineTo(250, 50);
graphics.lineTo(100, 100);
graphics.lineTo(250, 220);
graphics.lineTo(50, 220);
graphics.lineTo(50, 50);
graphics.lineTo(0, 50);
graphics.endFill();
// set a fill and line style again
@ -49,7 +42,7 @@
graphics.lineTo(210,300);
graphics.endFill();
// draw a rectangel
// draw a rectangle
graphics.lineStyle(2, 0x0000FF, 1);
graphics.drawRect(50, 250, 100, 100);
@ -64,15 +57,6 @@
game.add.tween(graphics).to({ x: 200 }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true);
// graphics.rotation = 1.2;
// graphics.angle = 10;
}
function update() {
}
function render() {
}
})();

View file

@ -3,7 +3,7 @@
*/
var Phaser = Phaser || {
VERSION: '1.0.5',
VERSION: '1.0.6',
GAMES: [],
AUTO: 0,
CANVAS: 1,

View file

@ -8,38 +8,12 @@ Phaser.Graphics = function (game, x, y) {
};
Phaser.Graphics.prototype = Object.create( PIXI.Graphics.prototype );
Phaser.Graphics.prototype = Object.create(PIXI.Graphics.prototype);
Phaser.Graphics.prototype.constructor = Phaser.Graphics;
Phaser.Graphics.prototype = Phaser.Utils.extend(true, Phaser.Graphics.prototype, Phaser.Sprite.prototype);
// Add our own custom methods
/**
* Automatically called by World.update
*/
Phaser.Graphics.prototype.OLDupdate = function() {
// if (!this.exists)
// {
// return;
// }
// this._cache.dirty = false;
// this._cache.x = this.x - (this.game.world.camera.x * this.scrollFactor.x);
// this._cache.y = this.y - (this.game.world.camera.y * this.scrollFactor.y);
// if (this.position.x != this._cache.x || this.position.y != this._cache.y)
// {
// this.position.x = this._cache.x;
// this.position.y = this._cache.y;
// this._cache.dirty = true;
// }
}
/*
Object.defineProperty(Phaser.Graphics.prototype, 'angle', {
get: function() {
@ -51,29 +25,3 @@ Object.defineProperty(Phaser.Graphics.prototype, 'angle', {
}
});
Object.defineProperty(Phaser.Graphics.prototype, 'x', {
get: function() {
return this.position.x;
},
set: function(value) {
this.position.x = value;
}
});
Object.defineProperty(Phaser.Graphics.prototype, 'y', {
get: function() {
return this.position.y;
},
set: function(value) {
this.position.y = value;
}
});
*/