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
Dave Eargle
209b588f8b
fix documentation for group.align -- row and column were swapped
2016-07-18 20:39:32 -04:00
Richard Davey
4548d70369
Experimenting with new MainLoop + position interpolation. (reverted from commit e49d45e278
)
2016-07-13 02:44:35 +01:00
Richard Davey
e49d45e278
Experimenting with new MainLoop + position interpolation.
2016-07-12 03:05:29 +01:00
photonstorm
9b4bb1bdd8
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.
2016-07-11 17:05:42 +01:00
photonstorm
1467eb48cf
A Group with inputEnableChildren
set would re-start the Input Handler on a Sprite, even if that handler had been disabled previously.
2016-07-11 14:17:51 +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
Mike Headley
fca0a625b0
Distance comparison opposite of intended. Fixing so it will save the smaller distance instead of the greater.
2016-06-21 22:20:27 -07:00
Richard Davey
2bd4f68ea0
Small tweaks to #2577 and TS defs.
2016-06-21 22:18:09 +01:00
Mike Headley
48616c8854
Replacing lost Group.getClosestTo documentation lines.
2016-06-20 14:26:30 -07:00
Mike Headley
2e91588f87
Refactored original getClosestTo and getFurthestFrom functions to include optional filter callback. Removed the getClosestToFilter and getFurthestFromFilter.
2016-06-20 14:07:12 -07:00
Mike Headley
ad0f31be8d
Added Group.getClosestToFilter() and Group.getFurthestFromFilter()
2016-06-19 10:45:35 -07:00
photonstorm
697a2ae94e
Fixed issue in Group.align where the cell wouldn't increase if rows
was great than -1
2016-06-17 15:28:39 +01:00
Richard Davey
a9976d2703
Phaser 2.5.0 Release.
2016-06-17 12:46:56 +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
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
fc7a3934d2
Group.align working.
2016-06-16 02:28:49 +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
Richard Davey
5415d9b603
Stage and Group postUpdate methods iterate the same way now.
2016-06-09 23:14:24 +01:00
photonstorm
a65f9c7e4b
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.
2016-06-09 16:19:11 +01:00
photonstorm
458a67251d
Fixed input property check.
2016-06-09 15:09:20 +01:00
photonstorm
24f4abe760
Group.add has a new optional argument index
which controls the index within the group to insert the child to. Where 0 is the bottom of the Group.
...
Group.addAt has been refactored to be a simple call to `Group.add`, removing lots of duplicate code in the process.
Group.create has a new optional argument `index` which controls the index within the group to insert the child to. Where 0 is the bottom of the Group. It also now makes proper use of `Group.add`, cutting down on more duplicate code.
Group.createMultiple now returns an Array containing references to all of the children that the method created.
2016-06-09 14:58:35 +01:00
photonstorm
e8e7e27184
The DisplayObject.renderOrderID
used to run in reverse. I.e. in a display list with 10 sprites on it, the first sprite (at the bottom of the list, rendering behind all the others) would have a renderOrderID
of 9, where-as the top-most sprite, rendering above all others, would have a renderOrderID
of 0. While this didn't cause any side-effects internally, it's arguably illogical. So the process has been reversed, and renderOrderID
s are now accumulative, starting at zero each frame, and increasing as it iterates down the display list. So the higher the ID, the more "on-top" of the output the object is.
...
`InputHandler.validForInput` and `Pointer.processInteractiveObjects` have been updated to reflect the new `renderOrderID` sequence (see above).
2016-06-09 12:32:37 +01:00
Richard Davey
de3d749385
Farthest swapped for the more common Furthest.
2016-06-05 23:01:00 +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
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
45bd98ee18
Fixed issue with camera target sync.
2016-06-02 23:20:46 +01:00
Richard Davey
645a614326
Stage has had all of its core update loops modified, so they now iterate through the display list forwards, instead of in reverse. Stage.postUpdate is now also a lot smaller, with no conditional branching if there is a Camera Target or not.
2016-06-02 22:45:31 +01:00
Richard Davey
09d09aaf84
Removed the updateTransform calls from the frame loop, because it happens automatically as part of Game.updateLogic anyway, so was duplicating the workload for no reason.
2016-06-02 22:41:03 +01:00
Richard Davey
eb1c61826c
The camera now divides its effects (like shake and fade) updates, and the updateTarget into two separate functions.
2016-06-02 22:40:30 +01:00
photonstorm
68c29470cf
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 )
2016-06-02 16:38:21 +01:00
photonstorm
dfa8b9dedc
Refactored Group.getClosestTo and Group.getFurthestFrom.
2016-06-02 15:11:23 +01:00
photonstorm
a52bbf621b
Added missing property.
2016-06-02 15:02:44 +01:00
Gustav
5a1cb006ec
beautified
2016-05-28 00:27:35 +02:00
Gustav
5b4b41c958
added functions for getting closest child and farthest child
2016-05-26 21:51:56 +02:00
zeterain
cd188ed0ab
Update Documentation in Game.js
...
Updated the documentation in Game.js to indicate that the renderType property could be set to Phaser.HEADLESS.
2016-05-18 10:56:44 -06:00
photonstorm
02e8b1ae0a
If you set Game.renderType to Phaser.HEADLESS
it will no longer render the output to the canvas. The canvas is still created (although not added to the DOM), as it's required internally, but no rendering now takes place on it (thanks @ForgeableSum #2464 )
2016-05-16 14:53:11 +01:00
photonstorm
16203a378a
PIXI.defaultRenderer is now set to null
in Game.destroy, allowing it to be reset if a new Game instance is created on the same page (thanks @xtforgame ##2474)
2016-05-11 11:27:36 +01:00
David Hayes
fb709fe728
Add a "shakeIntensity" property to Camera.
...
This would allow tweening the intensity of the Camera shake over the
lifetime of the shaking.
2016-04-22 19:53:52 -05:00
photonstorm
002d6250a8
Docs update.
2016-04-21 00:48:54 +01:00
photonstorm
3d6b1a3b7e
Stopped the Camera Shake effect from changing the World position, as it screws up Arcade Physics, Sprite deltas and some input handling. Instead moved the effect to be render applied only. On Canvas it updates the context.setTransform call, and on WebGL the renderSession offset property.
2016-04-19 04:12:58 +01:00
photonstorm
62d135cf1f
Small tidy-up.
2016-04-19 03:39:04 +01:00
photonstorm
5221bfd5da
You can now pass in your own Canvas element to Phaser and it will use that instead of creating one itself. To do so you must pass a Game Configuration object to Phaser when you instantiate it, and set the canvas
property of the config object to be the DOM element you wish to use, i.e.: { canvas: document.getElementById('yourCanvas') }
(thanks @Friksel #2311 )
2016-04-14 11:57:10 +01:00
photonstorm
7102a34706
Camera.flash is a new function that makes the camera 'flash' over the top of your game. It works by filling the game with the solid fill color specified, and then fading it away to alpha 0 over the duration given. This is great for things like hit effects. You can listen for the Camera.onflashComplete Signal.
...
Camera.fade is a new function that makes the camera fade to the color given, over the course of the duration specified. This is great for things like transitioning from one State to another. You can listen for the Camera.onFadeComplete Signal.
Camera.resetFX resets any active FX, such as a fade or flash and immediately clears it. Useful to calling after a fade in order to remove the fade from the Stage.
Phaser.Camera.ENABLE_FX is a const that controls if the Camera FX are available or not. It's `true` by default, but if you set it to `false` before boot then it won't create the Graphics object required to process the effects.
2016-04-09 04:05:07 +01:00
photonstorm
2ea94c83e6
Camera.shake is a new function that creates a camera shake effect. You can specify the intensity, duration and direction of the effect. You can also set if it should shake the camera out of bounds or not.
2016-04-09 02:57:16 +01:00
photonstorm
0b0a5d44cc
Camera shake working and documented.
2016-04-09 02:49:18 +01:00
photonstorm
a916812db1
Camera shake support.
2016-04-09 02:01:45 +01:00
photonstorm
9e803fff7c
Small fix.
2016-04-09 01:10:31 +01:00
photonstorm
dba84d5931
Camera has a new property: lerp
. This is a Point object, that allows you to control the amount of horizontal and vertical smoothing to be applied to the camera when it tracks a Sprite. It works both with and without deadzones, and is turned off by default. Set it to low values such as 0.1 for really smooth motion tracking (thanks to @WombatTurkey for the idea of adding this)
2016-04-09 01:07:19 +01:00