GameObject.input.dragStartPoint now stores the coordinates the object was at when the drag started. This value is populated when the drag starts. It can be used to return an object to its pre-drag position, for example if it was dropped in an invalid place in-game.
- Corrected off-by-one issue; the effect is the same but it is arguably
more correct.
- Fixed getRandomItem; it would previously return null for false'y values
(false/''/0) which was against the defined contract.
- Updated documentation / documented types
- Updated `readOnly` doclet to `readonly`
- `array` refined to `type[]`, where such information was immediately
determinable.
- Updated {Any}/{*} to {any}; {...*} is standard exception
- Udated {Object} to {object}
Keyboard.justReleased has bee renamed to Keyboard.upDuration which is a much clearer name for what the method actually does.
Keyboard.downDuration, Keyboard.upDuration and Keyboard.isDown now all return `null` if the Key wasn't found in the local keys array.
No breaking changes.
- Fixed jsdoc error `*[]` with documentation
- Also corrected documentation to align with behavior and changed
`callback` to `key` in callAll for consistency
- Renamed ArrayList to ArraySet
- Added ArrayList is a deprecated proxy for compatibility
- Updated internal code to use ArraySet
- ArraySet can be constructed with an array; if the caller is willing to
accept some responsibility this can remove the O(n^2) behavior of
repeatedly calling `add`.
- Updated Group.filter to take advantage of this
- ArraySet.total is read-only proxy for for list.length
- Fixes ArraySet.setAll where it would only set properties with truthy
values
- Updated documentation
- FIX/CHANGE - Math.wrapAngle over radians; it would convert radians to degrees
- No internal code relies on unexpected the radians-to-degrees behavior
- Moved additional methods over to ArrayUtils, only marked deprecated in Math
- Removed some private annotations; e.g. linear / factorial public, but bernstein / catmullRom still protected
- Marked additional duplicates deprecated; e.g linearValue, angleLimit
- Documentation updates
- Fixed some accidental "Utils.Arrays" usage (oops!)
- Bumped deprecations from 2.1.4 to 2.2.0
There are no known breaking changes.
- Timer
- Uses standard Math.min/Math.max (it's better 2, 3 items).
- Math
- Updated documentation
- Marked various Math functions as deprecated, proxying as appropriate
- Array-based functions -> ArrayUtils
- RNG-based functions -> Utils
- Updated core-usage
- floor/ceil should not be used (alternatives provided)
- Altered for some equivalencies
- Also fixes some assorted issues
- Marked a few internal functions as private
- Utils
- Moved polyfills to their own file for better visibility
- Moved array functions to ArrayUtils and marked proxies as deprecated
- Created Phaser.ArrayUtils for array-related functions
- polyfills moved to their own file
- Functions given function names
- Added Math.trunc
- backgroundColor now uses valueToColor which supports hex strings, web/rgba strings, and hex numbers.
- valueToColor normalizes across hexToColor/webToColor/getRGB; see comments
- hexToColor now documents the prefix being optional and allows the `0x` prefix.
- webToColor now exctracts an alpha channel if present - as a slight misfeature it will also accept `rgb(..,a)`.
Color.createColor now has a `color32` property with the results of `Phaser.Color.getColor32`.
Color.hexToColor has been optimised to inline the regex and has moved the createColor call so it now populates the color object fully, not just setting the r,g,b properties.
BitmapData.refreshBuffer has been removed and replaced with BitmapData.update.
BitmapData.drawSprite has been removed due to deprecation. Use BitmapData.draw instead.
Pointer.moveCallback has been removed due to deprecation.
SinglePad.addButton has been removed due to deprecation.
P2.Body.loadData has been removed due to deprecation.
P2.World.defaultFriction and defaultRestitution have been removed due to deprecation.
Canvas.create noCocoon parameter has been removed due to deprecation.
Color.getColorInfo, RGBtoHexstring, RGBtoWebstring and colorToHexstring has been removed due to deprecation.
Group.checkProperty allows you to check if the property exists on the given child of the Group and is set to the value specified (thanks @codevinsky #1013)
Phaser.Utils.setProperty will set an Objects property regardless of depth (thanks @codevinsky #1013)
Phaser.Utils.setProperty will set an Objects property regardless of depth (thanks @codevinsky #1013)
Phaser.Utils.getProperty will get an Objects property regardless of depth (thanks @codevinsky #1013)
Added deep-property getting and setting via strings:
Phaser.Util.getProperty(someObj, 'foo.bar.baz');
Phaser.Util.setProperty(someObj, 'foo.bar.baz', 'lol');
Added a "checkAll" method to Phaser.Group that returns true/false if all of the children's given properties match the value passed in.
this.someGroup.checkAll('foo.bar.baz', 'lol'); // will return true if child[n].foo.bar.baz === 'lol'
Comes with standard 'force' ability.
Color.HSVColorWheel will return an array with 360 color objects for each segment of an HSV color wheel, you can optionally set the saturation and value amounts.
Color.HSLColorWheel will return an array with 360 color objects for each segment of an HSL color wheel, you can optionally set the saturation and lightness amounts.
Removed un-needed cache vars from ArcadePhysics.World.
Tidied up ArcadePhysics.Body and fixed rotation parameters.
Every single Arcade Physics Example now runs perfectly under this release.
Loads of updates across most the Tilemap files. Not finished yet, still CSV loading to do and a multi-tileset issue to resolve, but it's a lot more flexible now.