Commit graph

1871 commits

Author SHA1 Message Date
photonstorm
4ad6df9a29 A test to try for #1424 2014-12-09 23:38:23 +00:00
photonstorm
22e8340df7 Fixes issue where Pixi CanvasTint didn't allow for browsers that bit-shift the alpha value on putImageData (Android Stock Browser, I'm looking at you!) 2014-12-09 15:27:26 +00:00
Richard Davey
1bf3f08d8d Merge pull request #1420 from pnstickne/wip-1406
Fix Full Screen launching in Android Chrome
2014-12-07 11:33:52 +00:00
photonstorm
38a224df3e Tween.delay, Tween.repeat and Tween.yoyo will no longer throw an error if called before a TweenData object has been created (via Tween.to or Tween.from) (thanks @SomMeri #1419) 2014-12-07 11:31:48 +00:00
Paul
388ab1d98b Fix Full Screen launching in Android Chrome
The click trampoline added for IE prevents Chrome for Android from being
able to launch Full Screen mode with the default parameters for
`ScaleManger#startFullScreen`. (The desktop version of Chrome is not
affected.)

This fix adds an additional compatibility settings (`clickTrampoline`)
that can be used to configure when such is used. By default the
'when-not-mouse' mode is only enabled for Desktop browsers, where the
primary input is ubquitously a mouse.

There are no known breaking compatibility changes - the Full Screen should
be initiatable in Chrome for Android as it was in 2.1.x. The default
Android browser does not support Full Screen.
2014-12-06 12:30:40 -08:00
photonstorm
e7f3b9188e Preparing for Phaser 2.2.2 development. 2014-12-04 11:49:53 +00:00
photonstorm
a3533b9b75 Phaser 2.2.1. 2014-12-04 11:31:41 +00:00
photonstorm
b0d8e43128 And Pixi fixed the premult alpha issue properly. Back in again! 2014-12-03 21:20:41 +00:00
photonstorm
847cde81a9 Custom Particle classes that used a BitmapData wouldn't work (thanks @hardalias #1402) 2014-12-03 20:59:44 +00:00
photonstorm
3371f9ff1e Added Game.debug reset method for when the debug manager is disabled (thanks @DanielSitarz #1407) 2014-12-03 20:56:39 +00:00
photonstorm
b05d745c40 Reverted changes as they broke all alpha support. Will put back once fixed in Pixi. 2014-12-03 20:54:25 +00:00
John Watson
fcca6ba730 Fixed TweenManager.isTweening() and .removeFrom()
Updated invalid reference Tween._object to .target
2014-12-03 10:20:29 -08:00
photonstorm
e271c63ca6 Preparing for Phaser 2.2.1. 2014-12-03 13:41:48 +00:00
photonstorm
1d6fd31bd7 Phaser 2.2.0. 2014-12-03 09:34:51 +00:00
photonstorm
eb6a09ca0a Pixi update. 2014-12-03 09:18:43 +00:00
photonstorm
84e845db71 Various doc fixes. 2014-12-03 03:19:25 +00:00
photonstorm
3018eaece9 Setting forceMinimumDocumentHeight default to false. This is an iOS edge-case and messes with desktop browsers.
Fix #1399
2014-12-02 14:37:07 +00:00
photonstorm
9d79605447 Pixi 2.2.0 merged. 2014-12-02 11:01:57 +00:00
photonstorm
35e2893db4 Game.lockRender is a new property. If false Phaser will automatically render the display list every update. If true the render loop will be skipped. You can toggle this value at run-time to gain exact control over when Phaser renders. This can be useful in certain types of game or application. Please note that if you don't render the display list then none of the game object transforms will be updated, so use this value carefully. 2014-12-02 09:03:55 +00:00
photonstorm
def662f28f Text.setShadow has had the default color value changed from rgba(0,0,0,0) to rgba(0,0,0,1) so it appears as a black shadow by default - before the alpha channel made it invisible. 2014-12-02 09:03:55 +00:00
photonstorm
03ebb8d11c Docs update. 2014-12-02 09:03:55 +00:00
photonstorm
2380d1827b Updated to latest Pixi dev branch. 2014-12-02 09:03:55 +00:00
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
Richard Davey
152b26a668 Merge pull request #1378 from pnstickne/wip-minor-updatelogic-fix
Minor logic fix for Sprite life update
2014-12-01 12:07:56 +00:00
Richard Davey
81f356c235 Merge pull request #1386 from pnstickne/wip-docs-1130
Assorted documentation/consistency updates
2014-12-01 12:07:10 +00:00
Paul
d15037e283 Event-Signal object count optimization
There are a bunch of signals added for Sprites; more when input is
enabled. However, very few of these signals are ever actually used. While
the previous performance update related to Signals addressed the size of
each Signal object, this update is to reduce the number of Signal objects
as used by the Events type.

As a comparison the "Particle: Random Sprite" demo creates 3200+ Signals;
with this change there less than 70 signals created when running the same
demo. (Each Event creates at 8 signals by default, and there is an Event
for each of the 400 particles.) While this is an idealized scenario, a
huge amount (of albeit small) object reduction should be expected.

It does this by creating a signal proxy property getter and a signal
dispatch proxy. When the event property (eg. `onEvent`) is accessed a new
Signal object is created (and cached in `_onEvent`) as required. This
ensures that no user code has to perform an existance-check on the event
property first: it just continues to use the signal property as normal.

When the Phaser game code needs to dispatch the event it uses
`event.onEvent$dispath(..)` instead of `event.onEvent.dispatch(..)`. This
special auto-generated method automatically takes care of checking for if
the Signal has been created and only dispatches the event if this is the
case. (If the game code used the `onEvent` property itself the event
deferal approach would be defeated.)

This approach is designed to require minimal changes, not negatively
affect performance, and reduce the number of Signal objects and
corresponding Signal/Event resource usage.

The only known user-code change is that code can add to signal (eg.
onInput) events even when input is not enabled - this will allow some
previously invalid code run without throwing an exception.
2014-11-30 21:39:25 -08:00
Paul
bedab931a9 Documentation - Signal 2014-11-30 15:56:20 -08:00
Paul
b66a32e3a1 Documentation - number refinement
Changed some {number} types to {integer} where such is trivially
verifiable.
2014-11-30 15:22:39 -08:00
Paul
fa95c53631 Documentation - Group
- Merged in group doc updates

- Added a DisplayObject stub type for better link-out across documentation
2014-11-30 15:13:55 -08:00
Paul
5645690174 General docs - reverting src/pixi changes
(Because outside of control, really.)
2014-11-30 13:04:02 -08:00
Paul
8b1c7625d4 Documentation - typo fix 2014-11-30 04:05:23 -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
cfbad72881 Documentation - general
Updated some documentation for formatting, consistency, and minor
corrections.
2014-11-30 04:02:45 -08:00
Paul
3299588326 Sprite - removed comment
The comment was no longer valid after the previos changes.
2014-11-29 14:12:14 -08:00
photonstorm
d5dfa464c0 Added alpha setting to getContext. 2014-11-29 19:40:50 +00:00
photonstorm
a012d8caa2 jsdoc update 2014-11-29 19:40:50 +00:00
Paul
dfe7279090 Minor logic fix for Sprite life update
The substraction of `physicsElapsedMS` needs to be done for all individual
updates. (When current FPS ~ target FPS this is a 1-1 mapping, but catchup
updates can throw off the calculations.)

Also renamed `Game#updateNumber` (a poor initial name on my part) to
`currentUpdateID`. This matches the naming of
`Stage#currentRenderOrderID`.
2014-11-28 23:02:31 -08:00
Paul
fb5a1b9946 TimerEvent - tabs to spaces
Converted tabs to spaces, for consistency
2014-11-27 23:57:42 -08:00
Paul
c5381f96ef Time/Time - documentation updates and minor cleanup
- Removed `Time.pausedTime`

  Time.pausedTime has not been used / updated since
  b255fea85f in Feb 2014.

  There might be a case to re-explore how pause time is
  reported/observable, possibly with a distinction of 'current' and 'last'
  and the semantics of such. For instance, pause duration is only updated
  after the resume occurs and reflects the duration-of-the-last-pause..

- Removed `Time` _i and _len properties These are better suited by local
  variables.

- General documentation updates.

- Marked several methods such as `Timer.order` as protected - there are
  advanced use-cases for them, but different user-facing methods and
  documentations are likely in order. Also marked `Timer.sortHandler` as
  private; but did not change any interfaces.
2014-11-27 23:54:42 -08:00
Paul
47c49b18cf Tilemap - Tiled image size calculation
Addresses https://github.com/photonstorm/phaser/issues/1371 - where Tiled
used floor calculations and Phaser used round calculations.

There are no breaking changes with the demos; however, if there was code
that relied on behavior that _deviated_ from the defactor Tilemap behavior
then may be prone to "incorrect results" if using tileset images that are
not correctly aligned to tilesize multiples.

This also adds/corrects some warnings:
- A warning when the tileset size is not an even multiple (it was
  suppressed due to using `round` prior to the checks.
- A warning if loading an image changes the cols/rows of a Tileset
- A specific warning for Tileset Image Collections which are not yet
  supported
2014-11-26 19:50:07 -08:00
photonstorm
2488359277 RC12 Prep. 2014-11-26 13:13:50 +00:00
photonstorm
471ad20b4a Added Time.physicsElapsedMS and used in Sprite lifespan and Tweens. 2014-11-26 13:13:25 +00:00
photonstorm
fb733ddcca onPreRenderCallback wasn't being cleared on a State swap. 2014-11-26 13:12:51 +00:00
photonstorm
fc457f5aca Added missing docs. 2014-11-26 04:16:52 +00:00
photonstorm
667d477a16 P2.BodyDebug always lagged behind the position of the Body it was tracking by one frame, which became visible at high speeds. It now syncs its position in the Body.postUpdate which prevents this from happening (thanks @valueerror) 2014-11-25 22:21:11 +00:00
photonstorm
3d3920efab Various jsdoc fixes. 2014-11-25 21:13:25 +00:00
photonstorm
e86f00eb55 Text.lineSpacing works correctly again. Before no space was added between the lines (thanks @intimidate #1367 and @brejep #1366) 2014-11-25 17:06:17 +00:00
Tim van den Eijnden
990867547e fix issue with lineSpacing, no space was added between the lines. The complete text moved down instead 2014-11-25 16:45:29 +01:00
photonstorm
72eaee3139 Adjusted Sprite.preUpdate to remove the lifespan calculation. 2014-11-25 14:18:18 +00:00