Skip to content

Releases: phaserjs/phaser

Phaser 3.0.0 Beta 5 Release

02 Oct 11:20
Compare
Choose a tag to compare
Pre-release

This is the Beta 5 release of Phaser 3.

The phaser.js is a dev build, ideal for local testing and includes full source map data and comments (hence the huge file size).

phaser.min.js is a minified build, with no source map and comments stripped. You can use this if you'd like to upload a test somewhere and save some bandwidth. For development though we strongly recommend the source-map build instead.

Phaser 3.0.0 Beta 4 Release

25 Sep 11:14
Compare
Choose a tag to compare
Pre-release

This is the Beta 4 release of Phaser 3.

The phaser.js is a dev build, ideal for local testing and includes full source map data and comments (hence the huge file size).

phaser.min.js is a minified build, with no source map and comments stripped. You can use this if you'd like to upload a test somewhere and save some bandwidth. For development though we strongly recommend the source-map build instead.

Phaser 3.0.0 Beta 2 Release

18 Sep 14:28
Compare
Choose a tag to compare
Pre-release

This is the Beta 2 release of Phaser 3.

The phaser.js is a dev build, ideal for local testing and includes full source map data and comments (hence the huge file size).

If you need a minified build then please use the supplied webpack build script to generate this.

Phaser 3.0.0 Beta 1 Release

11 Sep 13:10
Compare
Choose a tag to compare
Pre-release

This is the Beta 1 release of Phaser 3.

The phaser.js is a dev build, ideal for local testing and includes full source map data and comments (hence the huge file size).

phaser.min.js is a minified build, with no source map and comments stripped. You can use this if you'd like to upload a test somewhere and save some bandwidth. With gzip enabled it's just 104KB in size, including all Game Objects and both Canvas and WebGL renderers.

Phaser 3.0.0 Alpha 2 Release

31 Jul 16:11
Compare
Choose a tag to compare
Pre-release

This is the Alpha release of Phaser 3.

Please see the Phaser 3 Dev Logs from entry 91 and onwards for more details.

The phaser.js is a dev build, ideal for local testing and includes full source map data and comments (hence the huge file size).

phaser.min.js is a minified build, with no source map and comments stripped. You can use this if you'd like to upload a test somewhere and save some bandwidth. With gzip enabled it's just 104KB in size, including all Game Objects and both Canvas and WebGL renderers.

Phaser 3 Alpha Release

31 Jul 13:33
Compare
Choose a tag to compare
Pre-release

This is the Alpha release of Phaser 3.

Please see the Phaser 3 Dev Logs from entry 91 and onwards for more details.

The phaser.js is a dev build, ideal for local testing and includes full source map data and comments (hence the huge file size).

phaser.min.js is a minified build, with no source map and comments stripped. You can use this if you'd like to upload a test somewhere and save some bandwidth. With gzip enabled it's just 104KB in size, including all Game Objects and both Canvas and WebGL renderers.

Kore Springs

26 Aug 00:38
Compare
Choose a tag to compare

