mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 23:24:41 +00:00
BitmapData alpha option added.
Pointer return type added. pixi manifest updated to remove need for geom classes.
This commit is contained in:
parent
c7e256245a
commit
33c52eaf09
6 changed files with 51 additions and 15 deletions
|
@ -70,10 +70,12 @@ Version 2.1.0 - "Cairhien" - -in development-
|
|||
### Updates
|
||||
|
||||
* TypeScript definition updates to help fix for the `noimplicitany` option (thanks @Waog #1088)
|
||||
* All of the Pixi geom classes have been removed from the build file as they aren't needed (the Phaser.Geom classes overwrite them), saving some space in the process.
|
||||
|
||||
### New Features
|
||||
|
||||
* Device will now detect for Kindle and PS Vita (thanks @lucbloom)
|
||||
* Device will now detect for Cordova (thanks @videlais #1102)
|
||||
* Arcade Physics Body.skipQuadTree is a new boolean that if set to `true` when you collide the Sprite against a Group it will tell Phaser to skip using a QuadTree for that collision. This is handy if this Body is especially large.
|
||||
* Arcade Physics World.skipQuadTree will disable the use of all QuadTrees in collision methods, which can help performance in tightly packed scenes.
|
||||
|
||||
|
@ -86,7 +88,7 @@ Version 2.1.0 - "Cairhien" - -in development-
|
|||
* Fix for scale issues in CocoonJS using webgl renderer and screencanvas (thanks @txusinho #1064)
|
||||
* Resolves issue with pixel perfect click / over detection on Sprites that used trimmed image atlases for animations or frames > 0.
|
||||
* Group.swap() updates the Z index values properly (thanks @Blank101 #1090)
|
||||
* Device now recognises ChromeOS as a desktop (thanks @alvinsight #1091)
|
||||
* Device now recognises ChromeOS as a desktop (thanks @alvinsight @hilts-vaughan #1091)
|
||||
|
||||
The full Change Log is at https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md
|
||||
|
||||
|
|
|
@ -24,14 +24,21 @@
|
|||
echo " <script src=\"$path/src/physics/p2/p2.js\"></script>";
|
||||
}
|
||||
|
||||
// Testing a build without these - pretty sure we're safe to ignore them (as we over-write them)
|
||||
// <script src="$path/src/pixi/core/Point.js"></script>
|
||||
// <script src="$path/src/pixi/core/Rectangle.js"></script>
|
||||
// <script src="$path/src/pixi/core/Polygon.js"></script>
|
||||
// <script src="$path/src/pixi/core/Circle.js"></script>
|
||||
// <script src="$path/src/pixi/core/Ellipse.js"></script>
|
||||
// "src/pixi/core/Point.js",
|
||||
// "src/pixi/core/Rectangle.js",
|
||||
// "src/pixi/core/Polygon.js",
|
||||
// "src/pixi/core/Circle.js",
|
||||
// "src/pixi/core/Ellipse.js",
|
||||
|
||||
echo <<<EOL
|
||||
|
||||
<script src="$path/src/pixi/Pixi.js"></script>
|
||||
<script src="$path/src/pixi/core/Point.js"></script>
|
||||
<script src="$path/src/pixi/core/Rectangle.js"></script>
|
||||
<script src="$path/src/pixi/core/Polygon.js"></script>
|
||||
<script src="$path/src/pixi/core/Circle.js"></script>
|
||||
<script src="$path/src/pixi/core/Ellipse.js"></script>
|
||||
<script src="$path/src/pixi/core/Matrix.js"></script>
|
||||
<script src="$path/src/pixi/display/DisplayObject.js"></script>
|
||||
<script src="$path/src/pixi/display/DisplayObjectContainer.js"></script>
|
||||
|
@ -220,7 +227,7 @@ EOL;
|
|||
EOL;
|
||||
}
|
||||
|
||||
if ($custom)
|
||||
if (isset($custom))
|
||||
{
|
||||
for ($i = 0; $i < count($custom); $i++)
|
||||
{
|
||||
|
|
|
@ -772,14 +772,30 @@ Phaser.BitmapData.prototype = {
|
|||
* @param {Phaser.Rectangle} area - The Rectangle region to copy from the source image.
|
||||
* @param {number} x - The destination x coordinate to copy the image to.
|
||||
* @param {number} y - The destination y coordinate to copy the image to.
|
||||
* @param {number} [alpha] - An optional alpha value. If given the BitmapData.context.globalAlpha will be set to this before drawing and reset after.
|
||||
*/
|
||||
copyPixels: function (source, area, x, y) {
|
||||
copyPixels: function (source, area, x, y, alpha) {
|
||||
|
||||
if (typeof source === 'string')
|
||||
{
|
||||
source = this.game.cache.getImage(source);
|
||||
}
|
||||
|
||||
if (typeof alpha === 'undefined')
|
||||
{
|
||||
alpha = null;
|
||||
}
|
||||
else if (alpha <= 0)
|
||||
{
|
||||
// No point doing anything if alpha is zero
|
||||
return;
|
||||
}
|
||||
else if (alpha > 1)
|
||||
{
|
||||
// Sanity cap
|
||||
alpha = 1;
|
||||
}
|
||||
|
||||
var src = source;
|
||||
var sx = 0;
|
||||
var sy = 0;
|
||||
|
@ -799,8 +815,19 @@ Phaser.BitmapData.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
if (alpha)
|
||||
{
|
||||
var prevAlpha = this.context.globalAlpha;
|
||||
this.context.globalAlpha = alpha;
|
||||
}
|
||||
|
||||
this.context.drawImage(src, sx + area.x, sy + area.y, area.width, area.height, x, y, area.width, area.height);
|
||||
|
||||
if (alpha)
|
||||
{
|
||||
this.context.globalAlpha = prevAlpha;
|
||||
}
|
||||
|
||||
this.dirty = true;
|
||||
|
||||
},
|
||||
|
|
|
@ -352,6 +352,7 @@ Phaser.Input.prototype = {
|
|||
this.touch = new Phaser.Touch(this.game);
|
||||
this.mspointer = new Phaser.MSPointer(this.game);
|
||||
this.gamepad = new Phaser.Gamepad(this.game);
|
||||
|
||||
// this.gestures = new Phaser.Gestures(this.game);
|
||||
|
||||
this.onDown = new Phaser.Signal();
|
||||
|
@ -392,7 +393,10 @@ Phaser.Input.prototype = {
|
|||
this.keyboard.stop();
|
||||
this.touch.stop();
|
||||
this.mspointer.stop();
|
||||
|
||||
|
||||
this.gamepad.stop();
|
||||
|
||||
// this.gestures.stop();
|
||||
|
||||
this.moveCallbacks = [];
|
||||
|
|
|
@ -432,8 +432,6 @@ Phaser.Pointer.prototype = {
|
|||
{
|
||||
this.targetObject = null;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
else if (this.game.input.interactiveItems.total > 0)
|
||||
{
|
||||
|
@ -450,6 +448,7 @@ Phaser.Pointer.prototype = {
|
|||
* @method Phaser.Pointer#processInteractiveObjects
|
||||
* @protected
|
||||
* @param {boolean} [fromClick=false] - Was this called from the click event?
|
||||
* @return {boolean} True if this method processes an object (i.e. a Sprite becomes the Pointers currentTarget), otherwise false.
|
||||
*/
|
||||
processInteractiveObjects: function (fromClick) {
|
||||
|
||||
|
@ -545,6 +544,8 @@ Phaser.Pointer.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
return (this.targetObject !== null);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
[
|
||||
"src/pixi/Intro.js",
|
||||
"src/pixi/Pixi.js",
|
||||
"src/pixi/core/Point.js",
|
||||
"src/pixi/core/Rectangle.js",
|
||||
"src/pixi/core/Polygon.js",
|
||||
"src/pixi/core/Circle.js",
|
||||
"src/pixi/core/Ellipse.js",
|
||||
"src/pixi/core/Matrix.js",
|
||||
|
||||
"src/pixi/display/DisplayObject.js",
|
||||
|
|
Loading…
Reference in a new issue