Commit graph

169 commits

Author SHA1 Message Date
nextht
6f5d4b93b8 Fix mask combine filter bug
In the demo (code below), i create a group with a rect mask, and create a sprite as child with a blurXY filter, then nothing is displayed. 
So i hack WebGLFilterManager's pushFilter and popFilter method, in pushFilter method i create a new stencilManager instance and cache the old one, in popFilter i destroy the new stencilManager and restore the old one, then this workaround works rightly as i expect.

I think this is bug for PIXI, so i hope @GoodBoyDigital and @photonstorm can help me to check whether this fixing is right or not, thanks.
 
		var game = new Phaser.Game(800, 600, Phaser.WEBGL, 'phaser-example', { preload: preload, create: create });

		function preload() {

			game.load.image('phaser', 'assets/sprites/phaser2.png');
			game.load.script('filterX', '../filters/BlurX.js');
			game.load.script('filterY', '../filters/BlurY.js');

		}

		function create() {

			var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');
			logo.anchor.setTo(0.5, 0.5);

			var blurX = game.add.filter('BlurX');
			var blurY = game.add.filter('BlurY');

			logo.filters = [blurX, blurY];
			var group = game.add.group();
				group.addChild(logo);
				group.mask = game.add.graphics();
				group.mask.beginFill(0xff);
				group.mask.drawRect(0,0,500,500);
		}
