Commit graph

3555 commits

Author SHA1 Message Date
David Hayes
8f36b96c8a Reorder Weapon.onFire argument order in documentation. 2016-06-19 20:39:51 -05:00
Mike Headley
ad0f31be8d Added Group.getClosestToFilter() and Group.getFurthestFromFilter() 2016-06-19 10:45:35 -07:00
Matthias Fuchs
0d45251e98 Fixed Animation.setFrame() for sprite index argument. 2016-06-17 22:34:11 +02:00
photonstorm
697a2ae94e Fixed issue in Group.align where the cell wouldn't increase if rows was great than -1 2016-06-17 15:28:39 +01:00
Richard Davey
effb975a25 Preparing for 2.5.1 development. 2016-06-17 13:11:48 +01:00
Richard Davey
a9976d2703 Phaser 2.5.0 Release. 2016-06-17 12:46:56 +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
photonstorm
f64558c4ac Readme update. 2016-06-16 12:14:27 +01:00
Richard Davey
e659083818 Fixed jshint error. 2016-06-16 02:51:44 +01:00
Richard Davey
853d770764 Group.align is a new method that allows you to layout all the children of the Group in a grid formation. You can specify the dimensions of the grid, including the width, height and cell size. You can also control where children are positioned within each grid cell. The grid width and height values can also be set to -1, making them fluid, so the grid expands until all children are aligned. Finally an optional child index argument can be set. This is a great way to quickly and comprehensively align Group children, and has lots of use cases. 2016-06-16 02:50:24 +01:00
Richard Davey
fc7a3934d2 Group.align working. 2016-06-16 02:28:49 +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
Richard Davey
d67e902760 Rectangle.getPoint is a new method that returns a point based on the given location constant, such as Phaser.BOTTOM_LEFT. It returns the same result as calling Rectangle.bottomLeft (etc) but unlike those getters you are able to provide your own Point object. 2016-06-15 23:39:15 +01:00
Richard Davey
64a44aab17 Added the following new constants: Phaser.TOP_LEFT, Phaser.TOP_CENTER, Phaser.TOP_RIGHT, Phaser.MIDDLE_LEFT, Phaser.MIDDLE_CENTER, Phaser.MIDDLE_RIGHT, Phaser.BOTTOM_LEFT, Phaser.BOTTOM_CENTER and Phaser.BOTTOM_RIGHT. 2016-06-15 23:37:48 +01:00
Richard Davey
32cf1f1a9c Group.createMultiple can now accept Arrays for both the key and frame arguments. This allows you to create multiple sprites using each key and/or frame in the arrays, which is a great and quick way to build diverse Groups. See the JSDocs for complete details and code examples. 2016-06-15 22:36:23 +01:00
gotenxds
91987eff56 Added some data to image object types. 2016-06-15 13:09:47 +03:00
Richard Davey
70be74cb36 Lots of work on Body.moveTo and Body.moveFrom. Now working nicely. 2016-06-15 04:12:47 +01:00
Richard Davey
b5cc01132c Body.move tests. 2016-06-14 23:45:00 +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
189cbf4132 Added exists property. 2016-06-14 15:29:45 +01:00
photonstorm
6383f6b1fb Updated docs. 2016-06-14 15:29:38 +01:00
photonstorm
7817d47a25 Updated Cache docs. 2016-06-14 12:18:32 +01:00
photonstorm
ad3641830d Phaser.Matrix if passed a 0 value would consider it falsy, and replace it with the default by mistake. It now checks if the arguments are undefined or null and only then sets the defaults (thanks mmcs) 2016-06-14 12:18:23 +01:00
Richard Davey
7108bc3de3 Merge pull request #2552 from drhayes/dev
Distinguish between Arrays and Objects when cloning in Cache.getJSON.
2016-06-14 11:49:02 +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
photonstorm
1a3b06a9f4 The DisplayObject.worldRotation value didn't sign the wt.c value correctly, meaning the rotation would be wrong.
The `DisplayObject.worldScale` value didn't multiply the local objects scale into the calculation, meaning the value wasn't a true representation of the objects world scale.
2016-06-13 17:01:03 +01:00
Pete Baron
04980c8096 Remove hack to force WEBGL mode for testing. 2016-06-14 01:02:02 +12:00
Pete Baron
11c5300591 Remove dubious use of tile.index to reference the tilesets list (it seems unlikely that there would ever be a tilesets value for every tile, and a huge waste of memory if it was ever done that way).
TODO: look into putting the tileset index (or a tileset reference) into each Tile structure when building them to avoid resolveTilesets entirely too.
2016-06-14 00:43:46 +12:00
Pete Baron
7533005a62 Fix buffer size bug. 2016-06-14 00:00:18 +12:00
Pete Baron
b406d10d94 Comments, and removed reinitialisation of the glBatch list. 2016-06-13 18:40:51 +12:00
Pete Baron
310b151924 Removed pixiTest flag, using renderType instead. 2016-06-13 18:39:52 +12:00
Pete Baron
c7476a6583 Fixed bug where scroll was effectively applied twice. 2016-06-13 18:38:55 +12:00
Pete Baron
05efcfe36e Modified my PIXI.Tilemap class to accept the glBatch list of tile source and destination coordinates, convert them into a GL TRIANGLE_STRIP data buffer, then draw them as a single batch WebGL draw. 2016-06-13 17:28:35 +12:00
Pete Baron
a8405bd066 add comment 2016-06-13 17:26:33 +12:00
Pete Baron
57a6245f25 Made a copy of Phaser.TilemapLayer which instead extends PIXI.Tilemap, then added functions to build a batch list of tile source and destination coordinates (instead of drawing them directly onto a Canvas). This maintains all the existing Phaser functionality in regards to tile map decoding and interpretation, and also provides maximum performance from the PIXI component by using a TRIANGLE_STRIP to render everything as a single batch job. 2016-06-13 17:25:50 +12:00
Pete Baron
94d49f1196 Add GL variant of the Tileset.draw function for new approach to WebGL tile drawing (utilising most of the existing Phaser code unchanged) 2016-06-13 17:13:13 +12:00
David Hayes
346aed2866 Distinguish between Arrays and Objects when cloning in Cache.getJSON.
Fixes #2551.
2016-06-10 10:33:33 -05:00
photonstorm
0880380ea9 Phaser 2.4.9 RC4. 2016-06-10 16:22:54 +01:00
Richard Davey
1daf897b23 Small styling fixes. 2016-06-09 23:27:19 +01:00
Richard Davey
5415d9b603 Stage and Group postUpdate methods iterate the same way now. 2016-06-09 23:14:24 +01:00
Richard Davey
cd8bb5a216 Removed keyCode modifier (#2542) 2016-06-09 22:03:09 +01:00
Richard Davey
57642afc24 Fixed keyboard issue. 2016-06-09 20:55:21 +01:00
photonstorm
88f47e2497 Keyboard now uses a new internal method getKeyCode to normalize the key code value based on browser support. It first checks for event.key, then event.keyIdentifier and finally event.keyCode (thanks @SVasilev #2542) 2016-06-09 16:37:32 +01:00
photonstorm
2ac594ca03 TypeScript defs update. 2016-06-09 16:29:09 +01:00
photonstorm
a65f9c7e4b Group.onChildInputDown is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an onInputDown signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.
Group.onChildInputUp is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an `onInputUp` signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.

Group.onChildInputOver is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an `onInputOver` signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.

Group.onChildInputOut is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an `onInputOut` signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.
2016-06-09 16:19:11 +01:00
photonstorm
28331c4f7f Comment fix. 2016-06-09 15:37:03 +01:00
photonstorm
458a67251d Fixed input property check. 2016-06-09 15:09:20 +01:00
photonstorm
90e1460320 Added new Debug.displayList function. 2016-06-09 14:58:58 +01:00
photonstorm
24f4abe760 Group.add has a new optional argument index which controls the index within the group to insert the child to. Where 0 is the bottom of the Group.
Group.addAt has been refactored to be a simple call to `Group.add`, removing lots of duplicate code in the process.

Group.create has a new optional argument `index` which controls the index within the group to insert the child to. Where 0 is the bottom of the Group. It also now makes proper use of `Group.add`, cutting down on more duplicate code.

Group.createMultiple now returns an Array containing references to all of the children that the method created.
2016-06-09 14:58:35 +01:00
photonstorm
c64749fef2 Added missing properties. 2016-06-09 14:54:39 +01:00
photonstorm
92d3a5efa8 Adds a callback that is fired every time 'Pointer.processInteractiveObjects' is called.
The purpose of `processInteractiveObjects` is to work out which Game Object the Pointer is going to
interact with. It works by polling all of the valid game objects, and then slowly discounting those
 that don't meet the criteria (i.e. they aren't under the Pointer, are disabled, invisible, etc).

Eventually a short-list of 'candidates' is created. These are all of the Game Objects which are valid
for input and overlap with the Pointer. If you need fine-grained control over which of the items is
selected then you can use this callback to do so.

The callback will be sent 3 parameters:

1) A reference to the Phaser.Pointer object that is processing the Items.
2) An array containing all potential interactive candidates. This is an array of `InputHandler` objects, not Sprites.
3) The current 'favorite' candidate, based on its priorityID and position in the display list.

