Commit graph

148 commits

Author SHA1 Message Date
Josh McGhee
4a19aca212 some cleaning up and documentation polish 2015-09-01 01:03:51 +01:00
Josh McGhee
cbd7265bee cherry pick commits from master. Read: I'm not clever. 2015-09-01 00:57:54 +01:00
Richard Davey
af194d447c jsdoc fix #2049 2015-08-31 10:57:54 +01:00
photonstorm
9a83ddcab9 Updated to latest Creature runtimes, added to GameObjectFactory. 2015-07-23 13:25:08 +01:00
photonstorm
f15fe6706c All undefined argument checks were changed from if (typeof x === 'undefined') to if (x === undefined) removing the typeof check and saving some bytes across the codebase in the process. 2015-07-22 10:37:15 +01:00
Richard Davey
3c7293ab57 Updated AnimationParser and fixed LoadTexture calls. 2015-07-16 01:02:59 +01:00
photonstorm
f41f806b99 Fixed issue with looped animations skipping last frame (or getting stuck on a single frame in 2 frame anims) 2015-07-14 13:47:25 +01:00
photonstorm
7c9db8f632 jshint fixes. 2015-05-18 13:36:22 +01:00
photonstorm
2c775cf03d FrameData.getFrameIndexes when called with a partial array (such as creating an animation out of a set of frames) would return the indexes array padded out with 'undefined' entries, causing short animations to never fully play through. 2015-05-18 12:55:48 +01:00
photonstorm
2e6af02f86 AnimationManager.add no longer sets the currentFrame property when just adding an Animation to a Sprite. The currentFrame property is now only set when the animation begins playing. This avoids the Sprite.frame and Sprite.frameName properties from returning incorrect results after adding (but not playing) an Animation. It also allows very short animations (2 frames) to play correctly without needing to loop. 2015-05-18 12:55:48 +01:00
photonstorm
ed3e7cdf8c Frame.resize allows you to change the dimensions of a Frame object and recalculate all of its internal properties (such as bottom and distance). 2015-05-06 00:37:50 +01:00
photonstorm
d9434244a5 Removed array length vars. 2015-04-27 16:22:36 +01:00
photonstorm
aa9ea30e79 Working through fixing TilingSprites for WebGL. 2015-04-21 17:01:24 +01:00
photonstorm
05d0a94116 Phaser.AnimationParser methods JSONData, JSONDataHash and XMLData have all had their cacheKey parameter removed as it's no longer used. 2015-04-21 16:01:11 +01:00
photonstorm
3d75902a67 Removed all calls to TilingTexture because it's now handled in the setFrame component. 2015-04-21 15:55:40 +01:00
photonstorm
ede76cf4f6 Frame.uuid has been removed (was flagged as deprecated for several releases). This has a two-fold effect: First it means that the property no longer exists and secondly it means that the AnimationParser (the class responsible for loading sprite sheets and texture atlases) no longer has to call either RandomDataGenerator.uuid OR populates the PIXI.TextureCache. The first saves some CPU time and the second saves memory by not creating references to textures it doesn't ever use. The PIXI.TextureCache is now ignored by Phaser other than for the __missing and __default textures. 2015-04-21 15:55:04 +01:00
photonstorm
a4963adec3 jsdoc clarification. 2015-04-21 15:54:44 +01:00
photonstorm
8981e9603e Removed Frame.uuid and updating TileSprite to work with animated sprites. 2015-04-21 05:11:19 +01:00
photonstorm
8f06991527 Added support for the [Creature Automated Animation Tool](http://www.kestrelmoon.com/creature/). You can now create a Phaser.Creature object which uses json data and a texture atlas for the animations. Creature is a powerful animation tool, similar to Spriter or Spine. It is currently limited to WebGL games only, but the new libs should prove a solid starting point for anyone wanting to incorporate Creature animations into their games. 2015-04-13 23:16:29 +01:00
photonstorm
b41cf3bc8c AnimationManager.frameName setter wasn't checking if _frameData existed before accessing it (thanks @nesukun #1727) 2015-04-13 11:58:45 +01:00
photonstorm
aa13ec0165 Animation.play wouldn't correctly set the play state on the Game Objects AnimationManager causing the animation to fail to start (calling AnimationManager.play did work however), now they're both consistently working. 2015-03-25 03:59:36 +00:00
photonstorm
244372384e When an Animation completes playback and isn't set to loop it would change the currentFrame property to be the first frame in the set after the onComplete callback had fired. This meant if you set a Sprite to a new frame within an Animation onComplete callback then your change would have been overwritten by the animation itself. This is now no longer the case. 2015-03-24 23:17:13 +00:00
Paul
6225bb0e94 Animation - guard around destroy
- Allows sprites (and/or the animation) to be destroyed from within
  the onUpdate, onLoop, or onComplete events
2015-03-22 17:01:37 -07:00
photonstorm
a69e53f901 Copyright date change. 2015-02-25 03:36:23 +00:00
photonstorm
8d71e8a32c Animation.update skips ahead frames when the system is lagging, however it failed to set the animation to the final frame in the sequence if the animation skipped ahead too far (thanks @richpixel #1628) 2015-02-22 19:26:56 +00:00
photonstorm
6a0a44d47e Small code update. 2015-02-17 06:00:55 +00:00
photonstorm
823997744b Docs update. 2015-02-10 14:53:55 +00:00
Richard Davey
e6b5806c26 Merge pull request #1581 from jromer94/master
fixed index out of bound error
2015-02-03 20:52:04 +00:00
Josh
755653439a fixed index out of bound error 2015-01-28 23:39:23 -05:00
photonstorm
8973423e98 Sprite.frame and AnimationManager.frame wouldn't return the correct index if a sprite sheet was being used unless it had first been set via the setter. 2015-01-08 01:28:38 +00:00
photonstorm
9b967d1948 Removed a few more references in Animation.destroy. 2014-12-15 09:42:18 +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
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
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
c4b81ff6ea jsdoc fixes. 2014-11-25 00:24:28 +00:00
photonstorm
0a86a7ef51 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. 2014-11-08 20:01:10 +00:00
photonstorm
55953078d0 FrameData.clone fixed when cloning data using frame names rather than indexes (thanks pjbaron) 2014-11-08 17:08:29 +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
35d29170d0 Lots of small jsdoc fixes and DocGen updates. 2014-10-20 00:54:56 +01:00
Bobby Wilson
42f53d6266 Merge commit '0482684dc864869397031994f7ba7d9f81721763' of https://github.com/bobbywilson0/phaser into dev 2014-10-10 22:01:34 -06:00
Bobby Wilson
0482684dc8 changed all typeof comparisons from == to === 2014-10-10 21:52:06 -06:00
photonstorm
022d7094d5 jsdoc fixes and frameRate change. 2014-10-10 14:49:01 +01:00
photonstorm
b00866cee9 AnimationManager.name will now return the name property of the currently playing animation, if any. 2014-10-09 14:06:13 +01:00
photonstorm
f04c16da81 Bail out on undefined data. 2014-10-01 05:21:30 +01:00
photonstorm
ecfed2b311 AnimationParser is now using value instead of nodeValue when parsing atlas XML files, avoiding Chrome deprecation warnings (thanks @valtterip #1189) 2014-09-29 22:52:09 +01:00
photonstorm
20551f9129 Lots of jsdocs fixes ready for the new doc generator. 2014-09-16 17:35:08 +01:00
Richard Davey
15a0ae6b4f jsdoc fix 2014-09-16 00:28:09 +01:00
photonstorm
de07f5b649 Testing out Frame and Animation clone features. 2014-09-02 21:03:16 +01:00
photonstorm
32119e9892 Animation.onUpdate is a new event that is dispatched each time the animation frame changes. Due to its intensive nature it is disabled by default. Enable it with Animation.enableUpdate = true (#902) 2014-08-29 14:30:44 +01:00