Rafael Barbosa Lopes
0a9ca57a8f
Cleaning some white space.
2015-05-08 21:42:29 -03:00
Rafael Barbosa Lopes
29b22972ca
Proper code formatting.
2015-05-08 21:35:35 -03:00
Rafael Barbosa Lopes
d19411e069
Assign the default value of 60 FPS to the optional frameRate
parameter, when ommited.
...
This patch tries to prevent an issue in the tween timeline data generation
where an `undefined` value causes an unhandled type coercion when the program
calculate how many frames will be generated for a given `TweenData` timeline.
2015-05-08 19:39:13 -03: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
a1102d4d4d
Added re-tint reset.
2015-05-08 04:12:20 +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
164039d7e7
Sets the re-tint state to true.
...
Removed un-needed clear call.
2015-05-08 04:10:39 +01:00
photonstorm
326cb759cf
Docs fixes.
2015-05-08 02:28:46 +01:00
photonstorm
9cb7122743
Improved code formatting.
2015-05-08 01:51:06 +01:00
photonstorm
855831e4c2
BitmapData.update now validates the width
and height
values to ensure they aren't lower than 1, which would previously cause a context error.
2015-05-08 01:49:59 +01:00
photonstorm
d2b9bfe7b8
RetroFont has been updated to use RenderTexture.renderXY, removing the need for creating a Point object each update.
...
RetroFont no longer puts any entries into the TextureCache or generates any UUIDs on instantiation, speeding up creation and lowering memory use.
2015-05-08 01:49:11 +01:00
photonstorm
e3b8fe3401
Proper setFrame call.
2015-05-07 02:45:33 +01:00
photonstorm
67704d0136
Updated Frame handling for Videos so sprites have their own frames, not a reference to the Videos frame.
2015-05-07 02:44:48 +01:00
photonstorm
12362a8300
Mark new textures as valid.
2015-05-07 02:44:29 +01:00
photonstorm
af66b49f31
If a BitmapData is created with a width or height set to zero then the width and/or height are set to a default value (256) instead to avoid getContext errors.
2015-05-06 16:50:10 +01:00
photonstorm
303929a3ce
Added Video.snapshot and Video.grab support.
2015-05-06 16:47:46 +01:00
photonstorm
7cd89eedd6
jshint fixes.
2015-05-06 08:13:55 +01:00
photonstorm
7f89a3de60
Fixed video event.
2015-05-06 07:57:52 +01:00
photonstorm
d14d9f4f64
Added onAccess and onError signals and tidied up the stream handling.
2015-05-06 07:25:34 +01:00
photonstorm
a24a22742a
Enabled Stream stopping.
2015-05-06 06:11:09 +01:00
photonstorm
37304c7cc7
Added Video.createVideoStream support.
2015-05-06 06:06:02 +01:00
photonstorm
399cf3f804
jshint fix.
2015-05-06 02:02:49 +01:00
photonstorm
7674060afc
Removed PIXI.EventListener and VideoTexture as it's no longer required.
2015-05-06 01:59:49 +01:00
photonstorm
535b56bc4a
Got changeSource working properly on iOS and tidied up lots of docs.
2015-05-06 01:12:02 +01:00
photonstorm
927c14536d
Destroy will remove the listener from Video.onChangeSource.
2015-05-06 00:42:01 +01:00
photonstorm
bf25e67f5a
LoadTexture.resizeFrame lets you resize the Frame dimensions that the Game Object uses for rendering. You shouldn't normally need to ever call this, but in the case of special texture types such as Video or BitmapData it can be useful to adjust the dimensions directly in this way.
2015-05-06 00:41:40 +01:00
photonstorm
ed3e7cdf8c
Frame.resize allows you to change the dimensions of a Frame object and recalculate all of its internal properties (such as bottom
and distance
).
2015-05-06 00:37:50 +01:00
photonstorm
9a563f20b9
Updated video locked status.
2015-05-05 17:03:39 +01:00
photonstorm
5278c16acc
Swapped to using touchlock object.
2015-05-05 17:03:27 +01:00
photonstorm
4a91d97812
Input.addMoveCallback used to return the index of the callback entry in the internal moveCallbacks
array. However as callbacks were removed the indexes became invalid, potentially causing a future Input.deleteMoveCallback
to remove the wrong callback entirely or error. Input.deleteMoveCallback now takes the original callback and context as its parameters to ensure deletion safety.
2015-05-05 16:53:02 +01:00
photonstorm
0cde8f874d
Mobile touch lock support done.
2015-05-05 16:25:51 +01:00
photonstorm
45278a1816
Tidied up the video loader.
2015-05-05 16:25:30 +01:00
photonstorm
766b110f99
SoundManager now uses the new Touch.addTouchLockCallback
methods to handle mobile device audio unlocking.
2015-05-05 16:25:16 +01:00
photonstorm
f265f98eb4
Input.Touch.addTouchLockCallback allows you to add a callback that will be invoked automatically upon a touchstart event. This is used internally by the SoundManager and Video objects to handle mobile device unlocking, but is exposed publicly as well.
2015-05-05 16:24:49 +01:00
photonstorm
f032578f27
Removed Input.moveCallback
and Input.moveCallbackContext
as neither are used any longer. Use Input.addMoveCallback
.
2015-05-05 16:09:22 +01:00
photonstorm
df6dc70a41
Various VideoTexture tests (this file will be removed shortly however).
2015-05-05 14:02:38 +01:00
photonstorm
cc1c90d782
Removed videoSprite placeholder.
2015-05-05 14:01:47 +01:00
photonstorm
2e2d1c6bc2
Lots of updates to the Phaser.Video object.
2015-05-05 14:00:59 +01:00
photonstorm
7178ff61c7
jsdoc fixes.
2015-05-05 14:00:29 +01:00
photonstorm
f33082caf2
Support for Video texture updates.
2015-05-05 14:00:18 +01:00
photonstorm
d8c109b0a2
Tidying comments.
2015-05-05 14:00:05 +01:00
photonstorm
d98b984ad2
SoundManager.volume now has its input value clamped to ensure it's between 0 and 1 (inclusive)
2015-05-05 11:04:14 +01:00
photonstorm
36c7084e01
Adjusting property order.
2015-05-05 10:59:54 +01:00
photonstorm
adad60f8f4
SoundManager.onVolumeChange is a new signal that is dispatched whenever the global volume changes. The new volume is passed as the only parameter to your callback.
...
SoundManager.onMute is a new signal that is dispatched when the SoundManager is globally muted, either directly via game code or as a result of the game pausing.
SoundManager.onUnMute is a new signal that is dispatched when the SoundManager is globally un-muted, either directly via game code or as a result of the game resuming from a pause.
2015-05-05 10:58:43 +01:00
photonstorm
1a7450e126
Added blend modes to Color class for testing.
2015-05-04 03:01:09 +01:00
photonstorm
90a7a3e15c
Create video + added Video to config.
2015-05-04 03:00:45 +01:00
photonstorm
8a9e0c266a
Added currentTime and duration getters.
2015-05-04 03:00:22 +01:00
photonstorm
afb162849a
Docs update.
2015-05-04 03:00:03 +01:00
photonstorm
c1ab5a3345
The first pass at the new Phaser.Video object.
2015-05-03 13:53:03 +01:00
photonstorm
f092101531
Added in support for Phaser.Video to LoadTexture component.
2015-05-03 13:53:03 +01:00
photonstorm
9ee0de9192
Cache.addVideo allows you to add a loaded video into the Phaser Cache. This is called automatically by the Phaser Loader, but may be invoked directly as well.
...
Cache.checkVideoKey allows you to check if a video is stored in the cache based on the given key.
Cache.getVideo allows you to extract a video from the Cache based on its key. The video element itself (or the Blob is loaded with asBlob true) will be found in the `data` property of the returned object.
Cache.removeVideo will remove a video from the Cache based on the given key.
2015-05-03 13:53:03 +01:00
photonstorm
77468e7876
Loader.video allows you to load a video file into Phaser. It works in the same way as Loader.audio, allowing you to pass an array of video files - and it will load the first one the device is capable of playing back. You can optionally load the video via xhr where the video data is converted to a Blob upon successful load.
2015-05-03 13:53:03 +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
f0ac93ea62
Device.oggVideo indicates if the browser can play back ogg video files.
...
Device.h264Video indicates if the browser can play back H264 (mp4) video files.
Device.mp4Video indicates if the browser can play back H264 (mp4) video files.
Device.webmVideo indicates if the browser can play back webm video files with the vp8 codec.
Device.vp9Video indicates if the browser can play back webm video files with the vp9 codec.
Device.hlsVideo indicates if the browser can play back mpeg video files.
2015-05-03 13:53:02 +01:00
photonstorm
420272d589
Added Phaser.VIDEO object type const.
2015-05-03 13:53:02 +01:00
photonstorm
3578cd097c
jsdocs fix.
2015-05-03 13:53:02 +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
Boniatillo.com
9017081ef6
Fix to #1776 : load audiosprite from assetpack
...
The loader process the asset pack but use the method "audio" instead of
"audiosprite". The fix is to call "audiosprite" with the right
arguments.
2015-05-02 10:40:38 +02:00
Richard Davey
6a7006dec8
Merge pull request #1772 from soldoutactivist/dev
...
Stubbed Net and Debug so they can be properly excluded during a custom build.
2015-04-29 15:48:42 +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
Steven Rogers
105b08448d
Converted tabs to spaces.
2015-04-29 09:21:02 -04:00
Steven Rogers
b39788c5b0
Reverted Game/Debug classes
2015-04-29 09:10:53 -04:00
Steven Rogers
258b549a0d
Stubbed Net and Debug so they can be properly excluded during a custom build.
2015-04-29 09:07:06 -04:00
photonstorm
4c0e34e788
jsdoc fixes.
2015-04-29 13:13:47 +01:00
photonstorm
19f8a7316e
ArcadePhysics.Body.syncBounds is a new property that if true forces the Body to check itself against the Sprite.getBounds() dimensions and adjust its width and height accordingly. If false it will compare its dimensions against the Sprite scale instead, and adjust its width height if the scale has changed. Typically you would need to enable syncBounds
if your sprite is the child of a responsive display object such as a FlexLayer, or in any situation where the sprite scale doesn't change, but its parents scale is effecting the dimensions regardless.
2015-04-29 13:13:26 +01:00
photonstorm
da0bd86c26
Rectangle.ceil runs Math.ceil() on both the x and y values of the Rectangle.
...
Rectangle.ceilAll runs Math.ceil() on the x, y, width and height values of the Rectangle.
2015-04-29 13:13:11 +01:00
Jeremy Osborne
61f24f1719
Fix for #1761 : [Feature Request] Add Math.distanceSq(). Also, first attempt at a pull request for Phaser.
2015-04-28 10:03:35 -07:00
photonstorm
8290e8c371
Text.setShadow has two new optional parameters: shadowStroke
and shadowFill
. These allow you to set if the drop shadow is applied to the Text stroke, the Text fill or both of them (thanks @qdrj #1766 )
...
Text.shadowStroke and Text.shadowFill allow you to toggle if the drop shadow is applied to the Text stroke or fill independently.
2015-04-27 16:22:36 +01:00
photonstorm
d9434244a5
Removed array length vars.
2015-04-27 16:22:36 +01:00
photonstorm
c461c26393
Added onUpdate signal.
2015-04-27 16:22:36 +01:00
photonstorm
b645b277aa
jsdoc fix.
2015-04-27 16:22:36 +01:00
photonstorm
8519c9e394
The Tween.onStart signal wasn't dispatched if the Tween had a delay set. It's now dispatched immediately if no delay, or after the delay if set. It also respects the autoStart
parameter and will still dispatch even if autoStart
is true.
2015-04-27 16:22:35 +01:00
photonstorm
5d680ce4d4
pause not stop.
2015-04-27 16:22:35 +01:00
photonstorm
c6e9d7cad3
Removing PIXI.TextureCache calls as no longer used.
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
photonstorm
30450cb9bc
Loader.atlas and Cache.addTextureAtlas
will now automatically determine the format of the JSON data (array or hash) when added to the Cache. You no longer need to specify it explicitly if JSON, only if XML.
2015-04-23 02:35:09 +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
05d0a94116
Phaser.AnimationParser methods JSONData
, JSONDataHash
and XMLData
have all had their cacheKey
parameter removed as it's no longer used.
2015-04-21 16:01:11 +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
cc46212d5b
Refreshes a tiling texture on change of frame.
2015-04-21 15:55:58 +01:00
photonstorm
3d75902a67
Removed all calls to TilingTexture because it's now handled in the setFrame component.
2015-04-21 15:55:40 +01:00
photonstorm
ede76cf4f6
Frame.uuid has been removed (was flagged as deprecated for several releases). This has a two-fold effect: First it means that the property no longer exists and secondly it means that the AnimationParser (the class responsible for loading sprite sheets and texture atlases) no longer has to call either RandomDataGenerator.uuid OR populates the PIXI.TextureCache. The first saves some CPU time and the second saves memory by not creating references to textures it doesn't ever use. The PIXI.TextureCache is now ignored by Phaser other than for the __missing
and __default
textures.
2015-04-21 15:55:04 +01:00
photonstorm
a4963adec3
jsdoc clarification.
2015-04-21 15:54:44 +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
6c96568dd1
Files can now be added to the Loader with an absolute URL even if you have a Loader.baseURL set. In previous versions the baseURL would still be prepended to the file URL, but the Loader now checks if the a file URL begins with http
or //
and skips prepending the baseURL to it.
...
All calls to Loader methods that add files to the queue, such as `Loader.image` or `Loader.atlas`, now have the URL as an optional parameter. If not set Loader will assume the URL to be based on the key given. For example the following: `game.load.image("boom", "boom.png")` can now be expressed as just `game.load.image("boom")`, or `game.load.atlas("player", "player.png", "player.json")` can now be shortened to `game.load.atlas("player")`. Please see the freshly updated jsdocs for full details.
2015-04-21 02:14:41 +01:00
photonstorm
e6ab4884a6
Set usingWebAudio if using it :)
2015-04-21 02:07:47 +01:00
photonstorm
12f8454d62
close #1755
2015-04-19 01:35:15 +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
714580f9a9
Manual fix #1752
2015-04-17 17:35:52 +01:00
photonstorm
8476a0b87f
One ! too many #1746
2015-04-17 14:26:01 +01:00
photonstorm
59beae762d
The SoundManager didn't accurately detect devices or browser environments with no sound card present and would try to carry on using a null Web Audio context (thanks @englercj #1746 )
...
SoundManager.pauseAll, resumeAll and stopAll now checks if the SoundManager.noAudio is set and ignores the calls.
SoundManager.usingWebAudio is set to `false` by default (used to be `true`) and is only explicitly set if Web Audio is available and hasn't been disabled in the PhaserGlobal object.
SoundManager.touchLocked is now set to `false` should the device be using legacy Audio, avoiding the unlock call running without need.
2015-04-17 03:49:20 +01:00
photonstorm
8144c4910e
jshint fixes.
2015-04-17 03:23:40 +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
1d8f88173d
Phaser.Matrix.clone allows you to clone the Matrix to a new object, or copy its values into the given Matrix.
...
Phaser.Matrix.copyFrom and copyTo allow you to copy Matrix values from and to other Matrix objects.
Phaser.Matrix.setTo allows you to set all properties of a Matrix in a single call.
The Phaser.Matrix constructor now allows you to optionally set all Matrix properties on instantiation.
2015-04-17 03:19:28 +01:00
photonstorm
eca360301c
Bumping up the release to 2.4.0 due to the API changes in the State Manager.
2015-04-15 01:37:41 +01:00
photonstorm
333663731d
Added the missing preRender
function to the Phaser.State class template.
2015-04-15 01:37:18 +01:00
photonstorm
f2f8dcd061
Phaser.StateManager no longer calls preRender
unless the State create
method has finished. If the State doesn't have a create
method then preRender
runs immediately.
...
Phaser.StateManager.created is a new read-only boolean that tells you if the State has finished running its `create` method. If it doesn't have one it's always true.
2015-04-15 01:36:50 +01:00
photonstorm
b0e1b8facb
jsdoc fixes.
2015-04-15 01:36:25 +01:00
photonstorm
9f493044d4
The StateManager would incorrectly call loadUpdate
while the game was paused or if the State didn't have an update
method defined even after the loader was completed.
...
The StateManager would incorrectly call `loadRender` while the game was paused or if the State didn't have an `render` method defined even after the loader was completed.
2015-04-14 15:34:32 +01:00
photonstorm
7b011fe0d3
Fix #1742
2015-04-14 09:31:04 +01:00
photonstorm
8f06991527
Added support for the [Creature Automated Animation Tool]( http://www.kestrelmoon.com/creature/ ). You can now create a Phaser.Creature object which uses json data and a texture atlas for the animations. Creature is a powerful animation tool, similar to Spriter or Spine. It is currently limited to WebGL games only, but the new libs should prove a solid starting point for anyone wanting to incorporate Creature animations into their games.
2015-04-13 23:16:29 +01:00
photonstorm
0ffa499bd0
Removed getJSON parse parameter. It's already parsed :)
2015-04-13 22:06:57 +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
e5f1f6f896
Cache.getPixiTexture will return a PIXI.Texture from the cache based on the given key. A PIXI Texture is created automatically for all images loaded and added to the cache.
...
Cache.getPixiBaseTexture will return a PIXI.BaseTexture from the cache based on the given key. A PIXI BaseTexture is created automatically for all images loaded and added to the cache.
Cache.getTexture has now been removed (it was deprecated several versions ago). Use Cache.getRenderTexture instead.
Cache.getJSON has a new optional parameter: `parse`. If `true` the method will pass the data through JSON.parse before returning it. The default is `false` to retain backwards compatibility.
2015-04-13 20:25:42 +01:00
photonstorm
a7db0e2c70
Group.hash is an array (previously available as Group._hash
, but protected) into which you can add any of its children via Group.addToHash
and Group.removeFromHash
. Only children of the Group can be added to and removed from the hash. The hash is used automatically by Arcade Physics in order to perform non z-index based destructive sorting. However if you don't use Arcade Physics, or it isn't a physics enabled Group, then you can use the hash to perform your own sorting and filtering of Group children without touching their z-index (and therefore display draw order).
...
Group.physicsSortDirection is a new property allowing you to set a custom sort direction for Arcade Physics Sprites within the Group hash. Previously Arcade Physics used one single sort direction (defined on `Phaser.Physics.Arcade.sortDirection`) but this change allows you to specifically control how each and every Group is sorted, so you can now combine tall and wide Groups with narrow and thin in a single system.
2015-04-13 16:30:02 +01:00
photonstorm
432516fa0f
Physics.Arcade.sort has a new property 'sortDirection'. If not specified it will use World.sortDirection. If the Group given as the first parameter has its physicsSortDirection
property set that will override any other setting.
...
Physics.Arcade.sort now calls one of four functions: sortLeftRight, sortRightLeft, sortTopBottom and sortBottomTop. Each of which takes 2 Sprites as arguments.
Physics.Arcade.sort now doesn't bail out if the Group contains a mixture of physics and non-physics enabled objects, as the Group hash is now only ever populated with physics enabled objects. Also the sort comparison functions no longer return -1 if the bodies are invalid, but zero instead (#1721 )
2015-04-13 16:29:34 +01:00
photonstorm
35bfe5fb2a
Body.destroy now automatically calls Group.removeFromHash
.
2015-04-13 16:27:43 +01:00
photonstorm
412338478c
Added in all hooks required for MatterJS Physics (coming soon!)
2015-04-13 16:16:34 +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
f155ad452c
Tilemap.createFromObjects has been updated for Tiled 0.11 and can now look-up object layers based on id, uid or name. It will also now copy over Sprite scaling properties if set (thanks @mandarinx #1738 )
2015-04-13 12:40:12 +01:00
Richard Davey
78e7be5c96
Merge pull request #1738 from mandarinx/patch-1
...
Looking up object layers based on id, uid or name
2015-04-13 12:35:24 +01:00
photonstorm
7b8a430aac
TilemapLayer docs incorrectly reported it as extending Phaser.Image, but it doesn't share the same components so has been updated.
...
TilemapLayer was missing the Input component (thanks @uhe1231 #1700 )
2015-04-13 12:23:30 +01:00
photonstorm
04cb3889a9
P2.getConstraints would return an array of null objects. It now returns the raw p2 constraint objects (thanks @valueerrorx #1726 )
2015-04-13 12:12:18 +01:00
photonstorm
b41cf3bc8c
AnimationManager.frameName setter wasn't checking if _frameData
existed before accessing it (thanks @nesukun #1727 )
2015-04-13 11:58:45 +01:00
photonstorm
0aaa77a84d
Strict check.
2015-04-13 11:58:45 +01:00
photonstorm
0ccb3515d5
Removed dirty flag.
2015-04-13 11:58:44 +01:00
photonstorm
8bca406889
Console update.
2015-04-13 11:58:44 +01:00
Richard Davey
0b3fc61ba7
Merge pull request #1723 from dgoemans/dev
...
Fix for Phaser with requirejs
2015-04-13 11:29:58 +01:00
Richard Davey
b1f294e445
Merge pull request #1722 from GGAlanSmithee/dev
...
Minor change to Tilemap class
2015-04-13 11:24:29 +01:00
Richard Davey
daea4e8087
Merge pull request #1728 from cuixiping/dev
...
Fix bug of Color.webToColor and Color.updateColor
2015-04-13 11:23:44 +01:00
Chad Engler
b89cdd5a0c
check for existence of sprite on body destroy
2015-04-12 17:30:54 -07:00
Thomas Viktil
b406a61262
Looking up object layers based on id, uid or name
...
The description of the method stated that you could pass a string to look up an object layer based on its name, but the original code only looked for a gui property, regardless of type.
I'm using Tiled 0.11.0 on OSX, and my exported json-file doesn't contain a gui property on the object layers. Here's a snippet of my file:
```
{
"layers":[
{
"draworder":"topdown",
"height":0,
"name":"Objects",
"objects":[
{
"height":48,
"id":1,
"name":"pier",
"properties":
{
},
"rotation":0,
"type":"",
"visible":true,
"width":64,
"x":208,
"y":240
}],
"opacity":1,
"properties":
{
"type":"pier"
},
"type":"objectgroup",
"visible":true,
"width":0,
"x":0,
"y":0
}]
}]
}
```
The property in my file is called id and not uid. This might be due to changes in one of the later releases of Tiled. I kept the check for uid to avoid possibly breaking compatibility with older versions of Tiled.
I also added scaling of the sprite.
Feel free to make formatting changes, or rewrite the function to better fit the programming style of Phaser.
2015-04-11 22:16:17 +02:00
cuixiping
d0ec5e4060
Fix bug of Color.webToColor and Color.updateColor
...
Color.webToColor and Color.updateColor should update out.color and out.color32 property.
2015-04-09 12:14:20 +08:00
David Goemans
73bace335a
Built a fix into p2.js v0.6.1 for using requirejs with phaser. This has also been put as a pull request to p2.js
2015-04-06 12:43:03 +02:00
Alan Smithee
d2e3a69525
Adds nonNull parameter to Tilemap.getTileWorldXY
...
Since Tilemap.getTile lets you specify wether to return null
or an empty tile when index is -1, the WorldXY equivalent
should offer the same possibility for a more unified interface.
2015-04-06 10:08:37 +00: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
hardalias
4bd7a40e84
Fixes neverending tween when duration set to zero
...
* Passing a value of zero as the value of duration causes the
calculations performed in Tween#update to divide by zero when
calculating the next step for the tween. This causes the tweened
property value to be set to NaN having undesireable results and
also, causes the tween to never end since the ending criteria are
never met.
2015-04-01 15:01:05 +03:00
photonstorm
645723f939
Sprite was missing the Health and InCamera components.
2015-03-30 13:51:47 +01:00
photonstorm
5fb1130175
The LoadTexture component has had a redundant dirty
call removed from it.
...
TileSprites were missing a `physicsType` property, causing them to not collide with anything (thanks @numbofathma #1702 )
2015-03-28 00:56:02 +00:00
photonstorm
57474c0d44
Trying out removal of dirty flag.
2015-03-27 10:47:45 +00:00
photonstorm
67039df214
jsdoc fixes.
2015-03-27 10:47:25 +00:00
photonstorm
49be59b0c9
Added missing resumed
method to Phaser.State class template.
2015-03-26 10:54:32 +00:00
photonstorm
413c81e034
Preparing for 2.3.1 development.
2015-03-26 04:01:37 +00:00
photonstorm
8233b0a079
Phaser 2.3.0.
2015-03-26 02:37:31 +00:00
photonstorm
eb235197e9
Phaser 2.3 Release Candidate 3.
2015-03-25 16:17:53 +00:00
photonstorm
79ace60997
Added guard around the xhr onload try / catch block, so it doesn't incorrectly report errors as being from the Loader when they may have been throw by the create method.
2015-03-25 16:13:52 +00: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