Your callback MUST return one of the candidates sent to it.
2016-06-09 14:49:10 +01:00
photonstorm
7c2d1d4ab8 Pointer.interactiveCandidates is a new Array that is erased and re-populated every time this Pointer is updated. It contains references to all of the Game Objects that were considered as being valid for processing by this Pointer, during the most recent update. To be valid they must have suitable a priorityID, be Input enabled, be visible and actually have the Pointer over them. You can check the contents of this array in events such as onInputDown, but beware: it is reset every update.
Pointer.swapTarget allows you to change the `Pointer.targetObject` object to be the one provided. This allows you to have fine-grained control over which object the Pointer is targeting.
2016-06-09 14:36:15 +01:00
photonstorm
fa43bec19f PIXI.DisplayObjectContainer.ignoreChildInput is a new property. If true then the children will _not_ be considered as valid for Input events. Because this has been applied to DisplayObjectContainer it means it's available in Group, Sprite and any other display level object. Using this boolean you can disable input events for all children in an entire Group, without having to iterate anything or deep-set flags.
InputHandler._pointerOverHandler and _pointerOutHandler have new arguments `silent` - if `true` then they will not dispatch any Signals from the parent Sprite.
2016-06-09 14:32:56 +01:00
photonstorm
e8e7e27184 The DisplayObject.renderOrderID used to run in reverse. I.e. in a display list with 10 sprites on it, the first sprite (at the bottom of the list, rendering behind all the others) would have a renderOrderID of 9, where-as the top-most sprite, rendering above all others, would have a renderOrderID of 0. While this didn't cause any side-effects internally, it's arguably illogical. So the process has been reversed, and renderOrderIDs are now accumulative, starting at zero each frame, and increasing as it iterates down the display list. So the higher the ID, the more "on-top" of the output the object is.
`InputHandler.validForInput` and `Pointer.processInteractiveObjects` have been updated to reflect the new `renderOrderID` sequence (see above).
2016-06-09 12:32:37 +01:00
Richard Davey
53c579a50c Merge pull request #2545 from fillmoreb/patch-3
Fix Phaser.Rectangle.aabb()
2016-06-09 11:30:19 +01:00
Upperfoot
bab2fac729 Resolved issue with tilemapLayer collision. 2016-06-08 23:52:56 +01:00
fillmoreb
3f5de71add Fixe Phaser.Rectangle.aabb()
Number.MIN_VALUE does not return the most negative number, but rather the smallest representable number above 0.  As a result, Phaser.Rectangle.aabb() did not work correctly when the points had negative values.
2016-06-08 16:14:30 -06:00
Craig Whiteside
212a07b9ac Fixed problem with missing parameter in tileCheckX and tileCheckY. 2016-06-07 14:00:34 +01:00
Richard Davey
1956d3584e InputHandler.dragStopBlocksInputUp is a boolean that allows you to control what happens with the input events. If false (the default) then both the onInputUp and onDragStop events will get dispatched when a Sprite stops being dragged. If true then only the onDragStop event is dispatched, and the onInputUp is skipped. 2016-06-07 02:21:12 +01:00
Richard Davey
913936f080 jshint fix. 2016-06-07 01:50:38 +01:00
Richard Davey
df92c45420 There are two new Phaser consts available, for help with orientation of games or Game Objects. They are Phaser.HORIZONTAL, Phaser.VERTICAL, Phaser.LANDSCAPE and Phaser.PORTRAIT. 2016-06-07 01:45:33 +01:00
Richard Davey
66b846cbdb InputHandler.dragDistanceThreshold gives you more fine control over when a Sprite Drag event will start. It allows you to specify a distance, in pixels, that the pointer must have moved before the drag will begin.
InputHandler.dragTimeThreshold gives you more fine control over when a Sprite Drag event will start. It allows you to specify a time, in ms that the pointer must have been held down for, before the drag will begin.

