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
28c1a26780
Phaser 2.4.9 RC3.
2016-06-09 17:13:31 +01: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
aa8e5f00db
Phaser 2.4.9 RC2.
2016-06-03 18:48:34 +01: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
photonstorm
0da7cf5ffd
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
.
2016-06-03 15:19:18 +01:00
photonstorm
9ae43757b9
Group.removeAll has a new argument destroyTexture
which allows you to optionally destroy the BaseTexture of each child, as it is removed from the Group (thanks @stoneman1 #2487 )
2016-06-03 13:11:03 +01:00
Richard Davey
097add1aa6
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.
2016-06-03 01:08:32 +01:00
photonstorm
127e36df20
Defs update #2510
2016-06-02 15:14:11 +01:00
photonstorm
cb70152bc0
Defs update #2517
2016-06-02 15:13:00 +01:00
photonstorm
dfa8b9dedc
Refactored Group.getClosestTo and Group.getFurthestFrom.
2016-06-02 15:11:23 +01:00
Richard Davey
837d3cba46
Merge pull request #2505 from gotenxds/ReverseAnimation
...
Added a reverse functionality to animations.
2016-06-02 15:01:57 +01:00
gotenxds
b34860c89b
Reverse and reverseOnce will now return the animation to allow linking.
2016-05-31 20:27:55 +03:00
pigeonT
93c0cf378f
bugfix, in Class Graphics, the method generateTexture should return type RenderTexture, but not current Texture. When use typescript to compile, there is a Error: Type 'Texture' is not assignable to type 'RenderTexture'.
2016-05-29 23:36:18 +02:00
gotenxds
ae3ebf00cd
Added typescript defs; Fixed jshint.
2016-05-27 18:04:33 +03:00
gotenxds
b0c4f3bc4c
Added a convenient function.
2016-05-27 17:48:06 +03:00
John Doe
ce17ac9902
Added a reverse functionality to animations.
2016-05-27 15:44:32 +03:00
photonstorm
027725e702
Defs update.
2016-05-24 02:31:07 +01:00
Richard Davey
07e2edc651
Merge pull request #2495 from monagames/ts-colormatrix-filter-fix
...
Ts colormatrix filter fix
2016-05-23 12:39:22 +01:00
Richard Davey
06bd29662a
Merge pull request #2491 from monagames/systemjs-ts-fixes
...
Fixes for typescript declarations with system.js
2016-05-23 12:34:50 +01:00
monagames
2fee58fefc
Fixed typescript definitions for PIXI ColorMatrixFilter
2016-05-22 09:58:10 +02:00
monagames
12397377ab
Fixes for typescript declarations with system.js
2016-05-21 20:22:40 +02:00
Thanabodee Charoenpiriyakij
1387aaa055
typescript/pixi.d.ts: Add padding
to Graphics.generateTexture
2016-05-21 14:12:37 +07:00
photonstorm
9f28d0659d
Phaser 2.4.8 release.
2016-05-19 12:36:51 +01:00
photonstorm
ac89d1aec7
Arcade Physics Body has a new property worldBounce
. This controls the elasticity of the Body specifically when colliding with the World bounds. By default this property is null
, in which case Body.bounce is used instead. Set this property to a Phaser.Point object in order to enable a World bounds specific bounce value (thanks @VitaZheltyakov #2465 )
2016-05-16 13:53:12 +01:00
photonstorm
19dce62734
Arcade Physics has had a new world
argument added to the following functions: distanceBetween
, distanceToXY
, distanceToPointer
, angleBetween
, angleToXY
and angleToPointer
. The argument (which is false by default), when enabled will calculate the angles or distances based on the Game Objects world
property, instead of its x
and y
properties. This allows it to work for objects that are placed in offset Groups, or are children of other display objects (thanks @Skeptron for the thread #2463 )
2016-05-16 13:31:57 +01:00
photonstorm
a26bd55811
TS defs fix #2475
2016-05-16 13:03:48 +01:00
Richard Davey
6eca457877
Merge pull request #2476 from staff0rd/generate_texture
...
fix generateTexture return type
2016-05-16 12:56:27 +01:00
photonstorm
4fd2524c61
Text.setStyle has a new argument update
which will optionally automatically call updateText
after setting the new style (thanks @staff0rd #2478 )
2016-05-16 12:55:27 +01:00
stafford
e6b9ca4e22
fix generateTexture return type
2016-05-12 15:30:33 +10:00
photonstorm
2e1c858196
Added Create.
2016-04-29 01:41:15 +01:00
Richard Davey
88977e4609
Merge pull request #2444 from staff0rd/typescript_SaveCPU_Plugin
...
added type definintions for SaveCPU plugin
2016-04-28 00:05:31 +01:00
Richard Davey
d16ef28ae6
Merge pull request #2452 from osev7/patch-1
...
typescript defs: Allow game.physics.arcade.collide(group) for collisions within group
2016-04-27 23:56:43 +01:00
osev7
65f7f06849
Allow game.physics.arcade.collide(group) for collisions within group
2016-04-26 09:41:13 -04:00
photonstorm
620b95e510
Updated docs and TS defs re: #2443
2016-04-23 04:36:47 +01:00
Stafford Williams
0628870540
fix type
2016-04-23 12:33:12 +10:00
Stafford Williams
c3bc464b1c
added type definintions for SaveCPU plugin
2016-04-23 12:13:30 +10:00