2015-06-08 20:43:20 +08:00
Richard Davey
660ab8510c Merge pull request #1833 from danxexe/fix-drawcircle-docstring
Fix docstring of drawCircle
2015-06-04 04:23:45 +01:00
DanX
860d2e9538 Fix docstring of drawCircle 2015-06-03 13:41:42 -03:00
photonstorm
52b1b499a8 Removed un-needed Pixi file. 2015-06-03 05:28:24 +01:00
photonstorm
17648b74db Complete refactoring of PIXI.updateText - now properly respects the maxWidth setting regardless of kerning or font scale. 2015-06-03 05:28:23 +01:00
photonstorm
cc5740af10 BitmapText line spacing and word wrapping has been vastly improved and bought in-line with how Pixi 3 handles it, but with additional anchor support. 2015-05-31 01:31:11 +01:00
photonstorm
1e2940a6a4 PIXI.Graphics was calling Polygon.flatten in its drawShape call, causing the original Polygon object to internally change. It now takes a clone of the polygon and only flattens that (#1779) 2015-05-19 14:53:32 +01:00
photonstorm
9b95026cc9 Removed ConvertTintToImage as the Image object it created was never returned or used anywhere, so pointless having.
Optimised the canvas creation - before it was creating a new canvas every time it tinted a sprite.
Removed un-used tint method (tint with overlay)
Optimised tintWithMultiply.
2015-05-08 04:14:56 +01:00
photonstorm
8e6f9574ea Heavily tweaked tint texture handling. Can now be set by a texture and cached internally. 2015-05-08 04:13:34 +01:00
photonstorm
2cd59bbf32 Tidying up docs and formatting. 2015-05-08 04:12:07 +01:00
photonstorm
6f351ff0c1 Texture.requiresReTint is a new property that controls if a texture requires the display object to be re-tinted having been updated internally. The LoadTexture component now sets this. 2015-05-08 04:11:48 +01:00
photonstorm
9cb7122743 Improved code formatting. 2015-05-08 01:51:06 +01:00
photonstorm
12362a8300 Mark new textures as valid. 2015-05-07 02:44:29 +01:00
photonstorm
7674060afc Removed PIXI.EventListener and VideoTexture as it's no longer required. 2015-05-06 01:59:49 +01:00
photonstorm
df6dc70a41 Various VideoTexture tests (this file will be removed shortly however). 2015-05-05 14:02:38 +01:00
photonstorm
a686f6e212 PIXI.DisplayObject.worldPosition contains the position of the DisplayObject (and therefore any object that inherits from it, such as Phaser.Sprite) taking into account all transforms in the display list. It is updated at the end of DisplayObject.updateTransform. DisplayObject.position reflects only the position applied to the object directly, whereas worldPosition includes the positions that may have been applied to its ancestors.
PIXI.DisplayObject.worldScale contains the scale of the DisplayObject (and therefore any object that inherits from it, such as Phaser.Sprite) taking into account all transforms in the display list. It is updated at the end of `DisplayObject.updateTransform`. DisplayObject.scale reflects only the scale applied to the object directly, whereas worldScale includes any scales that may have been applied to its ancestors.

PIXI.DisplayObject.worldRotation contains the rotation of the DisplayObject (and therefore any object that inherits from it, such as Phaser.Sprite) taking into account all transforms in the display list. It is updated at the end of `DisplayObject.updateTransform`. DisplayObject.rotation reflects only the rotation applied to the object directly, whereas worldRotation includes any rotations that may have been applied to its ancestors.
2015-05-03 13:53:03 +01:00
photonstorm
df3c684760 PIXI.BaseTexture.forceLoaded allows you to set a BaseTexture as loaded, with the given width and height. It then calls BaseTexture.dirty. This is important for when you don't want to modify the shape of the source object by forcing in complete or dimension properties it may not naturally have, but still wish to use it as a base texture. 2015-05-03 13:53:02 +01:00
photonstorm
3f51463c7b PIXI.CanvasTinter.tintWithMultiply was performing a double drawImage operation for no reason. Simplified down to a single drawImage call. 2015-05-03 13:53:02 +01:00
photonstorm
e291f6d590 Added type parameter to VideoTexture.fromUrl allowing you to define the mime-type of the video file, which is required for Firefox and Safari in most cases. 2015-04-29 14:41:47 +01:00
photonstorm
c461c26393 Added onUpdate signal. 2015-04-27 16:22:36 +01:00
photonstorm
5d680ce4d4 pause not stop. 2015-04-27 16:22:35 +01:00
photonstorm
214e8abcda Added play and stop methods and related signals. 2015-04-23 02:35:27 +01:00
Richard Davey
fa5ed16f7d Trying something out :) 2015-04-22 04:22:17 +01:00
Richard Davey
be65b08e3b Close to getting WebGL Tiling Sprites back again - animations now work too, but the placement isn't quite right. 2015-04-22 01:36:12 +01:00
photonstorm
aa9ea30e79 Working through fixing TilingSprites for WebGL. 2015-04-21 17:01:24 +01:00
photonstorm
04e7be38bf Heavily refactored. Vastly optimised generateTexture method. Canvas renderer now works correctly with animated sprites, texture atlases and trimmed sprites. Warning: Currently breaks WebGL rendering. Will fix soon. 2015-04-21 15:57:17 +01:00
photonstorm
8fb5a89e1f Added video alias. 2015-04-21 05:11:31 +01:00
photonstorm
8981e9603e Removed Frame.uuid and updating TileSprite to work with animated sprites. 2015-04-21 05:11:19 +01:00
photonstorm
a5c14befa7 Formatting. 2015-04-17 19:56:14 +01:00
photonstorm
21de1e7c09 Added delayed load event handling back in. 2015-04-17 19:55:53 +01:00
photonstorm
97bc582f8d Added VideoTexture support back in and fixed various load related issues. 2015-04-17 19:55:30 +01:00
photonstorm
b196e4f17e Enabled PIXI.VideoTexture support. 2015-04-17 17:36:20 +01:00
photonstorm
2e2ba665cd PIXI.DisplayObject.updateTransform has a new optional parameter parent. If the DisplayObject doesn't have a parent (i.e. it isn't on the display list yet) then in the past updateTransform would fail. This meant you couldn't do things like scale or rotate a Sprite and then draw it to a RenderTexture or BitmapData, as calls to updateTransform would be ignored. The new checks now look to see if the parent parameter is set. If so this takes priority over the actual parent and is used to modify the transform (note that it **doesn't** reparent the DisplayObject, it merely uses it for the transform.) If there is no parent (explicitly or via the parameter) then it falls back to use Phaser.World as the parent. If it can't reach that then no transform takes place. 2015-04-17 03:22:23 +01:00
photonstorm
3a61fa35f0 RenderTexture.render now takes a Matrix as its second parameter, not a Point object. This brings it in line with Pixi and allows you to perform much more complex transformations on the object being rendered. If you need to replicate the old behavior please use RenderTexture.renderXY(sprite, point.x, point.y) instead.
RenderTexture.render and `renderXY` would ignore the Sprites rotation or scale. The full Sprite transform is now used correctly when the Sprite is drawn to the texture. If you wish to replicate the old behavior please use `RenderTexture.renderRawXY` instead.