New Features

  • Group.getRandomExists will return a random child from the Group that has exists set to true.
  • Group.getAll will return all children in the Group, or a section of the Group, with the optional ability to test if the child has a property matching the given value or not.
  • Group.iterate has a new returnType: RETURN_ALL. This allows you to return all children that pass the iteration test in an array.
  • The property checkCollision.none in the ArcadePhysics.Body class was available, but never used internally. It is now used and checked by the separate method. By setting checkCollision.none = true you can disable all collision and overlap checks on a Body, but still retain its motion updates (thanks @samme #2661)
  • Math.rotateToAngle takes two angles (in radians), and an interpolation value, and returns a new angle, based on the shortest rotational distance between the two.
  • Math.getShortestAngle will return the shortest angle between the two given angles. Angles are in the range -180 to 180, which is what Sprite.angle uses. So you can happily feed this method two sprite angles, and get the shortest angle back between them (#2494)

Updates

  • TypeScript definitions fixes and updates (thanks @calvindavis @AlvaroBarua)
  • Docs typo fixes (thanks @rroylance @Owumaro @boniatillo-com @samme @kjav)
  • The InputHandler.flagged property has been removed. It was never used internally, or exposed via the API, so was just overhead.
  • The src/system folder has been removed and all files relocated to the src/utils folder. This doesn't change anything from an API point of view, but did change the grunt build scripts slightly.
  • BitmapData.shadow and BitmapData.text now both return this keeping them in-line with the docs (thanks @greeny #2634)
  • Group.align has had its arguments changed so that it's now (width, height, ...) instead of (rows, columns, ...) (thanks @deargle #2643)
  • Group.align now returns true if the Group was aligned, or false if not.
  • The Loader.headers object has a new property requestedWith. By default this is set to false, but it can be used to set the X-Requested-With header to XMLHttpRequest (or any other value you need). To enable this do this.load.headers.requestedWith = 'XMLHttpRequest' before adding anything to the Loader.
  • ScaleManager.hasPhaserSetFullScreen is a new boolean that identifies if the browser is in full screen mode or not, and if Phaser was the one that requested it. As it's possible to enter full screen mode outside of Phaser, and it then gets confused about what bounding parent to use.
  • Phaser.Tileset has a new property lastgid which is populated automatically by the TilemapParser when importing Tiled map data, or can be set manually if building your own tileset.
  • Stage will now check if document.hidden is available first, and if it is then never even check for the prefixed versions. This stops warnings like "mozHidden and mozVisibilityState are deprecated" in newer versions of browsers and retain backward compatibility (thanks @leopoldobrines7 #2656)
  • As a result of changes in #2573 Graphics objects were calling updateLocalBounds on any shape change, which could cause dramatic performances drops in Graphics heavy situations (#2618). Graphics objects now have a new flag _boundsDirty which is used to detect if the bounds have been invalidated, i.e. by a Graphics being cleared or drawn to. If this is set to true then updateLocalBounds is called once in the postUpdate method (thanks @Pengchuan #2618)
  • Phaser.Image now has the ScaleMinMax component.
  • Animations now allow for speeds greater than 0, rather than forcing them to be greater than 1. This allows you to have animation speeds slower than 1 frame per second (thanks @jayrobin #2664)
  • Weapon.fire and all related methods (fireAtXY, fireAtPointer, fireAtSprite) now all return the instance of the Phaser.Bullet that was fired, or null if nothing was fired. Previously it would return a boolean, but this change allows you to perform additional processing on the Bullet as required (thanks @JTronLabs #2696)
  • Sound.loopFull now returns the Sound instance that was looped (thanks @hilts-vaughan #2697)
  • ArcadePhysics Body.rotation now reads its initial value from sprite.angle instead of sprite.rotation. The property was immediately replaced with the correct value in Body.preUpdate regardless, but it keeps it consistent (thanks @samme #2708)
  • Weapon.fire now tracks rotation properly, when using an offset and tracking a sprite (thanks @bobonthenet #2672)

Bug Fixes

  • A Group with inputEnableChildren set would re-start the Input Handler on a Sprite, even if that handler had been disabled previously.
  • Weapon.autofire wouldn't fire after the first bullet, or until fire was called, neither of which are requirements. If you now set this boolean the Weapon will fire continuously until you toggle it back to false (thanks @alverLopez #2647)
  • ArcadePhysics.World.angleBetweenCenters now uses centerX and centerY properties to check for the angle between, instead of center.x/y as that property no longer exists (thanks @leopoldobrines7 #2654)
  • The Emitter.makeParticles collide argument didn't work, as a result of #2661, but is now properly respected thanks to that change (thanks @samme #2662)
  • Sound.play would throw the error "Uncaught DOMException: Failed to execute 'disconnect' on 'AudioNode': the given destination is not connected." in Chrome, if you tried to play an audio marker that didn't exist, while a valid marker was already playing.
  • Text bounds would incorrectly displace if the Text resolution was greater than 1 (thanks @valent-novem #2685)
  • TilemapParser would calculate widthInPixels and heightInPixels were being read incorrectly from JSON data (capitalisation of properties) (thanks @hexus #2691)
  • A tinted Texture in Canvas mode wouldn't be updated properly if it was also cropped, beyond the initial crop. Now a cropped texture will re-tint itself every time the crop is updated, and has changed (thanks @phoenixyjll #2688)
  • The Weapon.fireRateVariance property was never taken into account internally. It's now applied to the firing rate correctly (thanks @noseglid #2715)
  • Text.updateText now sets Text.dirty = false, which stops Text objects from having updateText called twice on them after creation.

Pixi Updates

Please note that Phaser uses a custom build of Pixi and always has done. The following changes have been made to our custom build, not to Pixi in general.

  • This version contains significant fixes for DisplayObject.getBounds and DisplayObjectContainer.getBounds. The methods can now accept an optional argument targetCoordinateSpace which makes it much more flexible, allowing you to check the bounds against any target, not just local and global ones. If the targetCoordinateSpace is a valid DisplayObject:
    • If it's a parent of the caller at some level it will return the bounds
      relative to it.
    • if it's not parenting the caller at all, it will get the global bounds of
      it, and the caller and will calculate the x and y bounds of the caller
      relative to the targetCoordinateSpace DisplayObject.

As a result this also fixes how empty Groups are treated when they have no other children except Groups. So now calculations are correct.

  • DisplayObjectContainer.contains(child) is a new method which determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself. This method is used in the new getBounds function.
  • Corrected DisplayObjects default _bounds rect from (0, 0, 1, 1) to (0, 0, 0, 0).
  • Thanks to @fmflame for his hard work on the above (#2639 #2627)
  • The methods setStageReference and removeStageReference have been removed from all Pixi classes. Objects no longer have stage properties, or references to the Stage object. This is because no reference to the Stage is required for any calculations, and Phaser can only have 1 Stage, so adding and removing references to it were superfluous actions.
  • The file pixi/utils/Polyk.js has been removed, as it was no longer used with Pixi or Phaser (we replaced it with EarCut a while ago)

Caemlyn

11 Jul 09:15
Compare
Choose a tag to compare

Version 2.6.1 - "Caemlyn" - 11th July 2016

Bug Fixes

  • Fixed Uncaught TypeError: Cannot set property 'x' of undefined in Body.js (thanks @ErwanErwan #2607)

Fal Moran

08 Jul 14:56
Compare
Choose a tag to compare

Version 2.6.0 - "Fal Moran" - 8th July 2016

New Features

  • The Loader has a new property headers. This is an object checked by XHR Requests, used to set the Request Header of certain file types. JSON and XML are pre-configured, but you can add to, or modify this property as required (thanks @stoneman1 #2585 #2485)
  • Phaser now has support for Typings, the TypeScript Definition Manager. See the typescript/readme.md file for installation instructions (thanks @monagames #2576)
  • Phaser.Utils.reverseString will take the given string, reverse it, and then return it.
  • Phaser.ArrayUtils.rotateRight is the opposite of ArrayUtils.rotate. It takes an array, removes the element from the end of the array, and inserts it at the start, shifting everything else 1 space in the process.
  • Phaser.ArrayUtils.rotateLeft is the new name for Phaser.ArrayUtils.rotate. The old method is now deprecated (but still available in this release)
  • Phaser.Color.toABGR converts RGBA components to a 32 bit integer in AABBGGRR format.
  • ArcadePhysics.Body.setCircle is a new method that allows you to define an Arcade Physics Body as being a circle instead of a rectangle. You can control the radius of the body and the offset from the parent sprite.
  • ArcadePhysics.World.separateCircle is a new method that handles all circular body collisions internally within Arcade Physics (thanks @VitaZheltyakov)
  • All of the Arcade Physics internal methods, such as collideGroupVsSelf, collideSpriteVsSprite and so on, have been updated to work with circular body shapes (thanks @VitaZheltyakov)
  • ArcadePhysics.Body.onWorldBounds is a new Signal that is dispatched whenever the Body collides with the world bounds, something that was previously difficult to detect. Due to the potentially high volume of signals this could create it is disabled by default. To use this feature set this property to a Phaser.Signal: sprite.body.onWorldBounds = new Phaser.Signal() and it will be called when a collision happens, passing five arguments: the sprite on which it occurred, and 4 booleans mapping to up, down, left and right, indicating on which side of the world the collision occurred.
  • ArcadePhysics.Body.onCollide is a new Signal that is dispatched whenever the Body collides with another Body. Due to the potentially high volume of signals this could create it is disabled by default. To use this feature set this property to a Phaser.Signal: sprite.body.onCollide = new Phaser.Signal() and it will be called when a collision happens, passing two arguments: the sprites which collided.
  • ArcadePhysics.Body.onOverlap is a new Signal that is dispatched whenever the Body overlaps with another Body. Due to the potentially high volume of signals this could create it is disabled by default. To use this feature set this property to a Phaser.Signal: sprite.body.onOverlap = new Phaser.Signal() and it will be called when an overlap happens, passing two arguments: the sprites which collided.
  • Groups now have the following properties, which are getters and setters: centerX, centerY, left, right, top and bottom. These calculate the bounds of the Group, based on all visible children, and then allow you to apply positioning based on that. This means you can, for example, now get the horizontal center of a Group by called Group.centerX. These properties are also setters, so you can position the Groups, and it will take scale and rotation into consideration.
  • Groups have a new method alignIn. It allows you to align the Group within another Game Object, or a Rectangle. You can specify one of 9 positions which are the new position constants such as: Phaser.TOP_LEFT or Phaser.CENTER (see docs for the complete list). The Groups are positioned based on their child bounds, which takes rotation and scaling into consideration. You can easily place Groups into the corners of the screen, or game world, or align them within other Sprites, using this method.
  • Groups have a new method alignTo. It allows you to align a Group to the side of another Game Object, or a Rectangle. You can specify one of 11 positions which are the new position constants such as: Phaser.TOP_LEFT or Phaser.LEFT_BOTTOM (see docs for the complete list). The Groups are positioned based on their child bounds, which takes rotation and scaling into consideration. You can easily align Groups next to other Sprites using this method.

Updates

  • TypeScript definitions fixes and updates (thanks @monagames)
  • Docs typo fixes (thanks @drhayes)
  • The TilemapParser will now add more data when importing Image object types from Tiled. The extra data available is: image width, image height, and flags to see if the image is flipped either horizontally, vertically or diagonally (thanks @gotenxds #2564 #2554)
  • TilemapLayer.renderRegion has had an assignment to the obsolete tileColor property removed (thanks @cryptographer #2583)
  • Group.getFurthestFrom and Group.getClosestTo has a new optional argument: callback. This allows you to apply your own additional filtering to the distance checks, ultimately influencing the selected child (thanks @LoneStranger #2577)
  • Text.setText has a new optional argument immediate which will re-create the texture immediately upon call, rather than wait for the next render pass to do so (thanks @Scraft #2594)
  • Phaser.Utils.pad now calls toString on the input given, which means you can pass in common data types, such as numbers, and have them padded and returned as strings.
  • The canvas created by Phaser.Debug for use when displaying debug data is no longer stored in the CanvasPool, and is instead a stand-alone canvas, free from ever being re-used by another game object.
  • BitmapData has a new, optional, fifth argument: skipPool. By default BitmapData objects will ask for the first free canvas found in the CanvasPool, but this behavior can now be customized on a per object basis.
  • Phaser.ArrayUtils.rotate is now deprecated. Please use Phaser.ArrayUtils.rotateLeft instead.
  • Phaser.Text.fontPropertiesCanvas used to be taken from the CanvasPool, but as it's constantly needed it is now generated directly from the document.
  • The default image texture, for when none is supplied, is now available under Phaser.Cache.DEFAULT.
  • The missing image texture, for when an image has failed to load, is now available under Phaser.Cache.MISSING.
  • Phaser.Cache.addImage will now check the key given, and if __default or __missing it will update the new consts Phaser.Cache.DEFAULT and Phaser.Cache.MISSING accordingly, allowing you to replace the default or missing image textures used by Phaser.
  • Phaser.Cache.getPixiTexture has now been removed, as the Pixi Cache isn't used internally anywhere any longer.
  • Phaser.Cache.getPixiBaseTexture has now been removed, as the Pixi Cache isn't used internally anywhere any longer.
  • The second argument to Phaser.Cache.removeImage has been renamed from removeFromPixi to destroyBaseTexture, as that is fundamentally what the argument always did.
  • AnimationManager.refreshFrame has been removed as it never actually did anything internally.
  • Sound.stop will check to see if gainNode exists before trying to disconnect from it (#2597)

Bug Fixes

  • Fixed issue in Group.align where the cell wouldn't increase if rows was great than -1
  • Sound.volume was accidentally repeated twice in the source (thanks @LoneStranger #2569)
  • Animation.setFrame wouldn't work correctly if the useLocalFrameIndex argument was true, and the frame ID was a number (thanks @uboot #2571)
  • Polygon.contains would only work with non-flattened Polygon objects. It now works with both flat and non-flat Polygons.
  • Graphics objects enabled for input would fail to do anything if a Phaser Polygon was given to the Graphics object (which it was in nearly all cases), as it wouldn't detect input correctly with flattened polygons (thanks @symbiane #2591)
  • P2.World.clear will now clear out the World.walls property, resetting all of the wall bounds to null. This allows the walls to be re-created accurately when the P2 World is reset, which happens on a State change or restart (thanks @ewpolly1 @codermua #2574)

Pixi Updates

Please note that Phaser uses a custom build of Pixi and always has done. The following changes have been made to our custom build, not to Pixi in general.

  • Removed _renderWebGL, _renderCanvas, getLocalBounds and getBounds from PIXI.DisplayObject, as they were only there to pass ancient jshint rules.
  • All Pixi.Graphics methods that change the Graphics, i.e. drawShape, lineTo, arc, etc will now all automatically call Graphics.updateLocalBounds. This is so that the bounds of the Graphics object are kept updated, allowing you to scale and rotate the Graphics object and still obtain correct dimensions from it (thanks @kelu-smiley #2573)
  • PIXI.CanvasPool no longer just checks for null parent comparisons. It will check for all falsey parents, helping free-up canvases when the parent objects have been removed elsewhere.
  • PIXI.CanvasPool.remove and removeByCanvas both now set the removed canvas width and height to 1.
  • PIXI.Texture.fromImage, PIXI.BaseTexture.fromImage and PIXI.Sprite.fromImage have all been removed. They should never have actually been used, as they bypass the Phaser Loader, and don't factor in CORs or any other advanced loader settings.
  • The PIXI.BaseTexture.imageUrl property has been removed, as it was never actually populated.
  • The PIXI.BaseTexture._UID property has been removed, as it was never actually used internally.
  • All references to PIXI.BaseTextureCache have been removed (primarily from BaseTexture.destroy and Texture.destroy), as the BaseTextureCache was never used internally by Phaser, or by our custom version of Pixi.
  • PIXI.TextureCache has been removed. It was only ever used by the __default and __missing images that Phaser generates on start-up. It wasn't used internally by Phase...
Read more

Five Kings

17 Jun 11:49
Compare
Choose a tag to compare

Version 2.5.0 - "Five Kings" - 17th June 2016

Note: This version was also released as 2.4.9 'Four Kings' on 16th June 2016. The 2.5.0 release marks us moving to a more strict adherence of the Semver rules, and also contains some TypeScript definitions fixes.

New Features

  • Phaser.Line.intersectsRectangle checks for intersection between a Line and a Rectangle, or any Rectangle-like object such as a Sprite or Body.
  • Group.getClosestTo will return the child closest to the given point (thanks @Nuuf #2504)
  • Group.getFurthestFrom will return the child farthest away from the given point (thanks @Nuuf #2504)
  • Animation.reverse will reverse the currently playing animation direction (thanks @gotenxds #2505)
  • Animation.reverseOnce will reverse the animation direction for the current, or next animation only (thanks @gotenxds #2505)
  • The way the display list updates and Camera movements are handled has been completely revamped, which should result is significantly smoother motion when the Camera is following tweened or physics controlled sprites. The Stage.postUpdate function is now vastly reduced in complexity. It takes control over updating the display list (calling updateTransform on itself), rather than letting the Canvas or WebGL renderers do this. Because of this change, the Camera.updateTarget function uses the Sprites worldPosition property instead, which is now frame accurate (thanks @whig @Upperfoot @Whoisnt @hexus #2482)
  • Game Objects including Sprite, Image, Particle, TilemapLayer, Text, BitmapText and TileSprite have a new property called data. This is an empty Object that Phaser will never touch internally, but your own code, or Phaser Plugins, can store Game Object specific data within it. This allows you to associate data with a Game Object without having to pollute or change its class shape.
  • TilemapLayers will now collide properly when they have a position that isn't set to 0x0. For example if you're stitching together several maps, one after the other, and manually adjust their scrollX/Y properties (thanks @Upperfoot #2522)
  • There are a bunch of new Phaser consts available to help with setting the angle of a Game Object. They are Phaser.ANGLE_UP, ANGLE_DOWN, ANGLE_LEFT, ANGLE_RIGHT, ANGLE_NORTH_EAST, ANGLE_NORTH_WEST, ANGLE_SOUTH_EAST and ANGLE_SOUTH_WEST.
  • Math.between will return a value between the given min and max values.
  • InputHandler.dragDistanceThreshold gives you more fine control over when a Sprite Drag event will start. It allows you to specify a distance, in pixels, that the pointer must have moved before the drag will begin.
  • InputHandler.dragTimeThreshold gives you more fine control over when a Sprite Drag event will start. It allows you to specify a time, in ms that the pointer must have been held down for, before the drag will begin.
  • InputHandler.downPoint is a new Point object that contains the coordinates of the Pointer when it was first pressed down on the Sprite.
  • There are two new Phaser consts available, for help with orientation of games or Game Objects. They are Phaser.HORIZONTAL, Phaser.VERTICAL, Phaser.LANDSCAPE and Phaser.PORTRAIT.
  • InputHandler.dragStopBlocksInputUp is a boolean that allows you to control what happens with the input events. If false (the default) then both the onInputUp and onDragStop events will get dispatched when a Sprite stops being dragged. If true then only the onDragStop event is dispatched, and the onInputUp is skipped.
  • Group.inputEnableChildren is a new property. If set to true will automatically call inputEnabled = true on any children added to, or created by, the Group.
  • PIXI.DisplayObjectContainer.ignoreChildInput is a new property. If true then the children will not be considered as valid for Input events. Because this has been applied to DisplayObjectContainer it means it's available in Group, Sprite and any other display level object. Using this boolean you can disable input events for all children in an entire Group, without having to iterate anything or deep-set flags.
  • InputHandler._pointerOverHandler and _pointerOutHandler have new arguments silent - if true then they will not dispatch any Signals from the parent Sprite.
  • Pointer.interactiveCandidates is a new Array that is erased and re-populated every time this Pointer is updated. It contains references to all of the Game Objects that were considered as being valid for processing by this Pointer, during the most recent update. To be valid they must have suitable a priorityID, be Input enabled, be visible and actually have the Pointer over them. You can check the contents of this array in events such as onInputDown, but beware: it is reset every update.
  • Pointer.swapTarget allows you to change the Pointer.targetObject object to be the one provided. This allows you to have fine-grained control over which object the Pointer is targeting.
  • Input.setInteractiveCandidateHandler allows you to add a callback that is fired every time Pointer.processInteractiveObjects is called. The purpose of processInteractiveObjects is to work out which Game Object the Pointer is going to interact with. It works by polling all of the valid game objects, and then slowly discounting those that don't meet the criteria (i.e. they aren't under the Pointer, are disabled, invisible, etc). Eventually a short-list of 'candidates' is created. These are all of the Game Objects which are valid for input and overlap with the Pointer. If you need fine-grained control over which of the items is selected then you can use this callback to do so. The callback will be sent 3 parameters: 1) A reference to the Phaser.Pointer object that is processing the Items. 2) An array containing all potential interactive candidates. This is an array of InputHandler objects, not Sprites. 3) The current 'favorite' candidate, based on its priorityID and position in the display list. Your callback MUST return one of the candidates sent to it.
  • Group.onChildInputDown is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an onInputDown signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.
  • Group.onChildInputUp is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an onInputUp signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.
  • Group.onChildInputOver is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an onInputOver signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.
  • Group.onChildInputOut is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an onInputOut signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.
  • Phaser.Weapon is a brand new plugin that provides the ability to easily create a bullet pool and manager. Weapons fire Phaser.Bullet objects, which are essentially Sprites with a few extra properties. The Bullets are enabled for Arcade Physics. They do not currently work with P2 Physics. The Bullets are created inside of Weapon.bullets, which is a Phaser.Group instance. Anything you can usually do with a Group, such as move it around the display list, iterate it, etc can be done to the bullets Group too. Bullets can have textures and even animations. You can control the speed at which they are fired, the firing rate, the firing angle, and even set things like gravity for them. Please see the Documentation for more details, or view the Weapon examples in the Examples repo.
  • BitmapData.smoothProperty is a new property that holds the string based prefix needed to set image scaling on the BitmapData context.
  • BitmapData.copyTransform allows you to draw a Game Object to the BitmapData, using its worldTransform property to control the location, scaling and rotation of the object. You can optionally provide
  • BitmapData.drawGroup now uses the new copyTransform method, to provide for far more accurate results. Previously nested Game Objects wouldn't render correctly, nor would Sprites added via addChild to another Sprite. BitmapText objects also rendered without rotation taken into account, and the Sprites smoothing property was ignored. All of these things are now covered by the new drawGroup method, which also handles full deep iteration down the display list.
  • Added the following new constants: Phaser.TOP_LEFT, Phaser.TOP_CENTER, Phaser.TOP_RIGHT, Phaser.LEFT_TOP, Phaser.LEFT_CENTER, Phaser.LEFT_BOTTOM, Phaser.CENTER, Phaser.RIGHT_TOP, Phaser.RIGHT_CENTER, Phaser.RIGHT_BOTTOM, Phaser.BOTTOM_LEFT, Phaser.BOTTOM_CENTER and Phaser.BOTTOM_RIGHT.
  • Rectangle.getPoint is a new method that returns a point based on the given position constant, such as Phaser.BOTTOM_LEFT. It returns the same result as calling Rectangle.bottomLeft (etc) but unlike those getters you are able to provide your own Point object.
  • The Game Object Bounds component has been updated to include two new properties: centerX and centerY. This means you can, for example, now get the horizontal center of a Sprite by called Sprite.centerX. These properties are also setters, so you can position the Game Objects, and it will take scale and anchor into consideration.
  • All Game Objects with the Bounds component; which includes Sprites, Images, Text, BitmapText, TileSprites and anything that extend these, now have the new method alignIn. It allows you to align the Game Object within another Game Object, or a Rectangle. You can specify one of 9 positions which are the new position constants such as: `Phaser.TO...
Read more