InputHandler.downPoint is a new Point object that contains the coordinates of the Pointer when it was first pressed down on the Sprite.
2016-06-07 01:28:06 +01:00
Craig Whiteside
7a1667fa7e Fixed typo on collision for TileMapLayers (lesson to triple check your code...) 2016-06-06 15:43:51 +01:00
Richard Davey
a180882d27 Fixed the data object not being created. 2016-06-06 00:31:46 +01:00
Richard Davey
de3d749385 Farthest swapped for the more common Furthest. 2016-06-05 23:01:00 +01:00
Richard Davey
1b67850c82 Merge pull request #2529 from TheJasonReynolds/local_dev
Set isPlaying to true if no marker (.play is not called again)
2016-06-05 15:51:43 +01:00
John Rees
e75827d6ab Signal description typo fix 2016-06-04 19:41:54 +01:00
Jason Reynolds
db0a41bedf Set isPlaying to true if no marker (.play is not called again) 2016-06-03 17:08:07 -05:00
photonstorm
1a67079ae7 Phew. Added TypeScript defs for the Weapon Plugin. Don't say I never do anything for you! 2016-06-03 17:11:08 +01:00
photonstorm
61f064dfe9 Docs update. 2016-06-03 16:45:47 +01:00
Richard Davey
d81ec7fa0f Merge pull request #2526 from drhayes/dev
Don't extend Phaser.Utils when doing deep copy in Phaser.Cache.getJSON.
2016-06-03 16:42:30 +01:00
Richard Davey
6c292a4607 Merge pull request #2525 from Upperfoot/dev
Adds missing fixedToCamera check in TilemapLayer.prototype._renderWebGL
2016-06-03 16:40:00 +01:00
photonstorm
a2d0aac9fd Docs finished. 2016-06-03 16:38:40 +01:00
photonstorm
93b1f3eba1 Math.between will return a value between the given min and max values. 2016-06-03 16:18:35 +01:00
David Hayes
8317563d27 Don't extend Phaser.Utils when doing deep copy in Phaser.Cache.getJSON. 2016-06-03 10:16:07 -05:00
Upperfoot
57e8a35226 Adds missing fixedToCamera check in Phaser.TilemapLayer.prototype._renderWebGL e4ea011353 2016-06-03 16:11:39 +01:00
photonstorm
ee6f277b31 PluginManager.remove has a new argument destroy (defaults to true) which will let you optionally called the destroy method of the Plugin being removed. 2016-06-03 15:52:17 +01:00
photonstorm
c73ccfbddb Lots more docs updates. 2016-06-03 15:51:06 +01:00
photonstorm
d2269c362d Docs update. 2016-06-03 15:20:11 +01:00
photonstorm
0da7cf5ffd There are a bunch of new Phaser consts available to help with setting the angle of a Game Object. They are Phaser.ANGLE_UP, ANGLE_DOWN, ANGLE_LEFT, ANGLE_RIGHT, ANGLE_NORTH_EAST, ANGLE_NORTH_WEST, ANGLE_SOUTH_EAST and ANGLE_SOUTH_WEST. 2016-06-03 15:19:18 +01:00
photonstorm
96711f4db9 Added the Weapon Plugin and worked lots on its docs. 2016-06-03 15:09:43 +01:00
Richard Davey
7ec02f79e4 Merge pull request #2520 from seanirby/patch-1
Update docstring for TimerEvent
2016-06-03 13:15:43 +01:00
photonstorm
0a5b2673ff JSHint fixes re: #2522 2016-06-03 13:14:59 +01:00
photonstorm
9ae43757b9 Group.removeAll has a new argument destroyTexture which allows you to optionally destroy the BaseTexture of each child, as it is removed from the Group (thanks @stoneman1 #2487) 2016-06-03 13:11:03 +01:00
photonstorm
ae5be7ac92 Merging in the new Weapon Plugin. 2016-06-03 13:00:45 +01:00
photonstorm
84c60d4e87 Within RequestAnimationFrame both updateRAF and updateSetTimeout now only call game.update if isRunning is true. This should avoid asynchronous Game destroy errors under environments like Angular (thanks @flogvit #2521) 2016-06-03 13:00:45 +01:00
Richard Davey
05ca827c2b Merge pull request #2522 from Upperfoot/master
Fixing tileMap collision when tileMapLayer is set to a position other than 0,0
2016-06-03 12:45:37 +01:00
photonstorm
e4ea011353 TilemapLayer now adheres to fixedToCamera should it be disabled #2482 2016-06-03 12:13:01 +01:00
Sean Irby
3c2003365d Update docstring for TimerEvent
I think the TimerEvent lifecycle could use some clarification so I updated the docstring to explain what happens when they are finished firing.
2016-06-02 17:47:31 -07: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
Richard Davey
45bd98ee18 Fixed issue with camera target sync. 2016-06-02 23:20:46 +01:00
Richard Davey
645a614326 Stage has had all of its core update loops modified, so they now iterate through the display list forwards, instead of in reverse. Stage.postUpdate is now also a lot smaller, with no conditional branching if there is a Camera Target or not. 2016-06-02 22:45:31 +01:00
Richard Davey
c822cda452 TilemapLayer.postUpdate could potentially be called several times per frame (depending on device frame rate), which would cause multiple texture redraws, even though only the last texture is used during rendering. This has now been modified so that the local TilemapLayer canvas is only re-rendered once per frame, during the rendering phase, and not during the logic update phase. 2016-06-02 22:44:24 +01:00
Richard Davey
c4f4ceef42 Code format fix. 2016-06-02 22:41:58 +01:00
Richard Davey
09d09aaf84 Removed the updateTransform calls from the frame loop, because it happens automatically as part of Game.updateLogic anyway, so was duplicating the workload for no reason. 2016-06-02 22:41:03 +01:00
Richard Davey
eb1c61826c The camera now divides its effects (like shake and fade) updates, and the updateTarget into two separate functions. 2016-06-02 22:40:30 +01:00
photonstorm
68c29470cf The way the display list updates and Camera movements are handled has been completely revamped, which should result is significantly smoother motion when the Camera is following tweened or physics controlled sprites. The Stage.postUpdate function is now vastly reduced in complexity. It takes control over updating the display list (calling updateTransform on itself), rather than letting the Canvas or WebGL renderers do this. Because of this change, the Camera.updateTarget function uses the Sprites worldPosition property instead, which is now frame accurate (thanks @whig @Upperfoot @Whoisnt @hexus #2482) 2016-06-02 16:38:21 +01:00
Richard Davey
8da3395407 Merge pull request #2471 from cwleonard/gamepad
Gamepad problems in Google Chrome
2016-06-02 15:46:03 +01:00
photonstorm
a81fe3cf02 jshint fixes. 2016-06-02 15:38:05 +01:00
photonstorm
63a1336bd5 Sound.addMarker now has a default value for the duration argument (1 second) to avoid the DOM Exception 11 error if you accidentally miss it out (thanks @mari8i #2508) 2016-06-02 15:29:51 +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
photonstorm
dfa8b9dedc Refactored Group.getClosestTo and Group.getFurthestFrom. 2016-06-02 15:11:23 +01:00
photonstorm
a52bbf621b Added missing property. 2016-06-02 15:02:44 +01:00
Richard Davey
837d3cba46 Merge pull request #2505 from gotenxds/ReverseAnimation
Added a reverse functionality to animations.
2016-06-02 15:01:57 +01:00
Richard Davey
f67d304e99 Merge pull request #2504 from Nuuf/master
added functions for getting closest child and farthest child
2016-06-02 14:58:09 +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
Richard Davey
d18c591c15 Merge pull request #2499 from kevinleedrum/2496
Fixing issue #2496: Wrapped BitmapText not centering
2016-06-02 14:51:09 +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
gotenxds
7fc34c117c Reverse and reverseOnce will now return the animation to allow linking. 2016-05-31 20:29:02 +03:00
gotenxds
b34860c89b Reverse and reverseOnce will now return the animation to allow linking. 2016-05-31 20:27:55 +03:00
Vitaliy
cd3742f9f2 Corrected intersects fuction
Added protection against incorrect handling collisions. Clashes with the body itself will not be processed.
2016-05-31 01:18:17 +03:00
Gustav
5a1cb006ec beautified 2016-05-28 00:27:35 +02:00
gotenxds
d243da7a1b Small fix, should check for -1 not 0 2016-05-27 21:37:56 +03:00
gotenxds
ae3ebf00cd Added typescript defs; Fixed jshint. 2016-05-27 18:04:33 +03:00
gotenxds
d4636e9e81 Added a reverseOnce method. 2016-05-27 17:58:54 +03:00
gotenxds
b0c4f3bc4c Added a convenient function. 2016-05-27 17:48:06 +03:00
gotenxds
bb7cbb36f6 If animation is reversed it should start from last frame. 2016-05-27 17:43:36 +03:00
gotenxds
2c752a25c2 Deleted whitespace. 2016-05-27 15:55:46 +03:00
John Doe
911d345571 Merge remote-tracking branch 'origin/ReverseAnimation' into ReverseAnimation
Conflicts:
	src/animation/Animation.js
	typescript/phaser.comments.d.ts
	typescript/phaser.d.ts
2016-05-27 15:46:57 +03:00
John Doe
ce17ac9902 Added a reverse functionality to animations. 2016-05-27 15:44:32 +03:00
John Doe
11805b311d Added a reverse functionality to animations. 2016-05-27 02:24:23 +03:00
Gustav
5b4b41c958 added functions for getting closest child and farthest child 2016-05-26 21:51:56 +02:00
Pete Baron
0904e386de Use firstgid (TODO: assumes tileset 0 currently, needs to calculate the correct tileset) to fix the 'out by one' tilemap example errors.
Handle empty VBO case, and make sure we only drawArrays the correct number of vertices (to fix the large corrupt block in the top-right corner of many example demos).
2016-05-26 14:13:07 +12:00
Pete Baron
0dd3610ee4 Minor optimisation in TilemapLayerGL to remove unnecessary loop. 2016-05-26 14:10:45 +12:00
kevinleedrum
c1a2970488 Fixing issue #2496: Wrapped BitmapText not centering 2016-05-24 09:09:38 -04:00
photonstorm
07ef075e92 Phaser.Line.intersectsRectangle checks for intersection between a Line and a Rectangle, or any Rectangle-like object such as a Sprite or Body. 2016-05-24 02:30:00 +01:00
photonstorm
c1c2e6bc9d Removed left-over Body.isCircle checks. 2016-05-23 23:02:04 +01:00
photonstorm
e974ff4ee9 Removed Circle functions and updated setSize docs. 2016-05-23 13:16:21 +01:00
photonstorm
9b9e398c73 InputHandler.checkPointerDown had an incorrect single pipe character |, instead of an OR check ||, and an isDown check, causing Button Over events to fail (thanks @pengchuan #2486) 2016-05-23 13:03:11 +01:00
photonstorm
16e9acac84 Updated Body.reset call. 2016-05-23 12:54:41 +01:00
photonstorm
8743e8952c Reverted worldScale calculation. 2016-05-23 12:54:33 +01:00
photonstorm
09dd84565e Arcade Physics Body incorrectly positioned if the Sprite had a negative scale (see http://www.html5gamedevs.com/topic/22695-247-248-body-anchoring-any-migration-tips/) (thanks @SBCGames @icameron @Nuuf @EvolViper #2488 #2490) 2016-05-23 12:46:01 +01:00
photonstorm
7844ad927c Preparing for 2.4.9 dev. 2016-05-23 12:32:37 +01:00
Pete Baron
a9bf339efd Fully working sci-fly demo using a single gl draw to blit all of the tiles at once. Theoretically extremely fast (requires testing). Works here in FireFox and Chrome at 60 fps on an i7 4770 with Nvidia 780 GTX drawing typically 1989 tiles per frame. 2016-05-23 21:09:13 +12:00
Pete Baron
1b7eaadd06 First (nearly) working batch drawing test. Instead of pushing rectangles as pairs of triangles individually, this version creates a vertex buffer object for all visible tile rectangles, with degenerate triangles separating each one from the next. The drawing is done by a single call to gl.drawArrays.
Bizarrely, this version still chokes in Firefox, implying that the previous demo's horrible performance was not down to the GPU blocking as the rectangles are sent to it.

The test is not fully working because it does not scroll the drawing position. So instead of the map moving when you hit a scroll boundary, it simply stops drawing the top or left edges as the scroll region moves away from the visible window.  It's an easy fix, but I think I'll leave it until I find out exactly why Firefox still chokes on this demo.

Progress text file updated with latest experiments and progress today.
2016-05-23 17:48:54 +12:00
photonstorm
d1234d1685 Preparing for 2.5.0 dev. 2016-05-19 13:45:51 +01:00
photonstorm
9f28d0659d Phaser 2.4.8 release. 2016-05-19 12:36:51 +01:00
Upperfoot
4a3e8f2b4a Take into consideration Tilemap position into collision 2016-05-19 11:06:49 +01:00
Upperfoot
55700e4fec Take into account position of tilemap in collision 2016-05-19 08:47:31 +01:00
zeterain
cd188ed0ab Update Documentation in Game.js
Updated the documentation in Game.js to indicate that the renderType property could be set to Phaser.HEADLESS.
2016-05-18 10:56:44 -06:00
photonstorm
a6a2c61240 Sprites that had a tint on them, that then had their frame changed via either Sprite.frame or Sprite.frameName wouldn't re-tint the new frame, and would become stuck on the old frame in Canvas mode (thaks @spayton #2453) 2016-05-17 21:04:40 +01:00
photonstorm
d161a7f6bc Sounds played using the Audio tag, set to loop, would get caught in an endless pause-play loop cycle (thanks @rroylance #2473) 2016-05-17 16:43:11 +01:00
photonstorm
7018ca2132 Position in Body.reset #2470 2016-05-16 15:20:44 +01:00
photonstorm
54683b7fb2 Sounds played using the Audio tag, that were paused and then resumed again (either directly in code, or via a game pause event) would not resume from the point at which they paused (thanks @rroylance #2473) 2016-05-16 15:16:19 +01:00
photonstorm
02e8b1ae0a If you set Game.renderType to Phaser.HEADLESS it will no longer render the output to the canvas. The canvas is still created (although not added to the DOM), as it's required internally, but no rendering now takes place on it (thanks @ForgeableSum #2464) 2016-05-16 14:53:11 +01:00
photonstorm
ac89d1aec7 Arcade Physics Body has a new property worldBounce. This controls the elasticity of the Body specifically when colliding with the World bounds. By default this property is null, in which case Body.bounce is used instead. Set this property to a Phaser.Point object in order to enable a World bounds specific bounce value (thanks @VitaZheltyakov #2465) 2016-05-16 13:53:12 +01:00
photonstorm
f9994fac75 Fixed a bug in Arcade Physics Body.preUpdate which would incorrectly apply the position of an offset Body (one which has had Body.setSize used on it) when combined with a Sprite with a non-zero anchor (thanks @SBCGames #2470) 2016-05-16 13:39:46 +01:00
photonstorm
19dce62734 Arcade Physics has had a new world argument added to the following functions: distanceBetween, distanceToXY, distanceToPointer, angleBetween, angleToXY and angleToPointer. The argument (which is false by default), when enabled will calculate the angles or distances based on the Game Objects world property, instead of its x and y properties. This allows it to work for objects that are placed in offset Groups, or are children of other display objects (thanks @Skeptron for the thread #2463) 2016-05-16 13:31:57 +01:00
Richard Davey
6eca457877 Merge pull request #2476 from staff0rd/generate_texture
fix generateTexture return type
2016-05-16 12:56:27 +01:00
photonstorm
4fd2524c61 Text.setStyle has a new argument update which will optionally automatically call updateText after setting the new style (thanks @staff0rd #2478) 2016-05-16 12:55:27 +01:00
Pete Baron
5c6ad9cbcb Fix double subtraction error. 2016-05-13 14:34:24 +12:00
Pete Baron
e396c266b8 Use the correctly scaled scrollX, scrollY parameters for the scroll offsets.
This makes the layers in "blank tilemap" example work properly (you'll need to click the 3rd tile in the palette before drawing becomes visible - that's next up)
2016-05-13 14:13:51 +12:00
Pete Baron
5be5ddba25 Protect against zero and negative indexes (-1 is used in e.g. "blank tilemap" example). 2016-05-13 14:06:58 +12:00
Pete Baron
49b3d1a57a Temporary modification to force webgl renderer without needing to edit all the example files. 2016-05-13 14:06:08 +12:00
Pete Baron
e0008793bd Prepare Phaser.Tilemap for testing other examples/tilemaps with the TilemapLayerGL code.
Ensure that TilemapLayerGL is treated as a valid layer the same as TilemapLayer.

TODO: I've hardwired the PIXI TilemapLayerGL test flag (pixiTest) to be 'on' unless otherwise specified... need to turn this off before final commits!
2016-05-13 12:24:55 +12:00
Pete Baron
a98d0e8e70 First pass of 'clean-up': correcting comments, removing unused code 2016-05-13 12:06:18 +12:00
Pete Baron
4cfcb3b7bd Implemented _renderMode switch and _renderVisibleTiles functionality. This speeds up the sci-fly demo hugely. 2016-05-13 11:37:33 +12:00
Pete Baron
0855e59972 Added _renderMode to switch between full-map redrawing and visible screen redrawing modes. 2016-05-13 11:36:12 +12:00
stafford
e6b9ca4e22 fix generateTexture return type 2016-05-12 15:30:33 +10:00
photonstorm
f34b567295 BitmapData.copy, and by extension any method that uses it, including BitmapData.draw, drawGroup and drawFull, now all support drawing RenderTexture objects. These can either be passed directly, or be the textures of Sprites, such as from a call to generateTexture. 2016-05-12 03:48:14 +01:00
photonstorm
85d5d9715d Removed, this has gone to its own branch. 2016-05-11 16:38:56 +01:00
photonstorm
1d18c70371 BitmapData.drawGroupProxy is now capable of iterating through Sprites that have children, and also now uses the world positions for drawing instead. 2016-05-11 16:38:42 +01:00
photonstorm
74af2079b6 Swap to use worldScale instead of worldTransform. 2016-05-11 16:37:31 +01:00
photonstorm
621673b9ca Revert worldScale setter. 2016-05-11 16:37:21 +01:00
photonstorm
815907184a Typo fix. 2016-05-11 16:37:01 +01:00
photonstorm
9649f714bb InputHandler.checkPointerDown and checkPointerOver will now test the worldTransform scale property of a Sprite. If zero it will fast return, where-as before it would incorrectly report an up event (thanks @jaapaurelio #2466) 2016-05-11 12:25:35 +01:00
photonstorm
368913fd98 Removed WebGL Tilemap renderer, has moved to its own branch to be part of 2.5.0. 2016-05-11 11:27:36 +01:00
photonstorm
16203a378a PIXI.defaultRenderer is now set to null in Game.destroy, allowing it to be reset if a new Game instance is created on the same page (thanks @xtforgame ##2474) 2016-05-11 11:27:36 +01:00
Casey Leonard
9ede913609 gamepad bugs in Chrome
fixes issues with being unable to connect a gamepad in Chrome and losing
the gamepad when focus is lost to the game
2016-05-07 19:07:16 -04:00
Pete Baron
5e97f10c86 Remove un-needed mixin components leaving only FixedToCamera (not sure about this one). Move this.fixedToCamera after the Core.init call which creates the underlying core components required. Add temporary instant return from shiftCanvas in case that was being called and contributing to the slow-down (probably not). 2016-05-05 17:00:22 +12:00
Pete Baron
ef4143136e Use this.x, this.y as scrolling offsets when rendering each tile. 2016-05-05 16:57:55 +12:00
Pete Baron
69abe492cc Modified Phaser.Tilemap and PIXI.Tilemap to support the new Phaser.TilemapLayerGL objects.
The PIXI file has a reverse dependency on Phaser for it's 'layer' parameter which contains a Phaser.Tilemap (which holds the map data).  The other changes adapt it to the new data source (previously this expected a raw JSON object encoded like the Mario.json map is).

The Phaser file now keeps a reference to the data parsed from the original map, and adds a branch in createLayer to build a TilemapLayerGL instead of a TilemapLayer.
2016-05-05 15:58:03 +12:00
Pete Baron
ad04676980 New class: duplicate of Phaser.TilemapLayer modified to access the new PIXI.Tilemap WebGL based tile renderer.
This is just the first test which actually produces some visible output (the map is drawn for the "sci fly" demo example, if you adjust line 27 of that source file to: layer = map.createLayer(0, undefined, undefined, undefined, true);
The new terminal "true" parameter instructs Phaser.Tilemap.createLayer to create a TilemapLayerGL object instead of the usual Phaser.TilemapLayer.
2016-05-05 15:52:26 +12:00
photonstorm
45118e7a60 Docs fix. 2016-05-04 23:34:15 +01:00
Pete Baron
eb77949f63 Strip down PIXI.Tilemap to remove all unused code.
Add very simple tilemap render function to draw every layer, every tile, for the tiles provided.
Link to the TilemapShader and get the whole thing working.
2016-05-05 10:29:51 +12:00
Pete Baron
9deb07c3aa Modify this shader to draw a simple textured rectangle using a two-tri strip, extremely quickly due to simplicity. 2016-05-05 10:28:12 +12:00
photonstorm
1adece490a Docs update. 2016-05-04 02:02:13 +01:00
photonstorm
7afe087c3d Docs fix. 2016-04-29 17:46:44 +01:00
photonstorm
7332dd8028 Custom WebGL Tilemap renderer POC displaying textures. It's a start. 2016-04-28 00:18:09 +01:00
photonstorm
16378713b4 JSDocs update (#249) 2016-04-27 12:57:41 +01:00
photonstorm
d55b0c9e51 Tilemap update. 2016-04-27 03:38:07 +01:00
photonstorm
b10c8858c3 Tilemap shader WIP. 2016-04-27 03:02:13 +01:00
photonstorm
f494c867c7 Fixed an issue in the Arcade Physics overlap method where it would only detect overlaps up to the max bias threshold and no further (thanks @rgk #2441)
The Arcade Physics overlap method would return false if two bodies were overlapping but neither had any velocity (i.e. they were embedded into each other)
2016-04-25 11:38:51 +01:00
Richard Davey
74d52dd327 Merge pull request #2443 from drhayes/dev
Add a "shakeIntensity" property to Camera.
2016-04-23 04:34:08 +01:00
photonstorm
6bc93de7a5 Preparing for 2.4.8 dev. 2016-04-23 04:32:47 +01:00
David Hayes
fb709fe728 Add a "shakeIntensity" property to Camera.
This would allow tweening the intensity of the Camera shake over the
lifetime of the shaking.
2016-04-22 19:53:52 -05:00
photonstorm
a29cc64932 Phaser 2.4.7 Final. 2016-04-22 15:15:28 +01:00
photonstorm
002d6250a8 Docs update. 2016-04-21 00:48:54 +01:00
photonstorm
3d6b1a3b7e Stopped the Camera Shake effect from changing the World position, as it screws up Arcade Physics, Sprite deltas and some input handling. Instead moved the effect to be render applied only. On Canvas it updates the context.setTransform call, and on WebGL the renderSession offset property. 2016-04-19 04:12:58 +01:00
photonstorm
62d135cf1f Small tidy-up. 2016-04-19 03:39:04 +01:00
photonstorm
7d9c817373 Dragging a Sprite while the camera was moving would slowly cause the Sprite position to become out of sync the further the camera moved. A Sprite being dragged now tracks the camera position during the drag update and adjusts accordingly (thanks @jeroenverfallie #1044) 2016-04-19 01:54:24 +01:00
photonstorm
628dd1c420 P2.Body.offset is now used and applied to the Sprite position during rendering. The values given are normal pixel values, and offset the P2 Body from the center of the Sprite (thanks @Mourtz #2430) 2016-04-18 20:57:41 +01:00
photonstorm
a2d145a43d When the Loader loads audio via the Audio tag, instead of Web Audio, it used to use Phaser.GAMES[_this.game.id].load as the callback handler, which would stop it from working if you had multiple Loaders set-up within Phaser. It now uses a local reference to _this instead (thanks @SBCGames #2435) 2016-04-18 16:44:28 +01:00
photonstorm
41f81d39b7 jsdocs update (and removed isCircle switch) 2016-04-18 16:17:47 +01:00
photonstorm
257a22b170 When loading Video with the asBlob argument set it now uses a 'blob' type for the XHR loader, and doesn't cast the resulting file as a Blob upon load. This fixes loading videos as blobs on Chrome for Android (thanks @JuCarr #2433) 2016-04-18 16:17:27 +01:00
photonstorm
41add1b4bf Phaser 2.4.7 RC1. 2016-04-14 13:23:44 +01:00
photonstorm
ac4acfb912 Removed Arcade Physics Circle support (now in its own branch) ready for 2.4.7 release. 2016-04-14 13:23:28 +01:00
photonstorm
4d8753e9ce Tidying up for 2.4.7. 2016-04-14 12:57:05 +01:00
photonstorm
aad499b025 Tidying up the code base for 2.4.7. 2016-04-14 12:43:10 +01:00
photonstorm
5221bfd5da You can now pass in your own Canvas element to Phaser and it will use that instead of creating one itself. To do so you must pass a Game Configuration object to Phaser when you instantiate it, and set the canvas property of the config object to be the DOM element you wish to use, i.e.: { canvas: document.getElementById('yourCanvas') } (thanks @Friksel #2311) 2016-04-14 11:57:10 +01:00
Lewis Pollard
719b4bb7f6 Alter BitmapText to use toString on text parameter in constructor
The BitmapText property accessor for the text property uses toString on the value passed in, meaning Numbers can be passed in as the text value with no problem. However, passing a Number into the constructor results in the following exception as it isn't implicitly converted to a string in a similar manner.

phaser.js:71890 TypeError: text.substr is not a function
    at Phaser.BitmapText.updateText (http://localhost/phaser/build/phaser.js:56283:21)
    at new Phaser.BitmapText (http://localhost/phaser/build/phaser.js:56034:10)
    at Phaser.GameObjectFactory.bitmapText (http://localhost/phaser/build/phaser.js:46318:26)
    at Object.Boot.create (http://localhost/phaser/:46:34)
    at Phaser.StateManager.loadComplete (http://localhost/phaser/build/phaser.js:29240:35)
    at Phaser.Loader.finishedLoading (http://localhost/phaser/build/phaser.js:71446:25)
    at Phaser.Loader.processLoadQueue (http://localhost/phaser/build/phaser.js:71403:18)
    at Phaser.Loader.asyncComplete (http://localhost/phaser/build/phaser.js:71476:14)
    at Phaser.Loader.xmlLoadComplete (http://localhost/phaser/build/phaser.js:72413:14)
    at .<anonymous> (http://localhost/phaser/build/phaser.js:72236:34)

This simply mimics the logic in the property accessor by running toString on the text value and using an empty string if null to allow Numbers to be passed into the constructor.
2016-04-13 15:24:29 +01:00
Richard Davey
358cc6b8d0 Merge pull request #2428 from EJanuszewski/radToDeg-typo
Fix typo in Math radToDeg description
2016-04-13 14:18:18 +01:00
photonstorm
f4277efc20 Alternative snooker-ball like collision test. 2016-04-11 16:43:17 +01:00
photonstorm
a193ad557e Fixed jsdocs #2418 2016-04-11 08:55:24 +01:00
photonstorm
7102a34706 Camera.flash is a new function that makes the camera 'flash' over the top of your game. It works by filling the game with the solid fill color specified, and then fading it away to alpha 0 over the duration given. This is great for things like hit effects. You can listen for the Camera.onflashComplete Signal.
Camera.fade is a new function that makes the camera fade to the color given, over the course of the duration specified. This is great for things like transitioning from one State to another. You can listen for the Camera.onFadeComplete Signal.

Camera.resetFX resets any active FX, such as a fade or flash and immediately clears it. Useful to calling after a fade in order to remove the fade from the Stage.

Phaser.Camera.ENABLE_FX is a const that controls if the Camera FX are available or not. It's `true` by default, but if you set it to `false` before boot then it won't create the Graphics object required to process the effects.
2016-04-09 04:05:07 +01:00
photonstorm
2ea94c83e6 Camera.shake is a new function that creates a camera shake effect. You can specify the intensity, duration and direction of the effect. You can also set if it should shake the camera out of bounds or not. 2016-04-09 02:57:16 +01:00
photonstorm
0b0a5d44cc Camera shake working and documented. 2016-04-09 02:49:18 +01:00
photonstorm
a916812db1 Camera shake support. 2016-04-09 02:01:45 +01:00
photonstorm
9e803fff7c Small fix. 2016-04-09 01:10:31 +01:00
photonstorm
dba84d5931 Camera has a new property: lerp. This is a Point object, that allows you to control the amount of horizontal and vertical smoothing to be applied to the camera when it tracks a Sprite. It works both with and without deadzones, and is turned off by default. Set it to low values such as 0.1 for really smooth motion tracking (thanks to @WombatTurkey for the idea of adding this) 2016-04-09 01:07:19 +01:00
photonstorm
b9fab96471 Improved docs. 2016-04-09 00:25:56 +01:00
photonstorm
3c4e63fda5 World.separateCircle is working with circle vs. circle bodies. 2016-04-08 03:37:49 +01:00
photonstorm
d009b8d769 Circle vs. Circle rebound code started. 2016-04-07 19:32:27 +01:00
photonstorm
cc5361dd6d World.separate has been optimized to cut down on the number of calls to intersect from 3 calls per Game Object collision check, to 2. So if you were colliding 50 sprites it will reduce the call count from 150 to 100 per frame. It also reduces the calls made to seperateX and seperateY by the same factor.
Two immovable bodies would never set their overlap data, even if an overlap only check was being made. As this is useful data to have this has been changed. Two immovable bodies will still never separate from each other, but they _will_ have their `overlapX` and `overlapY` properties calculated now.
2016-04-07 18:04:45 +01:00
photonstorm
50e126f59e * Body has two new properties: left and top. These are the same as Body.x and Body.y but allow you to pass the Body to geometry level functions such as Circle.contains.
* Body.setCircle allows you to define a Body as using a circle to collide with instead of a rectangle. You can set the radius of the collision circle and an offset.
* Body.render now renders both circle and rectangle body shapes to the Debug canvas.
* World.intersects has been updated to support both circle and rectangle body shapes, and supports quick-paths for circle vs. circle and rect vs. rect checks.
* World.circleBodyIntersects is a new method that checks for intersection between a Body that has been defined as a circle, and a normal rectangle based Body. This is used internally by World.intersects, but exposed for direct calls as well.
2016-04-07 17:01:16 +01:00
photonstorm
b162ca4d51 Improved Math.clamp and docs. 2016-04-07 16:14:44 +01:00
photonstorm
952b5c04ea The start of Arcade Physics circle bodies. 2016-04-07 14:32:53 +01:00
photonstorm
b9f62e77e6 You can now pass a TilemapLayer as a Texture to a TileSprite. A limitation of this is that if you pass it to a TileSprite it will make a fill pattern from the TilemapLayer at that instant it's passed, and it won't keep track of the layer in future should it update (thanks @jdnichollsc #1989) 2016-04-07 03:45:21 +01:00
photonstorm
e4a505d4b6 Lots of new Signals documentation. 2016-04-07 02:44:29 +01:00
photonstorm
e5ceb7e9bc P2.World.setBounds has been re-written completely. If the World is resized it no longer removes the P2 body instances and re-creates them. Instead it checks to see which walls are required and then just moves the position of the shapes instead, or updates them, or creates or destroys them as required. This is far more efficnent, especially in a game which see's a lot of world bounds changes (i.e. resizes responsively in browser) 2016-04-07 01:56:42 +01:00
photonstorm
5c261821fe P2.World.updateBoundsCollisionGroup didn't set the _boundsOwnGroup private var, meaning the World.setBounds method wasn't able to restore previously set collision masks automatically (thanks @jmp909 #2183) 2016-04-07 01:25:52 +01:00
photonstorm
4d5a037ae5 P2.World.updateBoundsCollisionGroup wouldn't use the boundsCollisionGroup mask if you passed true as the argument, only if it was left undefined. 2016-04-07 01:18:19 +01:00
photonstorm
58af40ca92 Added a bit more info to the SoundManager docs re: #2373 2016-04-07 01:07:19 +01:00
photonstorm
787111c12c A Game Object with fixedToCamera = true that was then set for Input, and enabled for dragging from its center (input.enableDrag(true)) would throw an error upon being dragged (thanks @solusipse #2367) 2016-04-07 00:44:53 +01:00
photonstorm
fc7b5c79e3 Graphics objects can now have a Physics Body directly attached to them, where-as before it would throw an error due to a lack of anchor property (thanks @NLilley #2400) 2016-04-07 00:14:41 +01:00
photonstorm
0945083a4b Removed further mentions of RenderTexture re: TileSprite. 2016-04-06 23:58:34 +01:00
photonstorm
b3757ed862 jsdocs update #2384 2016-04-06 02:33:29 +01:00
photonstorm
896b32a28c SoundManager.muteOnPause is a new boolean that allows you to control if the Sound system gets muted automatically when a Phaser game pauses, such as when it loses focus. You may need to set this to false if you wish to control the audio system from outside of your Phaser game, i.e. from DOM buttons or similar (#2382) 2016-04-06 02:09:22 +01:00
photonstorm
61bc4a8dca Sound.play when using an AudioTag would ignore the muted state of the SoundManager and play regardless. It now checks the SoundManager.mute state on play, and sets the volume accorindingly (thanks @brianbunch #2139) 2016-04-06 01:41:54 +01:00
Richard Davey
8e74f4d06e Merge pull request #2187 from BdR76/patch-1
Bugfix, reuse emitter when parameter explode=false
2016-04-06 01:28:49 +01:00
Richard Davey
2f0231b3cd Merge pull request #2415 from jakewilson/dev
Fixed and added warnings.
2016-04-06 01:21:09 +01:00
photonstorm
988290631f When setting a global volume for the SoundManager it would previously incorrectly calculate the volumes of AudioTag based Sound objects that were not played at volume 1. The new approach uses Sound.updateGlobalVolume which adjusts the Sound volume to be a percentage of the global volume. So if the global volume is 0.5 and the Sound volume is 0.5, the Sound will play with an actual volume of 0.25 (thanks @VitaZheltyakov #2325) 2016-04-06 01:19:32 +01:00
Richard Davey
71056ccb69 Merge pull request #2371 from stoneman1/dev
Fixed video for future
2016-04-06 01:08:22 +01:00
photonstorm
4d69b13977 Passing a BitmapData to a TileSprite as a texture would fail if the BitmapData had not been previously added to the cache. It now uses the new frameData property (thanks @mzamateo @lucap86 #2380) 2016-04-06 00:44:55 +01:00
photonstorm
c33b53fa95 BitmapData has a new property frameData which is a Phaser.FrameData container instance. It contains a single Frame by default, matching the dimensions of the entire BitmapData, but can be populated with additional frames should you wish to create animations from dynamic BitmapData textures. 2016-04-06 00:43:21 +01:00
photonstorm
18c0b150b5 FrameData.destroy will nullify the local arrays used to contain Frame instances. 2016-04-06 00:43:09 +01:00
photonstorm
0c2ac47981 Camera.position would return the view rectangles centerX/Y coordinates, instead of view.x/y (which is what Camera.x/y returns), so it has been updated to return view.x/y instead (thanks @kamparR #2120) 2016-04-06 00:18:01 +01:00
photonstorm
ecbff44354 Group.getByName searches the Group for the first instance of a child with the name property matching the given argument. Should more than one child have the same name only the first instance is returned. 2016-04-05 23:59:05 +01:00
photonstorm
65f8f111c8 Game.forceSingleUpdate is now true by default. 2016-04-05 23:40:15 +01:00
photonstorm
b762e1dc55 Added jsdocs warning re: #2045 2016-04-05 23:28:02 +01:00
photonstorm
4c3a30a6f6 PluginManager.destroy is now called by Game.destroy. 2016-04-05 23:16:52 +01:00
photonstorm
6933b41e6f Arcade.Body's speed property was only set when the body moved, it now updates regardless (thanks @mark-henry #2417) 2016-04-05 23:06:57 +01:00
photonstorm
aee0212e11 Camera.follow now uses the Targets world property to seed the camera coordinates from, rather than its local position. This means Sprites that are members of offset Groups, or transformed display lists, should now be followed more accurately (thanks @rbozan #2106) 2016-04-05 23:04:31 +01:00
photonstorm
8ad7b25595 The Debug canvas now listens for the ScaleManager.onSizeChange signal and resizes itself accordingly when running under WebGL. This means if your game size changes the Debug canvas won't be clipped off (thanks @francisberesford #1919) 2016-04-05 21:52:11 +01:00
photonstorm
7b803135c8 Updated jsdocs for getBounds (#2406) 2016-04-05 21:13:04 +01:00
Jake Wilson
96a79cd91a Added warning if physics body is enabled on unknown physics system. 2016-04-05 11:23:17 -04:00
photonstorm
b3e6381a9e Tween.update wouldn't dispatch an onLoop signal for Tweens with just one child, such as those created via Tween.to with -1 as the repeat value (thanks @ForgeableSum #2407) 2016-04-05 01:11:50 +01:00
photonstorm
917d9c7060 TweenData.repeatTotal is a new property that keeps track of the total number of times the Tween should repeat. If TweenData.start is called, as a result of the Tween repeatCount being > 0 then the child tween resets its total before re-starting. 2016-04-05 01:06:05 +01:00
photonstorm
f9949166be Text that used fonts which had numbers in their names wouldn't be correctly rendered unless you explicitly set the font property after creation. You can now pass font names with numbers in them as the font style object correctly (thanks @And-0 #2390) 2016-04-04 23:20:04 +01:00
Jake Wilson
ca13a82acb Added Tileset name to tile size warning. 2016-04-04 18:10:53 -04:00
photonstorm
bc4b828b51 BitmapData.copy, and by extension draw, drawFull, drawGroup, etc, would incorrectly handle drawing a tinted Sprite if it was using a frame from a texture atlas (thanks @PhaserDebugger #2405) 2016-04-04 22:53:13 +01:00
photonstorm
f40cfbe2ae 2015 - 2016. 2016-04-04 22:16:16 +01:00
photonstorm
12f3bd6cc5 The Destroy component will now call TweenManager.removeFrom, removing any active tweens from the TweenManager upon the Game Objects destructions (thanks @PokemonAshLovesMyTurkeyAndILikeYouTwo #2408)
Tween.update will now return `false` (flagging the Tween for destruction) should the Tween.target property every become falsey. This can happen if the object the Tween was tracking is destroyed, nulled or generally removed..
2016-04-04 22:06:16 +01:00
photonstorm
d6942991bc Docs update (in light of browser extensions causing us grief) 2016-04-04 22:06:15 +01:00
Richard Davey
8e880eddee Merge pull request #2402 from jakewilson/dev
Added ability to kill a Game Object when it leaves camera bounds.
2016-04-04 21:52:30 +01:00
Richard Davey
4298b2caae Merge pull request #2368 from Weedshaker/patch-2
AudioBufferSourceNode - same issue as on play:
2016-04-04 21:48:20 +01:00
photonstorm
63b3b3e887 Negative lineSpacing in Text objects will no longer crop the bottom pixels off lines of text (thanks @gaelenh #2379 #2374) 2016-04-04 21:36:37 +01:00
Richard Davey
3c3ca5b515 Merge pull request #2394 from zeterain/patch-5
Check for sprite destruction in onInputDown event.
2016-04-04 21:29:59 +01:00
photonstorm
f9ff892510 Formatting. 2016-04-04 21:25:21 +01:00
Richard Davey
07adad9ae8 Merge pull request #2395 from sergey7c4/dev
Fixed issue #2317
2016-04-04 21:20:01 +01:00
Richard Davey
1528d54a38 Merge pull request #2397 from rblopes/remove-from-hash-issue
Ensure a parent container is a Group before removing from its hash.
2016-04-04 20:47:31 +01:00
Richard Davey
d3e8509f0e Merge pull request #2410 from slashman/limitWrappedTextToMaxLines
Add "maxLines" style attribute to Text object.
2016-04-04 20:44:35 +01:00
Richard Davey
04ed512612 Merge pull request #2383 from CptSelewin/patch-2
Fix tinting issue when loading textures
2016-04-04 17:15:18 +01:00
Richard Davey
4925080781 Merge pull request #2381 from englercj/dev
Fix typo in componentToHex
2016-04-04 17:09:56 +01:00
Richard Davey
3446733696 Merge pull request #2399 from thiagojobson/patch-1
Fixed links in documentation
2016-04-04 17:08:38 +01:00
Richard Davey
2c87d14ede Merge pull request #2412 from MannyC/keep_tiled_layer_encoding_synced
Remove encoding metadata from Tiled json if data has already had its …
2016-04-04 17:07:31 +01:00
MannyC
7178b7abf4 Remove encoding metadata from Tiled json if data has already had its encoding removed. 2016-04-03 23:33:38 +01:00
MannyC
b29a77f4a4 Detect if layer compression is used in a Tiled layer. Display warning and skip layer. 2016-04-03 23:17:41 +01:00
slash
fbdf8073ad Add "maxLines" style attribute to Text object, maximum number of lines
to be shown for wrapped text or 0 for no limit. (default).
2016-04-03 10:08:35 -05:00
Edward Januszewski
a9e4d956b3 Fix typo in Math radToDeg description 2016-03-29 21:14:55 +01:00
Jake Wilson
ae663f97aa Added ability to kill a Game Object when it leaves camera bounds. 2016-03-28 20:34:00 -04:00
thiagojobson
58817869dc Fixed links in documentation 2016-03-25 18:08:29 -03:00
Rafael Barbosa Lopes
dd51a1724e Ensure a parent container is a Group before removing from its hash. 2016-03-24 13:44:49 -03:00
sergey7c4
fef4c7b021 Fixed unwanted smoothing 2016-03-23 16:59:36 +05:00
zeterain
a948dab895 Check for sprite destruction in onInputDown event.
This sprite might have been destroyed during the onInputDown event. Check to see if it was.

Also, set the pointer's dirty flag before the altered if-block just in case the function returns.
2016-03-22 15:54:41 -06:00
CptSelewin
50a454b79e fixed tinting issue when loading textures 2016-03-11 10:06:15 +01:00
Chad Engler
a510761bf1 fix typo in componentToHex 2016-03-09 15:54:40 -08:00
Stoneman1
ee335fe466 Fixed backwards compatibility issue. 2016-03-02 13:28:44 +02:00
Stoneman1
5bdc1c05b4 MediaStream.stop() deprecated. Using MediaStreamTrack.stop() instead. 2016-03-02 12:34:28 +02:00
Stoneman1
4a29d5102d Fixes issue #2325 2016-03-02 11:57:41 +02:00
Silvan Strübi
1b1c4ef0f5 AudioBufferSourceNode - same issue as on play:
I was able to reproduce this rare occurrence. It gets triggered by me in some cases when leaving focus and then resuming the sound. Same as we have had it only play, see => https://github.com/photonstorm/phaser/issues/2351

Cheers
2016-03-02 10:06:01 +09:00
Richard Davey
b9f9058cf1 Merge pull request #2360 from ShimShamSam/patch-2
Added new format for polygon points
2016-03-02 01:03:20 +02:00
Richard Davey
0c48c2d6a8 * Added P2.Body.thrustLeft which will move the Body to the left by the speed given (thanks James Pryor)
* Added P2.Body.thrustRight which will move the Body to the right by the speed given (thanks James Pryor)
2016-03-01 22:31:58 +00:00
Samuel Hodge
6b85dbd6a9 Update Polygon.js 2016-02-28 16:00:29 -05:00
Samuel Hodge
a53676a924 Added new format for polygon points 2016-02-26 14:56:25 -05:00
photonstorm
ede6806e41 The default state of the internal property _boundDispatch in Phaser.Signal is now false, which allows for use of boundDispatches (thanks @alvinlao #2346) 2016-02-26 13:40:35 +00:00
photonstorm
08ce659447 Sound.position can no longer become negative, meaning calls to AudioContextNode.start with negative position offsets will no longer throw errors (thanks @Weedshaker #2351) 2016-02-26 13:36:19 +00:00
photonstorm
15d952171c SoundManager.destroy doesn't close the context if it's being stored in PhaserGlobal (thanks @brianbunch #2356) 2016-02-26 13:31:45 +00:00
photonstorm
cc3a07bada SoundManager.close now validates that context.close is a valid function before calling it (thanks @brianbunch #2355) 2016-02-26 13:29:35 +00:00
photonstorm
c04a2be36b Format updates. 2016-02-26 13:26:27 +00:00
Richard Davey
6ba5515995 Merge pull request #2357 from FilamentGames/dev
Patch for destructive getLocalBounds in PIXI.DisplayObjectContainer
2016-02-26 15:21:17 +02:00
Richard Davey
a8ae5a0024 Merge pull request #2353 from fillmoreb/patch-1
Fix for world.centerX and world.centerY with negative bounds origin.
2016-02-26 15:20:05 +02:00
Richard Davey
e21ec2f0d6 Merge pull request #2349 from stoneman1/dev
Fixed issue with IE crashing on this.context.close() in SoundManager.…
2016-02-26 15:17:28 +02:00
Alex Stone
db7c417baf Reset worldTransforms of children after computing local bounds. 2016-02-25 20:37:09 -06:00
fillmoreb
b1c74e694e Update World.js
Phaser.World.centerX and Phaser.World.centerY only worked if the bounds had an origin of 0,0.  This change takes into account the actual origin.
2016-02-25 11:58:22 -07:00
Stoneman1
62f0a52544 Fixed issue with IE crashing on this.context.close() in SoundManager.js (There was no check if context exists) 2016-02-24 13:08:37 +02:00
photonstorm
ba5981a03f Removed a console.log from the TilingSprite generator. 2016-02-19 14:46:55 +00:00
Stoneman1
4d587d3e40 Fixed issue with not removing mouseoutglobal eventlistener 2016-02-19 15:15:31 +02:00
photonstorm
ad6f0557f7 Preparing for 2.4.7 development. 2016-02-18 15:06:43 +00:00
photonstorm
47123c192d 2.4.6 Build files + docs + TS Docs. 2016-02-18 14:41:53 +00:00
photonstorm
866994743b URI + ? fix. 2016-02-18 14:34:20 +00:00
photonstorm
0b5a4391f1 StateManager.destroy now sets clearCache and clearWorld internally before clearing the current state, as otherwise they would have been left untouched, such as from Game.destroy (thanks @i-dimitrov #2138) 2016-02-18 13:10:54 +00:00
Richard Davey
6cf8bc75ba Merge pull request #2328 from taylankasap/dev
Added RandomDataGenerator.sign (returns -1 or +1)
2016-02-18 15:03:51 +02:00
photonstorm
17071b578c BaseTexture.destroy wasn't correctly removing the texture from the BaseTextureCache if it was a cached CanvasPool entry (such as Text objects use), causing drawImage errors in Canvas mode, and just blank textures in WebGL (thanks @civet #2339) 2016-02-18 12:59:40 +00:00
photonstorm
46cc05a377 Groups now check for child.parent before calling removeFromHash (thanks @spayton #2323 #2338) 2016-02-18 12:29:01 +00:00
Richard Davey
8aefd0fe9b Preparing for 2.4.6 development. 2016-02-17 16:28:27 +00:00
photonstorm
daea5f53ff Fixed Edge device check. 2016-02-17 13:37:32 +00:00
photonstorm
34c484367c Phaser 2.4.5 Build files. 2016-02-17 13:27:09 +00:00
Richard Davey
e6c508edcd Color.updateColor would pass color.a to the getColor32 method without first putting the value into the range 0 - 255 (thanks @mainpsyhos #2327) 2016-02-17 03:50:06 +00:00
Richard Davey
f6d273c4fc DisplayObject._generateCachedSprite (which is called from updateCache or when cacheAsBitmap is enabled) would bitwise | 1 the bounds width and height. This would often lead to incorrect rounding (heights of 4 would become 5, while heights of 5 would remain 5). This has now been removed and the width and height are passed through Mail.ceil and then checked to make sure they aren't less than 1 pixel in either direction (thanks @alesdotio #2078) 2016-02-17 03:40:04 +00:00
Richard Davey
b629539176 SpriteBatch incorrectly applied the PIXI SpriteBatch prototype over the top of Phaser.Group meaning that Sprites with animations wouldn't render correctly (thanks @qdrj #1951) 2016-02-17 03:23:56 +00:00
Richard Davey
0c52b9316a Text with lineSpacing set wouldn't apply the lineSpacing to the final line of text in the Text string, or to text with just single lines. This could lead to incorrect height calculations for further layout and unwanted padding at the bottom of Text objects (thanks @Lopdo #2137) 2016-02-17 03:14:51 +00:00
Richard Davey
15411f1e56 Tween.onLoop would be fired when a Tween repeated and Tween.onRepeat would be fired when a Tween looped. These are now reversed to fire correctly (thanks @vladkens #2024) 2016-02-17 02:57:45 +00:00
Richard Davey
071d9cffd0 Graphics.generateTexture has a new argument padding which allows you to add extra spacing onto the generated texture. This is useful for small Graphics objects where you find a few pixels getting sliced off the edges due to rounding issues (#1933) 2016-02-17 02:31:29 +00:00
Richard Davey
74fd042749 If the Mouse was over a Sprite and you then clicked it, it would dispatch another Over event. This is now surpressed if the Over event has already been dispatched previously (thanks @McFarts #2133)
InputHandler.pointerOver could fail to return anything in some instances, now always returns a boolean.
2016-02-17 02:07:07 +00:00
Richard Davey
83a35e41d6 ctrl + click is now only considered a right-click if event.buttons = 1, this should allow you to use ctrl as a key modifier on Windows (and any device with a multi-button mouse attached) and still use ctrl + click on OS X / trackpads for a right-click (thanks @yuvalsv #2167) 2016-02-17 01:46:55 +00:00
Richard Davey
1932515f56 Fixed a really nasty bug in Chrome OS X where a ctrl + click (i.e. simulated right-click) on a trackpad would lock up the Pointer leftButton, causing future clicks to fail. This is now handled by way of a mouseout listener on the window object, sadly the only way to force a mouseup in Chrome (thanks @KyleU #2286) 2016-02-17 01:26:35 +00:00
photonstorm
4426c712ff jshint fix. 2016-02-12 17:29:30 +00:00
photonstorm
6ad22bc098 Phaser 2.4.5-RC2 with fresh docs and build files. 2016-02-12 16:00:36 +00:00
photonstorm
59ff0b0a57 Docs fix. 2016-02-12 14:49:37 +00:00
Richard Davey
989d53ecba Undo #1993 2016-02-09 14:01:04 +00:00
Richard Davey
92479eb03f * Device.safariVersion now holds the major version of the Safari browser.
* Device.edge is a boolean that is set if running under the Microsoft Edge browser.
* Device.dolby is a boolean that is set if the browser can play EC-3 Dolby Digital Plus files
* The Loader and SoundManager can now play Dolby Digital Plus files on supported devices.
2016-02-09 13:17:14 +00:00
Richard Davey
332fb6fe68 Fixed window global check. 2016-02-09 11:41:24 +00:00
Richard Davey
30b563085b The z property assigned to children of a Group now starts from zero instead of 1, this is an internal change mostly but if you relied on the z property for some reason then please be aware of this (thanks pantoninho) 2016-02-09 11:31:46 +00:00
Richard Davey
eff10cec71 Moved the width / height floor into the ScaleManager (#2329) 2016-02-08 23:09:16 +00:00
Taylan Kasap
1310daa9af Added RandomDataGenerator.sign (returns -1 or +1) 2016-02-07 14:25:19 +02:00
Chad Engler
5b7130d4d6 fix one more place where resolution wasn't taken into account 2016-02-06 17:05:44 -08:00
Chad Engler
7457cc67f2 Fix #2320: properly size filter texture and viewport 2016-02-06 11:30:31 -08:00
Richard Davey
5801f1aa15 jshint fixes. 2016-02-04 23:39:58 +00:00
Richard Davey
818c64291a SinglePad.onDownCallback has been moved to the end of the method, so that DeviceButton.start is now called before the callback fires, meaning if you check the status of the button in the onDownCallback it will now be fully activated (thanks @suicidepills #2159) 2016-02-04 22:46:18 +00:00
photonstorm
829b1e7ad1 Events.onDragUpdate has a new 6th property fromStart which is a boolean. You can determine if the event was the result of the start of a drag movement or not by polling it (#2155) 2016-02-04 17:00:30 +00:00
photonstorm
882c8b8d40 InputHandler.consumePointerEvent has been removed, as it was never used internally anyway, so was misleading (thanks @GregoryAveryWeir #2227) 2016-02-04 16:46:35 +00:00
Richard Davey
1ac287f9d3 Merge pull request #1993 from nickryall/retina-fullscreen
Fix for fullscreen retina ( Desktop )
2016-02-04 18:31:50 +02:00
photonstorm
9787474c6e Camera.checkBounds now takes the scale of the Camera into account (thanks @ForGorNorPor #2263) 2016-02-04 16:26:18 +00:00
photonstorm
a7c360425f Tidying up code and docs. 2016-02-04 16:23:40 +00:00
Richard Davey
a8b04c4bf1 Merge pull request #2171 from mattrick16/dev
Add method to angle Display Objects relative to world
2016-02-04 18:21:14 +02:00
Richard Davey
2a948832fc Merge pull request #1842 from hightopo/fix-mask-filter-bug
Fix mask combine filter bug
2016-02-04 18:07:39 +02:00
photonstorm
af4c938299 Docs update (#1967) 2016-02-04 16:05:45 +00:00
photonstorm
5bcfa08af6 Text.useAdvancedWrap allows you to swap between the Basic and the Advanced word wrapping functions. In Advanced it will wrap long-words and condense and trim excess white space (thanks @soldoutactivist #1811) 2016-02-04 16:00:21 +00:00
photonstorm
da8fa83730 Changed default back. 2016-02-04 16:00:16 +00:00
photonstorm
afc96352de PIXI.WebGLGraphics.stencilBufferLimit is a new integer that allows you to define how many points exist in a Graphics object before Pixi swaps to using the Stencil Buffer to render it. The default is now 64 (originally 6). This fixes issues with things like Quadratic curves not rendering as masks in WebGL. 2016-02-04 14:52:35 +00:00
photonstorm
c3c2dd6067 Graphics.arc has a new argument segments that allows you to control how many segments are created when the arc is drawn. The default is 40. Use a higher number for more fidelity, i.e. if you find that reversed arcs are not joining up fully (#2064) 2016-02-04 13:49:55 +00:00
photonstorm
8076f64656 We have replaced the PolyK Triangulation calls within Pixi with EarCut 2.0.8. This allows for faster polygon triangulation, and also deals with more complex polygons that PolyK would crash on. 2016-02-04 13:23:01 +00:00
Rafael Barbosa Lopes
a267e81b26 Doc: Loader.enableParallel is Boolean. 2016-02-04 10:06:12 -02:00
Richard Davey
2cd76b7617 Docs update (#2166) 2016-02-04 00:13:32 +00:00