Commit graph

636 commits

Author SHA1 Message Date
photonstorm
c8ca3d1809 Emitter now calls the Phaser.Particle.onEmit function, which is left empty for you to override and add in custom behaviours. 2014-04-10 01:37:10 +01:00
photonstorm
95b0532f59 Emitter.setScale has a new 'rate' parameter which allows particles to change in scale over time, using any Easing value or timescale.
Emitter.setAlpha has a new 'rate' parameter which allows particles to change alpha over time, using any Easing value or timescale.
Emitter.bringToTop and Emitter.sendToBack are booleans that let you optionally set the display order of the Particle when emitted.
2014-04-10 01:36:05 +01:00
photonstorm
770ced8ac1 Group.customSort allows you to sort the Group children based on your own sort function. 2014-04-10 00:56:53 +01:00
photonstorm
be52515ed4 PluginManager parent parameter removed as it's redundant. Also most core functions tidied up and jsdocs fixed. 2014-04-09 16:12:25 +01:00
photonstorm
50981fd729 Emitter now has minParticleAlpha and maxParticleAlpha values for setting a random alpha on emitted particles.
Emitter.particleAnchor allows you to control the anchor of emitted Particles. Defaults to 0.5 (same as before) but now under your control.
Emitter now emits Phaser.Particle objects instead of Phaser.Sprites, which can be extended as required.
Emitter has had various local properties removed that were already declared in Phaser.Group which it extends.
2014-04-09 14:29:23 +01:00
photonstorm
73d0414672 Grunt update to dev dependencies (thanks @xtian, #695) 2014-04-09 12:23:17 +01:00
photonstorm
b9cb2417b6 Group.removeBetween now properly iterates through the children. 2014-04-09 03:19:36 +01:00
photonstorm
01ccbd97c0 Key.enabled boolean allows you to toggle if a Key processes its update method or dispatches any events without deleting and re-creating it. 2014-04-09 02:29:41 +01:00
photonstorm
e764be430e Emitter.minParticleScale and maxParticleScale wasn't resetting the Body size correctly. 2014-04-09 00:59:53 +01:00
photonstorm
8fc2a465cd New Phaser package, small docs updates and preparing P2.World for new bounds code and v0.5.0 migration. 2014-04-08 03:31:13 +01:00
photonstorm
01eec6cef5 Keyboard.stop nulls the function references after removing the event listeners (thanks @bmceldowney, #691) 2014-04-07 12:29:26 +01:00
photonstorm
bf32590cfe Fixed a few jsdoc errors. 2014-04-07 12:29:26 +01:00
photonstorm
38d722c1e5 Tilemap.removeTile(x, y, layer) lets you remove the tile at the given coordinates and updates the collision data.
Tilemap.removeTileWorldXY lets you remove the tile at the given pixel value coordinates and updates the collision data.
If you pass `null` to Tilemap.putTile as the tile parameter it will pass the call over to Tilemap.removeTile.
2014-04-01 13:36:42 +01:00
photonstorm
61429d8467 StateManager.restart allows you to quickly restart the *current* state, optionally clearing the world and cache. 2014-04-01 11:25:04 +01:00
photonstorm
a4ed94e039 Key.reset now clears any callbacks associated with the onDown and onUp events and nulls the onHoldCallback if set. Key.reset is called by Keyboard.reset when changing state. 2014-04-01 04:41:43 +01:00
photonstorm
439cefd481 ArcadePhysics.Body.hitTest(x, y) will return a boolean based on if the given world coordinate are within the Body or not.
Fixed jsdoc method tags in Body.
2014-04-01 03:54:20 +01:00
photonstorm
03b80887f2 SoundManager.removeByKey(key) will remove all sounds from the SoundManager that have a key matching the given value. 2014-04-01 03:42:30 +01:00
photonstorm
3728f25d68 SoundManager.remove(sound) now lets you remove a sound from the SoundManager, destroying it in the process.
Sound.destroy will remove a sound and all local references it holds, optionally removing itself from the SoundManager as well.
2014-04-01 03:38:13 +01:00
photonstorm
1f32ef721d The Phaser Gruntfile is now split up into option tasks (thanks @xtian, #638) 2014-04-01 01:47:42 +01:00
photonstorm
5ed79dfefe The Phaser jshint process is now running on Travis (thanks @xtian, #656) 2014-04-01 01:24:49 +01:00
photonstorm
5559fea0f8 The State.update function (and thus the update of any sub-classed Sprites or other objects) is now called before Stage, Tweens, Sound, Input, etc (#662) 2014-04-01 01:01:15 +01:00
photonstorm
0198a77fe6 Phaser.Point.centroid static function added to calculate the centroid or midpoint of an array of points (thanks @lewster32, #675) 2014-04-01 00:42:13 +01:00
photonstorm
e3f1c7b21c Added Pointer.positionUp which records the last point at which the pointer left the screen / was raised (thanks @Cryszon ,#676) 2014-04-01 00:40:26 +01:00
photonstorm
3f8911d95f SoundManager.boot will check to see if the AudioContext was created before carrying on (thanks @keyle, fix #669) 2014-03-31 11:22:44 +01:00
photonstorm
16853d0e82 Updated to Pixi 1.5.2 release. 2014-03-31 11:04:02 +01:00
photonstorm
686706173a Timers can now have a start delay value (thanks @georgiee, #660) 2014-03-31 10:49:53 +01:00
photonstorm
1a92f5b7d0 If you inputEnable = false a gameobject you couldn't re-enable it again using inputEnable = true, only directly via the handler (thanks @nickrall, fix #673)
Updated the PhysicsEditor plugin to maintain position, radius, mask bits, category bits and sensor flags (thanks @georgiee, #674)
2014-03-31 10:43:43 +01:00
photonstorm
b01ad969ab Updated tutorial file 2014-03-30 20:52:27 +01:00
photonstorm
76c0913b37 Setting up for 2.0.3 development. 2014-03-28 02:18:58 +00:00
photonstorm
5b73bb21bb Sprite would glitch if it had an ArcadePhysics Body that was re-positioned out of loop.
Sprite would "fly off" if it had an ArcadePhysics Body that was re-positioned during an input handler.
Newly generated docs
2014-03-28 01:42:49 +00:00
Richard Davey
06c953a293 Merge pull request #647 from xtian/grunt-jshint
Run jshint as part of build process and fix jshint errors
2014-03-26 15:46:35 +00:00
photonstorm
fc0e239719 ArcadePhysics.Body preUpdate has been modified to stop Sprites with non-1 scaling from gaining delta and moving off the screen (fix #644).
Lots of ArcadePhysics.World methods have been marked as private where they shouldn't be called directly (separateX, etc)
2014-03-26 10:48:30 +00:00
Christian Wesselhoeft
12c5a1b534 Run jshint as part of build process. 2014-03-25 14:56:00 -07:00
photonstorm
344ab46d78 Line.fromSprite now sets "fromCenter" to false by default as Sprite.center is deprecated in 2.x. Documentation and Examples updated to reflect this. 2014-03-25 12:44:20 +00:00
photonstorm
6483b61db7 Tween.generateData would enter an eternal loop if the total resulted in a float. Now wrapped in Math.floor. 2014-03-25 03:08:51 +00:00
photonstorm
6651f6c394 Tutorial updated for Phaser 2 2014-03-24 23:38:52 +00:00
photonstorm
65e1ae51d8 Fixed small typos in the README. 2014-03-24 12:21:21 +00:00
photonstorm
622957c9b0 Timer objects incorrectly set the first tick value on events if you added the events prior to starting them. 2014-03-24 02:25:35 +00:00
photonstorm
e1c98ba617 You can now create multiple blank layers in a Tilemap. 2014-03-23 23:58:01 +00:00
photonstorm
0c156ccd90 Fixed some md issues in Contributing and Readme.
Fixed game reference in Emitter.
2014-03-23 12:07:55 +00:00
photonstorm
21c0be4d02 BitmapDatas when used as Game Object textures in WebGL now update themselves properly.
Timer.ms now correctly reports the ms time even if the Timer has been paused (thanks Nambew, fix #624)
2014-03-21 18:37:54 +00:00
photonstorm
0fa54b0b24 TileSprites now emit outOfBounds and enterBounds events accordingly.
TileSprites working with physics bodies again.
2014-03-21 18:04:24 +00:00
photonstorm
9c8f01cd7f The volume given in Sound.play now over-rides that set in Sound.addMarker if specified (fix #623) 2014-03-21 15:43:59 +00:00
photonstorm
0fca997d43 P2.Body.loadPolygon no longer modifies the Cache array (fix #613) 2014-03-21 13:46:35 +00:00
photonstorm
768bbaaec6 README updates. 2014-03-21 12:34:26 +00:00
photonstorm
b9fcda73ca ArcadePhysics.World.seperate will now check gravity totals to determine separation order. You can set World.forceX to true to always separate on X first and skip this check. 2014-03-21 11:22:56 +00:00
photonstorm
111164e221 If no seed was given in the Game config object, the RandomDataGenerator wouldn't be started (thank tylerjhutchison fix #619) 2014-03-21 11:22:56 +00:00
photonstorm
634b1d1093 Emitter.friction property removed and replaced with Emitter.particleDrag, which is now correctly applied.
ArcadePhysics.Body.reset incorrectly set the Body.rotation to Sprite.rotation instead of angle.
Emitter.emitParticle resets the rotation on the particle to zero before emitting it.
Lots of fixes to the TypeScript definitions file (thanks as always to clark-stevenson for his tireless work on these)
Emitters now bring the particle they are about to emit to the top of the Group before doing so. Avoids particles hidden behind others.
ArcadePhysics.Body.setSize corrected to take the parameters as positive, not negative values.
ArcadePhysics.Body now checks the Sprite scale automatically and adjusts the body size accordingly (fix #608)
Emitter.particleClass can now be set to any object that extends Phaser.Sprite, which will be emitted instead of a regular Sprite.
2014-03-20 03:48:54 +00:00
photonstorm
684ee9c064 ArcadePhysics.Body has a deltaMax object, which allows you to cap the delta applied to the position to +- this value.
ArcadePhysics.Body now checks the Sprite scale automatically and adjusts the body size accordingly (fix #608)
2014-03-20 00:20:02 +00:00
photonstorm
2d08fab48e When creating a Sprite (via Group.create or directly) with exists = false and a P2 body, the body is not added to the world.
Every Input class now checks to see if it has already been started. If so it doesn't add the listeners again unless they have been nulled.
2014-03-19 13:22:04 +00:00
photonstorm
164f3cbe83 When creating a Sprite (via Group.create or directly) with exists = false and a P2 body, the body is not added to the world. 2014-03-19 13:09:29 +00:00
photonstorm
96365a3a1f The StateManager is now responsible for clearing down input, timers, tweens, physics, camera and the World display list.
Removed the use of Int16Array from all Game Objects, swapped for standard Array. Phaser now runs on Android 2.x again (fix #590)
2014-03-19 12:05:19 +00:00
photonstorm
5d40365b87 InputHandler.dragFromCenter will now work regardless of the anchor point of the Sprite. 2014-03-19 05:21:26 +00:00
photonstorm
84df7bf320 Sprite.events.onEnterBounds added. This is dispatched if the Sprite leaves the bounds but then returns. The opposite of onOutOfBounds. 2014-03-19 04:17:37 +00:00
photonstorm
0a42ac39b9 ArcadePhysics.World now has a checkCollision object which can be used to toggle collision against the 4 walls of its bounds. 2014-03-19 04:03:21 +00:00
photonstorm
9959e21925 Debug.spriteBounds will now take the position of the camera into consideration when rendering the bounds (fix #603) 2014-03-19 02:31:37 +00:00
photonstorm
79ffda3f18 ArcadePhysics.separate doesn't pass over to seperateX/Y if overlapOnly is true (fix #604)
ArcadePhysics.collideSpriteVsSprite checks if both objects have bodies before processing.
ArcadePhysics.Body now checks the ArcadePhysics.World bounds, not the game bounds.
ArcadePhysics.Body has reverted to the 1.1.3 method of preUpdate, so you can now position sprites with x/y, drag them, etc, regardless of the Body.moves flag (issue #606)
ArcadePhysics.World now has setBounds and setBoundsToWorld methods, which are called automatically on world resizing.
ArcadePhysics.Body no longer sets the offset to match the anchor.
2014-03-19 02:28:20 +00:00
photonstorm
9490041c79 ArcadePhysics.separate doesn't pass over to seperateX/Y if overlapOnly is true (fix #604)
ArcadePhysics.collideSpriteVsSprite checks if both objects have bodies before processing.
2014-03-19 02:05:29 +00:00
photonstorm
11fdd62436 World.destroy incorrectly clashed with the Group.destroy method it over-rode, renamed to World.shutdown and updated StateManager accordingly.
World.shutdown now removes all children iteratively, calling destroy on each one, ultimately performing a soft reset of the World.
Objects with a scale.x or y of 0 are no longer considered valid for input (fix #602)
InputHandler will set the browser pointer back to default if destroyed while over (fix #602)
Group.destroy has a new parameter: `soft`. A soft destruction won't remove the Group from its parent or null game references. Default is `false`.
InputHandler.validForInput is a new method that checks if the handler and its owner should be considered for Pointer input handling or not.
Group.replace will now return the old child, the one that was replaced in the Group.
2014-03-19 00:54:49 +00:00
photonstorm
8010d245f1 Fixed Grunt script that stopped the P2 constraint classes from building properly. 2014-03-18 18:36:46 +00:00
photonstorm
eec9f70c1c Math.removeRandom allows you to remove (and return) a random object from an array.
Updated TypeScript defs to fix getRandom (fix #583)
2014-03-18 16:51:58 +00:00
photonstorm
870d534e50 Fixed the Loader.preloadSprite crop effect on WebGL. 2014-03-18 16:23:44 +00:00
photonstorm
a7ff5f884c Added basic Webcam plugin.
Added Device.getUserMedia detection.
Updated config.php so you can toggle physics engines on/off via flags.
Updated Gruntfile.js so it builds a Phaser + Pixi but no Physics libs.
2014-03-18 15:14:28 +00:00
photonstorm
928b883c17 Swapped the order of the _pollGamepads gamepads check, to stop the Chrome 'webkitGamepads is deprecated' error in the console. 2014-03-18 00:10:43 +00:00
photonstorm
4a407f12a1 Button.onInputUpHandler wouldn't set an upFrame for a frame ID of zero, made the check more strict. 2014-03-17 23:57:27 +00:00
photonstorm
46d5069110 Tilemap.createFromObjects has a new parameter: adjustY, which is true by default. Because Tiled uses a bottom-left coordinate system Phaser used to set the Sprite anchor to 0,1 to compensate. If adjustY is true it now reduces the y value by the object height instead. 2014-03-17 23:54:04 +00:00
photonstorm
90ef694347 Tilemap.createFromObjects used to set the Sprite anchor to 0,1 because Tiled uses a bottom-left coordinate system. It now calculates the offset in TilemapParser. 2014-03-17 23:27:13 +00:00
photonstorm
2ecb0c7c76 P2.removeBody will check if the body is part of the world before removing, this avoids a TypeError from the p2 layer. 2014-03-17 22:34:19 +00:00
photonstorm
a8502f3498 Removed State.destroy empty method and replaced with State.shutdown, as that is what the StateManager expects (fix #586) 2014-03-17 19:43:28 +00:00
photonstorm
3ebd0d9303 Updated Device.isConsoleOpen as it no longer works in Chrome. Revised code and documentation accordingly (fix #593)
Revised p2 clear process.
2014-03-17 19:39:56 +00:00
photonstorm
96296c6582 The P2 World wouldn't clear down fully on a State change, now properly clears out contacts, resets the bitmask, etc. 2014-03-17 18:57:46 +00:00
photonstorm
bc8b2424ce Removed the examples build script from the Gruntfile (fix #592) 2014-03-17 16:10:19 +00:00
photonstorm
b9ac0d565e Fixed Tile callback check in Arcade Physics (fix #562) 2014-03-16 00:53:50 +00:00
photonstorm
ec2275e18c Group enableBody parameter was incorrectly assigned to the debug var (thanks BurnedToast, fix #565) 2014-03-16 00:45:47 +00:00
photonstorm
db88bd2f22 Fixed the IE11 version check (fixes #579) 2014-03-16 00:39:42 +00:00
photonstorm
fee4d36b91 Group.getAt comparison updated (fixes #578) 2014-03-15 23:53:05 +00:00
Richard Davey
fc5504f8d8 Fixed Sprite.destroy with an arcade body 2014-03-15 01:06:01 +00:00
photonstorm
5e11b1ad87 The Static, Kinematic and Dynamic consts that P2.Body uses were incorrect (fixes #563) 2014-03-14 19:20:35 +00:00
photonstorm
901a7f13d1 Updated docs for 2.0 release and updated README. 2014-03-14 06:36:05 +00:00
photonstorm
eb8f021202 Updated README, removed Examples, added Migration Guide. 2014-03-14 06:06:43 +00:00
photonstorm
017a017b96 TilemapLayer.getRayCastTiles will let you get all tiles that hit the given line for further processing.
Fixed Tilemap collision. Added new TILE_BIAS const to aid with fast/small sprites.
2014-03-14 02:33:58 +00:00
photonstorm
f678d1fd31 Line now has x, y, width, height, top, bottom, left and right properties, so you can effectively get its bounds. 2014-03-14 00:19:45 +00:00
photonstorm
a83a76bc5d Line.coordinatesOnLine will return all coordinates on the line using Bresenhams line algorithm. 2014-03-14 00:05:03 +00:00
photonstorm
c8e63582a4 Lots of small tweaks to pass jshint. 2014-03-13 16:49:52 +00:00
photonstorm
94448d2497 P2 postBroadphase example and handler done. Group.enableBodyDebug added. Sprites no longer remove bodies from the world if exists = false, instead they set safeDestroy to true, which removes the body on the next preUpdate, to avoid mid-step destruction issues. 2014-03-13 07:29:23 +00:00
photonstorm
fc788f909c P2 Body Begin and End Contact events done and working nicely. 2014-03-12 15:26:20 +00:00
photonstorm
d2762719b8 RandomDataGenerator is now started on Game creation instead of boot. You can pass a seed array in the game config object (feature request #547) 2014-03-12 13:53:30 +00:00
photonstorm
e9ae465272 Sorted out Body gravity settings and updated the example. 2014-03-11 16:26:03 +00:00
photonstorm
6bddf1a914 The main Game class has been modified so that the update methods no longer have any if/else checks in them. Now split into coreUpdate, etc.
Put QuadTree back into Debug class.
Debug class now clears down on WebGL.
Updated RetroFont.type.
Fixed QuadTree example.
2014-03-11 16:14:01 +00:00
photonstorm
384451bef7 Particles back in and working again. Also updated most of the examples and put Body.gravity back in as well. 2014-03-11 02:49:55 +00:00
photonstorm
f89da86444 Cache.destroy fixed to clear up properly (thanks Dumtard, #537) 2014-03-10 19:06:15 +00:00
photonstorm
13ff8985e1 Merged @georgiee p2 BodyDebug and reformatted for jshint pass. Looks awesome :) #536 2014-03-10 15:25:43 +00:00
photonstorm
1fe331956a Added in p2.total 2014-03-10 14:47:29 +00:00
photonstorm
c4183d200f Changed the define function calls to use named modules, allows pixi, phaser and p2 to reside in 1 file and still be located by requirejs (thanks brejep, #531) 2014-03-10 01:39:36 +00:00
photonstorm
45ab4673cc ScaleManager.fullScreenTarget allows you to change the DOM element that the fullscreen API is called on (feature request #526) 2014-03-10 01:13:01 +00:00
photonstorm
c73b4eaea0 json is now the default tilemap format when not defined (thanks RyanDansie, #528)
Updated docstrap
2014-03-10 00:50:06 +00:00
photonstorm
4cac6408d8 Ninja.AABB updated with all the correct properties, now works fully as with Circle. Created new tests, all Ninja shapes now set Body.touching values correctly. TileSprites work as bodies. Trying out AABB vs. AABB collision now. 2014-03-07 04:43:55 +00:00
photonstorm
a51ae03246 Tweens are now bound to their own TweenManager, not always the global game one. So you can create your own managers now (for you clark :) 2014-03-07 01:26:09 +00:00
photonstorm
3b2573de9a Objects that are 'fixedToCamera' are now still correctly placed even if the camera is scaled (#512) 2014-03-06 17:12:12 +00:00
photonstorm
7db8e5bc5e Fixed typo in README (thanks prtksxna, #518) 2014-03-06 16:56:25 +00:00
photonstorm
081c083176 InputHandler.enableSnap now correctly assigns the snap offset parameters (fixes #515) 2014-03-06 16:45:29 +00:00
photonstorm
3e93f24583 New split physics system is implemented. Still tidying-up, but ArcadePhysics, P2 and Ninja Physics are in and configured. Lots more examples required, and tilemap collision mostly broken in Arcade at the moment. Time to implement in Ninja. 2014-03-06 06:29:19 +00:00
photonstorm
22b1ce9b9d Added Phasers new Physics Manager and restored the pre-1.1.4 ArcadePhysics system. The new manager can handle multiple physics systems running in parallel, which could be extremely useful for lots of games. 2014-03-05 02:36:08 +00:00
photonstorm
5a6ae5f696 Tilemap.putTile now correctly re-calculates the collision data based on the new collideIndexes array (fixes #371)
Tilemap.putTile can now insert a tile into a null/blank area of the map (before it could only replace existing tiles)
2014-03-04 03:08:35 +00:00
photonstorm
8c2502d37d Group.xy(index, x, y) allows you to set the x and y coordinates of a Group child at the given index.
Group.reverse() reverses the display order of all children in the Group.
New labs demo.
Fixed some Easing docs issues.
2014-03-04 01:27:57 +00:00
photonstorm
67ad898294 Tween.generateData(frameRate) allows you to generate tween data into an array, which can then be used however you wish (see new examples)
Added new Retro Font examples.
2014-03-03 22:43:35 +00:00
photonstorm
7183322259 Renamed Phaser.BitmapFont to Phaser.RetroFont because I believe it will cause confusion otherwise. Also tidied up the asset fonts folder. 2014-03-03 17:05:28 +00:00
photonstorm
833960b3c8 Animation.looped has been renamed to Animation.loop. It's a boolean you can toggle at run-time to turn on/off animation looping.
A single Animation object now has 3 new events: onStart, onLoop and onComplete.
Animation.loopCount holds the number of times the animation has looped since it last started.
Animation.stop has a new parameter: dispatchComplete. If true it'll dispatch an Animation.onComplete event.
2014-03-03 16:05:55 +00:00
photonstorm
4a370c82cf You can now load in CSV Tilemaps again and they get created properly (fixes #391)
You can now create blank Tilemaps and then populate them with data later.
2014-03-03 13:45:47 +00:00
photonstorm
502d74ee39 Keyboard.event now stores the most recent DOM keyboard event. 2014-03-03 11:18:56 +00:00
photonstorm
d8f5832fa2 Completely empty Tilemaps can now be created. This allows for dynamic map generation at runtime.
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.
2014-03-03 05:19:46 +00:00
photonstorm
6f513042c1 Tween no longer copies all the object properties into the _valuesStart object on creation.
Fixed shadow bug in Debug.text
Fixed tween examples.
2014-03-03 02:40:59 +00:00
photonstorm
c4a68e3e87 The Debug panel now works in WebGL mode. Pay attention to the warning at the top of the Debug docs (feature request #499)
All the Debug methods have had the word 'render' removed from the start. So where you did `debug.renderSpriteInfo` before, it's now just `debug.spriteInfo`.
Debug methods that rendered geometry (Rectangle, Circle, Line, Point) have been merged into the single method: `Debug.geom`.
2014-03-03 00:46:03 +00:00
photonstorm
442e6bb776 Events.onInputUp would be dispatched twice if the Sprite had drag enabled, now only dispatched once (thanks Overbryd, fixes #502)
Changed webfont URI back to //
2014-03-02 11:31:26 +00:00
photonstorm
0eb23d4b11 RandomDataGenerator.integerInRange(min, max) now includes both min and max within its range (#501) 2014-03-02 11:21:30 +00:00
photonstorm
52118be088 Sound.onMarkerComplete event is now dispatched when a marker stops. See Sound.onLoop for a looping marker event (thanks registered99, fixes #500) 2014-03-02 11:11:20 +00:00
photonstorm
7ff4e51ab1 Time.reset does a removeAll on any Timers.
Device no longer things a Windows Phone or Windows Tablet are desktop devices (thanks wombatbuddy, fixes #506)
2014-03-02 10:56:39 +00:00
photonstorm
8dcfef8db0 Updated to latest Pixi build (can do away with our own local patch now).
Group.sendToBottom(child) is the handy opposite of Group.bringToTop()
Group.moveUp(child) will move a child up the display list, swapping with the child above it.
Group.moveDown(child) will move a child down the display list, swapping with the child below it.
2014-02-28 18:55:07 +00:00
photonstorm
8662cd2fd4 Brand new Grunt task - creates each core library as its own file and a combined phaser.js.
New build script now cleanly splits Phaser, Pixi and p2 so they are each UMD wrapped and each available in the global scope (now more requireJS friendly!).
phaser-no-libs.js allows you to use your own version of p2.js or pixi.js with Phaser. Warning: This is totally unsupported. If you hit bugs, you fix them yourself.
Fixed silly instanceof bug in game objects (sorry guys).
2014-02-28 09:30:53 +00:00
photonstorm
8dc28f4800 Animation.speed added. You can now change the animation speed on the fly, without re-starting the animation (feature request #458) 2014-02-28 04:32:12 +00:00
photonstorm
e3d53ad6a3 Game no longer pauses if you've forced orientation and change it, also doesn't resize a NO_SCALE game.
If the game was set to NO_SCALE and you swapped orientation, it would pause and resize, then fail to resize when you swapped back (thanks starnut, fixes #258)
2014-02-28 04:15:28 +00:00
photonstorm
34ee2b0b20 Fixed issue with CocoonJS detection in Device.
Fixed docs issue in Tilemap.
Created landscape pointer test, confirmed working fine (issue #276)
2014-02-28 03:09:04 +00:00
photonstorm
3568dc4ff1 Pixi GrayFilter ported over (thanks nickryall #404)
Fixed Time.totalElapsedSeconds, which gets the other filters working again too.
2014-02-27 22:35:06 +00:00
photonstorm
10b3dbf74a Loader.replaceInFileList wouldn't over-write the previous entry correctly, which caused the Loader.image overwrite parameter to fail (thanks basoko, fixes #493) 2014-02-27 21:41:54 +00:00
photonstorm
7e12075be1 Buttons are now cleanly destroyed if part of a Group without leaving their InputHandler running.
You can now safely destroy a Group and the 'destroyChildren' boolean will propogate fully down the display list.
Calling destroy on an already destroyed object would throw a run-time error. Now checked for and aborted.
Calling destroy while in an Input Event callback now works for either the parent Group or the calling object itself.
In Group.destroy the default for 'destroyChildren' was false. It's now `true` as this is a far more likely requirement when destroying a Group.
All GameObjects now have a 'destroyChildren' boolean as a parameter to their destroy method. It's default is true and the value propogates down its children.
2014-02-27 20:05:16 +00:00
photonstorm
53c10ca31f The grunt task now creates an optional version of Phaser without any Physics support built in. Quite a bit smaller now.
The grunt task now has a new `noUmd` option which builds Phaser without the UMD wrapper.
2014-02-27 17:00:14 +00:00
photonstorm
4d284029c7 Tweens now resume correctly if the game pauses (focus loss) while they are paused.
Tweens don't double pause if they were already paused and the game pauses.
2014-02-26 23:27:22 +00:00
photonstorm
86374d4437 Phaser.Timer will no longer resume if it was previously paused and the game loses focus and then resumes (fixes #383)
Phaser.Timer.stop has a new parameter: clearEvents (default true), if true all the events in Timer will be cleared, otherwise they will remain (fixes #383)
2014-02-26 20:12:17 +00:00
photonstorm
db090601b8 The Timer will no longer create negative ticks during game boot, no matter how small the Timer delay is (fixes #366) 2014-02-26 19:52:23 +00:00
photonstorm
d0fa50f014 Fixed issue stopping SoundManager.volume from working correctly on a global volume basis (fix # 488) 2014-02-26 14:40:55 +00:00
photonstorm
5ab104ad4b Loader.script now has callback (and callbackContext) parameters, so you can specify a function to run once the JS has been injected into the body. 2014-02-26 02:45:06 +00:00
photonstorm
1aea08d0f7 AnimationParser.spriteSheet wasn't taking the margin or spacing into account when calculating the numbers of sprites per row/column, nor was it allowing for extra power-of-two padding at the end (fix #482, thanks yig)
AnimationManager.add documentation said that 'frames' could be null, but the code couldn't handle this so it defaults to an empty array if none given (thanks yig)
Also updated TypeScript definitions and StateManager.add docs.
2014-02-26 01:32:38 +00:00
photonstorm
29fcfc515d Fixed TilemapParser - would spit out a tileset warning if margin/spacing were set (fix #485, thanks Cybolic) 2014-02-26 01:20:24 +00:00
photonstorm
db2e3733c2 Fullscreen mode now uses window.outerWidth/Height when using EXACT_FIT as the scale mode, which fixes input coordinate errors (fixes #232)
Fullscreen mode now works in Internet Explorer and uses the new fullscreen non-prefix call.
2014-02-25 21:16:56 +00:00
photonstorm
741249043c ScaleManager has 2 new events: ScaleManager.enterFullScreen and ScaleManager.leaveFullScreen, so you can respond to fullscreen changes directly.
Fullscreen mode now uses window.outerWidth/Height when using EXACT_FIT as the scale mode, which fixes input coordinate errors (fixes #232)
2014-02-25 17:10:37 +00:00
photonstorm
13c99f3491 Phaser.StageScaleMode has been renamed to ScaleManager and moved from the system folder to the core folder. It's still available under game.scale.
If your game references the old Phaser.StageScaleMode consts like SHOW_ALL you need to update them to Phaser.ScaleManager, i.e. Phaser.ScaleManager.SHOW_ALL.
All of the Project Templates have been updated to reflect the above change.
2014-02-25 14:46:48 +00:00
photonstorm
b4dbaf9950 StateManager.start can now have as many parameters as you like. The order is: start(key, clearWorld, clearCache, ...) - they are passed to State.init() (NOT create!) 2014-02-25 11:56:57 +00:00
photonstorm
a1b502fc06 Stage.smoothed allows you to set if sprites will be smoothed when rendered. Set to false if you're using pixel art in your game. Default is true. Works in Canvas and WebGL. Setting the game anti-aliased parameter now works properly too.
Sprite.smoothed and Image.smoothed allows you to set per-Sprite smoothing, perfect if you just want to keep a few sprites smoothed (or not).
Fixes #381.
2014-02-25 04:41:57 +00:00
photonstorm
b255fea85f Time.advancedTiming is a new boolean property. If true Time.fps, fpsMin, fpsMax, frames, msMin and msMax will be calculated, otherwise they remain at their defaults. 2014-02-25 04:05:28 +00:00
photonstorm
8fb2f20482 Swapping between tabs will pause and resume tweens correctly, allowing their onComplete events to still fire (fixes #292) 2014-02-25 03:33:47 +00:00
photonstorm
cc06a62b90 Pausing the game will now mute audio and resuming will un-mute, unless it was muted via the game (fixes #439) 2014-02-25 03:12:12 +00:00
photonstorm
415342d986 Vastly improved visibility API support + pageshow/pagehide + focus/blur. Working across Chrome, IE, Firefox, iOS, Android (also fixes #161) 2014-02-25 02:59:24 +00:00
photonstorm
beaac18b8f Active animations now monitor if the game pauses, and resume normally when the game un-pauses (fixes #179) 2014-02-24 23:06:45 +00:00
photonstorm
36df5516dd Fixed full-screen anti-alias issue (#478). 2014-02-24 20:33:22 +00:00
photonstorm
d9cadc70ac The Keyboard class has had a complete overhaul. Phaser.Key objects are created automatically, there are fixes against duration and keys reset properly on visibility loss.
Keyboard.removeKey has been removed. The way the new keyboard manager works means it's no longer required.
Fixes issue #462
2014-02-24 15:58:02 +00:00
photonstorm
46e85c8394 Updated version to 2.0.0 (fixes npm install issue #476) 2014-02-24 12:00:28 +00:00
photonstorm
e088d5c67f Documentation fix. 2014-02-24 00:35:11 +00:00
Richard Davey
94133e4c11 Updated Sound.play loop check 2014-02-22 03:05:41 +00:00
photonstorm
be4d42a1c2 The StateManager now looks for a function called 'resumed' which is called when a game un-pauses (fixes #358) 2014-02-22 00:01:19 +00:00
photonstorm
57796a60be TileSprites can now receive full Input events, dragging, etc and be positioned in-world and fixed to cameras (fixes #321) 2014-02-21 19:21:00 +00:00
photonstorm
1448562abd Loader can now load JSON files specifically (game.load.json) and they are parsed and stored in the Game.Cache. Retrieve with game.cache.getJSON(key) (#329)
Also fixed UTF encoding on the animation file.
2014-02-21 18:48:06 +00:00
photonstorm
fb5920feec We now force IE11 into Canvas mode to avoid a Pixi bug with pre-multiplied alpha. Will remove once that is fixed, sorry, but it's better than no game at all, right? :(
Loader.setPreloadSprite() will now set sprite.visible = true once the crop has been applied. Should help avoid issues (#430) on super-slow connections.
2014-02-21 17:29:51 +00:00
photonstorm
5a00a0ad97 TilemapParser will now throw a warning if the tileset image isn't the right size for the tile dimensions (fixes #377) 2014-02-21 16:57:45 +00:00
photonstorm
5c4dd26d25 Fixed for renderSpriteInfo. 2014-02-21 15:50:02 +00:00
photonstorm
7ee0c20bb3 Added Debug.renderSpriteBounds() back and wrapped Body.velocity and force in px2p calls. 2014-02-21 15:34:15 +00:00
photonstorm
d7ababa398 BitmapData.alphaMask will draw the given image onto a BitmapData using an image as an alpha mask. 2014-02-21 15:09:04 +00:00
photonstorm
066a625d17 When adding a Group if the parent value is null the Group won't be added to the World, so you can add it when ready. If parent is undefined it's added to World by default. 2014-02-21 12:35:30 +00:00
photonstorm
cf3796d60c Phaser.Animation.frame now returns the frame of the current animation, rather than the global frame from the sprite sheet / atlas (fix #466) 2014-02-21 10:31:17 +00:00
photonstorm
d057a9fe11 Device, Canvas and GamePad classes all updated for better CocoonJS support (thanks Videlais) 2014-02-19 02:45:42 +00:00
photonstorm
14646e811c QuadTree deprecated and moved to plugins. Body.collideWorldBounds added back and working. CollisionGroups pretty much finished. 2014-02-19 02:12:27 +00:00
photonstorm
5d5c64d22f Tilemap.createCollisionObjects will parse Tiled data for objectgroups and convert polyline instances into physics objects you can collide with in the world.
After defining tiles that collide on a Tilemap, you need to call Tilemap.generateCollisionData(layer) to populate the physics world with the data required.
Debug.renderPhysicsBody updated to take camera location and body rotation into account.
Body movement functions put back to velocity :)
Updated to latest dev version of pixi and latest p2.js
Updated docs
2014-02-18 03:01:51 +00:00
photonstorm
3a59c13a71 Added hostname: '*' to the grunt-connect in Gruntfile.js (fixes #426) 2014-02-15 19:03:43 +00:00
photonstorm
e5e643b103 fixedToCamera now works across all display objects. When enabled it will fix at its current x/y coordinate, but can be changed via cameraOffset.
fixedToCamrea now works for Groups as well :) You can fix a Group to the camera and it will influence its children.
Also fixed the issue with World.preUpdate/postUpdate not being called and various small documentation issues.
2014-02-15 01:27:42 +00:00
photonstorm
e5a4620b87 Loader.physics now lets you load Lime + Corona JSON Physics data, which can be used with Body.loadPolygon and Body.loadData.
Cache.addPhysicsData and Cache.getPhysicsData allow you to store parsed JSON physics data in the cache, for sharing between Bodies.
2014-02-14 23:51:49 +00:00
photonstorm
1b5837d71d World preUpdate, update and postUpdate have all been moved to Stage. So all children are updated regardless where on the display list they live. Fixes #419 2014-02-14 17:29:31 +00:00
photonstorm
539a0f2256 BitmapFont fixes and updates and Cache support for it added. Working sweet now. 2014-02-14 16:38:06 +00:00
photonstorm
15b83e1c88 Added the new BitmapFont class. This is for rendering retro style fixed-width bitmap fonts into an Image object. 2014-02-14 06:04:29 +00:00
photonstorm
b38b00c2c1 Loader.bitmapFont now has 2 extra parameters: xSpacing and ySpacing. These allow you to add extra spacing to each letter or line of the font. 2014-02-14 04:34:57 +00:00
photonstorm
f9a4beb608 Text update. 2014-02-14 00:15:36 +00:00
photonstorm
87fce63a23 Updated. 2014-02-13 23:47:25 +00:00
photonstorm
30fbbec675 BitmapData.addTo removed and enhanced BitmapData.add so it can accept either a single Sprite/Image or an Array of them.
BitmapData has had all of the EaselJS functions removed. It was just taking up space and you can do it all via BitmapData.context directly.
Camera following now working again.
2014-02-13 14:19:41 +00:00
photonstorm
e9fb8f6389 Updates across the board moving Stage.canvas to Game.canvas 2014-02-13 12:55:58 +00:00
photonstorm
0786e86ee5 Stage.scale has been moved to Game.scale. The same game scaling properties exist as before, but now accessed via Game.scale instead.
Stage.aspectRatio has been moved to StageScaleMode.sourceAspectRatio (so now game.scale.sourceAspectRatio)
Stage.scaleMode has been moved to StageScaleMode.scaleMode (so now game.scale.scaleMode)
Stage.fullScreenScaleMode has been moved to StageScaleMode.fullScreenScaleMode (so now game.scale.fullScreenScaleMode)
Stage.canvas has been removed. It was only ever an alias for Game.canvas anyway, so access it via that instead.
2014-02-13 12:50:10 +00:00
photonstorm
175584469a Updated README. Previous commit fixes #406. 2014-02-13 12:28:13 +00:00
photonstorm
b85f40df12 Phaser.Stage now extends PIXI.Stage, rather than containing a _stage object.
(Warning: currently breaks camera based code and pointers, as the scale property is removed).
2014-02-12 23:12:36 +00:00
photonstorm
ab5c07dfe8 Updated to Pixi 1.5 final.
InputHandler.pixelPerfectOver - performs a pixel perfect check to see if any pointer is over the current object (warning: very expensive!)
InputHandler.pixelPerfectClick - performs a pixel perfect check but only when the pointer touches/clicks on the current object.
2014-02-12 01:25:36 +00:00
photonstorm
da878b2181 Updated the Gruntfile. Also:
InputHandler.pixelPerfectOver - performs a pixel perfect check to see if any pointer is over the current object (warning: very expensive!)
InputHandler.pixelPerfectClick - performs a pixel perfect check but only when the pointer touches/clicks on the current object.
Previously using a Pixel Perfect check didn't work if the Sprite was rotated or had a non-zero anchor point, now works under all conditions + atlas frames.
2014-02-11 13:23:54 +00:00
photonstorm
d26bda2736 Small textual changes. 2014-02-10 02:32:56 +00:00
photonstorm
d2366d5fa5 Fix for issue #376 - IE11 didn't populate the Device.ieVersion value. Now extracted from Trident revision, but still use Device.trident instead for IE11+ checks. 2014-02-10 02:23:45 +00:00
photonstorm
ae74cb02dd Fixes #382 Error when using InputHandler#onInputUp & sprite destroys itself during the event. 2014-02-10 02:14:59 +00:00
photonstorm
0294a4735d Fixes issues reported in #389 2014-02-10 01:49:58 +00:00
photonstorm
d44775c095 Phaser.Ellipse added. A fully compatible port of the PIXI.Ellipse class, can be used in Sprite/Image hitArea tests.
Phaser.Polygon added. A fully compatible port of the PIXI.Polygon class, can be used in Sprite/Image hitArea tests.
2014-02-10 01:37:50 +00:00
photonstorm
e15bebd269 Text.lineSpacing allows you to control the spacing between each line that is rendered.
Text.inputEnabled allows you to enable all input events over Text objects: dragging, clicking, etc - anything that works on a Sprite works on Text now too.
2014-02-09 22:48:35 +00:00
photonstorm
bca64c2adb Huge update to Phaser.Text. Much more lean, but loads of great new options added including drop shadows, gradient fills, fonts with spaces in the name, etc. 2014-02-09 13:36:02 +00:00
photonstorm
e8b432f518 Fixed bug where changing State would cause the camera to not reset if it was following an object.
World.reset now calls Camera.reset which sends the camera back to 0,0 and un-follows any object it may have been tracking.
2014-02-08 13:45:18 +00:00
photonstorm
ee3f6d8e7f Tilemap had the wrong @method signatures so most were missing from the docs. 2014-02-08 07:24:40 +00:00
photonstorm
c429787877 Button now extends Phaser.Image not Phaser.Sprite, all the same functionality as before remains, just no animations or physics body. 2014-02-07 18:55:29 +00:00
photonstorm
dd43d59cce InputManager.getLocalPosition(displayObject, pointer, output) will return the local coordinates of the specified displayObject and pointer.
InputManager.hitTest will test for pointer hits against a Sprite/Image, its hitArea (if set) or any of its children.
2014-02-07 18:01:58 +00:00
photonstorm
bc3a3fd43d You can now use the hitArea property on Sprites and Image objects. hitArea can be a geometry object (Rectangle, Circle, Polygon, Ellipse) and is used in pointerOver checks. 2014-02-07 17:14:10 +00:00
photonstorm
d583b364bd Game.add.renderTexture now has the addToCache parameter. If set the texture will be stored in Game.Cache and can be retrieved with Cache.getTexture(key).
Game.add.bitmapData now has the addToCache parameter. If set the texture will be stored in Game.Cache and can be retrieved with Cache.getBitmapData(key).
2014-02-07 06:25:28 +00:00
photonstorm
3cae06d1ad Phaser.AnimationParser now sets the trimmed data directly for Pixi Texture frames. Tested across JSON Hash, JSON Data, Sprite Sheet and XML. 2014-02-07 00:57:41 +00:00
photonstorm
6cabb03a82 Sprite.crop() now takes a Phaser.Rectangle instead of explicit parameters.
Phaser.Image is a brand new display object perfect for logos, backgrounds, etc. You can scale, rotate, tint and blend and Image, but it has no animation, physics body or input events.
Previously if you used Sprite.crop() it would crop all Sprites using the same base image. It now takes a local copy of the texture data and crops just that.
2014-02-06 23:13:39 +00:00
photonstorm
7ba1196c0d Fixed TypeScript defs on lines 1741-1748 (thanks wombatbuddy) 2014-02-06 22:42:35 +00:00
photonstorm
3748811d11 Testing new Image object. 2014-02-06 19:34:05 +00:00
photonstorm
4ed20e0f77 Removed all intances of Sprite.group from Group and replaced with the already existing parent property. 2014-02-06 13:15:45 +00:00
photonstorm
4cfce8b4d2 Group now extends PIXI.DisplayObjectContainer, rather than owning a _container property, which makes life a whole lot easier re: nesting. 2014-02-06 02:31:36 +00:00
photonstorm
9737710200 Upgraded to Pixi.js 1.4.4 2014-02-06 00:19:46 +00:00
photonstorm
68d5c73fea Explicitly paused Timer continues if you un-focus and focus the browser window.
Added TimerEvent.pendingDelete and checks in Timer.update, so that removing an event in a callback no longer throws an exception.
2014-02-05 22:35:35 +00:00
photonstorm
eddce653e9 Preparing for 1.1.5 development. 2014-02-05 21:02:41 +00:00
photonstorm
e7a9b96d27 Final release 1.1.4 examples finished. 2014-02-05 16:55:02 +00:00