You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+90-10Lines changed: 90 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,11 @@
21
21
-[License](#license)
22
22
23
23
<aname="about"></a>
24
-
# Phaser 2.1.4
24
+
# Phaser 2.2.0
25
25
26
26
Phaser is a fast, free and fun open source game framework for making desktop and mobile browser HTML5 games. It uses [Pixi.js](https://github.com/GoodBoyDigital/pixi.js/) internally for fast 2D Canvas and WebGL rendering.
@@ -71,20 +71,48 @@ Finally the list of [community authored Phaser Tutorials](http://www.lessmilk.co
71
71
<aname="change-log"></a>
72
72
## Change Log
73
73
74
-
Version 2.1.4 - "Bethal" - in development
74
+
Version 2.2.0 - "Bethal" - in development
75
75
76
76
### New Features
77
77
78
+
* Updated to Pixi v2.1.0 - see seprate change log entry below.
78
79
* Cache.getRenderTexture will retrieve a RenderTexture that is stored in the Phaser Cache. This method replaces Cache.getTexture which is now deprecated.
79
80
* Cache.autoResolveURL is a new boolean (default `false`) that automatically builds a cached map of all loaded assets vs. their absolute URLs, for use with Cache.getURL and Cache.checkURL. Note that in 2.1.3 and earlier this was enabled by default, but has since been moved behind this property which needs to be set to `true`*before* you load any assets to enable.
80
81
* You can now call Tween.to again on a Tween that has already completed. This will re-use the same tween, on the original object, without having to recreate the Tween again. This allows a single tween instance to be re-used multiple times, providing they are linked to the same object (thanks InsaneHero)
81
82
* Phaser.Color.valueToColor converts a value: a "hex" string, a "CSS 'web' string", or a number - into red, green, blue, and alpha components (thanks @pnstickne#1264)
82
83
* Stage.backgroundColor now supports CSS 'rgba' values, as well as hex strings and hex numbers (thanks @pnstickne#1234)
83
-
84
+
* Pointer.addClickTrampoline now adds in support for click trampolines. These raise pointer events into click events, which are required internally for a few edge cases like IE11 full screen mode support, but are also useful if you know you specifically need a DOM click event from a pointer (thanks @pnstickne#1282)
85
+
* Point.floor will Math.floor both the `x` and `y` values of the Point.
86
+
* Point.ceil will Math.ceil both the `x` and `y` values of the Point.
87
+
* ScaleManager.scaleSprite takes a Sprite or Image object and scales it to fit the given dimensions. Scaling happens proportionally without distortion to the sprites texture. The letterBox parameter controls if scaling will produce a letter-box effect or zoom the sprite until it fills the given values.
88
+
* Phaser.DOM.getBounds is a cross-browser element.getBoundingClientRect method with optional cushion.
89
+
* Phaser.DOM.calibrate is a private method that calibrates element coordinates for viewport checks.
90
+
* Phaser.DOM.aspect gets the viewport aspect ratio (or the aspect ratio of an object or element)
91
+
* Phaser.DOM.inViewport tests if the given DOM element is within the viewport, with an optional cushion parameter that allows you to specify a distance.
92
+
* Phaser.DOM.viewportWidth returns the viewport width in pixels.
93
+
* Phaser.DOM.viewportHeight returns the viewport height in pixels.
94
+
* Phaser.DOM.documentWidth returns the document width in pixels.
95
+
* Phaser.DOM.documentHeight returns the document height in pixels.
96
+
* TilemapLayers have been given a decent performance boost on canvas with map shifting edge-redraw (thanks @pnstickne#1250)
97
+
* A large refactor to how the internal game timers and physics calculations has been made. We've now swapped to using a fixed time step internally across Phaser, instead of the variable one we had before that caused glitchse on low-fps systems. Thanks to pjbaron for his help with all of these related changes.
98
+
* We have separated the logic and render updates to permit slow motion and time slicing effects. We've fixed time calling to fix physics problems caused by variable time updates (i.e. collisions sometimes missing, objects tunneling, etc)
99
+
* Once per frame calling for rendering and tweening to keep things as smooth as possible
100
+
* Calculates a `suggestedFps` value (in multiples of 5 fps) based on a 2 second average of actual elapsed time values in the `Time.update` method. This is recalculated every 2 seconds so it could be used on a level-by-level basis if a game varies dramatically. I.e. if the fps rate consistently drops, you can adjust your game effects accordingly.
101
+
* Game loop now tries to "catch up" frames if it is falling behind by iterating the logic update. This will help if the logic is occasionally causing things to run too slow, or if the renderer occasionally pushes the combined frame time over the FPS time. It's not a band-aid for a game that floods a low powered device however, so you still need to code accordingly. But it should help capture issues such as gc spikes or temporarily overloaded CPUs.
102
+
* It now detects 'spiralling' which happens if a lot of frames are pushed out in succession meaning the CPU can never "catch up". It skips frames instead of trying to catch them up in this case. Note: the time value passed to the logic update functions is always constant regardless of these shenanigans.
103
+
* Signals to the game program if there is a problem which might be fixed by lowering the desiredFps
104
+
* Time.desiredFps is the new desired frame rate for your game.
105
+
* Time.suggestedFps is the suggested frame rate for the game based on system load.
106
+
* Time.slowMotion allows you to push the game into a slow motion mode. The default value is 1.0. 2.0 would be half speed, and so on.
107
+
* Time.timeCap is no longer used and now deprecated. All timing is now handled by the fixed time-step code we've introduced.
108
+
* Time.now can no longer be relied upon to contain a timestamp value. If the browser supports requestAnimationFrame then `Time.now` will contain the high resolution timer value that rAf generates. Otherwise it will contain the value of Date.now. If you require the actual time value (in milliseconds) then please use `Time.time` instead. Note that all Phaser sub-systems that used to rely on `Time.now` have been updated, so if you have any code that extends these please be sure to check it.
109
+
* Game.forceSingleUpdate will force just a single logic update, regardless of the delta timer values. You can use this in extremely heavy CPU situations where you know you're about to flood the CPU but don't want Phaser to get stuck in a spiral.
110
+
* Tilemap.createFromTiles will convert all tiles matching the given tile index (or an array of indexes) into Sprites. You can optionally then replace these tiles if you wish. This is perfect for games when you want to turn specific tiles into Sprites for extra control. The Sprites have an optional properties object which they can be populated with.
84
111
85
112
### Updates
86
113
87
114
* TypeScript definitions fixes and updates (thanks @clark-stevenson)
115
+
* The TypeScript definitions have moved to the `typescript` folder in the root of the repository.
88
116
* Cache._resolveUrl has been renamed to Cache._resolveURL internally and gained a new parameter. This method is a private internal one.
89
117
* Cache.getUrl is deprecated. The same method is now available as Cache.getURL.
90
118
* Loader.useXDomainRequest used to be enabled automatically for IE9 but is now always set to `false`. Please enable it only if you know your server set-up / CDN requires it, as some most certainly do, but we're finding them to be less and less used these days, so we feel it's safe to now disable this by default (#1248)
@@ -94,18 +122,70 @@ Version 2.1.4 - "Bethal" - in development
94
122
* Phaser.Polygon has been refactored to address some Pixi v2 migration issues (thanks @pnstickne for the original implementation #1267)
95
123
* Polygon.area is now only calculated when the Polygon points list is modified, rather than on every call.
96
124
* Phaser.Polygon can now accept the points list in a variety of formats: Arrays of Points, numbers, objects with public x/y properties or any combination of, or as a parameter list (thanks @pnstickne for the original implementation #1267)
125
+
* All of the Input classes now use the more consistent `enabled` property instead of `disabled`. I.e. you can now check `if (input.mouse.enabled)` rather than `if (!input.mouse.disabled)`. The disabled property has been moved to a getter for backwards compatibility but is deprecated and will be removed in a future version (thanks @pnstickne#1257)
126
+
* The Input class has been given a minor refactor to tidy things up. Specifically:
127
+
* pointerN are aliases to backed pointers[N-1] array. This simplifies (and increases the efficiency of) looping through all the pointers when applicable; also eliminates pointer-existance checks Removes various hard-coded limits (added MAX_POINTERS); changed maxPointers default
128
+
* Removed some special-casing from cases where it did not matter
129
+
* Removed === false/true, == usage for consistency, changed missing value check to typeof, etc.
130
+
* Updated documentation for specificty; added @public\@protected
131
+
*@deprecated currentPointers due to odd set pattern; totalCurrentPointers is more appropriate.
132
+
(thanks @pnstickne#1283)
133
+
* Various ScaleManager fixes and updates (thanks @pnstickne):
134
+
* Scale modes can now be set independently
135
+
* Switching between fullscreen and normal correctly restores modes
136
+
* Alignment does not incorrectly offset in fullscreen mode (#1255)
* NO_SCALE should not not scale (vs previous behavior of having no behavior)
141
+
* Correct usage of scaleMode depending on mode
142
+
* AudioSprite - removed an unnecessary if-statement (thanks @DaanHaaz#1312)
143
+
* ArcadePhysics.skipQuadTree is now set to `true` by default. A QuadTree is a wonderful thing if the objects in your game are well spaced out. But in tightly packed games, especially those with tilemaps or single-screen games, they are a considerable performance drain and eat up CPU. We've taken the decision to disable the Arcade Physics QuadTree by default. It's all still in there and can be re-enabled via `game.physics.arcade.skipQuadTree = false`, but please only do so if you're sure your game benefits from this.
144
+
* Phaser.DOM now houses new DOM functions. Some have been moved over from ScaleManager as appropriate.
97
145
98
146
### Bug Fixes
99
147
100
148
* Tilemaps in WebGL wouldn't update after the first frame due to a subtle change in how Pixi uploads new textures to the GPU.
101
149
* XML files weren't being added to the URL map.
102
150
* Cache._resolveURL was causing a Sound double-load in Firefox and causing errors (thanks @domonyiv#1253)
103
151
* Loader.json was using the wrong context in IE9 with XDomainRequest calls (thanks @pnstickne#1258)
104
-
* Polygon.contains was toggling the return value on each valid hit (thanks @Singularetantum#1265#1266)
105
152
* Text.updateText was incorrectly increasing the size of the texture each time it was called (thanks @spayton#1261)
106
153
* Polygon.contains now correctly calculates the result (thanks @pnstickne@BurnedToast#1267)
107
154
* Setting Key.enabled = false while it is down did not reset the isDown state (thanks @pnstickne#1190#1271)
108
-
155
+
* The Gamepad.addCallbacks context parameter was never actually remembered, causing the callbacks to run in the wrong context (thanks @englercj#1285)
156
+
* Animation.setFrame used the wrong frames array if `useLocalFrameIndex` was `false` and a numeric frame ID was given (thanks @Skeptron#1284)
157
+
* Fullscreen mode in IE11 now works (thanks @pnstickne)
158
+
* Cache.addBitmapData now auto-creates a FrameData (thanks @pnstickne#1294#1300)
159
+
* P2.BodyDebug circles were drawing at half widths (thanks @enriqueto#1288)
160
+
* FrameData.clone fixed when cloning data using frame names rather than indexes (thanks pjbaron)
161
+
* Lots of the Cache getters (such as `Cache.getbitmapData`) would return `undefined` if the asset couldn't be found. They now all consistently return `null` for missing entries (thanks @Matoking#1305)
162
+
* Phaser games should now work again from the CocoonJS Launcher.
163
+
164
+
### Pixi 2.1.0 New Features
165
+
166
+
* unloadFromGPU added to PIXI.BaseTexture
167
+
* PIXI.VideoTexture added
168
+
* PIXI.RoundedRectangle added
169
+
* Ensured all float32arrays use PIXI.Float32Array
170
+
* Removed the use of call in updateTransform (as its 10x faster to run the function directly)
171
+
* autoResize option added to renderer options (default is false). Pixi no longer automatically changes the style of the canvas.
* Fixed CocoonJS crashing, when loading destroyed texture
188
+
* Fix eventTarget emit bug
109
189
110
190
For details about changes made in previous versions of Phaser see the full Change Log at https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md
111
191
@@ -157,11 +237,11 @@ Nice and easy :)
157
237
158
238
Phaser is now available on [CDNJS](http://cdnjs.com). You can include the following in your html:
@@ -178,7 +258,7 @@ If you need to support IE9 or Android 2.x and want to use P2 physics then you mu
178
258
179
259
Phaser is developed in JavaScript. We've made no assumptions about how you like to code your games, and were careful not to impose any form of class / inheritance / structure upon you. So you won't find it split into require modules or pull in 3rd party npm packages for example. That doesn't mean you can't, it just means we don't force you to do so. If you're a requireJS user you'll find a new template in the `resources\Project Templates` folder just for you.
180
260
181
-
If you code with [TypeScript](http://www.typescriptlang.org/) you'll find a comprehensive definitions file inside the `build` folder and tutorials on getting started. This definitions file is for TypeScript 1.0+. If you are using an earlier version of TypeScript (i.e. 0.9.5) you will need to include the WebGL definitions into your project first. This file isn't included with Phaser.
261
+
If you code with [TypeScript](http://www.typescriptlang.org/) you'll find a comprehensive definitions file inside the `typescript` folder and tutorials on getting started on our site. This definitions file is for TypeScript 1.0+. If you are using an earlier version of TypeScript (i.e. 0.9.5) you will need to include the WebGL definitions into your project first. This file isn't included with Phaser.
0 commit comments