Commit graph

183 commits

Author SHA1 Message Date
Paul
fb9eab76e7 Utils - cleanup
- Updated linked documentation

- Also updated `removeRandomItem` per the contract and for consistency with
  `getRandomItem`.
2014-12-01 23:19:32 -08:00
Paul
bdacef8170 ArrayUtils - minor corrections
- 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
2014-12-01 23:06:06 -08:00
Paul
dab8772de0 Documentation - consistency updates
- 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}
2014-11-30 04:03:35 -08:00
photonstorm
1ef0f0a9fe Rounded off bounds. 2014-11-25 02:49:34 +00:00
photonstorm
7e4a494f13 Keyboard.justPressed has bee renamed to Keyboard.downDuration which is a much clearer name for what the method actually does.
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.
2014-11-20 20:55:51 +00:00
photonstorm
21479acd8e Sprite.autoCull now properly works if the camera moves around the world.
Sprite.inCamera uses a much faster check if auto culling or world bounds checks are enabled and properly adjusts for camera position.
2014-11-18 12:29:55 +00:00
Paul
3c57773710 ArraySet - documentation
(rest of changes..)
2014-11-17 19:55:23 -08:00
Paul
5ec4c4cbe8 ArraySet - documentation
No breaking changes.

- Fixed jsdoc error `*[]` with documentation

- Also corrected documentation to align with behavior and changed
  `callback` to `key` in callAll for consistency
2014-11-17 19:52:13 -08:00
Paul
aa3c21ade7 ArraySet/LinkedList - minor updates
- 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
2014-11-13 01:41:08 -08:00
Paul
794c9f65fe ArrayList/LinkedList - moved from core to utils
- ArrayList is also renamed to ArraySet to better reflect the nature
2014-11-13 00:59:42 -08:00
Paul
ae6cba5928 Math/Utils - various cleanup and deprecations/moves
- 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
2014-11-11 21:28:25 -08:00
Paul
d941e285a3 Math/Utils - various cleanup and deprecations/moves
- And one last before..
2014-11-09 17:40:54 -08:00
Paul
a35d032238 Math/Utils - various cleanup and deprecations/moves
- Put in the missing changes..
2014-11-09 17:26:07 -08:00
Paul
a6d2da2a8a Math/Utils - various cleanup and deprecations/moves
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
2014-11-09 16:17:18 -08:00
Paul
e08e99ea6a Updated Color.webToColor to accept [more] spaces
- webToColor now accepts arbitrary spaces, which are allowed per CSS rules (percents still not supported)
2014-10-28 06:25:20 -07:00
Paul
3cfe200ed1 Minor documentation cleanup 2014-10-28 06:12:48 -07:00
Paul
37a77c674f Add support for "rgba" to Phaser.Stage.backgroundColor
- 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)`.
2014-10-28 05:45:00 -07:00
photonstorm
9cb42a933d Fixed for Pixi v2 new method of batching. 2014-10-23 12:27:25 +01:00
photonstorm
96fd0ade74 JSDoc fixes. 2014-10-21 22:43:42 +01:00
Richard Davey
7a79a68050 Merge pull request #1230 from bobbywilson0/dev
Changed all typeof comparisons from == to ===
2014-10-15 21:39:07 +01:00
photonstorm
d3c26f8c38 Removed old WebGL UV calls. 2014-10-14 01:10:09 +01:00
Bobby Wilson
0482684dc8 changed all typeof comparisons from == to === 2014-10-10 21:52:06 -06:00
Richard Davey
5dbe6b6017 The Uint32Array check used in Utils was incorrectly replacing Uint32Array on Safari, causing errors like BitmapData.getPixel32 to fail and other related issues (fixes #1043 and #1197) 2014-10-05 12:35:40 +01:00
photonstorm
173786c60d Color.createColor now populates the color property of the returned object with the results of Phaser.Color.getColor.
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.
2014-10-01 16:51:34 +01:00
photonstorm
2794d94b08 Color.createColor now populates the color objects color and color32 properties with the results of Phaser.Color.getColor and getColor32 respectively. 2014-10-01 15:19:57 +01:00
photonstorm
e8ca670fba Fixed the body debug calls for Box2D. 2014-09-30 01:44:44 +01:00
photonstorm
c195998a1e Color.webToColor restored. Converts a CSS rgba color into a native color value. 2014-09-30 01:44:33 +01:00
photonstorm
00b5472d4c jshint fixes. 2014-09-29 12:29:18 +01:00
photonstorm
b0e96a37b9 Added Box2D handler support. 2014-09-29 12:27:28 +01:00
photonstorm
33d9b19e29 The Debug canvas is now cleared on State swap. 2014-09-09 15:28:58 +01:00
Jeremy Dowell
06c6b23454 moved: Utils.range to Math.numberArray 2014-09-05 09:36:36 -05:00
Jeremy Dowell
1835453880 fixed: jshint errors 2014-09-04 19:31:53 -05:00
Jeremy Dowell
6c3fac5665 added: Phaser.Utils.range 2014-09-04 19:28:46 -05:00
photonstorm
ec687868de Input.setMoveCallback has been removed due to deprecation.
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.
2014-08-28 03:40:59 +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
9941942941 Merge pull request #1030 from codevinsky/rope
Phaser.Rope
2014-08-28 01:56:02 +01:00
photonstorm
24527eac3e Group.checkAll allows you to check if the same property exists across all children of the Group and is set to the given value (thanks @codevinsky #1013)
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)
2014-07-18 11:52:39 +01:00
jdowell
6432817c7f added: Rope debug, segments, updateAnimation 2014-07-15 14:01:15 -05:00
jdowell
aad74ff4d5 added: Phaser.Utils.getProperty / Phaser.Utils.setProperty; added: Phaser.Group.checkAll
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.
2014-07-14 12:33:13 -05:00
photonstorm
0ff2eb2fb9 jshint fixes 2014-07-09 11:36:45 +01:00
photonstorm
003403c832 Color.getWebRGB will now accept either an Object or numeric color value. 2014-07-09 11:15:24 +01:00
photonstorm
f1bcd1d00b Added Phaser.Utils.mixin. 2014-07-08 12:59:36 +01:00
Richard Davey
6ce183189f Merge pull request #971 from psalaets/issue-970
reorder param list of Phaser.Physics.Arcade.Body.render
2014-07-07 10:29:51 +01:00
Paul Salaets
77b86f43e3 support for debug rendering ninja AABB and circle bodies 2014-07-05 20:58:33 -04:00
Paul Salaets
79f550bc89 updating comments: default color and method name 2014-07-05 18:08:00 -04:00
Phaiax
b14aff5844 Return type of Phaser.Color.packPixel changed 2014-06-29 18:02:59 +02:00
photonstorm
1e9d0b2438 Tidying up. 2014-05-30 05:33:30 +01:00
photonstorm
43e079a53a Readme update. 2014-05-20 10:31:55 +01:00
photonstorm
cc9a234c8c Color.getRGB would return incorrect color components if a color value without alpha was given, now works with both 0xRRGGBB and 0xAARRGGBB.
Color.getWebRGB now works regardless if you give an 0xRRGGBB or 0xAARRGGBB color value.
2014-05-14 02:09:44 +01:00
photonstorm
798d7a4fd1 Stage.backgroundColor now properly accepts hex #RRGGBB and color values 0xRRGGBB again (fix #785) 2014-05-14 01:59:21 +01:00