Commit graph

773 commits

Author SHA1 Message Date
photonstorm
508e5ae723 PIXI.TilingSprite has been removed, and all functionality merged in to Phaser.TileSprite, to cut down on the number of internal classes and inheritance going on. 2016-09-28 11:57:11 +01:00
Richard Davey
2005c9d86d PIXI.RenderTexture has been removed, and all functionality merged in to Phaser.RenderTexture, to cut down on the number of internal classes and inheritance going on. 2016-09-28 01:40:29 +01:00
Richard Davey
1d7b54b7d4 Merged Sprite Batch updates. 2016-09-27 23:22:26 +01:00
Richard Davey
41ad0873d4 Fixing the Sprite Batch. 2016-09-27 23:20:38 +01:00
Richard Davey
2bc9c73838 The Video.playing property didn't check to see if the Video existed, and would throw the error Uncaught TypeError: Cannot read property 'paused' of null if you called it after destroying the video (thanks @Tetley #2740) 2016-09-26 23:35:41 +01:00
Richard Davey
0692bf01b5 If you called Video.changeSource, and then immediately called Video.play after it, it would fire the onComplete event twice (thanks @jaraiza #2543) 2016-09-26 23:28:41 +01:00
Richard Davey
f331697fee Text.splitRegExp is a new property that allows you to control the regular expression that is used to split the text into multiple lines (@dai-shi #1403) 2016-09-26 22:35:54 +01:00
Richard Davey
feb1b980c0 Text.width and Text.height now divide the result by the Text.resolution, to avoid incorrect dimensions on High DPI devices (thanks @mattahj #2146) 2016-09-26 22:22:31 +01:00
Richard Davey
3f4decd59e First pass at adding rotated atlas frame support in to the Canvas renderer. 2016-09-20 00:53:00 +01:00
photonstorm
a84021679b Tidied up how crop destroys itself. 2016-08-25 16:41:26 +01:00
photonstorm
94a0dbe547 Text.updateText now sets Text.dirty = false, which stops Text objects from having updateText called twice on them after creation. 2016-08-25 14:16:48 +01:00
Richard Davey
d8cb40aa5e Merge pull request #2700 from kjav/patch-2
Fixed typo in TileSprite.js comment
2016-08-25 13:04:31 +01:00
photonstorm
cbef6d6648 Formatting fix. 2016-08-22 18:38:40 +01:00
photonstorm
4382944a2e A tinted Texture in Canvas mode wouldn't be updated properly if it was also cropped, beyond the initial crop. Now a cropped texture will re-tint itself every time the crop is updated, and has changed (thanks @phoenixyjll #2688) 2016-08-18 15:55:13 +01:00
kjav
314b088975 Fixed typo in TileSprite.js comment
Changed typo 'etch' in TileSprite.js to 'etc'. Related to pull request #2699
2016-08-18 15:40:19 +01:00
Richard Davey
a4de55c419 Merge pull request #2685 from valent-novem/dev
Fix rendering text with bounds and resolution
2016-08-16 21:12:57 +01:00
Richard Davey
49e40fc2d4 Typo 2016-08-16 20:59:59 +01:00
Sergey Z
68fe8b8058 Fix rendering text with bounds and resolution 2016-08-08 16:51:07 +03:00
Richard Davey
a0c6ae6c51 Phaser.Image now has the ScaleMinMax component. 2016-08-03 05:00:09 +01:00
Richard Davey
ce764e098d As a result of changes in #2573 Graphics objects were calling updateLocalBounds on any shape change, which could cause dramatic performances drops in Graphics heavy situations (#2618). Graphics objects now have a new flag _boundsDirty which is used to detect if the bounds have been invalidated, i.e. by a Graphics being cleared or drawn to. If this is set to true then updateLocalBounds is called once in the postUpdate method (thanks @pengchuan #2618) 2016-07-23 12:52:35 +01:00
Richard Davey
b405570833 Docs fix #2624 2016-07-17 11:26:09 +01:00
Tomáš Blatný
2b90f2cb3b BitmapData.js: fixed fluent interface 2016-07-15 20:16:35 +02:00
Richard Davey
4548d70369 Experimenting with new MainLoop + position interpolation. (reverted from commit e49d45e278) 2016-07-13 02:44:35 +01:00
Richard Davey
e49d45e278 Experimenting with new MainLoop + position interpolation. 2016-07-12 03:05:29 +01:00
photonstorm
ee202667ed Huge docs update for all of the Game Object events. 2016-07-08 11:28:30 +01:00
Richard Davey
0014201917 Groups now have the following properties, which are getters and setters: centerX, centerY, left, right, top and bottom. These calculate the bounds of the Group, based on all visible children, and then allow you to apply positioning based on that. This means you can, for example, now get the horizontal center of a Group by called Group.centerX. These properties are also setters, so you can position the Groups, and it will take scale and rotation into consideration.
Groups have a new method `alignIn`. It allows you to align the Group within another Game Object, or a Rectangle. You can specify one of 9 positions which are the new position constants such as: `Phaser.TOP_LEFT` or `Phaser.CENTER` (see docs for the complete list). The Groups are positioned based on their child bounds, which takes rotation and scaling into consideration. You can easily place Groups into the corners of the screen, or game world, or align them within other Sprites, using this method.

Groups have a new method `alignTo`. It allows you to align a Group to the side of another Game Object, or a Rectangle. You can specify one of 11 positions which are the new position constants such as: `Phaser.TOP_LEFT` or `Phaser.LEFT_BOTTOM` (see docs for the complete list). The Groups are positioned based on their child bounds, which takes rotation and scaling into consideration. You can easily align Groups next to other Sprites using this method.
2016-07-08 01:33:42 +01:00
Richard Davey
c4d7870a31 * PIXI.Texture.fromImage, PIXI.BaseTexture.fromImage and PIXI.Sprite.fromImage have all been removed. They should never have actually been used, as they bypass the Phaser Loader, and don't factor in CORs or any other advanced loader settings.
* The PIXI.BaseTexture.imageUrl property has been removed, as it was never actually populated.
* The PIXI.BaseTexture._UID property has been removed, as it was never actually used internally.
* All references to PIXI.BaseTextureCache have been removed (primarily from BaseTexture.destroy and Texture.destroy), as the BaseTextureCache was never used internally by Phaser, or by our custom version of Pixi.
* PIXI.TextureCache has been removed. It was only ever used by the __default and __missing images that Phaser generates on start-up. It wasn't used internally by Phaser anywhere else, and the only references Pixi has to it have all been removed. If you need it in your own game, please refactor it to avoid it, or re-create the object on the PIXI global object.
* Canvases created by `BaseTexture.fromCanvas` no longer have the `_pixiId` property attached to them, as this was never used internally by Phaser or Pixi.
* PIXI.BaseTexture.updateSourceImage is now deprecated. Please use `Sprite.loadTexture` instead.
* The property PIXI.BaseTextureCacheIdGenerator has been removed, as it is no longer used internally by Phaser or Pixi.
* PIXI.Texture.addTextureToCache has been removed. The PIXI Texture Cache was never actually used by Phaser, and was leading to complications internally.
* PIXI.Texture.removeTextureFromCache has been removed. The PIXI Texture Cache was never actually used by Phaser, and was leading to complications internally.
* PIXI.Texture.fromFrame and PIXI.Sprite.fromFrame have been removed. They relied on the PIXI Texture Cache, which was never actually used by Phaser, and was never used internally by Pixi either.
* The property PIXI.TextureCacheIdGenerator has been removed, as it was not used internally.
* The property PIXI.FrameCache has been removed, as it was not used internally.
2016-07-06 21:47:27 +01:00
Richard Davey
33150018ad Text.fontPropertiesCanvas no longer uses a CanvasPool entry. 2016-07-06 20:59:28 +01:00
photonstorm
0036bf747f BitmapData has a new, optional, fifth argument: skipPool. By default BitmapData objects will ask for the first free canvas found in the CanvasPool, but this behavior can now be customized on a per object basis. 2016-07-04 12:57:08 +01:00
photonstorm
32bec66031 Docs update. 2016-06-29 16:18:54 +01:00
Richard Davey
a0c771d47e Text.setText has a new optional argument immediate which will re-create the texture immediately upon call, rather than wait for the next render pass to do so (thanks @Scraft #2594) 2016-06-27 22:42:01 +01:00
Richard Davey
8c5cea066a Updated docs. 2016-06-23 00:45:24 +01:00
photonstorm
bd30181a2a Docs update. 2016-06-20 12:18:39 +01:00
photonstorm
47f0224a40 Phaser 2.4.9 release. 2016-06-17 01:11:24 +01:00
photonstorm
9dd745167c Docs fix. 2016-06-16 17:18:49 +01:00
photonstorm
4da3b15ae2 Renamed alignTo to alignIn, and added the new method alignTo, to allow for Sprite to Sprite alignment. Updated all of the Bounds and TS defs. 2016-06-16 17:01:51 +01:00
photonstorm
5bcf84f5a4 Added offsetX and offsetY arguments to Bounds.alignTo. 2016-06-16 15:51:12 +01:00
Richard Davey
ed8fbd9a6c All Game Objects with the Bounds component; which includes Sprites, Images, Text, BitmapText, TileSprites and anything that extend these, now have a new method alignTo. It allows you to align the Game Object to another Game Object, or a Rectangle. You can specify one of 9 positions which are the new constants: Phaser.TOP_LEFT, Phaser.TOP_CENTER and so on (see above for the complete list). The Game Objects are positioned based on their Bounds, which takes rotation, scaling and anchor into consideration. You can easily place Sprites into the corners or the screen or game world, or align them against other Sprites, using this method. 2016-06-16 02:00:46 +01:00
Richard Davey
0efcf68b21 The Game Object Bounds component has been updated to include two new properties: centerX and centerY. This means you can, for example, now get the horizontal center of a Sprite by called Sprite.centerX. These properties are also setters, so you can position the Game Objects, and it will take scale and anchor into consideration. 2016-06-16 01:00:11 +01:00
Richard Davey
123e61c018 The Game Object Bounds component has been updated so that it now provides setters for all of the properties, as well as getters. Previously Sprite.left, Sprite.right, Sprite.top and Sprite.bottom were read-only, but they are now available to be set as well, and take into consideration the anchor and scale of the Game Objects. 2016-06-16 00:33:48 +01:00
photonstorm
bc00c900e9 BitmapData.smoothProperty is a new property that holds the string based prefix needed to set image scaling on the BitmapData context.
BitmapData.copyTransform allows you to draw a Game Object to the BitmapData, using its `worldTransform` property to control the location, scaling and rotation of the object. You can optionally provide

BitmapData.drawGroup now uses the new `copyTransform` method, to provide for far more accurate results. Previously nested Game Objects wouldn't render correctly, nor would Sprites added via `addChild` to another Sprite. BitmapText objects also rendered without rotation taken into account, and the Sprites smoothing property was ignored. All of these things are now covered by the new drawGroup method, which also handles full deep iteration down the display list.
2016-06-14 15:29:56 +01:00
photonstorm
fb3f7721cb Working through updating BitmapData.copy to use the source matrix instead, so it retains the correct draw sequence order. 2016-06-13 17:01:33 +01:00
Richard Davey
a180882d27 Fixed the data object not being created. 2016-06-06 00:31:46 +01:00
photonstorm
96711f4db9 Added the Weapon Plugin and worked lots on its docs. 2016-06-03 15:09:43 +01:00
Richard Davey
097add1aa6 Game Objects including Sprite, Image, Particle, TilemapLayer, Text, BitmapText and TileSprite have a new property called data. This is an empty Object that Phaser will never touch internally, but your own code, or Phaser Plugins, can store Game Object specific data within it. This allows you to associate data with a Game Object without having to pollute or change its class shape. 2016-06-03 01:08:32 +01:00
photonstorm
a81fe3cf02 jshint fixes. 2016-06-02 15:38:05 +01:00
photonstorm
21b5492e98 Video.onComplete wouldn't fire on iOS if the user hit the 'Done' button before the video had finished playing. It now uses the webkitendfullscreen event to detect this, and dispatches the onComplete signal should that event fire (thanks @kelu-smiley #2498) 2016-06-02 15:26:11 +01:00
Richard Davey
56cc7dc155 Merge pull request #2519 from TadejZupancic/patch-1
Fixing measurement of text width that produced too narrow canvas
2016-06-02 14:53:17 +01:00
TadejZupancic
317c85db90 Fixing measurement of text width that produced too narrow canvas
When using a style on characters (e.g. addColor), the length of the whole line with default style was measured ignoring the different width of the characters with added style. 

I've included the measureLine function, which does the same measurements as updateLine, but it does not render the line to canvas - it only returns the line length.

Now this function is used for measuring line of text if some style is added to it.
2016-06-02 11:10:40 +02:00
kevinleedrum
c1a2970488 Fixing issue #2496: Wrapped BitmapText not centering 2016-05-24 09:09:38 -04:00