Richard Davey
bab50d7c88
* The Cache has been internally refactored considerably. Image data is now all stored in the same object, rather than being split across the PIXI global caches (such as PIXI.TextureCache and PIXI.BaseTextureCache), which are no longer used by Phaser.
...
* Internally the Cache now uses a single _cache object, which is partitioned to store the various different object types. Before the cache used lots of private objects, one per data type, but it's now a lot cleaner and we've managed to cut out hundreds of lines of duplicate code in the process.
* Cache.getImage has a new argument which lets you return either just the HTML Image element or the entire image cache object, which includes the baseTexture and frame data.
* Cache.getImage will return a __default image if the key isn't given, or a __missing image if the key is given but not found in the cache. This means it will always return a valid image and no longer cause Phaser to throw runtime errors deeper down with invalid image objects.
2015-07-16 00:46:28 +01:00
Richard Davey
c6f89737cb
The Cache has been internally refactored considerably. Images are now no longer grouped in a single Images cache, but split based on their type. For example you can now load an image called 'fire' and a texture atlas called 'fire' at they are placed into unique caches, where-as before you had to be careful not to use the same keys for anything using an image.
...
Internally the Cache now uses a single _cache object, which is partitioned to store the various different object types. Before the cache used lots of private objects, one per data type, but it's now a lot cleaner and we've managed to cut out hundreds of lines of duplicate code in the process.
2015-07-15 23:28:13 +01:00
photonstorm
a0d57544c7
P2 updates finished.
2015-07-13 14:48:33 +01:00
photonstorm
956fa493a6
The P2.Body.onBeginContact arguments have changed. It now sends 5 arguments: The Phaser.P2.Body, the p2.Body, the p2 Shape from Body A, the p2 Shape from Body B and the contact equations array. Note that the Phaser.P2.Body may be null if you collide with a 'native' p2 body (such as the world bounds). However the p2.Body argument will always be populated.
...
The P2.Body.onEndContact arguments have changed. It now sends 4 arguments: The Phaser.P2.Body, the p2.Body, the p2 Shape from Body A and the p2 Shape from Body B. Note that the Phaser.P2.Body may be null if this is the end of a contact with a 'native' p2 body (such as the world bounds). However the p2.Body argument will always be populated.
Upgraded to p2.js 0.7.0
2015-07-13 11:44:04 +01:00
Richard Davey
502dd548fb
Loader.path is a string and if set it is placed before any _relative_ file path given to the Loader. For example: load.path = "images/sprites/";
followed by load.image("ball", "ball.png");
and load.image("tree", "level1/oaktree.png");
would load the ball
file from images/sprites/ball.png
and the tree from images/sprites/level1/oaktree.png
. The path is added before the filename but *after* the Loader.baseURL
. The path _must_ end with a "/". Set it to nothing to disable the path.
2015-07-12 23:43:35 +01:00
Richard Davey
44c650f6e7
PIXI.DisplayObject.updateTransform now nulls the _currentBounds property (thanks @gaufqwi #1906 )
2015-07-12 12:01:38 +01:00
Richard Davey
b0a8d3d78c
Mouse.button and MSPointer.button properties removed and jsdocs expanded to explain the correct path to now take ( #1903 )
2015-07-12 11:47:20 +01:00
Richard Davey
4dec046c40
Added pendingDestroy to Groups.
2015-07-12 11:33:30 +01:00
photonstorm
6e84207331
Readme update.
2015-07-10 17:35:13 +01:00
photonstorm
d3525950a2
Group.addMultiple if given a Group.children array as the first parameter would fail as the original group length was decreased out of line with the children being added. Group.addMultiple now checks if the children argument is a Phaser.Group instance, and if so it uses Group.moveAll instead on it (thanks @AnderbergE #1898 )
...
Group.moveAll allows you to move all of the children of a Group into another Group.
2015-07-10 17:05:54 +01:00
Richard Davey
8e92c13412
Canvas.setSmoothingEnabled only applies the value of the property exists, which avoids the Chrome webkit prefix deprecation warnings.
2015-07-10 04:02:21 +01:00
Richard Davey
f65bca1026
All Signals now have the ability to carry extra custom arguments with them, which are passed on to the callback you define after any internal arguments. For example a Phaser.Key has an onDown signal. When dispatched onDown sends a reference to the Key as the first and only argument. But you can now set the callback like this: fireKey.onDown.add(shoot, this, 0, 'lazer', 64)
. So when the onDown signal is dispatched internally the callback (shoot
in this case) will receive 3 arguments: the Key reference that is raised internally and the string 'lazer' and value 64, which were the custom arguments provided when setting-up the callback.
2015-07-09 21:15:00 +01:00
photonstorm
918e00b868
Added Phaser.Keyboard.COMMA and Phaser.Keyboard.PERIOD to the consts list.
2015-07-09 14:31:18 +01:00
photonstorm
89c87bc9db
Updated addKeys to take an object instead of 2 arrays - it's just cleaner and reads easier in code.
2015-07-09 14:28:58 +01:00
photonstorm
5ad3698703
BitmapData.clear has 4 new optional parameters: x, y, width and height, that define the area to be cleared. If left undefined it works exactly the same as before and clears the entire canvas.
2015-07-09 11:44:21 +01:00
Richard Davey
d027bf8ba7
BitmapData.generateTexture will take a snapshot of the BitmapDatas canvas at that moment in time and convert it into an Image, which is then stored in the Phaser image Cache based on the key given. You can then use the new texture for any future sprites or texture based objects.
2015-07-09 00:19:07 +01:00
Richard Davey
3590272c51
All Game Objects have a new boolean property called pendingDestroy
. If you set this to true
then the object will automatically destroy itself in the *next* logic update, rather than immediately. This is useful for cases when you wish to destroy an object from within one of its own callbacks, such as with buttons or other input events (thanks @alamboley #1748 )
2015-07-08 18:52:01 +01:00
photonstorm
1b5da312d0
RandomDataGenerator.weightedPick has been tweaked slightly to allow for a more even distribution of weights. It still favors the earlier array elements, but will accurately include 'distance' elements as well (thanks @gingerbeardman #1751 )
2015-07-08 17:20:36 +01:00
photonstorm
64b1794d67
Rope.segments used the wrong vertices property, causing a runtime error.
...
Debug.ropeSegments didn't take the scale of the Rope object into consideration, causing incorrect debug rendering.
2015-07-08 16:40:26 +01:00
photonstorm
b9dcf74726
If the device is detected as a Windows Phone the renderer is automatically set to use Canvas, even if WebGL or AUTO was requested (thanks @ramarro123 #1706 )
2015-07-08 15:25:52 +01:00
photonstorm
0f31358724
Device.windowsPhone should now correctly identify Windows Phone 8.1 devices, which also think they are iOS and Androids. If you find a device that gets around this check please send us its ua string! (thanks @jounii #1496 )
2015-07-08 15:22:32 +01:00
photonstorm
1281bc52d7
Setting the scaleMode property of a Game configuration object would cause a ScaleManager TypeError in the resize method. It now stores the scale mode locally and applies it after boot (thanks @Mickawesomesque #1534 )
2015-07-08 14:52:20 +01:00
photonstorm
3012e49937
Text.addColor would incorrectly color the text stroke if set (thanks @llevkin #1893
...
Text.addStrokeColor works in the same way as `Text.addColor` but allows you to define a color stop for the stroke color instead of the fill color.
2015-07-08 12:52:39 +01:00
Richard Davey
86cac2085c
BitmapData.move(x, y) allows you to shift the contents of the BitmapData horizontally and vertically by the given amounts. The image wraps-around the edges of the BitmapData.
...
BitmapData.moveH(distance) allows you to horizontally shift the BitmapData with wrap-around the edges.
BitmapData.moveV(distance) allows you to vertically shift the BitmapData with wrap-around the edges.
2015-07-08 04:26:28 +01:00
Richard Davey
a7e18137d1
Text has a new style property: tabs. This allows you to specify a pixel value (or values) that allows you to space out text that contains tab characters within it. Text.tabs
can be either an integer, in which case all tabs share the same spacing, or an array of pixel values corresponding exactly to the number of tabs per line of text. This allows you to easily align columns of data in a single Text object.
2015-07-08 01:15:31 +01:00
photonstorm
157df30696
Pointer button handling has been given an overhaul. It has the following new boolean properties: leftButton
, rightButton
, middleButton
, backButton
, forwardButton
and eraserButton
. So you can now easily check which buttons are active and build right or middle click support into your games. The Pointer object normalises these properties for you, regardless if they came from a MouseEvent or PointerEvent (thanks @youssefdetovernickr for the idea #1848 )
2015-07-07 16:53:56 +01:00
photonstorm
9548fb9856
Final textBounds updates.
2015-07-07 15:16:23 +01:00
Richard Davey
92f2742a26
When reusing a Tween created with an array of properties the values would get exponentially added to the TweenData internal array each time the tween was re-run (thanks @SBCGames #1747 )
2015-07-07 04:21:55 +01:00
Richard Davey
6a9fd4de8d
Debug.currentAlpha wasn't being used to set the alpha of the Debug context at all (was always set to 1) but now updates the alpha of the Debug context before anything is rendered to it (thanks @wayfu #1888 )
2015-07-07 03:32:11 +01:00
Richard Davey
06658fa1e0
TilemapLayer.resize allows you to resize a TilemapLayer. It will update the internal canvas object and corresponding texture dimensions ( #1881 )
2015-07-07 03:27:28 +01:00
Richard Davey
f57d3c19e9
P2.Body.createGroupCallback incorrectly referenced the _groupCallbackContext
when deleting it (thanks @Langerz82 #1886 )
2015-07-07 01:24:26 +01:00
photonstorm
ab092c5c14
Keyboard.addKeys is a practical way to create an object containing user selected hotkeys. For example: addKeys( [Phaser.Keyboard.W, Phaser.Keyboard.S, Phaser.Keyboard.A, Phaser.Keyboard.D], [ 'up', 'down', 'left', 'right' ] );
would return an object containing the properties up
, down
, left
and right
that you could poll just like a Phaser.Key object. (thanks @Mourtz #1857 )
2015-07-02 14:15:06 +01:00
photonstorm
698167a596
Tiled Image Collection support is now available and has been added to the TilemapParser and Tilemap classes (thanks @asyed94 #1879 )
2015-07-02 13:53:02 +01:00
photonstorm
a89d48b9a6
Text.autoRound allows you to control if the text is allowed to render at sub-pixel coordinates or not. Set to true
to round the coordinates, often eliminating anti-aliasing from certain font types ( #1867 )
2015-07-02 13:39:59 +01:00
photonstorm
ce405acb02
jsdoc update #1864
2015-07-02 13:31:26 +01:00
photonstorm
29f9eeabc6
RenderTexture now takes the display objects alpha into consideration when rendering it, before it would always reset worldAlpha to 1 before rendering, thus ignoring any alpha that may be set.
2015-07-02 13:28:44 +01:00
photonstorm
1ed33cb06c
Setting mute to false on Sound that was never muted caused its volume to be set to zero (thanks @brianbunch #1870 )
2015-06-24 15:54:25 +01:00
photonstorm
a69c156526
The Text Bounds is a rectangular region that allows you to align your text within it, regardless of the number of lines of text or position within the world. For example in an 800x600 sized game if you set the textBounds to be 0,0,800,600 and text alignment to 'left' and vertical alignment to 'bottom' then the text will render in the bottom-right hand corner of the game, regardless of the size of font you're using or the number of lines in the text itself.
...
Set the Style properties `boundsAlignH` and `boundsAlignV` or adjust them via the Text setters to change the alignment.
It works by calculating the final position based on the Text.canvas size, which is modified as the text is updated. Some fonts have additional padding around them which you can mitigate by tweaking the Text.padding property.
Setting a textBounds _doesn't_ update the wordWrapWidth, so be aware of the relationship between the two.
Call this method with nothing defined for any of the parameters to reset an existing textBounds.
#1824
2015-06-17 17:18:04 +01:00
photonstorm
0258245f12
Phaser.Text no longer extends PIXI.Text but replaces it entirely. Phaser.Text now natively extends a Phaser Sprite, meaning it can be enabled for physics, damaged, etc.
2015-06-17 13:21:28 +01:00
photonstorm
102c74e121
Deprecated the following:
...
* Camera.screenView
* ScaleManager.maxIterations
* ScaleManager.enterPortrait (see onOrientationChange)
* ScaleManager.enterLandscape (see onOrientationChange)
* ScaleManager.enterFullScreen (see onFullScreenChange)
* ScaleManager.leaveFullScreen (see onFullScreenChange)
* ScaleManager.fullScreenFailed (see onFullScreenError)
* ScaleManager.checkResize
* ScaleManager.checkOrientation
* ScaleManager.setScreenSize (see updateLayout)
* ScaleManager.setSize (see reflowCanvas)
* ScaleManager.checkOrientationState (see reflowCanvas)
* ScaleManager.orientation (see screenOrientation)
* Gamepad.disabled (see enabled)
* Input.currentPointers (see totalActivePointers)
* Input.disabled (see enabled)
* Keyboard.disabled (see enabled)
* Mouse.disabled (see enabled)
* Mouse.mouseMoveCallback (see Input.addMoveCallback)
* MSPointer.disabled (see enabled)
* Touch.disabled (see enabled)
* Cache.getUrl (see getURL)
* Math.truncate (see Math.trunc)
* Math.snapToInArray (see Phaser.ArrayUtils.findClosest)
* Math.interpolateFloat (see Math.linear)
* Math.normalizeLatitude (use Phaser.Math.clamp(lat, -90, 90))
* Math.normalizeLongitude (use Phaser.Math.wrap(lng, -180, 180))
* Math.chanceRoll (use Phaser.Utils.chanceRoll)
* Math.numberArray (use Phaser.ArrayUtils.numberArray)
* Math.numberArrayStep (use Phaser.ArrayUtils.numberArrayStep)
* Math.limitValue (use Phaser.Math.clamp)
* Math.randomSign (use Phaser.Utils.randomChoice(-1, 1))
* Math.angleLimit (use Phaser.Math.clamp)
* Math.getRandom (use Phaser.ArrayUtils.getRandomItem)
* Math.removeRandom (use Phaser.ArrayUtils.removeRandomItem)
* Math.floor (use Math.trunc)
* Math.ceil (use Phaser.Math.roundAwayFromZero)
* Math.shift (use Phaser.ArrayUtils.rotate)
* Math.shuffleArray (use Phaser.ArrayUtils.shuffle)
* Math.distanceRounded (do the rounding locally)
* Canvas.getOffset (see Phaser.DOM.getOffset)
* Canvas.getAspectRatio (see Phaser.DOM.getAspectRatio)
* TilemapLayer.tileColor (use TilemapLayer.debugSettings.missingImageFill)
* Phaser.ArrayList alias removed, now use Phaser.ArraySet
* Utils.transposeArray (see Phaser.ArrayUtils.transposeMatrix)
* Utils.rotateArray (see Phaser.ArrayUtils.rotateMatrix)
* Utils.shuffle (see Phaser.ArrayUtils.shuffle)
2015-06-17 03:14:31 +01:00
photonstorm
8cf28fede7
maxHealth is a new property that Game Objects with the Health component receive and works in combination with the heal
method to ensure a health limit cap.
2015-06-17 02:00:04 +01:00
photonstorm
b725c25702
Button game objects now have Input.useHandCursor
set to true
by default.
2015-06-17 01:55:36 +01:00
photonstorm
e28eb7b390
Docs update.
2015-06-17 01:55:36 +01:00
photonstorm
40802314dd
TileSprite now fully supports animation again, having been broken for several versions due to a Pixi upgrade. We've updated the way TileSprites generate their textures internally considerably and animation support is back across both Canvas and WebGL as a result ( #1653 )
2015-06-17 01:25:56 +01:00
Richard Davey
14733e9b90
Tilemap.addTilesetImage can now accept a BitmapData as the key
parameter and will use the BitmapData to render the tileset with instead of an image from the cache (thanks to @unstoppablecarl for the idea #1838 )
2015-06-16 23:17:46 +01:00
photonstorm
30a35227da
Formatting update.
2015-06-16 20:38:18 +01:00
photonstorm
17831e0103
P2.Body.loadPolygon now allows the key
parameter to be passed as null
- when this happens the object
parameter can be the actual physics object data instead of a string pointing to the cache, allowing you to take advantage of adding multiple convex shapes with automatic adjustments for center of mass #1801
2015-06-16 19:02:28 +01:00
photonstorm
b481402ae4
Due to a Pixi 2 issue TileSprite when running under WebGL didn't respect the world alpha setting and would only work with its own alpha (thanks @hanenbro #1774 )
2015-06-16 17:03:19 +01:00
photonstorm
1990bce48b
Sound.restart and Sound.stop now properly disconnect the sound from the gainNode (or external node) before stopping it, allowing restart to work correctly (thanks @eofs #1796 )
2015-06-16 16:24:47 +01:00
photonstorm
00cf44eb22
If running under Cordova and iOS the Game.lockRender boolean will be set to true
when the game pauses and false
when it resumes. This avoids the gpus_ReturnNotPermittedKillClient
app crash on iOS (thanks @cncolder #1800 )
2015-06-16 14:54:42 +01:00
photonstorm
ab8c98676e
Sound.resume wouldn't properly restart looped sounds in Chrome after being paused. Phaser now specifically handles the Chrome 42 bug and later fix (thanks @nkovacs #1820 )
2015-06-16 14:28:46 +01:00
photonstorm
f5369628ce
Device.chromeVersion will return the major version number of Chrome.
2015-06-16 14:16:04 +01:00
photonstorm
732b80813e
Line.rotate allows you to rotate a line by the given amount around its center point.
2015-06-13 05:20:43 +01:00
photonstorm
9e78cd1d7a
Rectangle.random will return a uniformly distributed random point from anywhere within the rectangle.
2015-06-13 04:18:50 +01:00
photonstorm
77e7b2af9b
Ellipse.random will return a uniformly distributed random point from anywhere within the ellipse.
2015-06-13 03:46:20 +01:00
photonstorm
3daea179fb
Line.random will return a random point from anywhere on the Line segment.
2015-06-13 03:04:02 +01:00
photonstorm
9212c01dae
Returns a random point from anywhere within this circle.
2015-06-12 19:15:56 +01:00
photonstorm
af42f5d4c9
Cache.getJSON has a new parameter: clone
. If set it will return a clone of the object stored in the Cache rather than a reference to it.
2015-06-12 12:16:58 +01:00
photonstorm
681d8679e7
Rectangle.resize allows you to resize a Rectangle to the new given dimensions without altering its position.
2015-06-11 06:01:29 +01:00
photonstorm
2b0abb67dd
onDragUpdate is a new signal that is dispatched whenever a Game object enabled for input and drag is moved by a pointer (i.e. during a drag event). See the Phaser.InputHandler.enableDrag
docs for parameter details and the new Phaser Example.
2015-06-04 20:58:00 +01:00
photonstorm
eec99db8a9
Readme update.
2015-06-04 04:24:02 +01:00
photonstorm
ed82097151
Removed un-necessary PIXI.TextureCache pollution in Phaser.LoaderParser.bitmapFont.
2015-06-03 05:28:23 +01:00
photonstorm
76e2b00c82
Fixed pad jsdoc and ts defs ( #1823 )
2015-06-02 19:53:30 +01:00
photonstorm
cc5740af10
BitmapText line spacing and word wrapping has been vastly improved and bought in-line with how Pixi 3 handles it, but with additional anchor support.
2015-05-31 01:31:11 +01:00
Richard Davey
187d947c29
Merge pull request #1806 from joshtepei/patch-2
...
Fixed a comma error in README.md
2015-05-30 20:02:59 +01:00
photonstorm
1438248388
Group.add and Group.addAt will only create a Physics Body on the child if it doesn't already have one. This is a change from 2.3 where it would replace the physics body property with the new body, but this could lead to garbage build-up over time, so you should now properly destroy the body before changing it.
2015-05-29 00:59:23 +01:00
photonstorm
3ad60b815b
Docs update.
2015-05-27 18:07:38 +01:00
photonstorm
83b533557d
Docs update.
2015-05-26 20:01:57 +01:00
photonstorm
f2636a155a
Readme update.
2015-05-22 15:10:27 +01:00
photonstorm
312c31b778
jsdoc and formatting fixes.
2015-05-21 11:53:18 +01:00
Josh Tepei
6bf44a859c
Fixed a grammar error in README.md
...
Added a comma for further clarity on line 54 of README.md
2015-05-20 14:23:33 -07:00
photonstorm
5a91f85b1f
Typo.
2015-05-19 16:57:36 +01:00
photonstorm
ab594e930b
Readme update.
2015-05-19 16:09:19 +01:00
photonstorm
c3d123641b
Readme update.
2015-05-19 14:53:38 +01:00
photonstorm
0f6dd1a1a6
Device.firefoxVersion is a new property that contains the major Firefox version number if running within Firefox, otherwise zero.
2015-05-18 14:51:25 +01:00
photonstorm
bd44a25212
Readme updates.
2015-05-18 12:55:48 +01:00
photonstorm
5a149ea4ec
Docs updates.
2015-05-14 16:52:09 +01:00
photonstorm
f7514dc979
Docs updates.
2015-05-12 13:03:27 +01:00
photonstorm
7b938f396e
Rectangle.bottomLeft has been added (thanks @mattmogford #1788 )
2015-05-12 13:03:26 +01:00
photonstorm
4a4d7d594c
Docs updates.
2015-05-08 04:15:03 +01:00
photonstorm
25178fdf85
Docs update.
2015-05-08 01:51:18 +01:00
photonstorm
af66b49f31
If a BitmapData is created with a width or height set to zero then the width and/or height are set to a default value (256) instead to avoid getContext errors.
2015-05-06 16:50:10 +01:00
photonstorm
f623e68eb7
Docs updates.
2015-05-06 01:12:09 +01:00
photonstorm
9aa022ba8e
Docs update.
2015-05-05 17:03:44 +01:00
photonstorm
9ce76fcef8
Docs update.
2015-05-05 16:25:57 +01:00
photonstorm
33ece1fc52
Readme updates.
2015-05-05 14:02:10 +01:00
photonstorm
159a3f2f40
Readme updates.
2015-05-03 13:53:03 +01:00
photonstorm
df3c684760
PIXI.BaseTexture.forceLoaded allows you to set a BaseTexture as loaded, with the given width and height. It then calls BaseTexture.dirty
. This is important for when you don't want to modify the shape of the source object by forcing in complete
or dimension properties it may not naturally have, but still wish to use it as a base texture.
2015-05-03 13:53:02 +01:00
photonstorm
3f51463c7b
PIXI.CanvasTinter.tintWithMultiply was performing a double drawImage operation for no reason. Simplified down to a single drawImage call.
2015-05-03 13:53:02 +01:00
photonstorm
e291f6d590
Added type
parameter to VideoTexture.fromUrl
allowing you to define the mime-type of the video file, which is required for Firefox and Safari in most cases.
2015-04-29 14:41:47 +01:00
photonstorm
da0bd86c26
Rectangle.ceil runs Math.ceil() on both the x and y values of the Rectangle.
...
Rectangle.ceilAll runs Math.ceil() on the x, y, width and height values of the Rectangle.
2015-04-29 13:13:11 +01:00
photonstorm
8290e8c371
Text.setShadow has two new optional parameters: shadowStroke
and shadowFill
. These allow you to set if the drop shadow is applied to the Text stroke, the Text fill or both of them (thanks @qdrj #1766 )
...
Text.shadowStroke and Text.shadowFill allow you to toggle if the drop shadow is applied to the Text stroke or fill independently.
2015-04-27 16:22:36 +01:00
photonstorm
8519c9e394
The Tween.onStart signal wasn't dispatched if the Tween had a delay set. It's now dispatched immediately if no delay, or after the delay if set. It also respects the autoStart
parameter and will still dispatch even if autoStart
is true.
2015-04-27 16:22:35 +01:00
photonstorm
30450cb9bc
Loader.atlas and Cache.addTextureAtlas
will now automatically determine the format of the JSON data (array or hash) when added to the Cache. You no longer need to specify it explicitly if JSON, only if XML.
2015-04-23 02:35:09 +01:00
photonstorm
05d0a94116
Phaser.AnimationParser methods JSONData
, JSONDataHash
and XMLData
have all had their cacheKey
parameter removed as it's no longer used.
2015-04-21 16:01:11 +01:00
photonstorm
ede76cf4f6
Frame.uuid has been removed (was flagged as deprecated for several releases). This has a two-fold effect: First it means that the property no longer exists and secondly it means that the AnimationParser (the class responsible for loading sprite sheets and texture atlases) no longer has to call either RandomDataGenerator.uuid OR populates the PIXI.TextureCache. The first saves some CPU time and the second saves memory by not creating references to textures it doesn't ever use. The PIXI.TextureCache is now ignored by Phaser other than for the __missing
and __default
textures.
2015-04-21 15:55:04 +01:00
photonstorm
94b4d5d73c
Doc updates.
2015-04-21 05:10:27 +01:00
photonstorm
6c96568dd1
Files can now be added to the Loader with an absolute URL even if you have a Loader.baseURL set. In previous versions the baseURL would still be prepended to the file URL, but the Loader now checks if the a file URL begins with http
or //
and skips prepending the baseURL to it.
...
All calls to Loader methods that add files to the queue, such as `Loader.image` or `Loader.atlas`, now have the URL as an optional parameter. If not set Loader will assume the URL to be based on the key given. For example the following: `game.load.image("boom", "boom.png")` can now be expressed as just `game.load.image("boom")`, or `game.load.atlas("player", "player.png", "player.json")` can now be shortened to `game.load.atlas("player")`. Please see the freshly updated jsdocs for full details.
2015-04-21 02:14:41 +01:00
photonstorm
714580f9a9
Manual fix #1752
2015-04-17 17:35:52 +01:00
photonstorm
59beae762d
The SoundManager didn't accurately detect devices or browser environments with no sound card present and would try to carry on using a null Web Audio context (thanks @englercj #1746 )
...
SoundManager.pauseAll, resumeAll and stopAll now checks if the SoundManager.noAudio is set and ignores the calls.
SoundManager.usingWebAudio is set to `false` by default (used to be `true`) and is only explicitly set if Web Audio is available and hasn't been disabled in the PhaserGlobal object.
SoundManager.touchLocked is now set to `false` should the device be using legacy Audio, avoiding the unlock call running without need.
2015-04-17 03:49:20 +01:00
photonstorm
2e2ba665cd
PIXI.DisplayObject.updateTransform has a new optional parameter parent
. If the DisplayObject doesn't have a parent (i.e. it isn't on the display list yet) then in the past updateTransform
would fail. This meant you couldn't do things like scale or rotate a Sprite and then draw it to a RenderTexture or BitmapData, as calls to updateTransform would be ignored. The new checks now look to see if the parent
parameter is set. If so this takes priority over the actual parent and is used to modify the transform (note that it **doesn't** reparent the DisplayObject, it merely uses it for the transform.) If there is no parent (explicitly or via the parameter) then it falls back to use Phaser.World as the parent. If it can't reach that then no transform takes place.
2015-04-17 03:22:23 +01:00
photonstorm
eca360301c
Bumping up the release to 2.4.0 due to the API changes in the State Manager.
2015-04-15 01:37:41 +01:00
photonstorm
9f493044d4
The StateManager would incorrectly call loadUpdate
while the game was paused or if the State didn't have an update
method defined even after the loader was completed.
...
The StateManager would incorrectly call `loadRender` while the game was paused or if the State didn't have an `render` method defined even after the loader was completed.
2015-04-14 15:34:32 +01:00
photonstorm
8f06991527
Added support for the [Creature Automated Animation Tool]( http://www.kestrelmoon.com/creature/ ). You can now create a Phaser.Creature object which uses json data and a texture atlas for the animations. Creature is a powerful animation tool, similar to Spriter or Spine. It is currently limited to WebGL games only, but the new libs should prove a solid starting point for anyone wanting to incorporate Creature animations into their games.
2015-04-13 23:16:29 +01:00
photonstorm
0ffa499bd0
Removed getJSON parse parameter. It's already parsed :)
2015-04-13 22:06:57 +01:00
photonstorm
e5f1f6f896
Cache.getPixiTexture will return a PIXI.Texture from the cache based on the given key. A PIXI Texture is created automatically for all images loaded and added to the cache.
...
Cache.getPixiBaseTexture will return a PIXI.BaseTexture from the cache based on the given key. A PIXI BaseTexture is created automatically for all images loaded and added to the cache.
Cache.getTexture has now been removed (it was deprecated several versions ago). Use Cache.getRenderTexture instead.
Cache.getJSON has a new optional parameter: `parse`. If `true` the method will pass the data through JSON.parse before returning it. The default is `false` to retain backwards compatibility.
2015-04-13 20:25:42 +01:00
photonstorm
615925123a
Group would automatically add a child into the _hash array as soon as the child was created (or moved into the Group). This no longer happens. Instead the child is only added to Group.hash if it is enabled for Arcade Physics. However Group.addToHash and the hash array have been exposed in case you were taking advantage of the _hash even though it was a private array.
...
Enabling Arcade Physics would add the deltaCap property onto Phaser.Time, even though the property doesn't exist any more, changing the class shape in the process.
2015-04-13 16:34:39 +01:00
photonstorm
bd57510528
Group would automatically add a child into the _hash array as soon as the child was created (or moved into the Group). This no longer happens. Instead the child is only added to Group.hash if it is enabled for Arcade Physics. However Group.addToHash and the hash array have been exposed in case you were taking advantage of the _hash even though it was a private array.
2015-04-13 16:32:03 +01:00
photonstorm
432516fa0f
Physics.Arcade.sort has a new property 'sortDirection'. If not specified it will use World.sortDirection. If the Group given as the first parameter has its physicsSortDirection
property set that will override any other setting.
...
Physics.Arcade.sort now calls one of four functions: sortLeftRight, sortRightLeft, sortTopBottom and sortBottomTop. Each of which takes 2 Sprites as arguments.
Physics.Arcade.sort now doesn't bail out if the Group contains a mixture of physics and non-physics enabled objects, as the Group hash is now only ever populated with physics enabled objects. Also the sort comparison functions no longer return -1 if the bodies are invalid, but zero instead (#1721 )
2015-04-13 16:29:34 +01:00
photonstorm
eb506e2698
PIXI.Graphics in Canvas mode wouldn't respect the objects visible or alpha zero properties, rendering it regardless (thanks @TimvdEijnden #1720 )
2015-04-13 14:19:44 +01:00
photonstorm
bb8b0d04fc
Graphics.drawPolygon can now accept a Phaser.Polygon or PIXI.Polygon object, as well as a points array ( #1712 )
2015-04-13 13:00:52 +01:00
photonstorm
f155ad452c
Tilemap.createFromObjects has been updated for Tiled 0.11 and can now look-up object layers based on id, uid or name. It will also now copy over Sprite scaling properties if set (thanks @mandarinx #1738 )
2015-04-13 12:40:12 +01:00
photonstorm
7b8a430aac
TilemapLayer docs incorrectly reported it as extending Phaser.Image, but it doesn't share the same components so has been updated.
...
TilemapLayer was missing the Input component (thanks @uhe1231 #1700 )
2015-04-13 12:23:30 +01:00
photonstorm
04cb3889a9
P2.getConstraints would return an array of null objects. It now returns the raw p2 constraint objects (thanks @valueerrorx #1726 )
2015-04-13 12:12:18 +01:00
photonstorm
b41cf3bc8c
AnimationManager.frameName setter wasn't checking if _frameData
existed before accessing it (thanks @nesukun #1727 )
2015-04-13 11:58:45 +01:00
photonstorm
36c064511c
Added guards around context.getImageData
calls in BitmapData, Text and Canvas Tinting classes to avoid crashing restricted browsers like Epic Browser. Please understand that several Phaser features won't work correctly with this browser (thanks @Erik3000 #1714 )
2015-04-02 14:47:44 +01:00
photonstorm
645723f939
Sprite was missing the Health and InCamera components.
2015-03-30 13:51:47 +01:00
photonstorm
5fb1130175
The LoadTexture component has had a redundant dirty
call removed from it.
...
TileSprites were missing a `physicsType` property, causing them to not collide with anything (thanks @numbofathma #1702 )
2015-03-28 00:56:02 +00:00
photonstorm
49be59b0c9
Added missing resumed
method to Phaser.State class template.
2015-03-26 10:54:32 +00:00
photonstorm
8233b0a079
Phaser 2.3.0.
2015-03-26 02:37:31 +00:00
photonstorm
d4e838592c
Readme tweaks.
2015-03-26 02:22:05 +00:00
photonstorm
bd62459a56
Readme release changes.
2015-03-26 02:10:57 +00:00
photonstorm
93dc67be71
Graphics.drawArc would fail to draw any subsequent arcs if you set beginFill
on it after drawing the first arc.
...
Graphics.drawArc would only move to the center position of the first arc created and ignore any subsequent arcs.
Graphics.drawArc now correctly renders multiple arcs across both WebGL and Canvas. You no longer need to specifically call moveTo to move into the correct place to draw the arc.
Graphics.drawArc now bails out if the startAngle = the endAngle and/or the sweep is invalid *before* adjusting any points.
Graphics.drawArc now correctly handles the fill on the CanvasRenderer if the arc is a subsequent arc and no line style is set.
2015-03-25 13:00:08 +00:00
photonstorm
f4d55b7785
When an Emitter is destroyed via Emitter.destroy it now removes itself from the Phaser Particle Manager, freeing it up for garbage collection and stopping it from being processed.
2015-03-25 05:07:39 +00:00
photonstorm
aa13ec0165
Animation.play wouldn't correctly set the play state on the Game Objects AnimationManager causing the animation to fail to start (calling AnimationManager.play did work however), now they're both consistently working.
2015-03-25 03:59:36 +00:00
photonstorm
244372384e
When an Animation completes playback and isn't set to loop it would change the currentFrame
property to be the first frame in the set after the onComplete
callback had fired. This meant if you set a Sprite to a new frame within an Animation onComplete callback then your change would have been overwritten by the animation itself. This is now no longer the case.
2015-03-24 23:17:13 +00:00
photonstorm
d80ec1ae6d
Phaser 2.3 Release Candidate 2.
2015-03-24 21:35:23 +00:00
photonstorm
06b484e71c
Huge docs update.
2015-03-24 16:01:07 +00:00
photonstorm
96e313e768
If you paused a Sound object that is using audio markers and then resumed it, it wouldn't correctly calculate the resume duration - causing the sound to sometimes play into the marker that followed it (thanks @AnderbergE #1669 )
2015-03-24 14:43:35 +00:00
photonstorm
7e19f45350
When the Game first boots it will now call window.focus()
. This allows keyboard events to work properly in IE when the game is running inside an iframe. You can stop this from happening by setting window.PhaserGlobal.stopFocus = true
(thanks @webholics #1681 )
2015-03-24 13:27:27 +00:00
photonstorm
7aa4d0ad0d
When a State is started and linked to Phaser it has a new property created on it: key
, which is the string identifier used by the State.
2015-03-24 10:21:03 +00:00
photonstorm
3db4313e5d
Docs update.
2015-03-23 16:13:04 +00:00
photonstorm
7010883bc3
Tidying up.
2015-03-23 15:07:09 +00:00
photonstorm
4fbb7d2a7e
readme updates.
2015-03-23 08:13:59 +00:00
photonstorm
cb9ef4f12e
Text.padding specifies a padding value which is added to the line width and height when calculating the Text size. ALlows you to add extra spacing if Phaser is unable to accurately determine the true font dimensions ( #1561 #1518 )
2015-03-19 01:54:14 +00:00
photonstorm
b13acdb23b
TilingSprite.destroy fixed if TilingSprite hasn't ever been rendered ( #1663 )
2015-03-19 01:39:39 +00:00
photonstorm
5a9b509b44
ArraySet.removeAll allows you to remove all members of an ArraySet and optionally call destroy
on them as well.
...
GameObject.input.dragStartPoint now stores the coordinates the object was at when the drag started. This value is populated when the drag starts. It can be used to return an object to its pre-drag position, for example if it was dropped in an invalid place in-game.
2015-03-19 00:51:13 +00:00
photonstorm
62b2fb51d6
Link changed ( fix #1672 )
2015-03-18 19:25:12 +00:00
photonstorm
f2b03c8826
Readme updated.
2015-03-18 19:14:58 +00:00
photonstorm
2483cd5df4
Various readonly Body properties flagged as 'readonly' in the jsdocs ( #1643 )
2015-02-26 23:32:14 +00:00
photonstorm
f99f182a6f
Arcade Physics is now using a spacial pre-sort for all Sprite vs. Group and Group vs. Group collisions. You can define the direction the sort will prioritise via the new sortDirection
property. By default it is set to Phaser.Physics.Arcade.LEFT_RIGHT
. For example if you are making a horizontally scrolling game, where the player starts on the left and moves to the right, then this sort order will allow the physics system to quickly eliminate any object to the right of the players bounds. This cuts down on the sheer volume of actual collision checks needing to be made. In a densely populated level it can improve fps rate dramatically.
...
There are 3 other directions available (`RIGHT_LEFT`, `TOP_BOTTOM` and `BOTTOM_TOP`) and which one you need will depend on your game type. If you were making a vertically scrolling shoot-em-up then you'd pick `BOTTOM_TOP` so it sorts all objects above and can bail out quickly.
More importantly you can switch the `sortDirection` at run-time with no loss of performance. Just make sure you do it *before* running any collision checks. So if you had a large 8-way scrolling world you could set the `sortDirection` to match the direction the player was moving in and adjust it in real-time, getting the benefits as you go. My thanks to Aaron Lahman for inspiring this update.
2015-02-26 21:24:07 +00:00
photonstorm
74eeddf956
You can now set a resolution
property in your Game Configuration object. This will be read when the Pixi renderer instance is created and used to set the resolution within that ( #1621 )
2015-02-26 10:52:30 +00:00
photonstorm
41396d5ad2
Merged all of the relevant Pixi 2.2.7 fixes in ( #1621 )
2015-02-25 17:04:48 +00:00
photonstorm
321e11d0a5
A State swap now sets the Loader.reset hard
parameter to true
by default. This will null any Loader.preloadSprite that may have been set ( #1636 )
2015-02-25 05:18:49 +00:00
photonstorm
466a4d11bb
Loader.preloadSprite had an extra guard added to ensure it didn't try to updateCrop a non-existent sprite (thanks @noidexe #1636 )
2015-02-25 03:08:37 +00:00
photonstorm
5635bed54f
Docs update.
2015-02-23 13:58:57 +00:00
photonstorm
5fd066c610
ArraySet.getByKey gets an item from the set based on the property strictly equaling the value given.
2015-02-22 19:30:23 +00:00
photonstorm
8d71e8a32c
Animation.update skips ahead frames when the system is lagging, however it failed to set the animation to the final frame in the sequence if the animation skipped ahead too far (thanks @richpixel #1628 )
2015-02-22 19:26:56 +00:00
photonstorm
02ef1555c5
A TweenData wouldn't take into account the repeatDelay
property when repeating the tween, but now does. A TweenData also has a new property yoyoDelay
which controls the delay before the yoyo will start, allowing you to set both independently (thanks @DreadKnight #1469 )
...
Tween.updateTweenData allows you to set a property to the given value across one or all of the current tweens. All of the Tween methods like Tween.delay and Tween.repeat have been updated to use this.
Tween.repeat has a new parameter `repeatDelay` which allows you to set the delay (in ms) before a tween will repeat itself.
Tween.yoyo has a new parameter `yoyoDelay` which allows you to set the delay (in ms) before a tween will start a yoyo.
Tween.interpolation has a new parameter `context` which allows you to define the context in which the interpolation function will run.
2015-02-19 00:51:32 +00:00
photonstorm
35b4926eb8
Undoing previous change - doesn't actually work at all! #1620
2015-02-18 23:32:12 +00:00
photonstorm
9effb4a946
Stage.visibilityChange now has a second parameter fromPhaser
. This is set to true
by the Stage._onChange
callback. This should mean that when Phaser is listening for window.onblur
and window.onfocus
events it will only trigger the visibilityChange if that event was generated by Phaser itself. If it was generated by something else on the page or iframe it should now be ignored (thanks @austinhallock #1620 )
2015-02-18 23:12:08 +00:00
photonstorm
b0261e4a5f
Group.cursorIndex is the index of the item the Group cursor points to. This replaces Group._cache[8].
2015-02-18 22:54:19 +00:00
photonstorm
88ab104da4
BitmapText has a new maxWidth
property that will attempt to wrap the text if it exceeds the width specified.
2015-02-18 22:36:12 +00:00
photonstorm
ba727555c8
Emitter.flow now works in a slightly different (and more useful!) way. You can now specify a quantity
and a total
. The quantity
controls how many particles are emitted every time the flow frequency is met. The total
controls how many particles will be emitted in total. You can set total
to be -1 and it will carry on emitting at the given frequency forever (also fixes #1598 thanks @brianbunch)
2015-02-18 22:35:05 +00:00
photonstorm
9879fc6387
If you load an image and provide a key that was already in-use in the Cache, then the old image is now destroyed (via Cache.removeImage
) and the new image takes its place.
2015-02-18 16:58:08 +00:00
photonstorm
ef3cb1f31d
Sound in Web Audio now uses AudioContext.onended to trigger when it will stop playing instead of using a time based value. This is only used if the sound doesn't loop and isn't an audio sprite, but will give a much more accurate Sound.onStop
event. It also prevents short audio files from being cut off during playback ( #1471 ) and accounts for time spent decoding.
2015-02-18 11:25:17 +00:00
photonstorm
0dbcf88767
Readme update.
2015-02-17 16:41:04 +00:00
photonstorm
1b83674f6d
Docs update.
2015-02-17 06:01:51 +00:00
photonstorm
9670c8aa86
InputHandler.enableDrag with a boundsRect set now takes into account the Sprites anchor when limiting the drag (thanks @unindented #1593 )
...
InputHandler.enableDrag with a boundsSprite set now takes into account both the Sprites anchor and the boundsSprite anchor when limiting the drag.
2015-02-16 15:49:46 +00:00
photonstorm
8c23bca62d
Sprite.left, Sprite.right, Sprite.top, Sprite.bottom are new properties that contain the totals of the Sprite position and dimensions, adjusted for the anchor.
...
Sprite.offsetX and Sprite.offsetY contain the offsets from the Sprite.x/y coordinates to the top-left of the Sprite, taking anchor into consideration.
2015-02-16 15:47:55 +00:00
photonstorm
01a23b7d91
Tween.to now correctly accepts arrays are destination values, which makes the Tween interpolate through each value specified in the array using the defined Tween.interpolation method (see new example, thanks @FridayMarch26th #1619 )
...
Tween.interpolationFunction was using the incorrect context to invoke the function. This is now defined in `TweenData.interpolationFunctionContext` and defaults to `Phaser.Math`. If you provide your own interpolation function then please adjust the context accordingly (thanks @FridayMarch26th #1618 )
2015-02-16 12:23:54 +00:00
photonstorm
ae198e9364
InputHandler was using the wrong property in checkBoundsSprite
when fixedToCamera (thanks @yig #1613 )
2015-02-14 19:10:06 +00:00
photonstorm
f60b2b7635
World.setBounds if called after you had already started P2 Physics would incorrectly create a new collision group for the wall objects. P2.World now remembers the settings you provide for each wall and the collision group, and re-applies these settings should the world dimensions ever change (thanks @nextht #1455 )
2015-02-11 22:33:29 +00:00
photonstorm
b692d3b456
PIXI.TextureSilentFail is a boolean that defaults to false
. If true
then PIXI.Texture.setFrame
will no longer throw an error if the texture dimensions are incorrect. Instead Texture.valid
will be set to false
( #1556 )
2015-02-11 22:10:53 +00:00
photonstorm
daf8440247
Tile.properties is now unique to that specific Tile, and not a reference to the Tileset index bound properties object. Tile.properties can now be modified freely without impacting other tiles sharing the same id ( #1254 )
2015-02-11 21:40:37 +00:00
photonstorm
8892f46a83
PIXI.WebGLRenderer.destroy has been fixed to decrement the glContextId
and remove it from the PIXI.instances global. Game.destroy
now hooks into this. This now means that you can now delete and create your Phaser game over and over without it crashing WebGL after the 4th attempt ( #1260 )
2015-02-11 21:02:15 +00:00
photonstorm
b68c3071a6
Phaser.Ellipse.contains is now working again (thanks @spayton)
2015-02-11 18:51:35 +00:00
photonstorm
0e7820bde5
Group.forEach (and many other Group methods) now uses the children.length
value directly instead of caching it, which both helps performance and stops the loop from breaking should you remove a Group child in the invoked callback.
2015-02-11 17:19:56 +00:00
photonstorm
599bcf5f97
Loader.audiosprite has a new jsonData
parameter. It allows you to pass a pre-existing JSON object (or a string which will be parsed as JSON) to use as the audiosprite data, instead of specifying a URL to a JSON file on the server (thanks @jounii #1447 )
...
Loader.audiosprite has a new `autoDecode` parameter. If `true` the audio file will be decoded immediately upon load.
2015-02-11 16:16:58 +00:00
photonstorm
aa2df803b7
Pointer.stop would call event.preventDefault
if Pointer._stateReset
was true
, which is always true
after a State has changed and before Pointer.start has been called. However this broken interacting with DOM elements in the case where the State changes and you immediately try to use the DOM element without first having clicked on the Phaser game. An additional guard was added so preventDefault
will now only be called if both _stateReste
and Pointer.withinGame
are true (thanks @satan6 #1509 )
2015-02-11 16:03:24 +00:00
photonstorm
afd4108f04
Readme update.
2015-02-11 15:11:33 +00:00
photonstorm
6b8622a336
Timer.update was calling the TimerEvent callback even if TimerEvent.pendingDelete
was already set to true
, causing timer events to stack-up in cases where a new TimerEvent was generated in the callback (thanks @clowerweb #838 )
2015-02-11 14:43:23 +00:00
photonstorm
74bee324a5
Sound.fadeIn now supports fading from a marker, as well as the entire audio clip, so now works with audio sprites (thanks @vorrin #1413 )
2015-02-11 13:52:16 +00:00
photonstorm
dfee82834d
Sound.loop even when set for WebAudio wouldn't use the AudioContext loop property because Sound.start was being invoked with an offset and duration. Now if loop
is true and no marker is being used it will use the native Web Audio loop support ( #1431 )
...
SoundManager.setDecodedCallback lets you specify a list of Sound files, or keys, and a callback. Once all of the Sound files have finished decoding the callback will be invoked. The amount of time spent decoding depends on the codec used and file size. If all of the files given have already decoded the callback is triggered immediately.
Sound.loopFull is a new method that will start playback of the Sound and set it to loop in its entirety.
2015-02-11 05:17:53 +00:00
photonstorm
18ff04810f
ArcadePhysics.distanceToPointer now calculates the distance in world space values.
...
ArcadePhysics.moveToPointer no longer goes crazy if the maxTime parameter is given and the Sprite is positioned in a larger game world (thanks @AnderbergE #1472 )
2015-02-10 22:16:35 +00:00
photonstorm
7a066a3a8c
World.setBounds will now adjust the World.x/y values to match those given ( #1555 )
2015-02-10 21:40:53 +00:00
photonstorm
cc7096b045
jsdoc fix #1543
2015-02-10 21:22:36 +00:00
photonstorm
0054dc996b
The Loader now directly calls StateManager.loadComplete rather than the StateManager listening for the loadComplete event, because Loader.reset unbinds this event (and it's easy to accidentally remove it too)
...
Loader.onLoadComplete is dispatched *before* the Loader is reset. If you have a `create` method in your State please note that the Loader will have been reset before this method is called. This allows you to immediately re-use the Loader without having to first reset it manually.
2015-02-10 17:04:04 +00:00
photonstorm
dfc8ff32d2
You can now tint animated Sprites in Canvas mode. Or change the texture atlas frame of a tinted Sprite or Image. Please note that this is pretty expensive (depending in the browser), as the tint is re-applied every time the *frame changes*. The Pixi tint cache has also been removed to allow for subtle tint color shifts and to avoid blowing up memory. So use this feature sparingly! But at least it does now work ( #1070 )
2015-02-10 14:53:55 +00:00
photonstorm
823997744b
Docs update.
2015-02-10 14:53:55 +00:00
photonstorm
816a80f39a
If Body.customSeparateX
or customSeparateY
is true
then the Body will no longer be automatically separated from a **Tilemap** collision or exchange any velocity. The amount of pixels that the Body has intersected the tile is available in Body.overlapX
and overlapY
, so you can use these values to perform your own separation in your collision callback ( #992 )
2015-02-10 12:58:12 +00:00
photonstorm
4489a12fd8
Sprite.loadTexture and Image.loadTexture now no longer call updateTexture
if the texture given is a RenderTexture. This fixes issues with RetroFonts in IE11 WebGL as well as other RenderTexture related IE11 problems ( #1310 #1381 #1523 )
2015-02-10 12:27:55 +00:00
photonstorm
c154b8c785
Loader.resetLocked is a boolean that allows you to control what happens when the loader is reset, *which happens automatically on a State change*. If you set resetLocked
to true
it allows you to populate the loader queue in one State, then swap to another State without having the queue erased, and start the load going from there. After the load has completed you could then disable the lock again as needed.
...
Loader.reset has a new optional 2nd parameter `clearEvents` which if set to `true` (the default is false) will reset all event listeners bound to the Loader.
2015-02-10 11:58:17 +00:00
photonstorm
ec732e497f
Docs update.
2015-02-09 22:19:05 +00:00
photonstorm
3fc8fbadca
Docs update.
2015-02-09 20:10:51 +00:00
photonstorm
2b2ee27912
If for whatever reason you wish to hide the Phaser banner in the console.log you can set window.PhaserGlobal.hideBanner
to true
and it will skip the output. Honestly I'd rather if you didn't, but the option is now there.
2015-02-09 20:10:51 +00:00
photonstorm
35a04b2f1e
TilemapParser now supports Tiled 0.11 version maps which includes the rotation
property on all Object types.
...
Tilemap.createFromObjects now checks for a `rotation` property on the Object and if present will set it as the Sprite.angle (#1433 )
2015-02-08 23:25:41 +00:00
photonstorm
e85be1f1d8
BitmapText.font wouldn't update an internal Pixi property (fontName) causing the text to fail to change font (thanks @starnut #1602 )
2015-02-08 22:07:36 +00:00
photonstorm
46e5cfc639
Readme update.
2015-02-08 21:57:09 +00:00
photonstorm
9cdcdc7bc5
Device.touch checks if window.navigator.maxTouchPoints
is >= 1
rather than > 1, which now allows touch events to work properly in Chrome mobile emulation.
2015-02-05 06:12:20 +00:00
photonstorm
d710caed9e
Body.reset now resets the Body.speed value to zero.
2015-02-05 05:12:31 +00:00
photonstorm
8dec37107e
MSPointer.capture allows you to optionally event.preventDefault the pointer events (was previously always on)
...
MSPointer.event now stores the most recent pointer event.
MSPointer.pointerDownCallback, pointerMoveCallback and pointerUpCallback all allow you to set your own event based callbacks.
2015-02-05 05:12:00 +00:00
photonstorm
336fdfa672
TileSprites weren't destroying WebGL textures, leading to eventual out of memory errors (thanks @chacal #1563 )
2015-02-03 21:32:39 +00:00
photonstorm
3eba508382
Sprite.events.onDragStart has 2 new parameters x
and y
which is the position of the Sprite before the drag was started. The full list of parameters is: (sprite, pointer, x, y)
. This allows you to retain the position of the Sprite prior to dragging should dragFromCenter
have been enabled (thanks @vulvulune #1583 )
2015-02-03 21:32:39 +00:00
photonstorm
2ba6e0528e
TilemapLayer.getTiles now returns a copy of the Tiles found by the method, rather than references to the original Tile objects, so you're free to modify them without corrupting the source (thanks @Leekao #1585 )
2015-02-03 21:32:39 +00:00
photonstorm
ea4c9771a0
Updated docstrap-master toc.js to fix nav scrolling (thanks @abderrahmane-tj @vulvulune #1589 )
2015-02-03 20:28:18 +00:00
photonstorm
7003b65df6
Added missing properties to the InputHandler prototype, reducing hidden class modifications.
2015-02-03 20:28:18 +00:00
photonstorm
260490fe06
Fixed issue in PIXI.canUseNewCanvasBlendModes which would create false positives in browsers that supported multiply
in Canvas path/fill ops, but not for drawImage
(Samsung S5 for example). Now uses more accurate magenta / yellow mix test.
2015-02-03 16:16:25 +00:00
photonstorm
d37ffe6a8f
Sound.fadeTween is now used for Sound.fadeIn and Sound.fadeOut audio tweens.
...
Sound.stop and Sound.destroy now halt a fade tween if in effect.
2015-01-28 17:18:32 +00:00
photonstorm
6d967b6545
Error in diffX and diffY calculation in Tilemap.paste (thanks @amelia410 #1446 )
2015-01-20 10:49:15 +00:00
photonstorm
a67d2df6f0
BitmapData.text will render the given string to the BitmapData, with optional font, color and shadow settings.
2015-01-18 12:24:00 +00:00
photonstorm
587c3e5f6a
Arcade.Body.friction
allows you to have more fine-grained control over the amount of velocity passed between bodies on collision.
2015-01-18 12:24:00 +00:00
photonstorm
0f42b530eb
Physics.Arcade.isPaused
allows you to toggle Arcade Physics processing on and off. If true
the Body.preUpdate
method will be skipped, halting all motion for all bodies. Note that other methods such as collide
will still work, so be careful not to call them on paused bodies.
2015-01-10 00:30:02 +00:00
photonstorm
8973423e98
Sprite.frame and AnimationManager.frame wouldn't return the correct index if a sprite sheet was being used unless it had first been set via the setter.
2015-01-08 01:28:38 +00:00
photonstorm
65f8820514
SoundManager.unlock checks for audio start
support and falls back to noteOn
if not found.
2015-01-06 13:50:15 +00:00
photonstorm
413a59c516
Preparing for 2.3.0 development.
2015-01-06 07:24:28 +00:00
photonstorm
1c05e42f6b
Docs and Change Log update.
2015-01-06 06:56:59 +00:00
photonstorm
74951a41b4
Update for 2.2.2.
2015-01-06 06:20:46 +00:00
photonstorm
e015fec9a6
README updates.
2015-01-06 05:47:51 +00:00
photonstorm
6dedd89e36
Final screen shots.
2015-01-06 05:21:30 +00:00
photonstorm
2b7bb330ed
Slimmer shots.
2015-01-06 04:30:39 +00:00
photonstorm
8c5b8c7204
Shot alignment.
2015-01-06 04:26:25 +00:00
photonstorm
a57d2e5cb2
Added game screen shots.
2015-01-06 04:19:19 +00:00
photonstorm
8620f20dec
New div tests.
2015-01-06 02:26:03 +00:00
photonstorm
2b1dcb4a66
Can't ditch borders, so let's try with align=right.
2015-01-06 02:16:01 +00:00
photonstorm
2da6b9faa6
Table text alignment part 2. How 1990 :)
2015-01-06 02:13:33 +00:00
photonstorm
f390b88d86
Table text alignment. How 1990 :)
2015-01-06 02:01:15 +00:00
photonstorm
b7ddb09eec
README update test.
2015-01-06 01:55:27 +00:00
Richard Davey
8ad56c99e2
README update.
2015-01-05 23:31:36 +00:00
Richard Davey
479b3f0583
README update.
2015-01-05 21:53:50 +00:00
photonstorm
0adf0f3672
Readme update.
2015-01-05 21:26:59 +00:00
photonstorm
3e062826f9
Readme update.
2015-01-05 16:30:22 +00:00
photonstorm
741131312a
BitmapData.drawGroup draws the immediate children of a Phaser.Group to a BitmapData. Children are only drawn if they have their exists
property set to true
. The children will be drawn at their x
and y
world space coordinates. When drawing it will take into account the child's rotation, scale and alpha values. No iteration takes place. Groups nested inside other Groups will not be iterated through.
...
BitmapData.copy `tx` parameter if `null` and `source` is a Display Object, it will default to `source.x`.
BitmapData.copy `ty` parameter if `null` and `source` is a Display Object, it will default to `source.y`.
2015-01-05 14:28:16 +00:00
photonstorm
689501c15c
Phaser.Point.angleSq removed. It didn't work so any code relying on it would be broken, and it's unclear what it was meant for (thanks @nextht #1396 )
2015-01-05 13:00:07 +00:00
photonstorm
fc63d0a33a
Ellipse.right and Ellipse.bottom setters fixed (thanks @nextht #1397 )
...
Fixed double Ellipse.getBounds definition (thanks @nextht #1397 )
2015-01-05 12:36:35 +00:00
photonstorm
4bc8fb3c8f
Docs update #1489
2015-01-05 11:57:46 +00:00
photonstorm
35c68d4c9e
Tidied up Emitter.update.
2015-01-05 11:43:24 +00:00
photonstorm
9f6b7b49e5
Particles.Arcade.Emitter.makeParticles now checks the given quantity
value against Emitter.maxParticles
. If quantity
is more than maxParticles
then the maxParticles
value is used instead.
2015-01-05 11:22:07 +00:00
Richard Davey
a2c4cafa70
Update readme.
2015-01-04 12:38:52 +00:00
photonstorm
af15b9b4e7
Line.reflect will calculate the reflected, or outgoing angle of the line and a given line if they intersect. This can be used for Body vs. Line collision responses and rebounds.
...
Line.normalX and Line.normalY contain the x and y components of the left-hand normal of the line.
Line.fromAngle will sets this line to start at the given `x` and `y` coordinates and for the segment to extend at `angle` for the given `length`.
2015-01-04 05:11:19 +00:00
Richard Davey
1ceec8ec27
Added Code of Conduct.
2015-01-03 01:31:42 +00:00
Richard Davey
d3f913f415
Docs update.
2015-01-03 00:31:48 +00:00
Richard Davey
b3f322469b
Added Events.onEnterBounds to the destroy method (thanks @legendary-mich #1497 )
2015-01-02 21:53:20 +00:00
photonstorm
15d5b54c26
Removed redundant updateTransform call.
2015-01-02 04:15:27 +00:00
photonstorm
c1eb456ed2
Mouse.mouseMoveCallback is flagged as deprecated.
2015-01-02 04:14:44 +00:00
photonstorm
b22233a0bc
docs update and sound marker check.
2015-01-02 04:14:44 +00:00
Richard Davey
da27373c90
Device.webAudio check inversed to avoid throwing a warning in Chrome.
2015-01-01 21:38:02 +00:00
photonstorm
a6c6bf8e06
Time.reset would incorrectly reset the _started
property, now maps it to Time.time
(thanks @XekeDeath #1467 )
2014-12-18 08:07:38 +00:00
photonstorm
013abfe956
Added Pixi 2.2.0 details to README.
2014-12-17 13:53:05 +00:00
photonstorm
c6c5856dec
Phaser.Graphics.drawCircle now overrides PIXI.drawCircle which means the docs are now correct re: diameter not radius (thanks @ethankaminski #1454 )
2014-12-17 13:44:12 +00:00
photonstorm
f23c0aa24b
Removed redundant tolerance
parameter from Rectangle.intersects (thanks @toolness #1463 )
2014-12-17 13:25:21 +00:00
photonstorm
269af69da5
Added extra checks to Sound.play to stop it throwing DOM Exception Error 11 if the sound.readyState
wasn't set or the sound was invalid. Also wrapped stop()
call in a
try catch`.
2014-12-17 13:07:19 +00:00
photonstorm
5029427e14
Tween.stop fired a different set of onComplete parameters to Tween.update. Both now dispatch onComplete(target, tween) as the parameters in that order (thanks @P0rnflake #1450 )
2014-12-15 09:42:18 +00:00
photonstorm
3c564a33b6
The P2 World constructor wouldn't let you use your own config unless you specified both the gravity *and* broadphase. Now allows one or both (thanks @englercj #1412 )
2014-12-11 22:04:45 +00:00
photonstorm
93e0d2f3b1
Docs update.
2014-12-11 22:00:06 +00:00
photonstorm
0cd0a5bd9b
Phaser 2.2.3 Build Files for testing.
2014-12-11 09:26:14 +00:00
photonstorm
8d9e1196c0
readme update.
2014-12-09 15:27:26 +00:00
photonstorm
38a224df3e
Tween.delay, Tween.repeat and Tween.yoyo will no longer throw an error if called before a TweenData object has been created (via Tween.to or Tween.from) (thanks @SomMeri #1419 )
2014-12-07 11:31:48 +00:00
photonstorm
e7f3b9188e
Preparing for Phaser 2.2.2 development.
2014-12-04 11:49:53 +00:00
photonstorm
d206e3c2d5
Docs update.
2014-12-04 11:28:02 +00:00
photonstorm
847cde81a9
Custom Particle classes that used a BitmapData wouldn't work (thanks @hardalias #1402 )
2014-12-03 20:59:44 +00:00
photonstorm
3371f9ff1e
Added Game.debug reset method for when the debug manager is disabled (thanks @DanielSitarz #1407 )
2014-12-03 20:56:39 +00:00
photonstorm
1227232fd6
Updated readme.
2014-12-03 20:54:25 +00:00
photonstorm
e271c63ca6
Preparing for Phaser 2.2.1.
2014-12-03 13:41:48 +00:00
photonstorm
95ffa83e34
Phaser 2.2.0 Docs.
2014-12-03 10:39:20 +00:00
photonstorm
35e2893db4
Game.lockRender is a new property. If false
Phaser will automatically render the display list every update. If true
the render loop will be skipped. You can toggle this value at run-time to gain exact control over when Phaser renders. This can be useful in certain types of game or application. Please note that if you don't render the display list then none of the game object transforms will be updated, so use this value carefully.
2014-12-02 09:03:55 +00:00
photonstorm
def662f28f
Text.setShadow has had the default color
value changed from rgba(0,0,0,0)
to rgba(0,0,0,1)
so it appears as a black shadow by default - before the alpha channel made it invisible.
2014-12-02 09:03:55 +00:00
photonstorm
5b6e41b112
Readme updated.
2014-12-02 09:03:55 +00:00
photonstorm
30d2d1973a
readme update.
2014-11-27 21:33:21 +00:00
photonstorm
fb733ddcca
onPreRenderCallback wasn't being cleared on a State swap.
2014-11-26 13:12:51 +00:00
photonstorm
667d477a16
P2.BodyDebug always lagged behind the position of the Body it was tracking by one frame, which became visible at high speeds. It now syncs its position in the Body.postUpdate which prevents this from happening (thanks @valueerror)
2014-11-25 22:21:11 +00:00
photonstorm
e86f00eb55
Text.lineSpacing works correctly again. Before no space was added between the lines (thanks @intimidate #1367 and @brejep #1366 )
2014-11-25 17:06:17 +00:00
photonstorm
72eaee3139
Adjusted Sprite.preUpdate to remove the lifespan calculation.
2014-11-25 14:18:18 +00:00
photonstorm
7aaa63e7a5
When you change State the P2 Physics world is no longer fully cleared. All of the bodies, springs, fixtures, materials and constraints are removed - but config settings such as gravity, restitution, the contact solver, etc are all retained. The P2.World object is only created the very first time you call Physics.startSystem. Every subsequent call hits P2.World.reset instead ( #1292 )
2014-11-25 12:09:03 +00:00
photonstorm
54e79f5b25
Grunt and docs updates.
2014-11-25 00:24:29 +00:00
photonstorm
4ecd7f99a8
Docs update.
2014-11-24 11:12:09 +00:00
photonstorm
1928427bcb
Phaser TypeScript defs fixes.
2014-11-23 11:32:13 +00:00
photonstorm
874f60c1bc
Removed CocoonJS hack - woohoo!
2014-11-21 10:40:18 +00:00
photonstorm
7e4a494f13
Keyboard.justPressed has bee renamed to Keyboard.downDuration which is a much clearer name for what the method actually does.
...
Keyboard.justReleased has bee renamed to Keyboard.upDuration which is a much clearer name for what the method actually does.
Keyboard.downDuration, Keyboard.upDuration and Keyboard.isDown now all return `null` if the Key wasn't found in the local keys array.
2014-11-20 20:55:51 +00:00
photonstorm
88ea3412dc
Fixes issue where Tween.from didn't set the target properties until after the delay was up.
2014-11-20 20:42:10 +00:00
photonstorm
2589000435
Tweens have been completely rewritten. They're now much more flexible and efficient than before:
...
When specifying the ease in `Tween.to` or `Tween.from` you can now use a string instead of the Function. This makes your code less verbose. For example instead of `Phaser.Easing.Sinusoidal.Out` and you can now just use the string "Sine".The string names match those used by TweenMax and includes: "Linear", "Quad", "Cubic", "Quart", "Quint", "Sine", "Expo", "Circ", "Elastic", "Back", "Bounce", "Power0", "Power1", "Power2", "Power3" and "Power4". You can append ".easeIn", ".easeOut" and "easeInOut" variants. All are supported for each ease types.
Tweens now create a TweenData object. The Tween object itself acts like more of a timeline, managing multiple TweenData objects. You can now call `Tween.to` and each call will create a new child tween that is added to the timeline, which are played through in sequence.
Tweens are now bound to the new Time.desiredFps value and update based on the new Game core loop, rather than being bound to time calculations. This means that tweens are now running with the same update logic as physics and the core loop.
Tween.timeScale allows you to scale the duration of a tween (and any child tweens it may have). A value of 1.0 means it should play at the desiredFps rate. A value of 0.5 will run at half the frame rate, 2 at double and so on. You can even tween the timeScale value for interesting effects!
Tween.reverse allows you to instantly reverse an active tween. If the Tween has children then it will smoothly reverse through all child tweens as well.
Tween.repeatAll allows you to control how many times all child tweens will repeat before firing the Tween.onComplete event. You can set the value to -1 to repeat forever.
Tween.loop now controls the looping of all child tweens.
Tween.onRepeat is a new signal that is dispatched whenever a Tween repeats. If a Tween has many child tweens its dispatched once the sequence has repeated.
Tween.onChildComplete is a new signal that is dispatched whenever any child tweens have completed. If a Tween consists of 4 sections you will get 3 onChildComplete events followed by 1 onComplete event as the final tween finishes.
Chained tweens are now more intelligently handled. Because you can easily create child tweens (by simply calling Tween.to multiple times) chained tweens are now used to kick-off longer sequences. You can pass as many Tween objects to `Tween.chain` as you like as they'll all be played in sequence. As one Tween completes it passes on to the next until the entire chain is finished.
Tween.stop has a new `complete` parameter that if set will still fire the onComplete event and start the next chained tween, if there is one.
Tween.delay, Tween.repeat, Tween.yoyo, Tween.easing and Tween.interpolation all have a new `index` parameter. This allows you to target specific child tweens, or if set to -1 it will update all children at once.
Tween.totalDuration reports the total duration of all child tweens in ms.
There are new easing aliases:
* Phaser.Easing.Power0 = Phaser.Easing.Linear.None
* Phaser.Easing.Power1 = Phaser.Easing.Quadratic.Out
* Phaser.Easing.Power2 = Phaser.Easing.Cubic.Out
* Phaser.Easing.Power3 = Phaser.Easing.Quartic.Out
* Phaser.Easing.Power4 = Phaser.Easing.Quintic.Out
2014-11-20 06:06:26 +00:00
photonstorm
aa72cf63c1
Emitter.setScale fixed minX minY order presedence (thanks spayton)
2014-11-18 15:38:08 +00:00
photonstorm
07d43934c6
Docs update.
2014-11-18 12:43:26 +00:00
photonstorm
21479acd8e
Sprite.autoCull now properly works if the camera moves around the world.
...
Sprite.inCamera uses a much faster check if auto culling or world bounds checks are enabled and properly adjusts for camera position.
2014-11-18 12:29:55 +00:00
photonstorm
5cd4225412
If you are reloading a Phaser Game on a page that never properly refreshes (such as in an AngularJS project) then you will quickly run out of AudioContext nodes. If this is the case create a global var called PhaserGlobal
on the window object before creating the game. The active AudioContext will then be saved to window.PhaserGlobal.audioContext
when the Phaser game is destroyed, and re-used when it starts again ( #1233 )
2014-11-16 21:05:31 +00:00
photonstorm
b635ca511e
docs update
2014-11-16 19:13:53 +00:00
photonstorm
02665076e6
Docs updates.
2014-11-15 19:50:03 +00:00
photonstorm
d8d2ebdb31
Phaser 2.2.0 - Release Candidate 6.
2014-11-14 08:16:55 +00:00
photonstorm
527934d909
Key.justPressed has bee renamed to Key.downDuration which is a much clearer name for what the method actually does. See Key.justDown for a nice clean alternative.
...
Key.justReleased has bee renamed to Key.upDuration which is a much clearer name for what the method actually does. See Key.justUp for a nice clean alternative.
Key.justDown allows you to test if a Key has just been pressed down or not. You can only call justDown once per key press. It will only return `true` once, until the Key is released and pressed down again. This allows you to use it in situations where you want to check if this key is down without using a Signal, such as in a core game loop (thanks @pjbaron #1321 )
Key.justUp allows you to test if a Key has just been released or not. You can only call justUp once per key press. It will only return `true` once, until the Key is pressed down and released again. This allows you to use it in situations where you want to check if this key is up without using a Signal, such as in a core game loop (thanks @pjbaron #1321 )
2014-11-13 13:01:58 +00:00
photonstorm
b855df2656
Docs update.
2014-11-13 12:39:32 +00:00
photonstorm
e7356fc575
Pixi 2.1.1 merge.
2014-11-12 22:38:51 +00:00
photonstorm
515dff3b04
docs updated
2014-11-12 22:28:49 +00:00
photonstorm
1352b526c7
Merged final Pixi v2.1.0 release.
2014-11-11 23:24:50 +00:00
photonstorm
da031d8bbb
Phaser games should now work again from the CocoonJS Launcher.
2014-11-11 14:31:20 +00:00
photonstorm
042ceeb59d
Docs update.
2014-11-11 05:56:38 +00:00
photonstorm
bf70df2658
Game.forceSingleUpdate will force just a single logic update, regardless of the delta timer values. You can use this in extremely heavy CPU situations where you know you're about to flood the CPU but don't want Phaser to get stuck in a spiral.
2014-11-11 05:51:56 +00:00
photonstorm
a2b7d339a2
Tilemap.createFromTiles will convert all tiles matching the given tile index (or an array of indexes) into Sprites. You can optionally then replace these tiles if you wish. This is perfect for games when you want to turn specific tiles into Sprites for extra control. The Sprites have an optional properties object which they can be populated with.
2014-11-11 01:05:59 +00:00
photonstorm
8bf93fb658
ArcadePhysics.skipQuadTree is now set to true
by default. A QuadTree is a wonderful thing if the objects in your game are well spaced out. But in tightly packed games, especially those with tilemaps or single-screen games, they are a considerable performance drain and eat up CPU. We've taken the decision to disable the Arcade Physics QuadTree by default. It's all still in there and can be re-enabled via game.physics.arcade.skipQuadTree = false
, but please only do so if you're sure your game benefits from this.
2014-11-11 01:05:58 +00:00
photonstorm
547e7a4d1d
docs update
2014-11-09 23:15:30 +00:00
photonstorm
0a86a7ef51
Time.now can no longer be relied upon to contain a timestamp value. If the browser supports requestAnimationFrame then Time.now
will contain the high resolution timer value that rAf generates. Otherwise it will contain the value of Date.now. If you require the actual time value (in milliseconds) then please use Time.time
instead. Note that all Phaser sub-systems that used to rely on Time.now
have been updated, so if you have any code that extends these please be sure to check it.
2014-11-08 20:01:10 +00:00
photonstorm
71507c5487
Moving to 2.2.0 release version.
2014-11-08 19:25:47 +00:00
photonstorm
a0cc4c3777
A large refactor to how the internal game timers and physics calculations has been made. We've now swapped to using a fixed time step internally across Phaser, instead of the variable one we had before that caused glitchse on low-fps systems. Thanks to pjbaron for his help with all of these related changes.
...
We have separated the logic and render updates to permit slow motion and time slicing effects. We've fixed time calling to fix physics problems caused by variable time updates (i.e. collisions sometimes missing, objects tunneling, etc)
Once per frame calling for rendering and tweening to keep things as smooth as possible
Calculates a `suggestedFps` value (in multiples of 5 fps) based on a 2 second average of actual elapsed time values in the `Time.update` method. This is recalculated every 2 seconds so it could be used on a level-by-level basis if a game varies dramatically. I.e. if the fps rate consistently drops, you can adjust your game effects accordingly.
Game loop now tries to "catch up" frames if it is falling behind by iterating the logic update. This will help if the logic is occasionally causing things to run too slow, or if the renderer occasionally pushes the combined frame time over the FPS time. It's not a band-aid for a game that floods a low powered device however, so you still need to code accordingly. But it should help capture issues such as gc spikes or temporarily overloaded CPUs.
It now detects 'spiralling' which happens if a lot of frames are pushed out in succession meaning the CPU can never "catch up". It skips frames instead of trying to catch them up in this case. Note: the time value passed to the logic update functions is always constant regardless of these shenanigans.
Signals to the game program if there is a problem which might be fixed by lowering the desiredFps
Time.desiredFps is the new desired frame rate for your game.
Time.suggestedFps is the suggested frame rate for the game based on system load.
Time.slowMotion allows you to push the game into a slow motion mode. The default value is 1.0. 2.0 would be half speed, and so on.
Time.timeCap is no longer used and now deprecated. All timing is now handled by the fixed time-step code we've introduced.
2014-11-08 18:54:54 +00:00
photonstorm
55953078d0
FrameData.clone fixed when cloning data using frame names rather than indexes (thanks pjbaron)
2014-11-08 17:08:29 +00:00
photonstorm
0f3849491d
P2.BodyDebug circles were drawing at half widths (thanks @enriqueto #1288 )
2014-11-08 14:09:26 +00:00
photonstorm
19d8773ca6
readme updates.
2014-11-08 13:42:23 +00:00
photonstorm
2777c2a463
ScaleManager.elementBounds is a cross-browser element.getBoundingClientRect method with optional cushion.
...
ScaleManager.calibrate is a private method that calibrates element coordinates for viewport checks.
ScaleManager.aspect gets the viewport aspect ratio (or the aspect ratio of an object or element)
ScaleManager.inViewport tests if the given DOM element is within the viewport, with an optional cushion parameter that allows you to specify a distance.
ScaleManager.scaleSprite takes a Sprite or Image object and scales it to fit the given dimensions. Scaling happens proportionally without distortion to the sprites texture. The letterBox parameter controls if scaling will produce a letter-box effect or zoom the sprite until it fills the given values.
ScaleManager.viewportWidth returns the viewport width in pixels.
ScaleManager.viewportHeight returns the viewport height in pixels.
ScaleManager.documentWidth returns the document width in pixels.
ScaleManager.documentHeight returns the document height in pixels.
2014-11-08 13:31:35 +00:00
photonstorm
7e404604d3
docs update.
2014-11-04 23:57:21 +00:00
photonstorm
be8499fa49
Moved ts defs to new home.
2014-11-02 23:00:15 +00:00
photonstorm
807e443a31
The Input class has been given a minor refactor to tidy things up. Specifically:
...
* pointerN are aliases to backed pointers[N-1] array. This simplifies (and increases the efficiency of) looping through all the pointers when applicable; also eliminates pointer-existance checks Removes various hard-coded limits (added MAX_POINTERS); changed maxPointers default
* Removed some special-casing from cases where it did not matter
* Removed === false/true, == usage for consistency, changed missing value check to typeof, etc.
* Updated documentation for specificty; added @public\@protected
* @deprecated currentPointers due to odd set pattern; totalCurrentPointers is more appropriate.
(thanks @pnstickne #1283 )
2014-11-02 12:26:46 +00:00
photonstorm
97edb7b830
Pointer.addClickTrampoline now adds in support for click trampolines. These raise pointer events into click events, which are required internally for a few edge cases like IE11 full screen mode support, but are also useful if you know you specifically need a DOM click event from a pointer (thanks @pnstickne #1282 )
2014-11-02 12:18:23 +00:00
photonstorm
8b2628d99c
All of the Input classes now use the more consistent enabled
property instead of disabled
. I.e. you can now check if (input.mouse.enabled)
rather than if (!input.mouse.disabled)
. The disabled property has been moved to a getter for backwards compatibility but is deprecated and will be removed in a future version (thanks @pnstickne #1257 )
2014-11-02 12:14:47 +00:00
photonstorm
e853cb14bb
readme update
2014-11-02 11:04:03 +00:00
photonstorm
59b25ab6bb
Animation.setFrame used the wrong frames array if useLocalFrameIndex
was false
and a numeric frame ID was given (thanks @Skeptron #1284 )
2014-11-02 11:04:03 +00:00
photonstorm
e57c700816
The Gamepad.addCallbacks context parameter was never actually remembered, causing the callbacks to run in the wrong context (thanks @englercj #1285 )
2014-11-02 11:04:02 +00:00
photonstorm
ce32d492af
Phaser.Polygon has been refactored to address some Pixi v2 migration issues (thanks @pnstickne for the original implementation #1267 )
...
Polygon.area is now only calculated when the Polygon points list is modified, rather than on every call.
Phaser.Polygon can now accept the points list in a variety of formats: Arrays of Points, numbers, objects with public x/y properties or any combination of, or as a parameter list (thanks @pnstickne for the original implementation #1267 )
Polygon.contains now correctly calculates the result (thanks @pnstickne @BurnedToast #1267 )
2014-10-29 07:46:56 +00:00
photonstorm
dc20ab6020
Text.updateText was incorrectly increasing the size of the texture each time it was called (thanks @spayton #1261 )
2014-10-29 07:46:56 +00:00
photonstorm
d1b79f90a5
Polygon.contains was toggling the return value on each valid hit (thanks @Singularetantum #1265 #1266 )
2014-10-29 07:46:56 +00:00
photonstorm
1df98d82e3
You can now call Tween.to again on a Tween that has already completed. This will re-use the same tween, on the original object, without having to recreate the Tween again. This allows a single tween instance to be re-used multiple times, providing they are linked to the same object (thanks InsaneHero)
2014-10-28 01:49:20 +00:00
photonstorm
dfa442db93
Particle.Emitter will now automatically set particle.body.skipQuadTree
to true
to help with collision speeds within Arcade Physics.
...
Particle.Emitter.explode (or `Emitter.start` with the `explode` parameter set to `true`) will immediately emit the required quantity of particles and not delay until the next frame to do so. This means you can re-use a single emitter across multiple places in your game that require explode-style emissions, just by adjusting the `emitter.x` and `emitter.y` properties before calling explode (thanks Insanehero)
2014-10-27 23:29:43 +00:00
photonstorm
a471cfc235
Game.destroy now destroys either the WebGLRenderer or CanvasRenderer, whichever Pixi was using.
2014-10-27 22:09:39 +00:00
photonstorm
da87c75e00
Loader.useXDomainRequest used to be enabled automatically for IE9 but is now always set to false
. Please enable it only if you know your server set-up / CDN requires it, as some most certainly do, but we're finding them to be less and less used these days, so we feel it's safe to now disable this by default ( #1248 )
...
Loader.json was using the wrong context in IE9 with XDomainRequest calls (thanks @pnstickne #1258 )
2014-10-27 12:31:55 +00:00
photonstorm
0f3cda0aed
Cache.getRenderTexture will retrieve a RenderTexture that is stored in the Phaser Cache. This method replaces Cache.getTexture which is now deprecated.
...
Cache.autoResolveURL is a new boolean (default `false`) that automatically builds a cached map of all loaded assets vs. their absolute URLs, for use with Cache.getURL and Cache.checkURL. Note that in 2.1.3 and earlier this was enabled by default, but has since been moved behind this property which needs to be set to `true` *before* you load any assets to enable.
Cache._resolveUrl has been renamed to Cache._resolveURL internally and gained a new parameter. This method is a private internal one.
Cache.getUrl is deprecated. The same method is now available as Cache.getURL.
XML files weren't being added to the URL map.
Cache._resolveURL was causing a Sound double-load in Firefox and causing errors (thanks @domonyiv #1253 )
2014-10-27 11:46:24 +00:00
photonstorm
12c2f83bfc
Repackaging for 2.1.4 release.
2014-10-27 10:59:37 +00:00
Richard Davey
35c42e3073
Tilemaps in WebGL wouldn't update after the first frame due to a subtle change in how Pixi uploads new textures to the GPU.
2014-10-25 10:09:04 +01:00
photonstorm
18f6b320ab
Preparing for Phaser v2.2.0
2014-10-23 13:52:39 +01:00
photonstorm
fbe68e330d
Phaser 2.1.3 build.
2014-10-22 21:42:12 +01:00
photonstorm
9b16b11c88
Small Roadmap update.
2014-10-21 22:45:36 +01:00
photonstorm
01a068f53c
Rectangle.scale allows you to scale the width and height of a Rectangle.
2014-10-21 00:25:54 +01:00
photonstorm
9d58297eb9
Button.setSounds now works if given an AudioSprite as the sound source.
2014-10-20 23:17:05 +01:00
photonstorm
1a357e18c8
Rectangle contains updates.
2014-10-20 14:28:09 +01:00
photonstorm
b580746cb8
Input.hitTest now accurately detects hits on the extreme edges of a display object (thanks InsaneHero)
2014-10-20 14:28:09 +01:00
photonstorm
d70406588c
Filter.update now caches the previous pointer position to avoid flooding the uniform. Also the mouse uniform is now a value between 0 and 1 depending on the position within the game view.
2014-10-17 19:29:50 +01:00
photonstorm
f0b7670506
Fixed an issue where audio files with query strings after them would fail the canPlayAudio
checks (thanks Vithar)
2014-10-17 18:50:12 +01:00
photonstorm
52f1663642
Fixed the Filter mouse uniform value population.
2014-10-17 16:52:28 +01:00
photonstorm
4f1ba99120
BitmapData.getFirstPixel will scan the BitmapData and return the color and location of the first non-transparent pixel encountered. You can specify one of 4 scan directions: top to bottom, bottom to top, left to right and right to left.
...
BitmapData.getBounds will return a `Rectangle` object that encompasses the full extent of the non-transparent pixels in the BitmapData. This can be useful if you wish to trim away transparent pixels from the sides of a BitmapData down to size before saving.
2014-10-17 16:51:50 +01:00
photonstorm
fbfb107146
JSDoc fixes in the Rope class (thanks @Rovanion)
2014-10-15 22:05:38 +01:00
photonstorm
2657de0daa
Sound.fadeTo allows you to fade the Sound to the given volume over the duration specified (thanks @nickryall #1225 )
2014-10-15 21:48:00 +01:00
photonstorm
db68dd2780
docs update.
2014-10-15 21:39:33 +01:00
photonstorm
9140163c85
Fixed a reference error to the Loader.baseURL in Cache._resolveUrl method (thanks @neurofuzzy #1235 )
2014-10-15 21:36:44 +01:00
photonstorm
4ac162216a
readme updates.
2014-10-14 01:10:26 +01:00
photonstorm
3997a7c372
Time.prevTime is a new property that contains the raw value of the game timer from the previous update.
...
Timer.timeCap has been changed from `1000` to `1 / 60 * 1000` to bring it in line with Time.timeCap.
2014-10-13 16:18:42 +01:00
photonstorm
5d84f38f6e
Device.canPlayAudio now supports the opus
files directly, as well as opus
encoded audio stored in ogg containers ( #1232 )
2014-10-13 13:52:41 +01:00
photonstorm
ac27f12c95
Fixes for Pixi update WebGL UV calls.
2014-10-11 04:18:42 +01:00
photonstorm
163a6c46f3
Updated to Pixi 2.0.0-dev.
2014-10-10 20:36:04 +01:00
photonstorm
022d7094d5
jsdoc fixes and frameRate change.
2014-10-10 14:49:01 +01:00
photonstorm
bee0e73748
Preparing for 2.1.3 dev.
2014-10-09 16:32:31 +01:00
photonstorm
9f24c08216
Updated readme and docs.
2014-10-09 16:12:53 +01:00
photonstorm
506a091257
Sound.allowMultiple allows you to have multiple instances of a single Sound playing at once. This is only useful when running under Web Audio, and we recommend you implement a local pooling system to not flood the sound channels. But it allows for one Sound object to play overlapping times, useful for gun effects and similar ( #1220 )
2014-10-09 14:44:25 +01:00
photonstorm
a2a60f207f
Updated readme and TS defs.
2014-10-09 14:16:24 +01:00
photonstorm
94b6c01f31
readme updates.
2014-10-09 14:16:23 +01:00
photonstorm
b00866cee9
AnimationManager.name will now return the name
property of the currently playing animation, if any.
2014-10-09 14:06:13 +01:00
Richard Davey
5dbe6b6017
The Uint32Array check used in Utils was incorrectly replacing Uint32Array on Safari, causing errors like BitmapData.getPixel32 to fail and other related issues ( fixes #1043 and #1197 )
2014-10-05 12:35:40 +01:00
photonstorm
ab78710daa
BitmapData.textureLine takes a Phaser.Line object and an image in the image cache. It then accurately draws the image as a repeating texture for the full length of the line.
2014-10-03 02:21:09 +01:00
photonstorm
173786c60d
Color.createColor now populates the color
property of the returned object with the results of Phaser.Color.getColor
.
...
Color.createColor now has a `color32` property with the results of `Phaser.Color.getColor32`.
Color.hexToColor has been optimised to inline the regex and has moved the createColor call so it now populates the color object fully, not just setting the r,g,b properties.
2014-10-01 16:51:34 +01:00
photonstorm
2794d94b08
Color.createColor now populates the color objects color
and color32
properties with the results of Phaser.Color.getColor
and getColor32
respectively.
2014-10-01 15:19:57 +01:00
photonstorm
d65c526184
Cache.addBitmapData has a new parameter: frameData
allowing you to pass a Phaser.FrameData
object along with the BitmapData.
...
Cache.getFrameData has a new parameter: `map` which allows you to specify which cache to get the FrameData from, i.e. `Phaser.Cache.IMAGE` or `Phaser.Cache.BITMAPDATA`.
Sprite.loadTexture if given a BitmapData as the texture will now query the cache to see if it has any associated FrameData, and if so it will load that into the AnimationManager.
2014-10-01 03:10:13 +01:00
photonstorm
26f9e05dca
BitmapData.shadow(color, blur, x, y) provides a quick way to set all the relevant shadow settings, which are then be used in future draw calls.
2014-09-30 22:50:08 +01:00
photonstorm
ef85b8415d
If you pass a tinted Sprite to BitmapData.draw
or BitmapData.copy
it will now draw the tinted version of the Sprite to the BitmapData and not the original texture.
2014-09-30 21:07:57 +01:00
photonstorm
c195998a1e
Color.webToColor restored. Converts a CSS rgba color into a native color value.
2014-09-30 01:44:33 +01:00
photonstorm
ecfed2b311
AnimationParser is now using value
instead of nodeValue
when parsing atlas XML files, avoiding Chrome deprecation warnings (thanks @valtterip #1189 )
2014-09-29 22:52:09 +01:00
photonstorm
ccc4e42e03
A Timer with a delay value that was a float and not an integer would not loop correctly. Timer delay values are now passed through Math.round to avoid this (thanks @osmanzeki #1196 )
2014-09-29 22:15:41 +01:00
Richard Davey
acba9c4e14
Updated TypeScript defs.
2014-09-29 12:14:02 +01:00
photonstorm
415c7fe578
Added the sourceRect
and maskRect
parameters back into BitmapData.alphaMask
as they were accidentally removed in 2.1 (thanks seejay92)
2014-09-25 15:30:03 +01:00
photonstorm
7f196a01e7
Text.addColor allows you to set specific colors within the Text. It works by taking a color value, which is a typical HTML string such as #ff0000
or rgb(255,0,0)
and a position. The position value is the index of the character in the Text string to start applying this color to. Once set the color remains in use until either another color or the end of the string is encountered. For example if the Text was Photon Storm
and you did Text.addColor('#ffff00', 6)
it would color in the word Storm
in yellow.
...
Text.clearColors resets any previously set colors from `Text.addColor`.
2014-09-24 17:10:02 +01:00
photonstorm
9e29a58d89
Sound.fadeOut(duration) will fade the Sound to a volume of zero over the duration given. At the end of the fade the Sound will be stopped and Sound.onFadeComplete dispatched.
...
Sound.fadeIn(duration, loop) will start the Sound playing, or restart it if already playing, set its volume to zero and then increase the volume over the duration given until it reaches 1. At the end of the fade the Sound.onFadeComplete event is dispatched.
2014-09-24 06:51:39 +01:00
photonstorm
dd74e3b0b4
Changing any of the Text properties such as font, lineSpacing and fontSize on a Text object that wasn't already on the display list would cause an updateTransform error. Parent is now checked first in all setters.
2014-09-24 01:10:36 +01:00
Richard Davey
abe6f5ace2
Point.parse updated to allow either/or x/y setting and default values.
...
Point.parse will return a new Point object based on the x and y properties of the object given to Point.parse (thanks @codevinsky #1198 )
2014-09-23 22:23:01 +01:00
Richard Davey
01fd3df434
AudioSprite support is now built into the Loader and SoundManager. AudioSprites are like sprite sheets, only they consist of a selection of audio files and markers in a json configuration. You can find more details at https://github.com/tonistiigi/audiosprite (thanks @codevinsky #1205 )
...
Fixed AudioSprite jsdoc, casing and formatting issues.
2014-09-23 22:15:09 +01:00
Richard Davey
0c4d4cd7e1
readme update.
2014-09-19 15:22:33 +01:00
photonstorm
5980a3bdc6
Loader can now natively load XML files via load.xml
. Once the XML file has loaded it is parsed via either DOMParser or ActiveXObject and then added to the Cache, where it can be retrieved via cache.getXML(key)
.
...
Cache now has support for XML files stored in their own container. You can add them with `cache.addXML` (typically this is done from the Loader automatically for you) and get them with `cache.getXML(key)`. There is also `cache.checkXMLKey(key)`, `cache.checkKeys` and `cache.removeXML(key)`.
2014-09-19 13:45:04 +01:00
photonstorm
597b828d7a
StateManager.boot would call start on a State twice if it was added to the game and started before the DOM load had completed. This didn't cause an error but was duplicating function calls needlessly.
2014-09-18 05:14:44 +01:00
photonstorm
d68ed61999
If you called StateManager.start from within a states init
method which also had a preload
method it would fail to start the next State.
2014-09-18 05:11:58 +01:00
Richard Davey
cf363a56f1
Cache.removeImage has a new parameter: removeFromPixi
which is true
by default. It will remove the image from the Pixi BaseTextureCache as well as from the Phaser Cache. Set to false if you don't want the Pixi cache touched.
2014-09-16 12:20:03 +01:00
photonstorm
fc6b7dd36c
StateManager.unlink will null all State-level Phaser properties, such as game
, add
, etc. Useful if you never need to return to the State again.
2014-09-15 13:19:01 +01:00
photonstorm
60acef2f97
If Game Objects change their frame, such as with an animated Sprite, and the change goes from a previously trimmed frame to a non-trimmed (full size) one, then the previous trim values were still left active, causing it to glitch (thanks stupot)
2014-09-11 20:56:01 +01:00
photonstorm
e5cac96302
Preparing for 2.1.2
2014-09-11 12:02:20 +01:00
photonstorm
5b922be56e
Version 2.1.1. of Phaser is an emergency point release. It addresses a potential race condition that could happen in States that tried to change state from the create
method but had an empty preloader or pre-cached assets.
2014-09-11 10:38:40 +01:00
photonstorm
a1a0861070
readme update + screen shot
2014-09-11 10:38:38 +01:00
photonstorm
b801630d78
Preparing for 2.1.1 development.
2014-09-09 16:50:23 +01:00
photonstorm
33d9b19e29
The Debug canvas is now cleared on State swap.
2014-09-09 15:28:58 +01:00
photonstorm
133ffd5fd1
2.1.0 docs updates.
2014-09-09 14:47:30 +01:00
photonstorm
1f089d74c5
Phaser.Easing.Default is a new property that is used when a specific type of ease isn't given. It defaults to Linear.None but can be overridden to anything (thanks @alvinsight)
2014-09-09 14:01:49 +01:00
photonstorm
c40c140631
Camera.roundPx is a new boolean. If set to true
it will call view.floor
as part of its update loop, keeping its boundary to integer values. Set to false
to disable this from happening ( #1141 )
2014-09-09 12:47:27 +01:00
photonstorm
79d873f47b
If you are using CocoonJS, please set your game render type to CANVAS and not WEBGL or AUTO. You should also disable any of the ScaleManager screen resizing or margin setting code. By default in this mode CocoonJS will now set 'screencanvas=true' which helps with performance significantly.
2014-09-08 22:34:53 +01:00
photonstorm
282db76351
Readme update.
2014-09-08 22:34:53 +01:00
photonstorm
df16970bcc
Readme update.
2014-09-08 22:34:53 +01:00
photonstorm
59f7c53019
P2.Body.addCapsule didn't use to pass the radius value through pxm, but now does so you have to specify it in pixels, not meters.
2014-09-08 22:34:53 +01:00
photonstorm
4903e47a98
Rectangle.topRight returns a Point object that represents the top-right coordinate of the Rectangle.
2014-09-05 15:45:47 +01:00
photonstorm
0af4ec4da2
The StateManager will now check if a State has a method called resize
. If it does, and if the game is running in the RESIZE Scale Mode then this method will be called whenever the game resizes. It will be passed two parameters: width
and height
that will match the games new dimensions. Resizing can happen as a result of either the parent container changing shape, or the browser window resizing.
2014-09-05 06:22:10 +01:00
photonstorm
f2a8a927f9
Group.addMultiple allows you to pass an array of game objects and they'll all be added to the Group in turn.
2014-09-05 06:01:25 +01:00
photonstorm
cb14fd1c01
Rectangle.centerOn(x,y) allows you to quickly center a Rectangle on the given coordinates.
2014-09-05 04:13:21 +01:00
photonstorm
d5ffe1f971
Phaser.Mouse will now add a listener to the window
to detect mouseup
events. This is used to detect if the player releases the mouse while outside of the game canvas. Previously Pointer objects incorrectly thought they were still pressed when you returned the mouse over the canvas ( #1167 )
2014-09-04 23:29:43 +01:00
Richard Davey
7ee1564f2e
Signal.removeAll would ignore the context parameter and remove all bindings regardless (thanks @alect #1168 )
2014-09-04 22:24:47 +01:00
Richard Davey
55400ce988
World.createDistanceConstraint signature changed to include new local anchors (thanks @rhmoller #1169 )
2014-09-04 22:22:10 +01:00
photonstorm
9aaa8d80ca
jsdocs, fixes to load, draw, copy and addToWorld.
2014-09-04 05:05:30 +01:00
photonstorm
7d9a4f4100
Phaser.Text wouldn't render the text to its local canvas if you passed the text on the constructor and didn't add it to the display list. If a string is given it now updates the local canvas on creation.
2014-09-04 02:18:12 +01:00
Richard Davey
0d486aa949
Updated the road map.
2014-09-03 23:01:24 +01:00
Richard Davey
168ce82fe8
Rectangle.bottom setter swapped the order of the calculation (thanks @JakeCoxon #1165 )
2014-09-03 22:42:24 +01:00
Richard Davey
fe0c03d5d7
Phaser.Text.destroy will now destroy the base texture by default ( #1162 )
2014-09-03 22:34:10 +01:00
Richard Davey
42f19f4978
Phaser.Canvas.setImageRenderingCrisp now sets image-rendering: pixelated, perfect for pixel art and which is now supported in Chrome 38.
2014-09-03 22:16:03 +01:00
photonstorm
15e6edc56b
BitmapData.copy no longer creates any temporary variables. It also accurately copies over Sprite/Image values before drawing them.
...
Creation now defaults to a texture size of 256x256.
2014-09-03 12:53:07 +01:00
photonstorm
1f84024a3e
Cache.getImage now returns null if no image was found.
2014-09-03 11:11:48 +01:00
photonstorm
8bc5ba8d7d
Tween.generateData would skip the end values in the data array. They are now included as the object in the final array element.
2014-09-02 15:45:52 +01:00
photonstorm
865c6878bf
P2.World.getSprings used to return an empty array, but now returns all the Springs in the world ( #1134 )
2014-09-02 15:06:43 +01:00
photonstorm
d26f937f1c
RetroFont has a new property called frameData which contains the Frame objects for each of the letters in the font, which can be used by Sprites.
2014-09-02 00:41:53 +01:00
Richard Davey
152335ff46
docs update.
2014-09-01 21:33:29 +01:00
Carlos Martinez
a869939bc3
Merge branch 'master' of https://github.com/photonstorm/phaser into dev
2014-09-01 14:20:15 +01:00
photonstorm
070e33f1e7
ArcadePhysics.overlap has been updated so that the Body.overlapX/Y properties are set to the amount the two bodies overlapped by. Previously they were zero and only populated during the separation phase, but now the data is available for just overlap checks as well. You can then use these values in your ovrelap callback as required - note that they are changed for every check, so a Sprite overlap tested against 10 other sprites will have the overlapX/Y values updated 10 times in a single collision pass, so you can only safely use the values in the callback ( #641 )
2014-09-01 03:54:55 +01:00
photonstorm
7fc37751b2
ScaleManager.orientationSprite has been removed because it never displayed correctly anyway (it would be distorted by the game scale), it will be bought back in a future version by way of a custom orientation state.
2014-09-01 03:30:02 +01:00
photonstorm
8fec5169f0
Added Sound._muteVolume which stops Firefox and IE9 crashing if you try to unmute a sound that hasn't yet been muted, which can also happen as a result of a game visibility change (thanks @osmanzeki #1108 #1123 )
2014-09-01 03:13:05 +01:00
photonstorm
80d1df4705
ScaleManager.setMinMax(minWidth, minHeight, maxWidth, maxHeight) is a handy function to allow you to set all the min/max dimensions in one call.
2014-09-01 03:07:17 +01:00
photonstorm
fe9dbd15e5
The World bounds can now be set to any size, including smaller than the game dimensions. Before it was locked to a minimum size of the game canvas, but it can now be anything.
2014-09-01 02:41:07 +01:00
photonstorm
1a60d641b1
Canvas.removeFromDOM(canvas) will remove a canvas element from the DOM.
...
Game.destroy now removes the games canvas element from the DOM.
2014-09-01 02:38:21 +01:00
photonstorm
97d771c4e8
ScaleManager has a new scaleMode called RESIZE
which will tell Phaser to track the size of the parent container (either a dom element or the browser window if none given) and set the canvas size to match it. If the parent changes size the canvas will resize as well, keeping a 1:1 pixel ratio. There is also a new ScaleManager.setResizeCallback method which will let you define your own function to handle resize events from the game, such as re-positioning sprites for a fluid responsive layout ( #642 )
...
The width and height given to the Phaser.Game constructor can now be numbers or strings in which case the value is treated as a percentage. For example a value of "100%" for the width and height will tell Phaser to size the game to match the parent container dimensions exactly (or the browser window if no parent is given). Equally a size of "50%" would tell it to be half the size of the parent. The values are retained even through resize events, allowing it to maintain a percentage size based on the parent even as it updates.
2014-09-01 01:52:04 +01:00
photonstorm
5fb8c7eb85
ScaleManager window.resize handler would constantly dispatch enterPortrait and enterLandscape events on window resizing, regardless if it actually entered that orientation or not.
...
Stage.offset has been moved to ScaleManager.offset
Stage.bounds has been removed, you can access it via Stage.getBounds.
Stage.checkOffsetInterval has been moved to ScaleManager.trackParentInterval
ScaleManager.hasResized signal has been removed. Use ScaleManager.setResizeCallback instead.
2014-09-01 01:02:48 +01:00
photonstorm
e3f11d5aba
change log update.
2014-08-31 00:21:47 +01:00
photonstorm
92386221e4
Tile.setCollision now adjusts the tiles interesting faces list as well, this allows you to create one-way jump tiles without using custom callbacks on a specific tile basis (thanks @RafaelOliveira #886 )
2014-08-29 18:03:32 +01:00
photonstorm
5546e5903c
Tiled polylines are now imported into the map objects property as well as map collision ( #1117 )
2014-08-29 16:56:30 +01:00
photonstorm
0284d0b98c
If Time.elapsed was > Time.timeCap it would reset the elapsed value to be 1 / 60. It's now set to Time.timeCap and Time.timeCap defaults to 1 / 60 * 1000
as it's a ms value (thanks @casensiom #899 )
2014-08-29 16:37:57 +01:00
photonstorm
10e7d8ff7e
TilemapParser.getEmptyData now correct adds an empty bodies array into layers. This fixes an issue where p2 couldn't convert a csv map into collision tiles (thanks @sru #845 )
2014-08-29 16:30:29 +01:00
photonstorm
719b81c6e3
GamepadButton.justPressed and justReleased now correctly report if the button has just been pressed or released (thanks @padpadpad #1019 )
2014-08-29 16:08:38 +01:00
photonstorm
7b9c1a561e
GamePad and SinglePad onAxisCallback parameters have changed. You are now sent: this (a reference to the SinglePad that caused the callback), the axis index and the axis value in that order.
...
GamePad axis detection now works again properly in Firefox (#1035 )
2014-08-29 15:55:05 +01:00
photonstorm
32119e9892
Animation.onUpdate is a new event that is dispatched each time the animation frame changes. Due to its intensive nature it is disabled by default. Enable it with Animation.enableUpdate = true
( #902 )
2014-08-29 14:30:44 +01:00
photonstorm
9055fc7e01
The Pointer move callbacks are now sent an extra parameter: fromClick
allowing your callbacks to distinguish between the Pointer just moving, or moving as a result of being pressed down (thanks @iforce2d #1055 )
2014-08-29 14:19:47 +01:00
photonstorm
26a55bd202
SoundManager.destroy is a new method that will destroy all current sounds and reset any callbacks.
...
StateManager.clearCurrentState now handles the process of clearing down the current state and is now called if the Game is destroyed.
Game.destroy now clears the current state, activating its shutdown callback if it had one. It also now destroys the SoundManager, stopping any currently running sounds (#1092 )
2014-08-29 11:37:47 +01:00
photonstorm
69b9e5eb7c
Arcade.overlap and collide are now more consistent about allowing a Group vs. Group or Group vs. Array of Groups set (thanks @pyromanfo #877 #1147 )
2014-08-29 01:28:43 +01:00
photonstorm
52ea95d9ce
Sound.restart used to cause the Sound to double-up if it was already playing when called. Now correctly stops the sound before restarting it (thanks @wombatbuddy #1136 )
2014-08-29 01:06:29 +01:00
photonstorm
dd9e7e6297
Pointer.dirty is a new boolean that is set by the InputHandler. It tells the Pointer to re-check all interactive objects it may be over on the next update, regardless if it has moved position or not. This helps solve issues where you may have a Button that on click generates a pop-up window that now obscures the Button (thanks @jflowers45 #882 )
2014-08-29 00:47:49 +01:00
photonstorm
6fbaa36ddd
P2.PointProxy.mx and my values are get and set in meters with no pixel conversion taking place.
...
P2.InversePointProxy.mx and my values are get and set in meters with no pixel conversion taking place.
P2.PointProxy.x and y values are now returned in pixels (previously they were returned in meters). See PointProxy.mx/my for meter values.
P2.InversePointProxy.x and y values are now returned in pixels (previously they were returned in meters). See PointProxy.mx/my for meter values.
2014-08-28 17:04:58 +01:00
photonstorm
34426e7560
Loader.useXDomainRequest boolean automatically set to true
if the browser is specifically detected as IE9, but you can still override this. IE10 will use xhr.
2014-08-28 05:24:57 +01:00
photonstorm
9de1d494df
Phaser 2.1.0 build files for testing.
...
Ninja Physics is no longer included in the build files by default. Not enough people were using it, and not enough contributions were coming in to help polish it up, so we've saved the space and removed it. It's still available in the grunt build files if you require it, but we're deprecating it from the core library at this time. It will make a return in Phaser3 when we move to a modular class system.
2014-08-28 04:53:05 +01:00
photonstorm
4cdffb6b6f
Change log update.
2014-08-28 04:38:26 +01:00
photonstorm
2d4d1a050d
Tilemap.hasTile now checks the Tile.index value and will return false if the index is -1 (i.e. a non-active tile) (thanks @elgansayer #859 )
2014-08-28 04:30:13 +01:00
photonstorm
a7d9b2c8c5
The P2.World.postBroadphaseHandler now checks if the returned pairs array is empty or not before processing it (thanks @wayfu #934 )
2014-08-28 04:24:08 +01:00
photonstorm
0c88ba041a
If you used a single Game configuration object and didn't specify the enableDebug property it would crash on Debug.preUpdate (thanks @luizbills #1053 )
2014-08-28 04:19:10 +01:00
photonstorm
83619ba81e
InputHandler docs updated to avoid Pointer data-type confusion ( #1097 )
2014-08-28 04:07:24 +01:00
photonstorm
6216cf578c
BitmapFonts are now correctly added to the Cache._bitmapFont array and returned via Cache.getBitmapFont (thanks @prudolfs #1076 )
2014-08-28 03:52:26 +01:00
photonstorm
0f207c47a7
Calling P2.Body.destroy or ArcadePhysics.Body.destroy wouldn't null the parent sprite body, causing it to error in the next update (thanks @jonathanhooker #1077 )
2014-08-28 03:44:02 +01:00
photonstorm
ec687868de
Input.setMoveCallback has been removed due to deprecation.
...
BitmapData.refreshBuffer has been removed and replaced with BitmapData.update.
BitmapData.drawSprite has been removed due to deprecation. Use BitmapData.draw instead.
Pointer.moveCallback has been removed due to deprecation.
SinglePad.addButton has been removed due to deprecation.
P2.Body.loadData has been removed due to deprecation.
P2.World.defaultFriction and defaultRestitution have been removed due to deprecation.
Canvas.create noCocoon parameter has been removed due to deprecation.
Color.getColorInfo, RGBtoHexstring, RGBtoWebstring and colorToHexstring has been removed due to deprecation.
2014-08-28 03:40:59 +01:00
photonstorm
6e2cd37776
ScaleManager.destroy now removes the window and document event listeners, which are no longer created anonymously (thanks @eguneys #1092 )
...
Input.Gamepad.destroy now destroys all connected SinglePads and clears event listeners.
SinglePad.destroy now clears all associated GamepadButton objects and signals.
2014-08-28 03:31:47 +01:00
photonstorm
fa45d7feff
Events.onDestroy is a new signal that is dispatched whenever the parent is being destroyed. It's dispatched at the start of the destroy process, allowing you to perform any additional house cleaning needed (thanks @jonkelling #1084 )
...
Group.onDestroy is a new signal that is dispatched whenever the Group is being destroyed. It's dispatched at the start of the destroy process, allowing you to perform any additional house cleaning needed (thanks @jonkelling #1084 )
2014-08-28 02:56:06 +01:00
photonstorm
6b4510f693
TileSprite now has the alive
property, which should help with some Group operations (thanks @jonkelling #1085 )
2014-08-28 02:36:30 +01:00
photonstorm
42c810b43f
Fixed the resolution uniform type in the SampleFilter (thanks @VictoryRice #1137 )
2014-08-28 02:20:49 +01:00
photonstorm
d7f8950758
Debug.cameraInfo no longer crashes if the camera bounds are nulled (thanks @wayfu #1143 )
...
Camera.setBoundsToWorld no longer crashes if the camera bounds are nulled (thanks @wayfu #1143 )
2014-08-28 02:13:51 +01:00
photonstorm
01db9257e0
Change log updates.
2014-08-28 02:06:48 +01:00
photonstorm
31f450dd42
Docs updates, preparing for Rope merge.
2014-08-28 01:59:10 +01:00
photonstorm
c76aa785f9
Documentation updates.
2014-08-28 01:57:38 +01:00
photonstorm
7772590b18
Docs update.
2014-08-28 01:44:48 +01:00
photonstorm
ccc8369f43
InputHandler.checkBoundsRect was incorrectly assigning a property in Sprites fixed to the camera being dragged left (thanks @CraigBeswetherick #1093 )
2014-08-28 01:29:23 +01:00
photonstorm
7bfa6fa9f2
Loader.useXDomainRequest boolean added. If true
(the default is false
) it will use XDomainRequest when loading JSON files instead of xhr. In rare IE edge-cases this may be required. You'll know if you need it ( #1131 #1116 )
2014-08-28 01:23:45 +01:00
photonstorm
c87aa5103d
Fixed the RevoluteConstraint worldPivot and moved it to the end of the signature to minimise code changes.
2014-08-28 01:14:59 +01:00
photonstorm
aeb82dbee9
World.createRotationalSpring will now let you create rotational springs.
2014-08-28 00:58:50 +01:00
photonstorm
6acc8bf9f2
World.enableBodySleeping has been removed and replaced with World.sleepMode.
2014-08-28 00:45:57 +01:00
photonstorm
98ccae56de
P2.Body now uses the new Body.type value instead of Body.motionState, however as P2.Body already have a property called type
we have left the motionState
getter/setter in for now.
2014-08-28 00:39:47 +01:00
photonstorm
4935a4e4af
RevoluteConstraint fixed for new version of p2.
2014-08-28 00:24:56 +01:00
photonstorm
b25bdf3523
Fixed the DistanceConstraint parameters.
2014-08-28 00:15:28 +01:00
photonstorm
33c52eaf09
BitmapData alpha option added.
...
Pointer return type added.
pixi manifest updated to remove need for geom classes.
2014-08-27 21:26:29 +01:00
A.S. Lomoff
134068bada
return back misstyping
2014-08-27 17:35:26 +03:00
A.S. Lomoff
61e58f4e9a
fix TypeScript site URL
2014-08-27 17:34:31 +03:00
photonstorm
f887ee0df8
TypeScript definition updates to help fix for the noimplicitany
option (thanks @Waog #1088 )
2014-08-06 16:24:33 +01:00
Alvin
31c1423947
Merge pull request #1057 from steelywing/patch-2
...
add README.md index
2014-08-06 15:39:14 +02:00
photonstorm
36ecd81f29
Arcade Physics Body.skipQuadTree is a new boolean that if set to true
when you collide the Sprite against a Group it will tell Phaser to skip using a QuadTree for that collision. This is handy if this Body is especially large.
...
Arcade Physics World.skipQuadTree will disable the use of all QuadTrees in collision methods, which can help performance in tightly packed scenes.
2014-08-04 13:04:11 +01:00
photonstorm
06cb37247a
Updated readme.
2014-08-04 12:24:34 +01:00
photonstorm
aabdf6f97a
Resolves issue with pixel perfect click / over detection on Sprites that used trimmed image atlases for animations or frames > 0.
2014-08-01 17:46:51 +01:00
photonstorm
9bbc8ecce3
Phaser.Physics.P2.addPolygon now takes a nested array again (thanks @wayfu #1060 )
2014-07-31 13:39:26 +01:00
Wing
eb4d635046
add README.md index
2014-07-22 14:13:32 +08:00
photonstorm
122640e01b
Phaser.Loader was incorrectly getting the responseText from _xhr instead of _ajax on IE9 xDomainRequests (thanks @lardratboy #1050 )
2014-07-21 11:12:58 +01:00
photonstorm
8e7e6f05e1
Adding .0 :)
2014-07-18 13:12:08 +01:00
photonstorm
113b69a5d1
Preparing for 2.1 development work.
2014-07-18 13:09:21 +01:00
photonstorm
ee49575714
Preparing for master.
2014-07-18 12:35:16 +01:00
photonstorm
24527eac3e
Group.checkAll allows you to check if the same property exists across all children of the Group and is set to the given value (thanks @codevinsky #1013 )
...
Group.checkProperty allows you to check if the property exists on the given child of the Group and is set to the value specified (thanks @codevinsky #1013 )
Phaser.Utils.setProperty will set an Objects property regardless of depth (thanks @codevinsky #1013 )
Phaser.Utils.setProperty will set an Objects property regardless of depth (thanks @codevinsky #1013 )
Phaser.Utils.getProperty will get an Objects property regardless of depth (thanks @codevinsky #1013 )
2014-07-18 11:52:39 +01:00
photonstorm
883c11e377
BitmapData.resize fixed to update the crop property too, resolves issues with images getting cut off with BitmapData.load.
2014-07-18 03:33:17 +01:00
photonstorm
49bb45c42e
Tilemap.swap now accurately swaps from A to B and from B to A (thanks @noidexe #1034 )
2014-07-18 00:29:24 +01:00
photonstorm
82ef6d4aeb
If you add a Tween to the TweenManager and then immediately stop it, it will still exist in the TweenManager (thanks @gilangcp #1032 )
2014-07-16 19:50:58 +01:00
photonstorm
90eec97707
Animation.updateFrameData allows you to load a new FrameData object into an existing animation, even if currently running (based on #1029 )
...
AnimationManager.loadFrameData will now update all existing Animations to use the newly loaded FrameData (based on #1029 )
2014-07-16 00:55:12 +01:00
photonstorm
aaf82f9d3a
Sprite.loadTexture has a new optional stopAnimation
boolean parameter which will halt the currently running animation (if any) after changing the texture (based on #1029 ).
2014-07-16 00:29:43 +01:00
photonstorm
d72e199291
Physics.bounds now correctly matches World.bounds on system start (thanks @Dumtard #1028 )
2014-07-16 00:14:47 +01:00
photonstorm
afeeeecbe0
Keyboard.processKeyPress now checks if the Keyboard Input handler is disabled or not before processing the key callbacks.
2014-07-16 00:12:59 +01:00
photonstorm
d10dea27b0
Pixi updated worldTransform from an Array to an Object and Phaser Image, BitmapText, Text and Graphics were still using array access to populate the world property, giving it incorrect results (thanks @alvinsight)
2014-07-15 22:44:02 +01:00
photonstorm
538425193a
World.wrap when using the bounds of the object wouldn't adjust the bounds correctly, meaning wrapping outside the camera failed (thanks @jackrugile #1020 )
2014-07-15 14:22:24 +01:00
photonstorm
f78a527ad5
Prevented objects with pixel perfect checks from over-riding other higher priority ID items ( #983 )
...
Rebuilt the way items are polled for Pointer events (drag, click, move). Now faster and more efficient, especially when some items in the stack require pixel perfect checks.
2014-07-15 11:20:57 +01:00
photonstorm
2c421d27ce
GameObjectFactory.spriteBatch now lets you specify null
as a parameter for the parent and automatically adds the batch to game.world
as a result. Also fixed jsdocs issues (@petarov #1000 )
2014-07-14 12:56:05 +01:00
photonstorm
5bc482685b
Renaming the release :) #1004
2014-07-14 12:08:46 +01:00
photonstorm
bc9e5804b2
Updated docs.
2014-07-11 18:02:47 +01:00
photonstorm
0353ee12be
Reverting to a 2.0.7 release to fix the issues with Image / RetroText / Buttons.
2014-07-11 16:30:25 +01:00
photonstorm
74679922d1
Debug.preUpdate was still being called in the Game Loop even if enableDebug was set to false (thanks @qdrj, #995 )
2014-07-11 11:52:48 +01:00
photonstorm
d7bed24a27
Preparing for 2.1.0 build.
2014-07-10 23:14:29 +01:00
photonstorm
8421cfc400
Final readme updates.
2014-07-10 20:39:17 +01:00
photonstorm
d0727b9c04
ReadMe update.
2014-07-10 20:39:13 +01:00
photonstorm
d11d8051b1
You can now prevent the Debug class from being created or booted by using the Game configuration setting: enableDebug
. By default it is true
, set to false
to prevent the class from being created. Please note you are responsible for checking if this class exists before calling it, but you can do that via if (game.debug) { ... }
(request #984 )
2014-07-10 10:46:18 +01:00
photonstorm
a182598c65
Using a Game configuration object you can now specify the value of the preserveDrawingBuffer
flag for the WebGL renderer. By default this is disabled for performance reasons. But if you need to be able to take screen shots of your WebGL games using toDataUrl on the game canvas then you'll need to set this to true
( #987 )
2014-07-10 10:46:18 +01:00
photonstorm
494c33a9f4
Rectangle.randomX will return a random value located within the horizontal bounds of the Rectangle.
...
Rectangle.randomY will return a random value located within the vertical bounds of the Rectangle.
2014-07-09 11:34:18 +01:00
photonstorm
003403c832
Color.getWebRGB will now accept either an Object or numeric color value.
2014-07-09 11:15:24 +01:00
photonstorm
ca8c6e16e9
README updates.
2014-07-08 12:59:36 +01:00
photonstorm
0b2bea3564
Removed hasOwnProperty check from Tween.from because it breaks on extended or inherited Game Objects.
2014-07-08 12:59:36 +01:00
photonstorm
2a106473b4
Added more detail to the Tween docs.
2014-07-08 12:59:36 +01:00
photonstorm
2d676b00b4
Working through crop issues.
2014-07-08 12:59:36 +01:00
photonstorm
77d5be1d8e
When adding a new Animation to a Sprite it would incorrectly reset the current Sprite frame to the first frame of the animation sequence, it is now left un-touched until you call play
on the animation.
2014-07-08 12:59:35 +01:00
photonstorm
14109aeeb1
Animation.next will advance to the next frame in the animation, even if it's not currently playing. You can optionally define the number of frames to advance, but the default is 1. This is also aliased from the AnimationManager, so you can do Sprite.animations.next()
.
...
Animation.previous will rewind to the previous frame in the animation, even if it's not currently playing. You can optionally define the number of frames to rewind, but the default is 1. This is also aliased from the AnimationManager, so you can do `Sprite.animations.previous()`.
2014-07-03 16:23:36 +01:00
photonstorm
7c624f409f
Updated console.log and README.
2014-07-03 10:50:26 +01:00
photonstorm
177d51f238
Signal.removeAll now has a new context
parameter. If specified only listeners matching the given context are removed (thanks @lucbloom for the idea, #880 )
2014-07-03 02:22:11 +01:00
photonstorm
92dbabb2df
Camera.updateTarget has had a make-over and now is a lot smoother under certain conditions (thanks @tjkopena, fix #966 )
2014-07-03 02:09:53 +01:00
photonstorm
8c41f6cc10
Game.onBlur and Game.onFocus events are now dispatched regardless if Stage.disableVisibilityChange is true or false, so you can respond to these events without your game automatically pausing or resuming ( #911 )
2014-07-02 14:57:28 +01:00
photonstorm
2916f0413f
Group.bringToTop (and consequently Sprite.bringToTop) no longer removes the child from the InputManager if enabled (thanks @BinaryMoon, fix #928 )
...
Group.sendToBack (and consequently Sprite.sendToBack) no longer removes the child from the InputManager if enabled.
Group.add has a new optional boolean parameter: `silent`. If set to `true` the child will not dispatch its `onAddedToGroup` event.
Group.addAt has a new optional boolean parameter: `silent`. If set to `true` the child will not dispatch its `onAddedToGroup` event.
Group.remove has a new optional boolean parameter: `silent`. If set to `true` the child will not dispatch its `onRemovedFromGroup` event.
Group.removeBetween has a new optional boolean parameter: `silent`. If set to `true` the children will not dispatch their `onRemovedFromGroup` events.
Group.removeAll has a new optional boolean parameter: `silent`. If set to `true` the children will not dispatch their `onRemovedFromGroup` events.
Internal child movements in Group (such as bringToTop) now uses the new `silent` parameter to avoid the child emitting incorrect Group addition and deletion events.
2014-07-02 14:04:14 +01:00
photonstorm
2cef655ed6
Calling Tween.stop from inside a Tween update callback would still cause the tween onComplete event to fire (thanks @eguneys, #924 )
2014-07-02 05:47:38 +01:00
photonstorm
5ee9245acf
Rectangle.right when set would set the new width to be Rectangle.x + the value given. However the value given should be a new Right coordinate, so the width calculation has been adjusted to compensate (thanks @cryptonomicon, #849 )
2014-07-02 05:37:12 +01:00
photonstorm
58fc73348c
The StateManager has a preRenderCallback option, which checks for a preRender function existing on the State, but it was never called. Have decided to add this in, so the core Game loop now calls state.preRender right before the renderer runs (thanks @AnderbergE #869 )
2014-07-02 05:32:40 +01:00
photonstorm
757136bf4f
Device.mobileSafari was no longer detecting Mobile Safari, now fixed (thanks @Zammy, #927 )
2014-07-01 19:19:49 +01:00
photonstorm
79bd7c400b
Key.duration wasn't set to zero after a Key.reset (thanks @DrHackenstein, #932 )
2014-07-01 16:57:55 +01:00
photonstorm
faa9af5539
readme updates
2014-07-01 16:19:20 +01:00