photonstorm
621673b9ca
Revert worldScale setter.
2016-05-11 16:37:21 +01:00
photonstorm
815907184a
Typo fix.
2016-05-11 16:37:01 +01:00
photonstorm
9649f714bb
InputHandler.checkPointerDown and checkPointerOver will now test the worldTransform scale property of a Sprite. If zero it will fast return, where-as before it would incorrectly report an up event (thanks @jaapaurelio #2466 )
2016-05-11 12:25:35 +01:00
photonstorm
368913fd98
Removed WebGL Tilemap renderer, has moved to its own branch to be part of 2.5.0.
2016-05-11 11:27:36 +01:00
photonstorm
16203a378a
PIXI.defaultRenderer is now set to null
in Game.destroy, allowing it to be reset if a new Game instance is created on the same page (thanks @xtforgame ##2474)
2016-05-11 11:27:36 +01:00
Pete Baron
5e97f10c86
Remove un-needed mixin components leaving only FixedToCamera (not sure about this one). Move this.fixedToCamera after the Core.init call which creates the underlying core components required. Add temporary instant return from shiftCanvas in case that was being called and contributing to the slow-down (probably not).
2016-05-05 17:00:22 +12:00
Pete Baron
ef4143136e
Use this.x, this.y as scrolling offsets when rendering each tile.
2016-05-05 16:57:55 +12:00
Pete Baron
69abe492cc
Modified Phaser.Tilemap and PIXI.Tilemap to support the new Phaser.TilemapLayerGL objects.
...
The PIXI file has a reverse dependency on Phaser for it's 'layer' parameter which contains a Phaser.Tilemap (which holds the map data). The other changes adapt it to the new data source (previously this expected a raw JSON object encoded like the Mario.json map is).
The Phaser file now keeps a reference to the data parsed from the original map, and adds a branch in createLayer to build a TilemapLayerGL instead of a TilemapLayer.
2016-05-05 15:58:03 +12:00
Pete Baron
ad04676980
New class: duplicate of Phaser.TilemapLayer modified to access the new PIXI.Tilemap WebGL based tile renderer.
...
This is just the first test which actually produces some visible output (the map is drawn for the "sci fly" demo example, if you adjust line 27 of that source file to: layer = map.createLayer(0, undefined, undefined, undefined, true);
The new terminal "true" parameter instructs Phaser.Tilemap.createLayer to create a TilemapLayerGL object instead of the usual Phaser.TilemapLayer.
2016-05-05 15:52:26 +12:00
photonstorm
45118e7a60
Docs fix.
2016-05-04 23:34:15 +01:00
Pete Baron
eb77949f63
Strip down PIXI.Tilemap to remove all unused code.
...
Add very simple tilemap render function to draw every layer, every tile, for the tiles provided.
Link to the TilemapShader and get the whole thing working.
2016-05-05 10:29:51 +12:00
Pete Baron
9deb07c3aa
Modify this shader to draw a simple textured rectangle using a two-tri strip, extremely quickly due to simplicity.
2016-05-05 10:28:12 +12:00
photonstorm
1adece490a
Docs update.
2016-05-04 02:02:13 +01:00
photonstorm
7afe087c3d
Docs fix.
2016-04-29 17:46:44 +01:00
photonstorm
7332dd8028
Custom WebGL Tilemap renderer POC displaying textures. It's a start.
2016-04-28 00:18:09 +01:00
photonstorm
16378713b4
JSDocs update ( #249 )
2016-04-27 12:57:41 +01:00
photonstorm
d55b0c9e51
Tilemap update.
2016-04-27 03:38:07 +01:00
photonstorm
b10c8858c3
Tilemap shader WIP.
2016-04-27 03:02:13 +01:00
photonstorm
f494c867c7
Fixed an issue in the Arcade Physics overlap method where it would only detect overlaps up to the max bias threshold and no further (thanks @rgk #2441 )
...
The Arcade Physics overlap method would return false if two bodies were overlapping but neither had any velocity (i.e. they were embedded into each other)
2016-04-25 11:38:51 +01:00
Richard Davey
74d52dd327
Merge pull request #2443 from drhayes/dev
...
Add a "shakeIntensity" property to Camera.
2016-04-23 04:34:08 +01:00
photonstorm
6bc93de7a5
Preparing for 2.4.8 dev.
2016-04-23 04:32:47 +01:00
David Hayes
fb709fe728
Add a "shakeIntensity" property to Camera.
...
This would allow tweening the intensity of the Camera shake over the
lifetime of the shaking.
2016-04-22 19:53:52 -05:00
photonstorm
a29cc64932
Phaser 2.4.7 Final.
2016-04-22 15:15:28 +01:00
photonstorm
002d6250a8
Docs update.
2016-04-21 00:48:54 +01:00
photonstorm
3d6b1a3b7e
Stopped the Camera Shake effect from changing the World position, as it screws up Arcade Physics, Sprite deltas and some input handling. Instead moved the effect to be render applied only. On Canvas it updates the context.setTransform call, and on WebGL the renderSession offset property.
2016-04-19 04:12:58 +01:00
photonstorm
62d135cf1f
Small tidy-up.
2016-04-19 03:39:04 +01:00
photonstorm
7d9c817373
Dragging a Sprite while the camera was moving would slowly cause the Sprite position to become out of sync the further the camera moved. A Sprite being dragged now tracks the camera position during the drag update and adjusts accordingly (thanks @jeroenverfallie #1044 )
2016-04-19 01:54:24 +01:00
photonstorm
628dd1c420
P2.Body.offset is now used and applied to the Sprite position during rendering. The values given are normal pixel values, and offset the P2 Body from the center of the Sprite (thanks @Mourtz #2430 )
2016-04-18 20:57:41 +01:00
photonstorm
a2d145a43d
When the Loader loads audio via the Audio tag, instead of Web Audio, it used to use Phaser.GAMES[_this.game.id].load
as the callback handler, which would stop it from working if you had multiple Loaders set-up within Phaser. It now uses a local reference to _this
instead (thanks @SBCGames #2435 )
2016-04-18 16:44:28 +01:00
photonstorm
41f81d39b7
jsdocs update (and removed isCircle switch)
2016-04-18 16:17:47 +01:00
photonstorm
257a22b170
When loading Video with the asBlob
argument set it now uses a 'blob' type for the XHR loader, and doesn't cast the resulting file as a Blob upon load. This fixes loading videos as blobs on Chrome for Android (thanks @JuCarr #2433 )
2016-04-18 16:17:27 +01:00
photonstorm
41add1b4bf
Phaser 2.4.7 RC1.
2016-04-14 13:23:44 +01:00
photonstorm
ac4acfb912
Removed Arcade Physics Circle support (now in its own branch) ready for 2.4.7 release.
2016-04-14 13:23:28 +01:00
photonstorm
4d8753e9ce
Tidying up for 2.4.7.
2016-04-14 12:57:05 +01:00
photonstorm
aad499b025
Tidying up the code base for 2.4.7.
2016-04-14 12:43:10 +01:00
photonstorm
5221bfd5da
You can now pass in your own Canvas element to Phaser and it will use that instead of creating one itself. To do so you must pass a Game Configuration object to Phaser when you instantiate it, and set the canvas
property of the config object to be the DOM element you wish to use, i.e.: { canvas: document.getElementById('yourCanvas') }
(thanks @Friksel #2311 )
2016-04-14 11:57:10 +01:00
Lewis Pollard
719b4bb7f6
Alter BitmapText to use toString on text parameter in constructor
...
The BitmapText property accessor for the text property uses toString on the value passed in, meaning Numbers can be passed in as the text value with no problem. However, passing a Number into the constructor results in the following exception as it isn't implicitly converted to a string in a similar manner.
phaser.js:71890 TypeError: text.substr is not a function
at Phaser.BitmapText.updateText (http://localhost/phaser/build/phaser.js:56283:21 )
at new Phaser.BitmapText (http://localhost/phaser/build/phaser.js:56034:10 )
at Phaser.GameObjectFactory.bitmapText (http://localhost/phaser/build/phaser.js:46318:26 )
at Object.Boot.create (http://localhost/phaser/:46:34 )
at Phaser.StateManager.loadComplete (http://localhost/phaser/build/phaser.js:29240:35 )
at Phaser.Loader.finishedLoading (http://localhost/phaser/build/phaser.js:71446:25 )
at Phaser.Loader.processLoadQueue (http://localhost/phaser/build/phaser.js:71403:18 )
at Phaser.Loader.asyncComplete (http://localhost/phaser/build/phaser.js:71476:14 )
at Phaser.Loader.xmlLoadComplete (http://localhost/phaser/build/phaser.js:72413:14 )
at .<anonymous> (http://localhost/phaser/build/phaser.js:72236:34 )
This simply mimics the logic in the property accessor by running toString on the text value and using an empty string if null to allow Numbers to be passed into the constructor.
2016-04-13 15:24:29 +01:00
Richard Davey
358cc6b8d0
Merge pull request #2428 from EJanuszewski/radToDeg-typo
...
Fix typo in Math radToDeg description
2016-04-13 14:18:18 +01:00
photonstorm
f4277efc20
Alternative snooker-ball like collision test.
2016-04-11 16:43:17 +01:00
photonstorm
a193ad557e
Fixed jsdocs #2418
2016-04-11 08:55:24 +01:00
photonstorm
7102a34706
Camera.flash is a new function that makes the camera 'flash' over the top of your game. It works by filling the game with the solid fill color specified, and then fading it away to alpha 0 over the duration given. This is great for things like hit effects. You can listen for the Camera.onflashComplete Signal.
...
Camera.fade is a new function that makes the camera fade to the color given, over the course of the duration specified. This is great for things like transitioning from one State to another. You can listen for the Camera.onFadeComplete Signal.
Camera.resetFX resets any active FX, such as a fade or flash and immediately clears it. Useful to calling after a fade in order to remove the fade from the Stage.
Phaser.Camera.ENABLE_FX is a const that controls if the Camera FX are available or not. It's `true` by default, but if you set it to `false` before boot then it won't create the Graphics object required to process the effects.
2016-04-09 04:05:07 +01:00
photonstorm
2ea94c83e6
Camera.shake is a new function that creates a camera shake effect. You can specify the intensity, duration and direction of the effect. You can also set if it should shake the camera out of bounds or not.
2016-04-09 02:57:16 +01:00
photonstorm
0b0a5d44cc
Camera shake working and documented.
2016-04-09 02:49:18 +01:00
photonstorm
a916812db1
Camera shake support.
2016-04-09 02:01:45 +01:00
photonstorm
9e803fff7c
Small fix.
2016-04-09 01:10:31 +01:00
photonstorm
dba84d5931
Camera has a new property: lerp
. This is a Point object, that allows you to control the amount of horizontal and vertical smoothing to be applied to the camera when it tracks a Sprite. It works both with and without deadzones, and is turned off by default. Set it to low values such as 0.1 for really smooth motion tracking (thanks to @WombatTurkey for the idea of adding this)
2016-04-09 01:07:19 +01:00
photonstorm
b9fab96471
Improved docs.
2016-04-09 00:25:56 +01:00
photonstorm
3c4e63fda5
World.separateCircle is working with circle vs. circle bodies.
2016-04-08 03:37:49 +01:00
photonstorm
d009b8d769
Circle vs. Circle rebound code started.
2016-04-07 19:32:27 +01:00
photonstorm
cc5361dd6d
World.separate has been optimized to cut down on the number of calls to intersect
from 3 calls per Game Object collision check, to 2. So if you were colliding 50 sprites it will reduce the call count from 150 to 100 per frame. It also reduces the calls made to seperateX
and seperateY
by the same factor.
...
Two immovable bodies would never set their overlap data, even if an overlap only check was being made. As this is useful data to have this has been changed. Two immovable bodies will still never separate from each other, but they _will_ have their `overlapX` and `overlapY` properties calculated now.
2016-04-07 18:04:45 +01:00