Commit graph

435 commits

Author SHA1 Message Date
photonstorm
426b43cc9f Removed console.log calls. 2014-09-18 05:12:35 +01:00
photonstorm
d68ed61999 If you called StateManager.start from within a states init method which also had a preload method it would fail to start the next State. 2014-09-18 05:11:58 +01:00
photonstorm
756561920f Group.ignoreDestroy boolean will bail out early from any call to Group.destroy. Handy if you need to create a global Group that persists across States. 2014-09-18 05:11:48 +01:00
photonstorm
20551f9129 Lots of jsdocs fixes ready for the new doc generator. 2014-09-16 17:35:08 +01:00
photonstorm
fc6b7dd36c StateManager.unlink will null all State-level Phaser properties, such as game, add, etc. Useful if you never need to return to the State again. 2014-09-15 13:19:01 +01:00
photonstorm
5b922be56e Version 2.1.1. of Phaser is an emergency point release. It addresses a potential race condition that could happen in States that tried to change state from the create method but had an empty preloader or pre-cached assets. 2014-09-11 10:38:40 +01:00
photonstorm
33d9b19e29 The Debug canvas is now cleared on State swap. 2014-09-09 15:28:58 +01:00
photonstorm
a1c9b64327 Now bails out of a few methods if RESIZE is set. 2014-09-09 12:48:21 +01:00
photonstorm
2e9dc682a1 Tidied up a redundant if call. 2014-09-09 12:47:59 +01:00
photonstorm
b4e7da78ed jsdocs updated. 2014-09-09 12:47:39 +01:00
photonstorm
c40c140631 Camera.roundPx is a new boolean. If set to true it will call view.floor as part of its update loop, keeping its boundary to integer values. Set to false to disable this from happening (#1141) 2014-09-09 12:47:27 +01:00
photonstorm
79d873f47b If you are using CocoonJS, please set your game render type to CANVAS and not WEBGL or AUTO. You should also disable any of the ScaleManager screen resizing or margin setting code. By default in this mode CocoonJS will now set 'screencanvas=true' which helps with performance significantly. 2014-09-08 22:34:53 +01:00
photonstorm
09915ebfde Tidying up debug. 2014-09-08 22:34:53 +01:00
Richard Davey
3102ad534d Swapped the order of the Camera.view floor to avoid the 1px jitter effect on the right of maps. 2014-09-06 10:26:54 +01:00
photonstorm
7c02358eed More FlexGrid updates. 2014-09-05 16:19:32 +01:00
photonstorm
22df587bd3 Swapped to using FlexLayers. 2014-09-05 15:46:21 +01:00
photonstorm
ff07317120 First version of the FlexLayer class. 2014-09-05 15:46:10 +01:00
photonstorm
72c0f50b6b Lots of small enhancements and layer types. 2014-09-05 08:02:44 +01:00
photonstorm
0af4ec4da2 The StateManager will now check if a State has a method called resize. If it does, and if the game is running in the RESIZE Scale Mode then this method will be called whenever the game resizes. It will be passed two parameters: width and height that will match the games new dimensions. Resizing can happen as a result of either the parent container changing shape, or the browser window resizing. 2014-09-05 06:22:10 +01:00
photonstorm
0c9eef8a91 FlexGrid added to the ScaleManager. 2014-09-05 06:02:25 +01:00
photonstorm
07f529bf12 First experimental build of FlexGrid. 2014-09-05 06:01:48 +01:00
photonstorm
f2a8a927f9 Group.addMultiple allows you to pass an array of game objects and they'll all be added to the Group in turn. 2014-09-05 06:01:25 +01:00
photonstorm
ac9c9a1f9b Fixed the assignment of the fullScreenTarget so FS mode works again now. 2014-09-05 01:07:51 +01:00
Richard Davey
7ee1564f2e Signal.removeAll would ignore the context parameter and remove all bindings regardless (thanks @alect #1168) 2014-09-04 22:24:47 +01:00
photonstorm
cbc6ac8e7d New debug header. 2014-09-04 05:05:05 +01:00
Carlos Martinez
94f9c0906f this fixes the camera judders when following with float values. 2014-09-01 14:49:44 +01:00
photonstorm
2cc8e57808 Fixed issue with the ScaleManager. 2014-09-01 08:19:43 +01:00
photonstorm
7fc37751b2 ScaleManager.orientationSprite has been removed because it never displayed correctly anyway (it would be distorted by the game scale), it will be bought back in a future version by way of a custom orientation state. 2014-09-01 03:30:02 +01:00
photonstorm
047839d806 Fixed preUpdate so that the offset is reset regardless of the RESIZE scaleMode. 2014-09-01 03:20:09 +01:00
photonstorm
80d1df4705 ScaleManager.setMinMax(minWidth, minHeight, maxWidth, maxHeight) is a handy function to allow you to set all the min/max dimensions in one call. 2014-09-01 03:07:17 +01:00
photonstorm
2f1f680d73 Docs fixes. 2014-09-01 02:59:24 +01:00
photonstorm
c6493b59c3 Removed use of _startHeight, left over from the Phaser v1 days that's no longer required. 2014-09-01 02:44:35 +01:00
photonstorm
fe9dbd15e5 The World bounds can now be set to any size, including smaller than the game dimensions. Before it was locked to a minimum size of the game canvas, but it can now be anything. 2014-09-01 02:41:07 +01:00
photonstorm
1a60d641b1 Canvas.removeFromDOM(canvas) will remove a canvas element from the DOM.
Game.destroy now removes the games canvas element from the DOM.
2014-09-01 02:38:21 +01:00
photonstorm
97d771c4e8 ScaleManager has a new scaleMode called RESIZE which will tell Phaser to track the size of the parent container (either a dom element or the browser window if none given) and set the canvas size to match it. If the parent changes size the canvas will resize as well, keeping a 1:1 pixel ratio. There is also a new ScaleManager.setResizeCallback method which will let you define your own function to handle resize events from the game, such as re-positioning sprites for a fluid responsive layout (#642)
The width and height given to the Phaser.Game constructor can now be numbers or strings in which case the value is treated as a percentage. For example a value of "100%" for the width and height will tell Phaser to size the game to match the parent container dimensions exactly (or the browser window if no parent is given). Equally a size of "50%" would tell it to be half the size of the parent. The values are retained even through resize events, allowing it to maintain a percentage size based on the parent even as it updates.
2014-09-01 01:52:04 +01:00
photonstorm
5fb8c7eb85 ScaleManager window.resize handler would constantly dispatch enterPortrait and enterLandscape events on window resizing, regardless if it actually entered that orientation or not.
Stage.offset has been moved to ScaleManager.offset
Stage.bounds has been removed, you can access it via Stage.getBounds.
Stage.checkOffsetInterval has been moved to ScaleManager.trackParentInterval
ScaleManager.hasResized signal has been removed. Use ScaleManager.setResizeCallback instead.
2014-09-01 01:02:48 +01:00
photonstorm
004deff508 Note: This commit will break all input, don't pull it down until I finish this work off later today please!
Moved the DOM offset from Stage to ScaleManager (a more logical location for it) and updated Pointer to use that.
Moved the Pointer offset check to look at the ScaleManager.
Used getBoundingClientRect(), will see if that works better than Phaser.Canvas.getOffset.
2014-08-31 12:17:07 +01:00
photonstorm
8c7a699f74 Getting ready to test auto resizing renderer. 2014-08-31 11:09:27 +01:00
photonstorm
4d0cae0e2d jshint fixes for CocoonJS.App and continuing work on the new ScaleManager. 2014-08-31 10:17:02 +01:00
photonstorm
3e1eb10673 First pass at fully resizable canvas tracking and parenting. 2014-08-31 10:17:02 +01:00
Dan Cox
cccaa30459 CocoonJSApp 'onSuspended' and 'onActivated' events
This PR depends on [#1150] (https://github.com/photonstorm/phaser/pull/1150)!

(I apologize for all the different pull requests in a short time period. I finally got some time to do some development tonight and have been making my way through many of my TODO items.)

This adds support for CocoonJS.App's 'onSuspended' and 'onActivated' events, making it so that the timers and sounds are stopped/started and muted/unmuted when the user swaps an app from the background to the fore or the reverse.

Because neither ['onActivated'] (http://doc.ludei.com/2.0.2/CocoonJS_App/symbols/CocoonJS.App.html#.event:onActivated) nor ['onSuspended'] (http://doc.ludei.com/2.0.2/CocoonJS_App/symbols/CocoonJS.App.html#.event:onSuspended) send an Event object themselves, this patch fakes sending an object by creating one during the function call and giving it a 'type' property for visibilityChange() to check against.
2014-08-29 23:13:13 -04:00
photonstorm
26a55bd202 SoundManager.destroy is a new method that will destroy all current sounds and reset any callbacks.
StateManager.clearCurrentState now handles the process of clearing down the current state and is now called if the Game is destroyed.
Game.destroy now clears the current state, activating its shutdown callback if it had one. It also now destroys the SoundManager, stopping any currently running sounds (#1092)
2014-08-29 11:37:47 +01:00
Richard Davey
ffb413b741 Fixed issue with callbacks not having the correct context. 2014-08-28 21:54:30 +01:00
photonstorm
0c88ba041a If you used a single Game configuration object and didn't specify the enableDebug property it would crash on Debug.preUpdate (thanks @luizbills #1053) 2014-08-28 04:19:10 +01:00
photonstorm
6e2cd37776 ScaleManager.destroy now removes the window and document event listeners, which are no longer created anonymously (thanks @eguneys #1092)
Input.Gamepad.destroy now destroys all connected SinglePads and clears event listeners.
SinglePad.destroy now clears all associated GamepadButton objects and signals.
2014-08-28 03:31:47 +01:00
photonstorm
fa45d7feff Events.onDestroy is a new signal that is dispatched whenever the parent is being destroyed. It's dispatched at the start of the destroy process, allowing you to perform any additional house cleaning needed (thanks @jonkelling #1084)
Group.onDestroy is a new signal that is dispatched whenever the Group is being destroyed. It's dispatched at the start of the destroy process, allowing you to perform any additional house cleaning needed (thanks @jonkelling #1084)
2014-08-28 02:56:06 +01:00
photonstorm
d7f8950758 Debug.cameraInfo no longer crashes if the camera bounds are nulled (thanks @wayfu #1143)
Camera.setBoundsToWorld no longer crashes if the camera bounds are nulled (thanks @wayfu #1143)
2014-08-28 02:13:51 +01:00
Richard Davey
50179d76fb Merge pull request #1015 from Zielak/dev
Phaser.Camera.position for quick access
2014-08-28 02:02:40 +01:00
Richard Davey
6a314a60d1 Merge pull request #1142 from darfux/dev
Fixed Group.removeBetween's default endIndex bug
2014-08-28 01:44:01 +01:00
Richard Davey
cc69a4bf2c Merge pull request #1127 from FedeOmoto/dev
Game configuration object "renderer" property wrongly assigned to Game.r...
2014-08-28 01:36:49 +01:00