Commit graph

253 commits

Author SHA1 Message Date
Richard Davey
46c20ab00a The property checkCollision.none has been removed from the ArcadePhysics.Body class. It was never used internally, so lead to confusion about its use. To disable a body, use body.enable = false (thanks @samme #2661) 2016-07-23 09:43:01 +01:00
Richard Davey
d14250304c Defs update. 2016-07-22 04:19:17 +01:00
Richard Davey
9eff79f2c2 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. 2016-07-22 02:35:33 +01:00
Richard Davey
c36babcc1c Code formatting and docs updates. 2016-07-21 10:45:23 +01:00
Richard Davey
79e135087f 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. 2016-07-21 02:11:16 +01:00
Richard Davey
60b8d78ab8 Group.align updates. 2016-07-20 12:29:30 +01:00
Richard Davey
bd6c91f924 Merge pull request #2651 from calvindavis/dev
Fixed optional seeds parameter in RandomDataGenerator's constructor.
2016-07-20 12:11:17 +01:00
Calvin Davis
e12e34e56d Fixed optional seeds parameter in RandomDataGenerator's constructor. 2016-07-19 16:18:48 +01:00
Richard Davey
b2c0b3d014 Merge pull request #2641 from calvindavis/dev
Fixed optional alpha parameter in interpolateColor.
2016-07-18 18:22:15 +01:00
Richard Davey
e62257fbed Merge pull request #2640 from Amyantis/physicsGroup_definition_fix
Fix definition of GameObjectFactory.physicsGroup
2016-07-18 18:21:46 +01:00
Calvin Davis
c2d596997c Fixed optional alpha parameter in interpolateColor. 2016-07-18 17:21:02 +01:00
Richard Davey
8d914bece8 Fixed TS defs for weapon.fire. 2016-07-16 07:56:16 +01:00
Amyantis
8b386dbbb1 Fix definition of GameObjectFactory.physicsGroup
Making physicsBodyType optionnal according to http://phaser.io/docs/2.6.1/Phaser.GameObjectFactory.html#physicsGroup
2016-07-12 14:13:57 +02:00
photonstorm
ac2516f5aa 2.6.1 Release. 2016-07-11 10:07:56 +01:00
Richard Davey
0014201917 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.
2016-07-08 01:33:42 +01:00
Richard Davey
c0ba439e82 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.
2016-07-07 23:16:18 +01:00
Richard Davey
6ba3c9401f 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 one argument: the sprite on which it occurred.
2016-07-07 21:58:39 +01:00
Richard Davey
63158a1dbf Argument swapped for destroyBaseTexture. 2016-07-06 22:31:26 +01:00
Richard Davey
1b4d0330bf TypeScript updates. 2016-07-06 22:19:17 +01:00
Richard Davey
3642ff0489 Phaser.Color.toABGR converts RGBA components to a 32 bit integer in AABBGGRR format. 2016-07-04 18:50:42 +01:00
photonstorm
0036bf747f 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. 2016-07-04 12:57:08 +01:00
Richard Davey
fdcbb9229b Phaser.ArrayUtils.shift 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. 2016-06-29 02:08:42 +01:00
Richard Davey
fbd1ba05f7 Phaser.Utils.reverseString will take the given string, reverse it, and then return it. 2016-06-27 22:43:53 +01:00
Richard Davey
a0c771d47e 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) 2016-06-27 22:42:01 +01:00
photonstorm
b24de1e561 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)
2016-06-27 14:51:25 +01:00
monagames
d5661264d4 Improved typescript definitions 2016-06-25 17:22:56 +02:00
Richard Davey
2bd4f68ea0 Small tweaks to #2577 and TS defs. 2016-06-21 22:18:09 +01:00
Richard Davey
f3ad741614 Merge pull request #2580 from monagames/ts-emitter-missing-prop
Added missing property (particleAnchor) to emitter typescript definitions
2016-06-21 22:04:02 +01:00
monagames
b70eeeb3b1 Missing property in emitter type definitions 2016-06-20 21:35:28 +02:00
Richard Davey
a9976d2703 Phaser 2.5.0 Release. 2016-06-17 12:46:56 +01:00
Richard Davey
43b4fd3caf Fixed defs (#2568) and added in Box2D defs. 2016-06-17 11:52:46 +01:00
photonstorm
694debe94b Rebuilt Phaser Comments TypeScript defs. 2016-06-17 02:28:57 +01:00
photonstorm
4da3b15ae2 Renamed alignTo to alignIn, and added the new method alignTo, to allow for Sprite to Sprite alignment. Updated all of the Bounds and TS defs. 2016-06-16 17:01:51 +01:00
photonstorm
5bcf84f5a4 Added offsetX and offsetY arguments to Bounds.alignTo. 2016-06-16 15:51:12 +01:00
Richard Davey
853d770764 Group.align is a new method that allows you to layout all the children of the Group in a grid formation. You can specify the dimensions of the grid, including the width, height and cell size. You can also control where children are positioned within each grid cell. The grid width and height values can also be set to -1, making them fluid, so the grid expands until all children are aligned. Finally an optional child index argument can be set. This is a great way to quickly and comprehensively align Group children, and has lots of use cases. 2016-06-16 02:50:24 +01:00
Richard Davey
ed8fbd9a6c All Game Objects with the Bounds component; which includes Sprites, Images, Text, BitmapText, TileSprites and anything that extend these, now have a new method alignTo. It allows you to align the Game Object to another Game Object, or a Rectangle. You can specify one of 9 positions which are the new constants: Phaser.TOP_LEFT, Phaser.TOP_CENTER and so on (see above for the complete list). The Game Objects are positioned based on their Bounds, which takes rotation, scaling and anchor into consideration. You can easily place Sprites into the corners or the screen or game world, or align them against other Sprites, using this method. 2016-06-16 02:00:46 +01:00
Richard Davey
0efcf68b21 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. 2016-06-16 01:00:11 +01:00
Richard Davey
c7225cb3b7 Added Rectangle.getPoint. 2016-06-15 23:40:15 +01:00
Richard Davey
64a44aab17 Added the following new constants: Phaser.TOP_LEFT, Phaser.TOP_CENTER, Phaser.TOP_RIGHT, Phaser.MIDDLE_LEFT, Phaser.MIDDLE_CENTER, Phaser.MIDDLE_RIGHT, Phaser.BOTTOM_LEFT, Phaser.BOTTOM_CENTER and Phaser.BOTTOM_RIGHT. 2016-06-15 23:37:48 +01:00
Richard Davey
32cf1f1a9c Group.createMultiple can now accept Arrays for both the key and frame arguments. This allows you to create multiple sprites using each key and/or frame in the arrays, which is a great and quick way to build diverse Groups. See the JSDocs for complete details and code examples. 2016-06-15 22:36:23 +01:00
photonstorm
bc00c900e9 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.
2016-06-14 15:29:56 +01:00
Dave Leaver
4dde32d746 Add Pointer.pointerMode 2016-06-14 18:02:11 +12:00
photonstorm
2ac594ca03 TypeScript defs update. 2016-06-09 16:29:09 +01:00
Richard Davey
1956d3584e 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. 2016-06-07 02:21:12 +01:00
Richard Davey
df92c45420 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. 2016-06-07 01:45:33 +01:00
Richard Davey
66b846cbdb 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.
2016-06-07 01:28:06 +01:00
BaroqueEngine
042fc28513 Fixed typescript definitions: ArrayUtils.rotateMatrix and ArrayUtils.numberArrayStep 2016-06-06 17:27:32 +09:00
photonstorm
1a67079ae7 Phew. Added TypeScript defs for the Weapon Plugin. Don't say I never do anything for you! 2016-06-03 17:11:08 +01:00
photonstorm
93b1f3eba1 Math.between will return a value between the given min and max values. 2016-06-03 16:18:35 +01:00
photonstorm
ee6f277b31 PluginManager.remove has a new argument destroy (defaults to true) which will let you optionally called the destroy method of the Plugin being removed. 2016-06-03 15:52:17 +01:00