Commit graph

2797 commits

Author SHA1 Message Date
Paul
10d0f1943a ScaleManager - scaling consistency and bug-fixes
This includes some minor breaking changes.

- Unifies SHOW_ALL and NO_SCALE being stretched in Firefox and IE
  - As suggested by MDN: "..to emulate WebKit's behavior on Gecko, you
    need to place the element you want to present inside another
    element.."
  - This done via an (overwritable) `createFullScreenTarget` function.
    The (new) DOM element returned from this is placed into the DOM and
    the canvas is added to (and later removed) as the full screen mode
    changes.
  - MINOR BREAK: may affect code that assumes the Phaser canvas has a
    fixed DOM/CSS path (which should hopefully be nobody).  To use to the
    original behavior, where the canvas is not moved, simply set
    `this.fullScreenTarget = game.canvas` manually.

- Updates the refresh/queue to be unified and uses a smarter back-off to
  detect and react to parent dimension changes
  - Cleans up some odd browser issues; not tried on mobile
  - Fixes an issue were update might be called too much and spend time
    doing nothing useful.
  - `maxIterations` is no longer user and marked as deprecated
  - MINOR BREAK: previous approach would occasionally (but not always)
    back off updates the entire iteration/setTimeout sequence; under the
    new approach "onResize" may be called more frequently.

- Fixes a number various transition issues, mostly around RESIZE
  - MINOR BREAK, but correct: leaving RESIZE restores the original game
    size possible
  - Fixes assorted quirks with scales not being updated

- Layout
  - MINOR BREAK: All Canvas margins are "OWNED" by the ScaleManager. They
    will be reset in all modes as appropriate. This is for consistency
    fixes as well as coping with the updated full screen.
  - MINOR BREAK: Canvas right/bottom margins are set to negative margins
    to counter left/top margins. This prevents Canvas margin adjustments
    from affecting the flow .. much.
  - `getParentBounds` rounds to the nearest pixel to avoid "close to"
    value propagation from CSS.
  - Fixes page-align center pushing canvas out of parent

- Misc.
  - MINOR BREAK: `setScreenSize` will update the game size if the mode is
    RESIZE. User-code shoulde use `refresh` instead to ensure that any
    relevant changes are propagated.

- Corrected incorrect documentation
2014-11-07 16:06:33 -08:00
Paul
f7f940d3da Cache: addBitmapData can auto-create FrameData, fixes 1294
- In the "Particle Class" demo there was no explicitly-created FrameData which cause issues later on.
  This cache updates ensures that FrameData will be automatically created for any added cached bitmap data, unless such is explicitly supplied or forbidden.
- Impact: low
  - AnimationManager.loadFrameData is called for all Sprites with BitmapData (except those with an explicit null FrameData) added to the cache