RenderTexture.matrix has been removed as it's no longer used.

Fixed bug in Pixi where RenderTexture.render would ignore the given matrix.

Fixed a bug in Pixi where drawing a Sprite to a RenderTexture would reset the Sprites transform to an identity Matrix.
2015-04-17 03:22:07 +01:00
photonstorm
cdfc4ff45b Pixi.Sprite.renderCanvas and renderWebGL now has a new optional matrix parameter. You can use this to render the Sprite with an alternative transform matrix without actually adjusting the Sprite matrix at all. 2015-04-17 03:20:44 +01:00
photonstorm
1f4e54eec9 Removed duplicate methods from PIXI.Text such as wordWrap and updateText as Phaser overrides them, so it was wasting bytes. 2015-04-13 21:54:14 +01:00
photonstorm
eb506e2698 PIXI.Graphics in Canvas mode wouldn't respect the objects visible or alpha zero properties, rendering it regardless (thanks @TimvdEijnden #1720) 2015-04-13 14:19:44 +01:00
photonstorm
bb8b0d04fc Graphics.drawPolygon can now accept a Phaser.Polygon or PIXI.Polygon object, as well as a points array (#1712) 2015-04-13 13:00:52 +01:00
photonstorm
36c064511c Added guards around context.getImageData calls in BitmapData, Text and Canvas Tinting classes to avoid crashing restricted browsers like Epic Browser. Please understand that several Phaser features won't work correctly with this browser (thanks @Erik3000 #1714) 2015-04-02 14:47:44 +01:00
photonstorm
c1366c2f4f Arc comment. 2015-03-25 16:13:21 +00:00
photonstorm
93dc67be71 Graphics.drawArc would fail to draw any subsequent arcs if you set beginFill on it after drawing the first arc.
Graphics.drawArc would only move to the center position of the first arc created and ignore any subsequent arcs.
Graphics.drawArc now correctly renders multiple arcs across both WebGL and Canvas. You no longer need to specifically call moveTo to move into the correct place to draw the arc.
Graphics.drawArc now bails out if the startAngle = the endAngle and/or the sweep is invalid *before* adjusting any points.
Graphics.drawArc now correctly handles the fill on the CanvasRenderer if the arc is a subsequent arc and no line style is set.
2015-03-25 13:00:08 +00:00
photonstorm
d45a7bae8e Fixed constructor. 2015-03-25 12:59:41 +00:00
photonstorm
e7400be625 Formatting updates. 2015-03-25 12:59:31 +00:00
photonstorm
b1cdb358bb Merging in fixes from Pixi 3. 2015-03-25 11:04:58 +00:00
photonstorm
17b2eafbf3 Split GraphicsData to its own file. 2015-03-25 11:04:48 +00:00
photonstorm
7010883bc3 Tidying up. 2015-03-23 15:07:09 +00:00
photonstorm
55048a4b25 BitmapText objects now have an anchor property. This works in a similar way to Sprite.anchor except that it offsets the position of each letter of the BitmapText by the given amount, based on the overall BitmapText width - whereas Sprite.anchor offsets the position the texture is drawn at. 2015-03-23 15:03:53 +00:00
photonstorm
4e3d189678 Updated Pixi version. 2015-03-23 08:13:59 +00:00
photonstorm
b13acdb23b TilingSprite.destroy fixed if TilingSprite hasn't ever been rendered (#1663) 2015-03-19 01:39:39 +00:00
photonstorm
6cf982a4a0 Fixed to Destroy component if still in render loop. 2015-03-11 01:44:46 +00:00