2014-11-07 00:08:54 -08:00
Richard Davey
8396d991b1 Merge pull request #1296 from clark-stevenson/dev
Split pixi.d.ts out of phaser.d.ts
2014-11-05 22:41:13 +00:00
Clark Stevenson
6e648b8a46 updated readme 2014-11-05 21:53:50 +00:00
Clark Stevenson
9cd78d74be updated readme 2014-11-05 21:52:00 +00:00
Clark Stevenson
d775fa8711 Added webgl.d.ts for those who need it. Changed readme.txt to readme.md 2014-11-05 19:25:53 +00:00
Clark Stevenson
c3d2b7a90d Split pixi.d.ts and phaser.d.ts 2014-11-05 18:19:45 +00:00
Clark Stevenson
91bd2da5b6 Updated to 2014/11/05 preparing to separate 2014-11-05 15:20:08 +00:00
photonstorm
2469e45649 Rounding out new dimensions. 2014-11-04 23:57:21 +00:00
photonstorm
7e404604d3 docs update. 2014-11-04 23:57:21 +00:00
photonstorm
d9c4890882 Point.floor will Math.floor both the x and y values of the Point.
Point.ceil will Math.ceil both the `x` and `y` values of the Point.
2014-11-04 23:57:21 +00:00
photonstorm
b6b478f214 Small jsdoc fixes. 2014-11-04 23:57:21 +00:00
Richard Davey
6ae7e6ed90 Merge pull request #1287 from pnstickne/wip-props-to-members
Docs: PIXI Integration and "property to member" decorator for JSDoc
2014-11-04 23:54:56 +00:00
Richard Davey
f4237b3130 Merge pull request #1272 from pnstickne/wip-1246b
Button - bug fixes, issue #1246 (try number two)
2014-11-04 23:51:46 +00:00
Paul
66ab47ff09 PIXI-in-Docs: fixed line numbers
- Also added support for various additional meta-tags
- Minor code cleanup
2014-11-03 18:49:32 -08:00
Paul
4b02ef54ce PIXI-in-Docs: visibility fix
- Private methods were not being annotated as such
2014-11-03 14:52:40 -08:00
Paul
b87eece645 PIXI-in-Docs: prop support
- Added support for nested/ad-hoc properties
- Also cleanup and documentation / limitation notions
2014-11-03 12:45:52 -08:00
spayton
5b6671a634 removed this.z =0, missed from last push 2014-11-03 20:24:56 +00:00
Paul
a7044a6cb6 PIXI-in-Docs fixups
- Removed hard-coded path (oops)
- Added grunt task (oops)
- Added EOLs
2014-11-03 11:30:33 -08:00
Paul
343c0dca3f PIXI-in-Docs - making jshint happy 2014-11-03 11:21:00 -08:00
Paul
ce02d3402f PIXI-in-Docs - Initial
- Initial support for generating PIXI-combined documentation
- Includes yuidoc-to-jsdoc for generating pixi-jsdoc.js
- Creates doc (using pixidoc + builddoc) tasks
- Adds sourceproxy JSDoc plugin to map in corrected file/line meta
- Added yuidocjs as a dev-dependency
2014-11-03 11:05:00 -08:00
spayton
b51c162b4d Fixed new groups incorrectly always adding with a z index of 0 2014-11-03 18:19:41 +00:00
Paul
96915e1612 JSDoc Property to member - slight combining update 2014-11-03 08:27:50 -08:00
Paul
e6da96e908 Added "property to member" plugin for JSDoc
This automatically fixes usage of the form

    /** desc
    * @property {T} name - desc

To

    /** desc
    * @member {T} name

Being careful to only make the transformation when it is logical to do and preserving both descriptions as appropriate.
2014-11-03 03:13:01 -08:00
Pete Baron
8d2cb71300 Created Phaser.Signal fpsProblemNotifier to warn the game program when the CPU starts spiralling out of control. Signal dispatch is limited to once per 10 seconds. 2014-11-03 17:01:36 +13:00
Pete Baron
7d6126799e Bug fix: this.time needs the Date.now() value, not the function! 2014-11-03 17:00:10 +13:00
Pete Baron
9760468929 Detect "spiralling" due to CPU falling behind.
Permanently skip frames when spiralling occurs.
2014-11-03 16:26:56 +13:00
Pete Baron
64682857ac Calculate suggestedFps.
Deprecated timeCap.
2014-11-03 16:25:43 +13:00
Pete Baron
c38f4802ea Fixed pause/resume time incompatibilities (RAF time and Date.now() can't be mixed) which has fixed the problem with tweens disappearing when paused. 2014-11-03 13:59:40 +13:00
Pete Baron
497e919e43 Adjusted particle emitter for slow-mo.
Removed un-needed physics changes.
2014-11-03 13:01:14 +13:00
Pete Baron
0da8c6cb1a Established fixed steps for logic update with catch-up for dropped frames.
Render update runs every frame.
Tweens moved into render update to maintain smooth motion.
Added Time.slowMotion factor, integrated with logic/render updates and tweens.
2014-11-03 12:02:43 +13:00
photonstorm
be8499fa49 Moved ts defs to new home. 2014-11-02 23:00:15 +00:00
Richard Davey
fc0d423a7b Merge pull request #1278 from pnstickne/wip-1255
ScaleManager - bugfixes and updates for #1255
2014-11-02 14:01:23 +00:00
photonstorm
807e443a31 The Input class has been given a minor refactor to tidy things up. Specifically:
* 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
    * Removed some special-casing from cases where it did not matter
    * Removed === false/true, == usage for consistency, changed missing value check to typeof, etc.
    * Updated documentation for specificty; added @public\@protected
    * @deprecated currentPointers due to odd set pattern; totalCurrentPointers is more appropriate.
(thanks @pnstickne #1283)
2014-11-02 12:26:46 +00:00
Richard Davey
a4870a7e62 Merge pull request #1283 from pnstickne/wip-pointer-mgmt
Input - Minor Pointer refactor and documentation updates
2014-11-02 12:24:50 +00:00
photonstorm
30159691fa Fixed onClickTrampoline jsdocs. 2014-11-02 12:20:19 +00:00
photonstorm
97edb7b830 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) 2014-11-02 12:18:23 +00:00
Richard Davey
21a47faaed Merge pull request #1282 from pnstickne/wip-trampoline-click
Click Trampolines - support to trampoline pointer events into 'click' events
2014-11-02 12:15:37 +00:00
photonstorm
8b2628d99c 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) 2014-11-02 12:14:47 +00:00
Richard Davey
5a23b77ec9 Merge pull request #1257 from pnstickne/wip-1191
Input "enabled/disabled" API and documentation consistency updates
2014-11-02 12:12:19 +00:00
photonstorm
65618a7ec6 docs fix. 2014-11-02 12:08:54 +00:00
photonstorm
e853cb14bb readme update 2014-11-02 11:04:03 +00:00
photonstorm
59b25ab6bb Animation.setFrame used the wrong frames array if useLocalFrameIndex was false and a numeric frame ID was given (thanks @Skeptron #1284) 2014-11-02 11:04:03 +00:00
photonstorm
e57c700816 The Gamepad.addCallbacks context parameter was never actually remembered, causing the callbacks to run in the wrong context (thanks @englercj #1285) 2014-11-02 11:04:02 +00:00
Paul
2f460aaf8a Browser incompatibility fix - MAX_SAFE_INTEGER
- Number.MAX_SAFE_INTEGER is only defined in ES6 and not currently cross-browser
2014-11-01 09:50:28 -07:00
Paul
5ec14929de Input - Minor Pointer refactor and documentation updates
- `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
- Removed some special-casing from cases where it did not matter
- Removed `=== false/true`, `==` usage for consistency, changed missing value check to `typeof`, etc.
- Updated documentation for specificty; added `@public\@protected`
- `@deprecated` currentPointers due to odd set pattern; `totalCurrentPointers` is more appropriate.
2014-11-01 09:45:12 -07:00
Paul
31061775d7 Pointe - removed extra whitespace 2014-11-01 01:25:01 -07:00
Paul
5b16bd45a5 ScaleManager - minor fullscreenerror fixes
- IE9 compatibility (no setWindow arguments)
- And removed code that assumpted event.target was the canvas..

(Actually adding the changes this time..)
2014-11-01 01:23:14 -07:00
Paul
14002ca02d Pointer - minor documentation update for click trampolines 2014-11-01 01:11:26 -07:00
Paul
3005419435 Click Trampolines - support to trampoline pointer events into 'click' events
- This is needed to support Fullscreen on IE11 because IE only trusts 'click' events for this operation; click trampolines as a general solution, although they are only required in some "special" cases.
2014-11-01 01:04:17 -07:00