photonstorm
f6903df104
Stage now extends Container.
2016-10-14 02:20:01 +01:00
photonstorm
680ce51842
Updated Container methods, renamed renderers, added Factory.
2016-10-14 02:19:35 +01:00
photonstorm
d0cb0f2457
Commented out World and Camera for now.
2016-10-14 02:19:10 +01:00
photonstorm
c2841cc1f6
Fixed parenting.
2016-10-14 02:18:48 +01:00
photonstorm
fe623ec708
Fixed Transform, added in child management methods and tidied up.
2016-10-14 02:18:37 +01:00
Richard Davey
483c3eb34b
Updated to work with new Image properties.
2016-10-13 01:54:40 +01:00
Richard Davey
6373d8ebb3
Moved methods and getters around.
2016-10-13 01:54:30 +01:00
Richard Davey
559126d7b5
Moved to using new Transform component, and adjusted other properties.
2016-10-13 01:54:18 +01:00
Richard Davey
d6bb27f51c
Disabled the Debug class.
2016-10-13 01:54:01 +01:00
Richard Davey
72ee3c7a84
Updating Image game object to use the new Transform component.
2016-10-13 00:08:26 +01:00
Richard Davey
35854ea58d
Cache now adds in Default and Missing images to the new Texture Manager.
2016-10-13 00:08:11 +01:00
Richard Davey
e9b80ecb93
Added the Transform components.
2016-10-12 23:53:39 +01:00
Richard Davey
e05cc8978a
Added Data.merge.
2016-10-12 22:39:37 +01:00
photonstorm
ca4874cdd7
Data component updates.
2016-10-12 17:05:27 +01:00
photonstorm
9ed542781b
Added the new Data Component.
2016-10-12 15:19:04 +01:00
Richard Davey
271aab1844
Removed the GPU texture handlers out of the Texture Manager, and into the WebGL Renderer.
2016-10-11 23:48:22 +01:00
Richard Davey
379b54b554
Added TextureManager.addSpriteSheetFromAtlas and removed it from the Texture class.
2016-10-11 22:46:23 +01:00
Richard Davey
a2ac0a2c58
Multi-atlas loader support complete, adding to the Texture Manager properly.
2016-10-11 22:11:54 +01:00
Richard Davey
65ce4928d9
Expanded multi-atlas support in the Loader. Fixing ESLint errors too.
2016-10-11 19:50:36 +01:00
Richard Davey
591bf828a9
Phaser.ArrayUtils.numberArray now has optional prefix
and suffix
arguments, allowing you to do: numberArray(1, 4, 'Level ')
and the Array will contain ["Level 1", "Level 2", "Level 3", "Level 4"]
.
2016-10-11 17:42:58 +01:00
photonstorm
775dee029d
Added Loader.multiatlas - for multi-atlas textures.
2016-10-11 16:48:12 +01:00
photonstorm
ce3308ea1d
Hooking the Loader and Cache into the new Texture Manager.
2016-10-11 14:52:17 +01:00
Richard Davey
e0ef9cab8b
Hooked the Texture Manager into the Cache.
2016-10-10 23:57:51 +01:00
Richard Davey
70729234e8
Added the Texture Manager into the core systems list.
2016-10-10 23:39:52 +01:00
Richard Davey
3ac8c4fcc5
Tidied up the Children component.
2016-10-09 23:39:27 +01:00
Richard Davey
0af16817a5
Refactored GameObjects
to GameObject
.
2016-10-09 22:27:58 +01:00
Richard Davey
fb13151959
Start of the container.
2016-10-08 17:19:55 +01:00
Richard Davey
d137d3e989
Swapped over to using the new Factory.
2016-10-08 16:31:08 +01:00
Richard Davey
380e717e52
Finished off missing factories. Moved over the docs. Changed rogue @returns to @return everywhere.
2016-10-08 16:17:46 +01:00
Richard Davey
6d0dc5e003
Added BitmapText Factory.
2016-10-08 13:18:35 +01:00
Richard Davey
729020477a
New Game Objects structure in place, and starting to take shape.
...
Moved BitmapData and RenderTexture into the textures folder for now.
All Game Objects now have their own sub-folder, with their Factory and renderer functions alongside them, plus any other files they need.
New Factory class added. Currently hooked into `game.factory` for testing, but will swap to `game.add` when complete.
2016-10-08 03:05:42 +01:00
Richard Davey
85c580ac61
Starting porting RenderTexture over.
2016-10-07 03:55:55 +01:00
Richard Davey
f9fe6a3e94
Fixed canvas SpriteBatch and removed duplicate render functions.
2016-10-07 03:41:48 +01:00
Richard Davey
5b4280d694
Removed the matrix.
2016-10-07 03:34:42 +01:00
Richard Davey
35fd29a45a
Removed Pixi globals, and moved constructors above the prototype.
2016-10-07 03:32:37 +01:00
Richard Davey
1262ba7e51
Removed PixiDefaults.
2016-10-07 03:23:38 +01:00
Richard Davey
0abf9d958d
Updated scaleMode global.
2016-10-07 03:22:59 +01:00
Richard Davey
3fab1ce385
Working through the Pixi globals and removing them.
2016-10-07 03:21:39 +01:00
Richard Davey
98d2bdf03b
Fixed rotation! and setting Canvas tint modes.
2016-10-07 03:08:51 +01:00
Richard Davey
f6047763fa
Fixed Graphics rendering.
2016-10-07 02:53:34 +01:00
Richard Davey
39a8d71027
Fixed, and now rendering properly.
2016-10-07 02:31:35 +01:00
Richard Davey
2630a48266
Added TileSprite to the renderer.
2016-10-07 02:09:12 +01:00
Richard Davey
b18bdab447
UID is set by the Renderer now, removing another Phaser global.
2016-10-07 01:33:01 +01:00
Richard Davey
c67904311c
Moved default vertex shader to the sprite shader.
...
Added multi-texture support back in.
2016-10-07 01:12:31 +01:00
Richard Davey
ea9c9ae7b3
Removed gl texture ID.
2016-10-07 00:59:10 +01:00
Richard Davey
b254d085cd
All of the WebGL Graphics draw ops have been split out, tidied up and merged.
2016-10-07 00:40:31 +01:00
Richard Davey
97b1ac9d4f
Typo fix.
2016-10-06 23:37:44 +01:00
Richard Davey
8a72f0ff35
FilterTexture converted.
2016-10-06 23:36:00 +01:00
Richard Davey
281e9287d1
FilterManager converted. Temp. stencil buffer needs adding.
2016-10-06 23:19:26 +01:00
Richard Davey
caffc9ca5f
Added FilterManager and StencilManager to new renderer.
2016-10-06 22:59:42 +01:00
Richard Davey
a096dd4f7d
Removed context arrays.
2016-10-05 01:47:54 +01:00
Richard Davey
dc92c92a30
Removed all instances of gl.id
.
2016-10-05 01:45:22 +01:00
Richard Davey
a12ba9fa10
Added WebGL Sprite Batch.
2016-10-05 01:40:25 +01:00
Richard Davey
fe92b4e388
WebGL using mixins.
2016-10-05 01:25:06 +01:00
Richard Davey
4cd0e833d5
Sorted out the mixin needed for the Canvas renderer.
2016-10-05 01:09:23 +01:00
Richard Davey
047a994334
Canvas and WebGL rendering Text again.
2016-10-04 22:47:05 +01:00
Richard Davey
28eb7a5f40
Adding in more renderer game objects.
2016-10-04 22:36:07 +01:00
photonstorm
482bb96056
Added in SpriteBatch, Graphics and Strip shaders.
2016-10-04 16:51:47 +01:00
photonstorm
03f67a2677
Refactored WebGL renderer working for Sprites and Containers.
2016-10-04 15:39:54 +01:00
Richard Davey
d55cc215ee
Moving more rendering functionality over.
2016-10-04 00:58:52 +01:00
Richard Davey
0142997787
Merged Tint functions into Canvas Renderer.
2016-10-03 22:31:10 +01:00
Richard Davey
40bef9543a
Updated Game Object renderer blocks to use 'this'.
...
Split out the Graphics renderer to avoid being a giant if/else loop.
2016-10-03 21:46:39 +01:00
photonstorm
7b40711418
Moved the Mask related features from Graphics into the Canvas Renderer.
2016-10-03 17:14:44 +01:00
photonstorm
1da95994a5
First pass of the newly re-structured Canvas Renderer (still using old texture system though).
2016-10-03 12:44:54 +01:00
Richard Davey
42b8118fa0
All core features of the new Texture classes are now done. Multi-atlas support, Sprite Sheets embedded in atlases, shared source references, shared frame data, and split parsers. Phew.
2016-09-30 06:07:00 +01:00
photonstorm
184b070440
Fixed Sprite Sheet parser.
2016-09-29 16:32:24 +01:00
photonstorm
f993769336
Lots of work on the new Texture classes.
2016-09-29 16:10:22 +01:00
Richard Davey
2590e67e2b
First pass at the new consolidated Texture classes. Ultimately these will replace PIXI.BaseTexture, PIXI.Texture and Phaser.Frame. Objects will grab frame references, rather than creating their own Texture objects all the time.
2016-09-29 04:21:12 +01:00
Richard Davey
0aa6650422
Re-arranged methods and added parent.
2016-09-29 03:10:16 +01:00
Richard Davey
043efb759c
Updated version.
2016-09-29 03:09:59 +01:00
Richard Davey
b5ef896448
Device.arora has been removed.
...
Device.epiphany has been removed.
Device.midori has been removed.
Device.css3D has been removed, and the function that tested it is no longer run.
Device.isConsoleOpen has been removed. The function only worked on a very limited set of old browsers.
Device.littleEndian has been removed, you can use Device.LITTLE_ENDIAN instead.
2016-09-29 03:09:49 +01:00
Richard Davey
e47a7741c3
Modified showDebugHeader so it works on Chrome, FF and Safari. Updated colors and text. Removed the easter egg.
2016-09-29 02:48:48 +01:00
Richard Davey
5cb7cc8e92
Start of the new Children component.
2016-09-29 02:29:56 +01:00
Richard Davey
6ce28658f6
PIXI.Float32Array, PIXI.Uint16Array, PIXI.Uint32Array and PIXI.ArrayBuffer have all been removed, and replaced with their own proper native versions. The polyfill now captures any instances where the browser needs to fall back to an Array instead.
2016-09-28 19:02:59 +01:00
photonstorm
4ca182dd1a
PIXI._UID has been removed, all affected classes now use Phaser._UID.
2016-09-28 17:14:07 +01:00
photonstorm
2b220a3ae0
PIXI.RETINA_PREFIX has been removed, as it was never used anywhere internally.
2016-09-28 16:58:23 +01:00
photonstorm
c836d4bfbd
PIXI.PI_2, PIXI.RAD_TO_DEG and PIXI.DEG_TO_RAD have all been removed, as they are no longer used internally, and are all available under Phaser.Math.
...
PIXI.VERSION has been removed, as it's no longer relevant and misleading.
2016-09-28 16:57:08 +01:00
photonstorm
f9a2c2a79e
PIXI.Graphics and PIXI.GraphicsData have been removed, and all functionality merged in to Phaser.Graphics, to cut down on the number of internal classes and inheritance going on.
...
WebGLGraphics and CanvasGraphics have been updated so that it checks for Phaser Geometry shape types internally.
2016-09-28 16:42:33 +01:00
photonstorm
e1370f3549
Ignore EarCut from jshint. Too many errors.
2016-09-28 15:40:30 +01:00
photonstorm
69db3632d6
PIXI.Rope and PIXI.Strip have been removed, and all functionality merged in to Phaser.Rope, to cut down on the number of internal classes and inheritance going on.
2016-09-28 15:10:43 +01:00
photonstorm
a2cd364db5
Removed AbstractFilter and its manifest entry.
2016-09-28 14:31:23 +01:00
photonstorm
347519d8cb
Removed as no longer used internally.
2016-09-28 14:30:25 +01:00
photonstorm
a8d1bbcfdc
PIXI.AbstractFilter has been merged into the Phaser.Filter class.All references to PIXI.AbstractFilter have been updated to use Phaser.Filter instead.
2016-09-28 14:30:15 +01:00
photonstorm
879bcffc88
Removed PIXI.Utils and remapped functions to their new locations.
2016-09-28 14:02:02 +01:00
photonstorm
b0f27b3f3c
Color.hexToRGBArray converts a hex color value to an [R, G, B] array.
...
Color.RGBArrayToHex converts an RGB color array, in the format: [R, G, B], to a hex color value.
2016-09-28 13:57:29 +01:00
photonstorm
eda4961c06
Math.getNextPowerOfTwo will get the next power of two for the given value.
...
Math.isPowerOfTwo will return a boolean if the given width and height are a power of two.
2016-09-28 13:48:08 +01:00
photonstorm
bffdb8fbc5
Moved the Canvas tests into the Phaser.Device class.
2016-09-28 13:39:30 +01:00
photonstorm
ae9460c80e
Docs fix.
2016-09-28 13:39:05 +01:00
photonstorm
2cf447c151
PIXI.EarCut has been moved into the Phaser utils
folder, and renamed to Phaser.EarCut
. All references to PIXI.EarCut have been updated to match the new namespace.
2016-09-28 13:38:59 +01:00
photonstorm
1e15012a91
PIXI.CanvasPool has been moved into the Phaser utils
folder, and renamed to Phaser.CanvasPool
. All references to PIXI.CanvasPool have been updated to match the new namespace.
2016-09-28 12:53:04 +01:00
photonstorm
508e5ae723
PIXI.TilingSprite has been removed, and all functionality merged in to Phaser.TileSprite, to cut down on the number of internal classes and inheritance going on.
2016-09-28 11:57:11 +01:00
Richard Davey
2005c9d86d
PIXI.RenderTexture has been removed, and all functionality merged in to Phaser.RenderTexture, to cut down on the number of internal classes and inheritance going on.
2016-09-28 01:40:29 +01:00
Richard Davey
0bfb52d159
Phaser.SpriteBatch was incorrectly applying the prototypes, causing the Sprite Batch render methods to be replaced by the normal DisplayObjectContainer ones, meaning nothing was really batched at all. This has now been fixed, and PIXI.SpriteBatch removed, as it's no longer required.
2016-09-28 00:43:19 +01:00
Felipe Alfonso
d5c9ab669e
Added global texture array
2016-09-27 20:43:00 -03:00
Richard Davey
1d7b54b7d4
Merged Sprite Batch updates.
2016-09-27 23:22:26 +01:00
Richard Davey
41ad0873d4
Fixing the Sprite Batch.
2016-09-27 23:20:38 +01:00
photonstorm
2d84ea8938
Removed SS in Atlas.
2016-09-27 14:27:12 +01:00
photonstorm
840d3669b0
Updated tutorial code so you can't bounce off stars.
2016-09-27 13:57:32 +01:00
Richard Davey
00abd388e8
Bumped version.
2016-09-27 02:00:40 +01:00
Richard Davey
1c415a0d7e
Cache.addBitmapFontFromAtlas allows you to add a Bitmap Font to the Cache, that is comprised of a frame from a Texture Atlas, and the font data (in JSON or XML format). Once added you can use the Bitmap Font in the same way as you would any Bitmap Font ( #2614 )
2016-09-27 02:00:31 +01:00
Richard Davey
811c347cc3
Camera.fade has a new argument alpha
to control the alpha level of the effect (thanks @rgk #2493 )
...
Camera.flash has a new argument `alpha` to control the alpha level of the effect (thanks @rgk #2493 )
2016-09-27 01:07:40 +01:00
Richard Davey
2bc9c73838
The Video.playing property didn't check to see if the Video existed, and would throw the error Uncaught TypeError: Cannot read property 'paused' of null
if you called it after destroying the video (thanks @Tetley #2740 )
2016-09-26 23:35:41 +01:00
Richard Davey
0692bf01b5
If you called Video.changeSource, and then immediately called Video.play after it, it would fire the onComplete
event twice (thanks @jaraiza #2543 )
2016-09-26 23:28:41 +01:00
Richard Davey
f331697fee
Text.splitRegExp is a new property that allows you to control the regular expression that is used to split the text into multiple lines (@dai-shi #1403 )
2016-09-26 22:35:54 +01:00
Richard Davey
feb1b980c0
Text.width and Text.height now divide the result by the Text.resolution, to avoid incorrect dimensions on High DPI devices (thanks @mattahj #2146 )
2016-09-26 22:22:31 +01:00
Richard Davey
604da9ebc8
TS defs fix #2754
2016-09-26 21:28:43 +01:00
Richard Davey
a16e6e92ff
Tidying up the formatting #2760
2016-09-26 21:02:36 +01:00
Richard Davey
de56e37400
Merge pull request #2760 from JTronLabs/dev
...
Phaser.Math.between fixes & added Phaser.Math.random
2016-09-26 20:55:05 +01:00
Richard Davey
53de7c20f0
Small code tidy + TS defs for #2763
2016-09-26 20:49:35 +01:00
Richard Davey
bb452e2b4e
Merge pull request #2763 from arefiev/skip-frames-in-spritesheets
...
Add a parameter to load.spritesheet which tells it how many frames to…
2016-09-26 20:44:17 +01:00
Kevin Albertson
a512763508
Fixed fixedToCamera update for Group.
2016-09-25 22:39:59 -04:00
Richard Davey
4cc18e2df4
Phaser 3.0.0 Beta 1 release.
2016-09-21 23:22:08 +01:00
Richard Davey
31592b98f1
The P2 Physics library has been updated to 0.7.1. This is still quite out of date, but as soon as they release their latest build (hopefully soon) we'll update to that.
2016-09-21 23:16:14 +01:00
Richard Davey
665f126461
Updated docs and defs.
2016-09-21 23:10:46 +01:00
Richard Davey
0d1d4f048f
Updated docs.
2016-09-21 23:08:48 +01:00
Richard Davey
cfb2f73813
Removed un-used property.
2016-09-21 23:00:20 +01:00
Richard Davey
fb1ea7a01e
Updated documentation.
2016-09-21 22:59:20 +01:00
Richard Davey
6aff35b5fd
Frame.rotationDirection
has been removed. It isn't needed, as modern texture packers only rotate 90 degrees clockwise anyway, and Phaser only supports this rotation direction.
2016-09-21 22:53:30 +01:00
Richard Davey
5cf3fcccbc
Fixed CanvasTinter for rotated texture frames.
2016-09-21 22:47:05 +01:00
Felipe Alfonso
98e0fceac9
Moved transform for rotated texture clipping to a single transform. Added support for webgl rotated textures
2016-09-21 17:48:26 -03:00
Richard Davey
f3c5b7a0bc
TS defs update.
2016-09-20 02:03:00 +01:00
Richard Davey
6bd0ab6a8c
Updated jsdocs and jshint fixes.
2016-09-20 01:48:30 +01:00
Felipe Alfonso
2f3fc22b50
Merge branch 'dev' of https://github.com/photonstorm/phaser into dev
2016-09-19 20:58:18 -03:00
Felipe Alfonso
702bc9b69f
fixed issues with conflict resolving
2016-09-19 20:54:06 -03:00
Richard Davey
3f4decd59e
First pass at adding rotated atlas frame support in to the Canvas renderer.
2016-09-20 00:53:00 +01:00
Felipe Alfonso
d0c23c15b5
Merge branch 'dev' into texture-compression-webgl
...
Conflicts:
src/pixi/renderers/webgl/WebGLRenderer.js
2016-09-19 20:19:24 -03:00
Mikhail Arefiev
e3b8071d43
Add a parameter to load.spritesheet which tells it how many frames to skip. Good when you have huge PNGs with multiple spritesheets in each.
2016-09-20 01:50:11 +03:00
Richard Davey
4057412397
Updated array allocation.
2016-09-19 23:48:56 +01:00
Richard Davey
3924371aae
New property for batched textures.
2016-09-19 23:46:05 +01:00
Richard Davey
b0ce81bec0
Multiple Batched Texture support is now available. This is a WebGL feature that can seriously decrease the volume of draw calls made in complex, or asset heavy, games. To enable it you can either use the new renderer type Phaser.WEBGL_MULTI
, or you can pass the property multiTexture: true
in a Phaser.Game configuration object. Once enabled, it cannot be disabled.
...
`game.renderer.setTexturePriority` is the method that goes with the Multiple Texture support. It takes an array as its single argument. The array consists of Phaser.Cache image key strings. Phaser will then try to batch as many of the textures as it can, depending on the hardware limits. If for example the GPU can only batch 8 textures, and you provide an array of 16, then only the first 8 in the array will be batched.
2016-09-19 23:31:32 +01:00
Richard Davey
6caec0d14d
Updated the pointer check code in the Device class, to get rid of the message Navigator.pointerEnabled is a non-standard API added for experiments only. It will be removed in near future.
in Chrome.
2016-09-19 23:10:42 +01:00
Richard Davey
e49151877b
jshint fixes.
2016-09-19 22:28:25 +01:00
Felipe Alfonso
c22f37818f
Fixed issue when initializing pixishader from filter manager
2016-09-19 18:17:51 -03:00
Felipe Alfonso
ca07b988a0
Merge branch 'renderer-updates' into texture-compression-webgl
2016-09-19 14:20:39 -03:00
Felipe Alfonso
840ea05bae
Fix that allows for using filters with multi texture. It'll still be disabled for filter textures and render targets (framebuffers)
2016-09-16 17:43:55 -03:00
Felipe Alfonso
0f63bfa210
Fixed problem with filters. If filters are used multi-texture batching support is dropped.
2016-09-15 17:25:46 -03:00
Felipe Alfonso
e67830fb13
wip fixing pixi's filter manager bug with multi-texture implementation
2016-09-15 16:53:34 -03:00
James Lowrey
ff75721507
minor docs fixes from last commit
2016-09-14 18:31:21 -07:00
James Lowrey
a6302cdd9a
fixed between() docs and updated it to accept negative numbers, default values, and auto-orders min/max parameters if they're input wrong. Added a random() function that does the same but returns floats instead of integers
2016-09-14 18:25:58 -07:00
Felipe Alfonso
b7a61200e0
Fixed framebuffer / FilterTexture issue when using multi texture batching
2016-09-14 17:13:08 -03:00
Felipe Alfonso
e99ab878fd
Fixing framebuffer src -> dst bug
2016-09-14 16:12:52 -03:00
Felipe Alfonso
34cb845ac8
Wip fixing filter issue with multitexture
2016-09-12 23:17:25 -03:00
Felipe Alfonso
c8f7761cc9
Added selection of multi texture for the rest of PIXI shaders
2016-09-12 19:00:29 -03:00
Felipe Alfonso
58f74ec16b
Merge branch 'dev' into multitexture-gl
...
Conflicts:
src/pixi/renderers/webgl/WebGLRenderer.js
2016-09-08 19:51:25 -03:00
Felipe Alfonso
224c397622
Added dynamic shader selection if multi texture is enabled. If not it'll fallback to default pixi shader
2016-09-08 19:28:19 -03:00
Felipe Alfonso
4ecab8a912
Merge branch 'renderer-updates' into multitexture-gl
2016-09-08 19:21:26 -03:00
Felipe Alfonso
7350509f0b
by default multitexture is disabled
2016-09-08 19:17:59 -03:00
Felipe Alfonso
8a8e026ce3
Merge commit '314b0889750792fcfbe240296361e58db224ed91' into multitexture-gl
2016-09-08 16:13:10 -03:00
Richard Davey
c42c447bfb
Weapon.multiFire is a new property that allows you to set a Weapon as being allowed to call fire
as many times as you like, per game loop. This allows a single Weapon instance to fire multiple bullets.
...
Weapon.fire has two new arguments: `offsetX` and `offsetY`. If the bullet is fired from a tracked Sprite or Pointer, or the `from` argument is set, this applies a horizontal and vertical offset from the launch position.
Weapon.fireOffset attempts to fire a single Bullet from a tracked Sprite or Pointer, but applies an offset to the position first. This is a shorter form of calling `Weapon.fire` and passing in the offset arguments.
Weapon.fireMany attempts to fire multiple bullets from the positions defined in the given array. If you provide a `from` argument, or if there is a tracked Sprite or Pointer, then the positions are treated as __offsets__ from the given objects position. If `from` is undefined, and there is no tracked object, then the bullets are fired from the given positions, as they exist in the world.
2016-09-08 01:42:19 +01:00
Richard Davey
8a78029e2b
Merge pull request #2728 from samme/issue-2720
...
Add a hint for resizing Body of scaled Sprites
2016-09-07 23:27:34 +01:00
Richard Davey
1193bc7d47
Return null instead of false.
2016-09-07 23:25:37 +01:00
Richard Davey
f990e632f1
Tidying-up code style.
2016-09-07 23:23:47 +01:00
Richard Davey
c3b4590e29
Merge pull request #2731 from JTronLabs/dev
...
Cleaned up commits from previous PR
2016-09-07 23:23:04 +01:00
Richard Davey
85fc05ec0b
Merge pull request #2729 from samme/line-fromSprite-center
...
Use centerX, centerY in Phaser.Line#fromSprite
2016-09-07 23:16:01 +01:00
Richard Davey
07994c37a1
Merge pull request #2739 from samme/issue-2738
...
Test for `camera.fx` before resetting
2016-09-07 23:12:00 +01:00
Alex Espinoza
e6cb910d6a
Remove use of non-existent begin variable and
...
reference beginIndex instead
2016-09-05 23:30:43 -04:00
samme
b67073c62d
Test for camera.fx
before resetting
2016-09-04 11:18:08 -07:00
James
42ca43d98c
updated docs on Arcade body's setSize
2016-08-30 17:08:25 -05:00
James
99f0fb63bd
prevent crash if weapon's bullets have not yet been initialized before settting _bulletClass
2016-08-30 17:05:27 -05:00
James
639b9161f7
updated docs on weapon's setBulletBodyOffset
2016-08-30 17:03:10 -05:00
James
3c605285ee
updated weapon's fire() docs
2016-08-30 16:58:27 -05:00
samme
792ae127bf
Add a hint for resizing Body of scaled Sprites
2016-08-29 12:50:05 -07:00
samme
f6cdcc3878
Use centerX, centerY in Phaser.Line#fromSprite
2016-08-29 12:08:31 -07:00
Richard Davey
7f7a355686
Preparing for Phaser 3.0.0 dev.
2016-08-26 02:20:05 +01:00
Richard Davey
dd39f9ab08
Updated TS defs.
2016-08-26 01:24:15 +01:00
photonstorm
a84021679b
Tidied up how crop destroys itself.
2016-08-25 16:41:26 +01:00
photonstorm
94a0dbe547
Text.updateText now sets Text.dirty = false
, which stops Text objects from having updateText
called twice on them after creation.
2016-08-25 14:16:48 +01:00
photonstorm
19dbd8bba8
The Weapon.fireRateVariance property was never taken into account internally. It's now applied to the firing rate correctly (thanks @noseglid #2715 )
2016-08-25 13:31:43 +01:00
photonstorm
cbbb2cd97b
Created _rotatedPoint in the constructor, and tidied up code formatting to match the rest of Phaser #2672
2016-08-25 13:12:42 +01:00
Richard Davey
dfbdd59f33
Merge pull request #2672 from bobonthenet/master
...
Weapon.Fire now tracks offset rotation
2016-08-25 13:06:31 +01:00
Richard Davey
d8cb40aa5e
Merge pull request #2700 from kjav/patch-2
...
Fixed typo in TileSprite.js comment
2016-08-25 13:04:31 +01:00
photonstorm
ad0e4aca2e
Large batch of jshint fixes.
2016-08-25 13:03:41 +01:00
bobonthenet
7da5604500
Use this.rotatedPoint instead of a new object
2016-08-22 21:36:49 -04:00
samme
b05becf962
Correct docs:
...
* `angularAcceleration`, `angularDrag`, and `angularVelocity` are measured in degrees.
* `angle` describes `velocity` and is unrelated to angular motion
2016-08-22 12:05:12 -07:00
photonstorm
cbef6d6648
Formatting fix.
2016-08-22 18:38:40 +01:00
photonstorm
11b0436a26
Fixed Arcade Physics Circle body collision, after the #2654 change broke it unintentionally.
2016-08-22 16:23:22 +01:00
photonstorm
92fc28010b
Tidying up formatting.
2016-08-22 13:37:46 +01:00
photonstorm
7b9c4114b2
Preparing for 2.6.2 release.
2016-08-22 12:31:02 +01:00
Richard Davey
19342fa3af
ArcadePhysics Body.rotation now reads its initial value from sprite.angle instead of sprite.rotation. The property was immediately replaced with the correct value in Body.preUpdate regardless, but it keeps it consistent (thanks @samme #2708 )
2016-08-21 10:27:58 +01:00
photonstorm
4382944a2e
A tinted Texture in Canvas mode wouldn't be updated properly if it was also cropped, beyond the initial crop. Now a cropped texture will re-tint itself every time the crop is updated, and has changed (thanks @phoenixyjll #2688 )
2016-08-18 15:55:13 +01:00
kjav
314b088975
Fixed typo in TileSprite.js comment
...
Changed typo 'etch' in TileSprite.js to 'etc'. Related to pull request #2699
2016-08-18 15:40:19 +01:00
photonstorm
04e70e820c
Updated KeyCode docs placement #2653
2016-08-18 15:35:43 +01:00
Richard Davey
33748ece87
Merge pull request #2697 from hilts-vaughan/fix-sound-loop
...
Sound: Fixes an issue where loopFull would not return the soundinstan…
2016-08-18 15:29:18 +01:00
Vaughan Hilts
067f3cca83
Sound: Fixes an issue where loopFull would not return the soundinstance that it looped from
2016-08-17 22:15:45 -04:00
James
e90619b40e
changed return value of Plugin.Weapon's fire, fireAtXY, fireAtPointer, fireAtSprite to Phaser.Bullet
2016-08-17 18:24:24 -05:00
photonstorm
bfb12d9dba
Fixed code formatting.
2016-08-17 11:28:08 +01:00
Richard Davey
a12157d77e
Merge pull request #2691 from hexus/dev
...
Fixed widthInPixels/heightInPixels for JSON tilemaps and TilemapLayerGL display width/height
2016-08-16 21:17:08 +01:00
Richard Davey
a4de55c419
Merge pull request #2685 from valent-novem/dev
...
Fix rendering text with bounds and resolution
2016-08-16 21:12:57 +01:00
Richard Davey
435ff9a420
Merge pull request #2664 from jayrobin/fix-fractional-anim-speed
...
Allow animation speed greater than 0
2016-08-16 21:10:49 +01:00
Richard Davey
49e40fc2d4
Typo
2016-08-16 20:59:59 +01:00
Chris Andrew
50fc2cf0c3
Fixed TilemapLayerGL bugs regarding display width and height.
2016-08-15 14:56:07 +01:00
Chris Andrew
e30ade0a67
Fixed incorrectly parsing widthInPixels/heightInPixels for JSON tilemaps.
2016-08-15 14:46:05 +01:00
Sergey Z
68fe8b8058
Fix rendering text with bounds and resolution
2016-08-08 16:51:07 +03:00
pjbaron
906e00cec1
Minor optimisation and clean up.
2016-08-08 11:14:57 +12:00
Felipe Alfonso
b84e6efbfe
Merge branch 'dev' into texture-compression-webgl
2016-08-07 17:49:15 -04:00
Felipe Alfonso
ce9e9fbd6c
Dynamic loading of compressed textures.
2016-08-07 17:47:55 -04:00
Richard Davey
a41f62a37a
Merge pull request #2671 from fmflame/display-object-container-dimensions-fix
...
Fix for DisplayObject/DisplayObjectContainer - getting dimensions or bounds do NOT retrieve proper values
2016-08-03 12:38:07 +01:00
Richard Davey
a0c6ae6c51
Phaser.Image now has the ScaleMinMax component.
2016-08-03 05:00:09 +01:00
Richard Davey
e955cf4222
Sound.play would throw the error "Uncaught DOMException: Failed to execute 'disconnect' on 'AudioNode': the given destination is not connected." in Chrome, if you tried to play an audio marker that didn't exist, while a valid marker was already playing.
2016-08-03 04:04:22 +01:00
Filip Nedyalkov
64a02ddef4
fixed top, bottom, left, right, centerX and centerY to use the updated getBounds and compute their values depending on the parent local coordinate space. I think this is better than using the global getBounds and a lot more convenient because it makes total sense x and centerX for example to be from the same coordinate space and also with this change now these values would be working when the group is a top level display object and also when it is parented by something else. So this loosens the global only getBounds restriction. Also it doesn't really makes sense to align objects with totally different parents but if that is the case separate calculations could be made.
2016-08-02 17:47:35 +03:00
Felipe Alfonso
5ce4643dfa
Compressed textures are able to upload to GPU
2016-08-01 19:40:35 -04:00
Felipe Alfonso
100aa413bf
Texture loading depending on webgl extensions included default truecolor
2016-08-01 16:27:39 -04:00
bobonthenet
6df44bd21a
Apparently I didn't fix them the first time
2016-07-29 19:38:37 -04:00
bobonthenet
6d7b84b10e
Fixed jshint errors
2016-07-29 19:24:49 -04:00
Robert Bedard
383f14cb3f
Weapon.Fire now tracks offset rotation
2016-07-29 15:08:29 -04:00
Filip Nedyalkov
aad2ab398a
fixed a typo;
2016-07-29 20:06:06 +03:00
Felipe Alfonso
0cbe8969d1
Merge branch 'dev' into texture-compression-webgl
2016-07-28 23:04:27 -04:00
Felipe Alfonso
4b3d449a3d
compression algorithm name passed during parsing
2016-07-28 23:02:34 -04:00
Richard Davey
a532f7b2c4
Optimised Math.getShortestAngle.
2016-07-29 03:58:25 +01:00
Richard Davey
688752c5de
Math.getShortestAngle will return the shortest angle between the two given angles. Angles are in the range -180 to 180, which is what Sprite.angle
uses. So you can happily feed this method two sprite angles, and get the shortest angle back between them ( #2494 )
2016-07-29 03:39:51 +01:00
Richard Davey
3c3d09e46a
Docs update.
2016-07-29 03:39:51 +01:00
Richard Davey
fb5ba0aa62
Bail out if no parent.
2016-07-29 03:39:51 +01:00
Richard Davey
24368ef8d7
Docs update.
2016-07-29 03:39:51 +01:00
Felipe Alfonso
8960cf26d7
texture meta data parsed and saved in cache
2016-07-28 21:33:31 -04:00
Felipe Alfonso
1b9f25b820
texture binary loading.
2016-07-28 18:42:46 -04:00
Filip Nedyalkov
7b4d6a65ca
fixed getLocalBounds() to return the bounds of the DisplayObject without transformations and adjusted width and height to work the way they did before to be compatible with how PIXI used to work.
2016-07-28 21:41:34 +03:00
Felipe Alfonso
08ec080f67
PVR, DDS, KTX and PKM parsing implemented on LoaderParser.js
2016-07-27 19:47:05 -04:00
Felipe Alfonso
f68f454620
Fix Tiling Sprite mask and filter
2016-07-27 12:49:42 -04:00
Felipe Alfonso
1711266ff8
Fixed multi texture support on tiling sprite.
2016-07-27 00:36:20 -04:00
Felipe Alfonso
6e35817675
Fixed issue with multiple "texture not bound to unit X" webgl warning
2016-07-26 11:49:21 -04:00
photonstorm
3e1595ffaf
Removed debugger calls.
2016-07-26 14:57:48 +01:00
photonstorm
f246c276cb
Multi-Texture support has now been built into our version of Pixi. This can offer dramatic performance increases in WebGL games on GPUs that support multiple texture bindings (which is most of them these days).
...
WebGLRenderer.setTexturePriority is the method used to set the priority of textures when the GPU supports multi-texture batching.
Rope has two new properties `textureIndices` and `textureIndex` to handle multi-texture support.
Strip has two new properties `textureIndices` and `textureIndex` to handle multi-texture support.
The following shaders have all been updated to support multi-textures: `ComplexPrimitiveShader`, `PixiFastShader`, `PixiShader`, `PrimitiveShader`, `StripShader`.
WebGLFastSpriteBatch.vertSize was increased from 10 to 11.
BaseTexture.textureIndex is a new property that controls the index of the texture within the GPU texture cache. Usually you don't change this yourself, and use `renderer.setTexturePriority` instead, but the property is public and available for more advanced use-cases.
CanvasRenderer.setTexturePriority is an empty function, but included to allow you to simply call `game.renderer.setTexturePriority` without first having to wrap that in a WebGL check.
2016-07-26 14:56:12 +01:00
photonstorm
dfaf0b99dd
Merge branch 'multitexture-gl' into dev
2016-07-26 14:47:26 +01:00
photonstorm
2318fec65c
Start of a Particle base class.
2016-07-26 14:31:36 +01:00
photonstorm
86affde81b
The file pixi/utils/Polyk.js has been removed, as it was no longer used with Pixi or Phaser (we replaced it with EarCut a while ago)
2016-07-26 14:30:06 +01:00
Filip Nedyalkov
566c781f26
Merge remote-tracking branch 'refs/remotes/photonstorm/dev' into display-object-container-dimensions-fix
2016-07-26 14:10:15 +03:00
Filip Nedyalkov
c56bc766cc
Overrided getLocalBounds() for PIXI Sprite, Strip and Graphics
...
Since they override the getBounds of the DisplayObjectContainer, the
getLocalBounds should also be overriden for them to properly work.
2016-07-26 14:01:35 +03:00
James Robinson
118d2057c0
Allow animation speed greater than 0
2016-07-25 19:43:19 -07:00
Felipe Alfonso
4d09b31560
Merge branch 'dev' into multitexture-gl
2016-07-25 15:50:57 -04:00
Richard Davey
9654a4b3c5
Consolidating Layers into View class.
2016-07-25 01:39:46 +01:00
Richard Davey
19e609185a
Math.rotateToAngle takes two angles (in radians), and an interpolation value, and returns a new angle, based on the shortest rotational distance between the two.
2016-07-25 00:39:38 +01:00
Richard Davey
8d4a72c9d7
Phaser 2.7.0 Beta 3
2016-07-23 15:05:52 +01:00
Richard Davey
b69cae4206
The methods setStageReference
and removeStageReference
have been removed from all Pixi classes. Objects no longer have stage
properties, or references to the Stage object. This is because no reference to the Stage is required for any calculations, and Phaser can only have 1 Stage, so adding and removing references to it were superfluous actions.
2016-07-23 14:31:17 +01:00
Richard Davey
ce764e098d
As a result of changes in #2573 Graphics objects were calling updateLocalBounds
on any shape change, which could cause dramatic performances drops in Graphics heavy situations ( #2618 ). Graphics objects now have a new flag _boundsDirty
which is used to detect if the bounds have been invalidated, i.e. by a Graphics being cleared or drawn to. If this is set to true then updateLocalBounds
is called once in the postUpdate
method (thanks @pengchuan #2618 )
2016-07-23 12:52:35 +01:00
Richard Davey
fb1a7f13cb
Merge pull request #2639 from fmflame/display-object-container-dimensions-fix
...
Fix for DisplayObject/DisplayObjectContainer - getting dimensions or bounds do NOT retrieve proper values
2016-07-23 12:18:06 +01:00
Richard Davey
02d078500c
Merge pull request #2656 from leopoldobrines7/documentHidden-compatibility
...
Check if hidden is available first
2016-07-23 12:09:00 +01:00
Richard Davey
6947057427
The property checkCollision.none
in the ArcadePhysics.Body class was available, but never used internally. It is now used and checked by the separate
method. By setting checkCollision.none = true
you can disable all collision and overlap checks on a Body, but still retain its motion updates (thanks @samme #2661 )
2016-07-23 10:01:38 +01:00
Richard Davey
ab739bdce0
Added back in undefined Tileset check.
2016-07-23 09:43:20 +01:00
Richard Davey
46c20ab00a
The property checkCollision.none
has been removed from the ArcadePhysics.Body class. It was never used internally, so lead to confusion about its use. To disable a body, use body.enable = false
(thanks @samme #2661 )
2016-07-23 09:43:01 +01:00
photonstorm
30e9273eb8
Removed console.log.
2016-07-22 17:38:46 +01:00
photonstorm
3ba00bbf2d
Loads of work on tilemap collision, and offset support. You can now collide with a tilemap no matter where it is on the screen, or which layer it's from.
2016-07-22 17:02:10 +01:00
photonstorm
0e25c5acac
Revert getTiles call.
2016-07-22 14:08:54 +01:00
photonstorm
9fb27b6fe2
Moving all the getTiles calls back again, as it's just a bit TOO API breaking to move them, for the sake of a few KB.
2016-07-22 14:05:35 +01:00
Richard Davey
d8560eb3bc
Fixed Tilemap collision.
2016-07-22 04:32:56 +01:00
Richard Davey
d14250304c
Defs update.
2016-07-22 04:19:17 +01:00
Richard Davey
91b9513e7e
TilemapLayer.getTileX, getTileY and getTileXY all now required a Phaser.TilemapLayer (or Phaser.TilemapLayerGL) as the first argument.
...
Tilemap.getRayCastTiles now requires a Phaser.TilemapLayer (or Phaser.TilemapLayerGL) as the first argument.
Tilemap.getTiles now requires a Phaser.TilemapLayer (or Phaser.TilemapLayerGL) as the first argument.
2016-07-22 04:10:55 +01:00
Richard Davey
0301330c2d
jshint fixes.
2016-07-22 03:59:10 +01:00
Richard Davey
020cb01056
Canvas tilemap renderer fixes.
2016-07-22 03:55:21 +01:00
Felipe Alfonso
062c7cd95a
Added setTexturePriority function to WebGLRenderer
2016-07-21 22:34:27 -04:00
Richard Davey
be92e41366
The private methods TilemapLayer._fixX
, _unfixX
, _fixY
and _unfixY
have been moved to `Tilemap.
2016-07-22 03:20:56 +01:00
Richard Davey
ef9f53e350
TilemapLayer.getRayCastTiles has been moved to Tilemap.getRayCastTiles.
...
TilemapLayer.rayStepRate has been moved to Tilemap.rayStepRate.
TilemapLayer.getTiles has been moved to Tilemap.getTiles.
2016-07-22 03:03:50 +01:00
Felipe Alfonso
1755bfd779
Merge branch 'dev' into multitexture-gl
2016-07-21 21:51:14 -04:00
Felipe Alfonso
44774d648e
Final implementation related to multi texture batching
2016-07-21 21:49:29 -04:00
Richard Davey
f669202fb4
Loads of refactoring. Removed the internal layer creation, added in first/last gid detection, sorted out multiple identical layer creation.
2016-07-22 02:39:35 +01:00
Richard Davey
9eff79f2c2
Phaser.Tileset has a new property lastgid
which is populated automatically by the TilemapParser when importing Tiled map data, or can be set manually if building your own tileset.
2016-07-22 02:35:33 +01:00
Richard Davey
91e7b2ca9c
Updated properties.
2016-07-22 00:30:55 +01:00
Pete Baron
8c6fec0e97
Apply "half pixel correction" to the source coordinates for tiles when drawing with WebGL.
2016-07-22 11:30:06 +12:00
Richard Davey
8832680aa0
Exposed 'width' and 'height' properties on TilemapLayer, so it can be resized and update all children.
2016-07-22 00:09:31 +01:00
Richard Davey
ed9793e06b
Removed un-needed baseTexture dirty call.
2016-07-21 22:55:10 +01:00
Richard Davey
e384724b28
Doesn't need to extend DoC, can extend DO instead.
2016-07-21 22:54:39 +01:00
photonstorm
6661952d50
Masses of changes to get tilemap layer display dimensions filtering down to linked child layers. Also allowed offset to work correctly, and fixed the display sizes with offset bounds. Exposed offset as layer.x/y. Need to duplicate in canvas variation.
2016-07-21 16:56:17 +01:00
Pete Baron
d994641d52
Don't scale the clip offset value when the layer is scaled.
2016-07-22 00:23:05 +12:00
Pete Baron
3faca89831
oops my bad: rename
2016-07-22 00:12:56 +12:00
Pete Baron
7c2dae0773
Add offset parameter to TilemapLayerGL and use it with clipping to draw a view into a map at a specified location and size in the game window.
2016-07-22 00:02:05 +12:00
Richard Davey
c36babcc1c
Code formatting and docs updates.
2016-07-21 10:45:23 +01:00
Felipe Alfonso
40b4b2dbd0
added multi texture to WebGLFastSpritebatch and Strip (wip)
2016-07-21 01:57:39 -04:00
Pete Baron
aecbd7c267
Add width/height to debug log for new layers.
2016-07-21 17:13:12 +12:00
Pete Baron
29c77e10d7
Send layer width/height to PIXI.Tilemap (previously these were ignored and forgotten after the c'tor).
...
Modify resize to set displayWidth/displayHeight only.
2016-07-21 17:12:46 +12:00
Pete Baron
008de253ce
Add displaywidth/height parameters to PIXI.Tilemap c'tor and save them.
...
Clean up _initWebGL to remove unused GL buffers.
Clean up _renderBatch to remove unused srcWide/srcHigh variables.
Set new Tile Shader's clipping uniform using displayWidth/Height.
2016-07-21 17:10:51 +12:00
Pete Baron
5f55fb095e
Tile shader uses clipping dimensions when drawing.
2016-07-21 17:07:50 +12:00
Pete Baron
42a2608036
Fix createInternalLayer to use the 'base layer' rather than assume this.layers[0] was the base layer for each new one. This makes the multi-tileset, multi-layer demos work correctly.
2016-07-21 16:27:35 +12:00
Pete Baron
37a9f4fa01
Remove console warn for invalid tile index as it was firing incorrectly (when processing a base layer which only uses tiles from another tileset).
2016-07-21 16:26:32 +12:00
Pete Baron
f958567a48
Remove more dead code.
2016-07-21 15:24:05 +12:00
Pete Baron
7454eb0aa0
Add console warning when invalid tile index is used.
2016-07-21 15:23:37 +12:00
Pete Baron
70f95d2558
Remove dead code (commented out).
...
Add flag to detect when an 'internal layer' is not needed (none of the specified tileset is used in the parent layer) and skip creating one.
2016-07-21 14:58:25 +12:00
Pete Baron
f9ff1d10c5
Apply rendersession.offset to the TilemapShader (fixes screen shake).
2016-07-21 14:16:17 +12:00
Richard Davey
5ecdee86c2
Merging in flipped tile support.
2016-07-21 02:32:08 +01:00
Richard Davey
79e135087f
ScaleManager.hasPhaserSetFullScreen is a new boolean that identifies if the browser is in full screen mode or not, and if Phaser was the one that requested it. As it's possible to enter full screen mode outside of Phaser, and it then gets confused about what bounding parent to use.
2016-07-21 02:11:16 +01:00
Filip Nedyalkov
d18f303d28
Fixed formatting to match the general formatting of the code
2016-07-21 03:38:41 +03:00
Filip Nedyalkov
7206453126
Just removed some whitespace I don't remember adding it...
2016-07-21 03:32:41 +03:00
Leopoldo Brines
1e7cd986ee
Check if hidden is available first
2016-07-20 20:04:25 -04:00
Richard Davey
b90d7b28f8
Merge pull request #2654 from leopoldobrines7/fix-function
...
Fix 'TypeError: target.center is undefined'
2016-07-21 00:26:16 +01:00
Filip Nedyalkov
4f21e70852
Fix for PIXI's DisplayObject/DisplayObjectContainer - getting correct dimensions and bounds
...
With the previous fix what the getBounds did was:
1) if targetCoordinateSpace is the same instance as the caller of
getBounds(), then it will return the bounds of the caller without any
transformations;
2) if targetCoordinateSpace is null/undefined it will return the global
bounds of the caller.
3) if targetCoordinateSpace is any valid DisplayObject it will return
the local bounds of the caller.
What this fix does is fixing 3) along with other obsolete code that
wasn't necessary so I reverted it.
So now if the targetCoordinateSpace is a valid DisplayObject:
- if it's a parent of the caller at some level it will return the bounds
relative to it
- if it's not parenting the caller at all it will get global bounds of
it and the caller and will calculate the x and y bounds of the caller
relative to the targetCoordinateSpace DisplayObject
Also I have fixed how empty groups are treated when they have no other
children except groups, so now calculations are correct. They obviously
have 0 width and height but are still being positioned and other things
could possibly relate to that bounds and it didn't make sense to me to
ignore them.
Also added a DisplayObjectContainer.contains(child) method which
determines whether the specified display object is a child of the
DisplayObjectContainer instance or the instance itself. This method is
used in the new getBounds function.
Corrected DisplayObject's default _bounds rect from (0, 0, 1, 1), to (0,
0, 0, 0) - it doesn't seem to break anything and also in the getBounds
before the fix, when there were no children it assigned a (0, 0, 0, 0)
rectangle to it so I am pretty sure it's safe to correct it.
2016-07-21 02:14:10 +03:00
Richard Davey
b9d34ca843
Added debug object back in.
2016-07-20 23:44:41 +01:00
Leopoldo Brines
18472f5998
Fix 'TypeError: target.center is undefined'
2016-07-20 18:34:02 -04:00
Richard Davey
d982003760
Lots more tidying up and adding jsdocs.
2016-07-20 20:06:59 +01:00
Richard Davey
ca6985e2f2
Removed lots of redundant code and tidied up bad formatting.
2016-07-20 19:27:32 +01:00
Richard Davey
7645e773dc
More tidying and jshint fixing.
2016-07-20 17:28:19 +01:00
Richard Davey
82fb296b2a
Code formatting issues.
2016-07-20 17:00:00 +01:00
Richard Davey
49fb798f60
Fixed createInternalLayer loop.
2016-07-20 16:24:06 +01:00
Richard Davey
cff28860fa
The Loader.headers object has a new property requestedWith
. By default this is set to false
, but it can be used to set the X-Requested-With
header to XMLHttpRequest
(or any other value you need). To enable this do this.load.headers.requestedWith = 'XMLHttpRequest'
before adding anything to the Loader #2398
2016-07-20 12:45:11 +01:00
Richard Davey
60b8d78ab8
Group.align updates.
2016-07-20 12:29:30 +01:00
Richard Davey
8139d484a3
Merge pull request #2649 from boniatillo-com/boniatillo-com-patch-jsdoc-intersectsRectangle
...
jsdoc fix: complete the Phaser.Line.intersectsRectangle @method tag
2016-07-20 12:10:47 +01:00
Richard Davey
29a2f65922
Merge pull request #2648 from boniatillo-com/jsdoc-fixes
...
jsdoc fix: replace #onTop for #onCeiling
2016-07-20 12:10:20 +01:00
Richard Davey
dc6d3e2680
Merge pull request #2643 from deargle/group-align-documentation-fix
...
fix documentation for group.align -- row and column were swapped
2016-07-20 12:08:22 +01:00
Richard Davey
418c87ea1a
Weapon.autofire wouldn't fire after the first bullet, or until fire
was called, neither of which are requirements. If you now set this boolean the Weapon will fire continuously until you toggle it back to false (thanks @alverLopez #2647 )
2016-07-20 11:52:48 +01:00
Richard Davey
1105e4821d
Added more info to console.warn.
2016-07-20 04:53:21 +01:00
Felipe Alfonso
6d21a4ca18
First working example of multi texture support
2016-07-19 23:17:13 -04:00
Felipe Alfonso
1f72355e8a
Fixed issue with disabled vertex attribute
2016-07-19 22:06:37 -04:00
Felipe Alfonso
601573b62c
working on setting up texture index on vertex buffer object.
2016-07-19 21:32:38 -04:00
Boniatillo.com
a465a0e8c7
jsdoc fix: complete the Phaser.Line.intersectsRectangle @method tag
...
complete the @method tag of Phaser.Line.intersectsRectangle with the class prefix.
2016-07-19 08:51:51 -04:00
Boniatillo.com
881dca3cc5
Fix jsdoc: change to #audioSprite
...
The Phaser.Loader.audioSprite method is using #audiosprite in its jsdoc. Here it is changed to #audioSprite.
2016-07-19 08:41:39 -04:00
Boniatillo.com
3d1b10c310
jsdoc fix: replace #onTop for #onCeiling
...
Modified the jsdoc of Phaser.Arcade.Body.onCeiling, by replacing the #onTop reference for #onCeiling.
2016-07-19 08:32:34 -04:00
Felipe Alfonso
bb53624418
Merge branch 'dev' into multitexture-gl
2016-07-18 22:54:34 -04:00
Felipe Alfonso
f97b0c4016
Moved texture index to vertex buffer to avoid memory overhead
2016-07-18 22:50:44 -04:00
Dave Eargle
209b588f8b
fix documentation for group.align -- row and column were swapped
2016-07-18 20:39:32 -04:00
Richard Davey
3574d86bba
Code formatting and copyright text.
2016-07-18 23:39:09 +01:00
Richard Davey
1e181fa30d
Tidying up new Tilemap classes.
2016-07-18 23:24:49 +01:00
Richard Davey
d3e460567b
Updated config to handle WebGL Tilemap renderer for testing.
2016-07-18 23:05:03 +01:00
Richard Davey
8d1b670df1
Merge remote-tracking branch 'origin/webgl-tilemap' into dev
2016-07-18 23:00:35 +01:00
Pete Baron
e3f402ec06
Clean-up and comments.
2016-07-18 13:28:20 +12:00
Pete Baron
550954210e
Clean-up and comments.
2016-07-18 13:24:29 +12:00
Pete Baron
9daf6d0525
Clean-up and comments.
2016-07-18 13:19:15 +12:00
Pete Baron
5f6ea15c58
Clean-up and comments.
2016-07-18 13:09:43 +12:00
Pete Baron
263238ba42
Comments and clean-up.
2016-07-18 12:56:34 +12:00
Pete Baron
fdb80f1a55
Modify Tile Shader to produce scaled layers that look identical to the Canvas renderer scaling (add uCentreOffset, scale the drawing coordinates, subtract uCentreOffset).
2016-07-18 12:43:59 +12:00
Pete Baron
0b392e19a2
Remove unused precalculated u/v scale factor.
2016-07-18 12:41:32 +12:00
Pete Baron
e87fc84527
comment - Tile.scale is currently unused
2016-07-18 12:40:08 +12:00
Filip Nedyalkov
483a3b6836
Fix for DisplayObject/DisplayObjectContainer - getting dimensions or bounds do NOT retrieve proper values
...
* Documentation
* TypeScript Defs
* Nothing, it's a bug fix
Describe the changes below:
I noticed that getting dimensions or bounds changed in Phaser 2.6.1 and
it was bugged - returned dimensions were doubled in the direction of the
scaling for example, but the nice thing was that this time the
dimensions included the rotation of the object - which I think should be
the default behavior. It also bugged getLocalBounds which started
returning global getBounds();
When I checked the previous version of phaser 2.5.0 - total different
story. getLocalBounds returns the object without any transformations to
it. Getting width and height works ok, but rotation wasn't calculated to
the dimensions at all.
In all cases only getBounds returned proper dimensions, which is
obviously not enough and this is also a very important issue to be
resolved as soon as possible since it's a major core component feature
used all the time.
That's why I decided to spare the time and hopefully find a good fix for
all of this mess and I think I finally got there and tried to make the
changes as much as possible with your Code of Conduct. This is actually
the first time I am requesting a pull so I hope it will do some good. I
did compare my results with how Flash handles dimensions - they match,
so I do hope I didn't miss something and believe you guys would make
sure everything works ok.
To help you with reviewing and possibly (and hopefully) accepting this
pull request I've made available online 3 demos of the issues and with
demo of the fix of course:
1.
http://www.nedyalkov.net/filip/demos/phaser/IncorrectDisplayObjectDimensionsDemo_v2.5.0/
2.
http://www.nedyalkov.net/filip/demos/phaser/IncorrectDisplayObjectDimensionsDemo_v2.6.1/
3.
http://www.nedyalkov.net/filip/demos/phaser/IncorrectDisplayObjectDimensionsDemoFixed_v2.6.1/
Here is a zip file of the demo projects (build with VS2015):
http://www.nedyalkov.net/filip/demos/phaser/IncorrectDisplayObjectDimensionsDemos.zip
I really hope to see this FIX in the next version - would help me and a
lot of people I guess to get the job done properly!
Thank you!
2016-07-18 02:32:29 +03:00
Richard Davey
b405570833
Docs fix #2624
2016-07-17 11:26:09 +01:00
Richard Davey
6f9bcae23e
Docs fixes #2629
2016-07-17 11:23:41 +01:00
Richard Davey
0765e9eaa6
Merge pull request #2634 from greeny/hotfix-bitmapdata-fluent
...
BitmapData.js: fixed fluent interface
2016-07-17 11:20:40 +01:00
Richard Davey
776c148a93
Fixed jshint errors.
2016-07-16 08:04:56 +01:00
Tomáš Blatný
2b90f2cb3b
BitmapData.js: fixed fluent interface
2016-07-15 20:16:35 +02:00
Felipe Alfonso
44d9f08c06
Merge branch 'dev' into multitexture-gl
2016-07-14 19:45:28 -04:00
Felipe Alfonso
e73837aa77
Texture Index working on common shaders. Still need to disable draw call for texture changing
2016-07-14 19:44:10 -04:00
Felipe Alfonso
2f41d9cf57
Sampler Array working correctly for WebGLSpriteBatch + PixiShader
2016-07-13 00:40:32 -04:00
Felipe Alfonso
9aa71e5e90
Added comments to shaders to help with debugging with WebGL Inspector.
2016-07-12 23:30:30 -04:00
Richard Davey
a01f59d82d
Added Path Manager Plugin.
2016-07-13 03:08:03 +01:00
Richard Davey
4548d70369
Experimenting with new MainLoop + position interpolation. (reverted from commit e49d45e278
)
2016-07-13 02:44:35 +01:00
Richard Davey
e49d45e278
Experimenting with new MainLoop + position interpolation.
2016-07-12 03:05:29 +01:00
Richard Davey
265501b4af
The src/system folder has been removed and all files relocated to the src/utils folder. This doesn't change anything from an API point of view, but did change the grunt build scripts slightly.
2016-07-11 22:38:09 +01:00
photonstorm
9b4bb1bdd8
Group.getRandomExists will return a random child from the Group that has exists set to true.
...
Group.getAll will return all children in the Group, or a section of the Group, with the optional ability to test if the child has a property matching the given value or not.
Group.iterate has a new `returnType`: `RETURN_ALL`. This allows you to return all children that pass the iteration test in an array.
2016-07-11 17:05:42 +01:00
photonstorm
1467eb48cf
A Group with inputEnableChildren
set would re-start the Input Handler on a Sprite, even if that handler had been disabled previously.
2016-07-11 14:17:51 +01:00
photonstorm
94498fcd32
The InputHandler.flagged property has been removed. It was never used internally, or exposed via the API, so was just overhead.
2016-07-11 14:17:41 +01:00
photonstorm
9aef9b741c
Preparing for 2.6.2 dev.
2016-07-11 10:30:09 +01:00
photonstorm
ac2516f5aa
2.6.1 Release.
2016-07-11 10:07:56 +01:00
Richard Davey
cfb2b813ef
Fixed Uncaught TypeError: Cannot set property 'x' of undefined
in Body.js (thanks @ErwanErwan #2607 )
2016-07-08 18:54:00 +01:00
photonstorm
aaa9f0d61a
Preparing for 2.6.1 dev.
2016-07-08 16:18:59 +01:00
photonstorm
fced3f86ec
Phaser 2.6.0 Release.
2016-07-08 15:46:26 +01:00
photonstorm
8a8fa0297d
Preparing for release.
2016-07-08 14:26:31 +01:00
photonstorm
61ce14f332
P2.World.clear will now clear out the World.walls property, resetting all of the wall bounds to null
. This allows the walls to be re-created accurately when the P2 World is reset, which happens on a State change or restart (thanks @ewpolly1 @codermua #2574 )
2016-07-08 13:02:58 +01:00
photonstorm
521a6c9dbb
Sound.stop will check to see if gainNode
exists before trying to disconnect from it.
2016-07-08 12:27:12 +01:00
photonstorm
c34c7bae4e
Docs updates.
2016-07-08 12:04:28 +01:00
photonstorm
dfd9203e0a
onWorldBounds now sends the bounds it collided with.
2016-07-08 11:28:45 +01:00
photonstorm
ee202667ed
Huge docs update for all of the Game Object events.
2016-07-08 11:28:30 +01:00
Richard Davey
0014201917
Groups now have the following properties, which are getters and setters: centerX
, centerY
, left
, right
, top
and bottom
. These calculate the bounds of the Group, based on all visible children, and then allow you to apply positioning based on that. This means you can, for example, now get the horizontal center of a Group by called Group.centerX
. These properties are also setters, so you can position the Groups, and it will take scale and rotation into consideration.
...
Groups have a new method `alignIn`. It allows you to align the Group within another Game Object, or a Rectangle. You can specify one of 9 positions which are the new position constants such as: `Phaser.TOP_LEFT` or `Phaser.CENTER` (see docs for the complete list). The Groups are positioned based on their child bounds, which takes rotation and scaling into consideration. You can easily place Groups into the corners of the screen, or game world, or align them within other Sprites, using this method.
Groups have a new method `alignTo`. It allows you to align a Group to the side of another Game Object, or a Rectangle. You can specify one of 11 positions which are the new position constants such as: `Phaser.TOP_LEFT` or `Phaser.LEFT_BOTTOM` (see docs for the complete list). The Groups are positioned based on their child bounds, which takes rotation and scaling into consideration. You can easily align Groups next to other Sprites using this method.
2016-07-08 01:33:42 +01:00
Richard Davey
410237881e
PIXI.DisplayObjectContainer calls updateTransform
at the start of getBounds
to help avoid the bounds being out of date.
2016-07-08 01:06:25 +01:00
Richard Davey
c0ba439e82
ArcadePhysics.Body.onCollide is a new Signal that is dispatched whenever the Body collides with another Body. Due to the potentially high volume of signals this could create it is disabled by default. To use this feature set this property to a Phaser.Signal: sprite.body.onCollide = new Phaser.Signal()
and it will be called when a collision happens, passing two arguments: the sprites which collided.
...
ArcadePhysics.Body.onOverlap is a new Signal that is dispatched whenever the Body overlaps with another Body. Due to the potentially high volume of signals this could create it is disabled by default. To use this feature set this property to a Phaser.Signal: `sprite.body.onOverlap = new Phaser.Signal()` and it will be called when an overlap happens, passing two arguments: the sprites which collided.
2016-07-07 23:16:18 +01:00
Richard Davey
6ba3c9401f
ArcadePhysics.Body.setCircle is a new method that allows you to define an Arcade Physics Body as being a circle instead of a rectangle. You can control the radius of the body and the offset from the parent sprite.
...
ArcadePhysics.World.separateCircle is a new method that handles all circular body collisions internally within Arcade Physics (thanks @VitaZheltyakov)
All of the Arcade Physics internal methods, such as `collideGroupVsSelf`, `collideSpriteVsSprite` and so on, have been updated to work with circular body shapes (thanks @VitaZheltyakov)
ArcadePhysics.Body.onWorldBounds is a new Signal that is dispatched whenever the Body collides with the world bounds, something that was previously difficult to detect. Due to the potentially high volume of signals this could create it is disabled by default. To use this feature set this property to a Phaser.Signal: `sprite.body.onWorldBounds = new Phaser.Signal()` and it will be called when a collision happens, passing one argument: the sprite on which it occurred.
2016-07-07 21:58:39 +01:00
photonstorm
261155a683
Merged the arcade-circles branch back into 2.6 and tidied up lots of the source code. Needs checking as not working properly with rect vs. circle, but fine with circle vs. circle.
2016-07-07 16:45:10 +01:00
Richard Davey
97bba5f3c7
toABGR updated.
2016-07-06 22:40:05 +01:00
Richard Davey
d93019e86b
Moved to 2.6.0
2016-07-06 22:40:00 +01:00
Richard Davey
63158a1dbf
Argument swapped for destroyBaseTexture
.
2016-07-06 22:31:26 +01:00
Richard Davey
c4d7870a31
* PIXI.Texture.fromImage, PIXI.BaseTexture.fromImage and PIXI.Sprite.fromImage have all been removed. They should never have actually been used, as they bypass the Phaser Loader, and don't factor in CORs or any other advanced loader settings.
...
* The PIXI.BaseTexture.imageUrl property has been removed, as it was never actually populated.
* The PIXI.BaseTexture._UID property has been removed, as it was never actually used internally.
* All references to PIXI.BaseTextureCache have been removed (primarily from BaseTexture.destroy and Texture.destroy), as the BaseTextureCache was never used internally by Phaser, or by our custom version of Pixi.
* PIXI.TextureCache has been removed. It was only ever used by the __default and __missing images that Phaser generates on start-up. It wasn't used internally by Phaser anywhere else, and the only references Pixi has to it have all been removed. If you need it in your own game, please refactor it to avoid it, or re-create the object on the PIXI global object.
* Canvases created by `BaseTexture.fromCanvas` no longer have the `_pixiId` property attached to them, as this was never used internally by Phaser or Pixi.
* PIXI.BaseTexture.updateSourceImage is now deprecated. Please use `Sprite.loadTexture` instead.
* The property PIXI.BaseTextureCacheIdGenerator has been removed, as it is no longer used internally by Phaser or Pixi.
* PIXI.Texture.addTextureToCache has been removed. The PIXI Texture Cache was never actually used by Phaser, and was leading to complications internally.
* PIXI.Texture.removeTextureFromCache has been removed. The PIXI Texture Cache was never actually used by Phaser, and was leading to complications internally.
* PIXI.Texture.fromFrame and PIXI.Sprite.fromFrame have been removed. They relied on the PIXI Texture Cache, which was never actually used by Phaser, and was never used internally by Pixi either.
* The property PIXI.TextureCacheIdGenerator has been removed, as it was not used internally.
* The property PIXI.FrameCache has been removed, as it was not used internally.
2016-07-06 21:47:27 +01:00
Richard Davey
440e2afe7c
* PIXI.CanvasPool no longer _just_ checks for null
parent comparisons. It will check for all falsey parents, helping free-up canvases when the parent objects have been removed elsewhere.
...
* PIXI.CanvasPool.remove and `removeByCanvas` both now set the removed canvas width and height to 1.
2016-07-06 21:47:05 +01:00
Richard Davey
886c641ddc
* The default image texture, for when none is supplied, is now available under Phaser.Cache.DEFAULT
.
...
* The missing image texture, for when an image has failed to load, is now available under `Phaser.Cache.MISSING`.
* Phaser.Cache.addImage will now check the key given, and if `__default` or `__missing` it will update the new consts `Phaser.Cache.DEFAULT` and `Phaser.Cache.MISSING` accordingly, allowing you to replace the default or missing image textures used by Phaser.
* Phaser.Cache.getPixiTexture has now been removed, as the Pixi Cache isn't used internally anywhere any longer.
* Phaser.Cache.getPixiBaseTexture has now been removed, as the Pixi Cache isn't used internally anywhere any longer.
2016-07-06 21:46:40 +01:00
Richard Davey
8a3c71f050
CanvasPool parent checks are now falsey, not just !== null.
2016-07-06 20:59:42 +01:00
Richard Davey
33150018ad
Text.fontPropertiesCanvas no longer uses a CanvasPool entry.
2016-07-06 20:59:28 +01:00
Richard Davey
3642ff0489
Phaser.Color.toABGR converts RGBA components to a 32 bit integer in AABBGGRR format.
2016-07-04 18:50:42 +01:00
photonstorm
e08e0861d0
Phaser.ArrayUtils.rotate is now deprecated. Please use Phaser.ArrayUtils.rotateLeft instead.
2016-07-04 13:09:36 +01:00
photonstorm
0036bf747f
BitmapData has a new, optional, fifth argument: skipPool
. By default BitmapData objects will ask for the first free canvas found in the CanvasPool, but this behavior can now be customized on a per object basis.
2016-07-04 12:57:08 +01:00
photonstorm
cb0861d881
The canvas created by Phaser.Debug for use when displaying debug data is no longer stored in the CanvasPool, and is instead a stand-alone canvas, free from ever being re-used by another game object.
2016-07-04 12:56:52 +01:00
photonstorm
7ebae00c8f
Phaser 2.5.1 RC1
2016-07-01 16:57:36 +01:00
photonstorm
32bec66031
Docs update.
2016-06-29 16:18:54 +01:00
photonstorm
4066a8d8d8
All Pixi.Graphics methods that change the Graphics, i.e. drawShape
, lineTo
, arc
, etc will now all automatically call Graphics.updateLocalBounds
. This is so that the bounds of the Graphics object are kept updated, allowing you to scale and rotate the Graphics object and still obtain correct dimensions from it (thanks @kelu-smiley #2573 )
2016-06-29 16:18:54 +01:00
Richard Davey
fdcbb9229b
Phaser.ArrayUtils.shift is the opposite of ArrayUtils.rotate. It takes an array, removes the element from the end of the array, and inserts it at the start, shifting everything else 1 space in the process.
2016-06-29 02:08:42 +01:00
Richard Davey
1f570b49e8
Phaser.Utils.pad now calls toString
on the input given, which means you can pass in common data typs such as numbers and have them padded and returned as strings.
2016-06-29 00:04:22 +01:00
Richard Davey
fbd1ba05f7
Phaser.Utils.reverseString will take the given string, reverse it, and then return it.
2016-06-27 22:43:53 +01:00
Richard Davey
a0c771d47e
Text.setText has a new optional argument immediate
which will re-create the texture immediately upon call, rather than wait for the next render pass to do so (thanks @Scraft #2594 )
2016-06-27 22:42:01 +01:00
photonstorm
b24de1e561
Polygon.contains would only work with non-flattened Polygon objects. It now works with both flat and non-flat Polygons.
...
Graphics objects enabled for input would fail to do anything if a Phaser Polygon was given to the Graphics object (which it was in nearly all cases), as it wouldn't detect input correctly with flattened polygons (thanks @symbiane #2591 )
2016-06-27 14:51:25 +01:00
Pete Baron
2a2c82ee3d
Fixed the alpha blending (copied the approach from the TriangleStrip PIXI shader) for Tilemap layers. The "blank tilemap" example now works properly and blends the background layers when you use the number keys to switch primary layers.
2016-06-28 00:28:28 +12:00
Pete Baron
9e3a7ec537
Modified the batch creation code and the batch drawing code to only insert degenerate triangles at the end of rows or when a row is broken (e.g. by some empty tiles which we won't draw at all). This should speed things up by optimising the draw, and reducing the amount of data required to describe the batch.
...
PIXI.Tilemap - _renderBatch using a local 'degenerate' flag to signal to next iteration that one should be inserted before the next triangle.
Phaser.TilemapLayerGL - add degenerate markers at end of rows and whenever a row has a break in it (e.g. empty tiles)
Phaser.Tileset - new addDegenerate function which prevents double markers in a row
2016-06-27 18:24:56 +12:00
Pete Baron
2a4049d5ef
Pass each Tile.alpha value and store it with the glBatch data.
...
NOTE: if implemented this will have to break the tile batch into separate batches based on the alpha values! Need a chat with Rich...
2016-06-27 16:09:01 +12:00
Pete Baron
d43f29d839
Use the tilemap layer alpha value when batch rendering tiles.
2016-06-27 16:07:24 +12:00
Pete Baron
61635c930e
Added offsets to render large tiles at the correct (according to Tiled editor) positions.
2016-06-27 15:21:55 +12:00
Pete Baron
b8c81c21c9
Removed resolveTileset from TilemapLayerGL, added new task to task list.
2016-06-27 15:14:08 +12:00
Pete Baron
20b3d92b9b
Fixed large tiles vanishing at screen edges by making a clear distinction between the original tilemap tile width and height, and the collision width and height of tiles for each layer. The difference between these two is now applied when calculating the region to be drawn to fill the screen.
2016-06-27 15:02:20 +12:00
Pete Baron
4f1728c62d
First working demo of multiple tileset sources specified in a single Tiled map layer being rendered as separate Batch drawing lists by the webgl renderer.
...
Phaser.Tilemap now creates internal map layers for each tileset except the first one (which will be handled by the createLayer call from the game). It also stores a reference to each tileset where the new map layers can access it.
Phaser.TilemapLayerGL uses the new tileset reference to ensure the correct base image and tile sizes are used for each new layer.
PIXI.Tilemap: added initialisation of glBatch to null in c'tor.
Phaser.TilemapParser was cleaned up to remove the now unnecessary tilemap parameter and the attempt to create layers while parsing.
2016-06-27 14:41:46 +12:00
Pete Baron
8d4733c8a5
Commit current state of development before trying something different (see last note in the progress doc). Will revert to previous commits if this attempt fails.
2016-06-27 11:46:52 +12:00
Richard Davey
8c5cea066a
Updated docs.
2016-06-23 00:45:24 +01:00
Richard Davey
e050c39357
Gamedevs do it in the render method.
2016-06-22 19:30:30 +01:00
Mike Headley
fca0a625b0
Distance comparison opposite of intended. Fixing so it will save the smaller distance instead of the greater.
2016-06-21 22:20:27 -07:00
Richard Davey
80f12ec074
Merge pull request #2571 from uboot/dev
...
Fixed Animation.setFrame() for sprite index argument
2016-06-21 22:20:24 +01:00
Richard Davey
2bd4f68ea0
Small tweaks to #2577 and TS defs.
2016-06-21 22:18:09 +01:00
Richard Davey
8cde880d98
Merge pull request #2577 from LoneStranger/dev
...
Modifed Group.getClosestTo() and Group.getFurthestFrom() to add optional filter callback
2016-06-21 22:07:13 +01:00
Richard Davey
50434375a1
Tidy up formatting for #2585
2016-06-21 22:00:59 +01:00
Richard Davey
495cbb7c14
Merge pull request #2585 from stoneman1/dev
...
Added file type mappings to accept headers.
2016-06-21 21:56:36 +01:00
Stoneman1
4861df4b66
Added file type mappings to accept headers.
2016-06-21 18:05:56 +03:00
cryptographer
9fdbb2d25d
Remove assignment to obsolete tileColor property
2016-06-20 22:29:05 -04:00
Mike Headley
48616c8854
Replacing lost Group.getClosestTo documentation lines.
2016-06-20 14:26:30 -07:00
Mike Headley
2e91588f87
Refactored original getClosestTo and getFurthestFrom functions to include optional filter callback. Removed the getClosestToFilter and getFurthestFromFilter.
2016-06-20 14:07:12 -07:00
photonstorm
e39cd584bf
The start of the PIXI re-documentation process. Time to remove the old YUIdoc syntax, and replace with JSDoc and more meaningful descriptions.
2016-06-20 15:50:51 +01:00
Mike Headley
3ef8e5011b
Revert "Clarified health property in component Health documentation that 'kill' will be called if it goes below zero."
...
This reverts commit 18ae3b1ddb
.
2016-06-20 07:38:01 -07:00
photonstorm
d119ffa539
Removed PIXI.DisplayObject.prototype._renderWebGL
and PIXI.DisplayObject.prototype._renderCanvas
as both were only there for ancient jshint tests.
2016-06-20 14:10:21 +01:00
photonstorm
bd30181a2a
Docs update.
2016-06-20 12:18:39 +01:00
photonstorm
2310e5dc6f
Sound.volume was accidentally repeated twice in the source (thanks @LoneStranger #2569 )
2016-06-20 12:18:39 +01:00
Richard Davey
b0cb949b6c
Merge pull request #2564 from gotenxds/dev
...
Added some data to image object types.
2016-06-20 11:55:01 +01:00
Mike Headley
18ae3b1ddb
Clarified health property in component Health documentation that 'kill' will be called if it goes below zero.
2016-06-19 22:36:27 -07:00
David Hayes
8f36b96c8a
Reorder Weapon.onFire argument order in documentation.
2016-06-19 20:39:51 -05:00
Mike Headley
ad0f31be8d
Added Group.getClosestToFilter() and Group.getFurthestFromFilter()
2016-06-19 10:45:35 -07:00
Matthias Fuchs
0d45251e98
Fixed Animation.setFrame() for sprite index argument.
2016-06-17 22:34:11 +02:00
photonstorm
697a2ae94e
Fixed issue in Group.align where the cell wouldn't increase if rows
was great than -1
2016-06-17 15:28:39 +01:00
Richard Davey
effb975a25
Preparing for 2.5.1 development.
2016-06-17 13:11:48 +01:00
Richard Davey
a9976d2703
Phaser 2.5.0 Release.
2016-06-17 12:46:56 +01:00
photonstorm
47f0224a40
Phaser 2.4.9 release.
2016-06-17 01:11:24 +01:00
photonstorm
9dd745167c
Docs fix.
2016-06-16 17:18:49 +01:00
photonstorm
4da3b15ae2
Renamed alignTo to alignIn, and added the new method alignTo, to allow for Sprite to Sprite alignment. Updated all of the Bounds and TS defs.
2016-06-16 17:01:51 +01:00
photonstorm
5bcf84f5a4
Added offsetX and offsetY arguments to Bounds.alignTo.
2016-06-16 15:51:12 +01:00
photonstorm
f64558c4ac
Readme update.
2016-06-16 12:14:27 +01:00
Richard Davey
e659083818
Fixed jshint error.
2016-06-16 02:51:44 +01:00
Richard Davey
853d770764
Group.align is a new method that allows you to layout all the children of the Group in a grid formation. You can specify the dimensions of the grid, including the width, height and cell size. You can also control where children are positioned within each grid cell. The grid width and height values can also be set to -1, making them fluid, so the grid expands until all children are aligned. Finally an optional child index argument can be set. This is a great way to quickly and comprehensively align Group children, and has lots of use cases.
2016-06-16 02:50:24 +01:00
Richard Davey
fc7a3934d2
Group.align working.
2016-06-16 02:28:49 +01:00
Richard Davey
ed8fbd9a6c
All Game Objects with the Bounds component; which includes Sprites, Images, Text, BitmapText, TileSprites and anything that extend these, now have a new method alignTo
. It allows you to align the Game Object to another Game Object, or a Rectangle. You can specify one of 9 positions which are the new constants: Phaser.TOP_LEFT
, Phaser.TOP_CENTER
and so on (see above for the complete list). The Game Objects are positioned based on their Bounds, which takes rotation, scaling and anchor into consideration. You can easily place Sprites into the corners or the screen or game world, or align them against other Sprites, using this method.
2016-06-16 02:00:46 +01:00
Richard Davey
0efcf68b21
The Game Object Bounds component has been updated to include two new properties: centerX
and centerY
. This means you can, for example, now get the horizontal center of a Sprite by called Sprite.centerX
. These properties are also setters, so you can position the Game Objects, and it will take scale and anchor into consideration.
2016-06-16 01:00:11 +01:00
Richard Davey
123e61c018
The Game Object Bounds component has been updated so that it now provides setters for all of the properties, as well as getters. Previously Sprite.left
, Sprite.right
, Sprite.top
and Sprite.bottom
were read-only, but they are now available to be set as well, and take into consideration the anchor and scale of the Game Objects.
2016-06-16 00:33:48 +01:00
Richard Davey
d67e902760
Rectangle.getPoint is a new method that returns a point based on the given location constant, such as Phaser.BOTTOM_LEFT
. It returns the same result as calling Rectangle.bottomLeft
(etc) but unlike those getters you are able to provide your own Point object.
2016-06-15 23:39:15 +01:00
Richard Davey
64a44aab17
Added the following new constants: Phaser.TOP_LEFT
, Phaser.TOP_CENTER
, Phaser.TOP_RIGHT
, Phaser.MIDDLE_LEFT
, Phaser.MIDDLE_CENTER
, Phaser.MIDDLE_RIGHT
, Phaser.BOTTOM_LEFT
, Phaser.BOTTOM_CENTER
and Phaser.BOTTOM_RIGHT
.
2016-06-15 23:37:48 +01:00
Richard Davey
32cf1f1a9c
Group.createMultiple can now accept Arrays for both the key
and frame
arguments. This allows you to create multiple sprites using each key and/or frame in the arrays, which is a great and quick way to build diverse Groups. See the JSDocs for complete details and code examples.
2016-06-15 22:36:23 +01:00
gotenxds
91987eff56
Added some data to image object types.
2016-06-15 13:09:47 +03:00
Richard Davey
70be74cb36
Lots of work on Body.moveTo and Body.moveFrom. Now working nicely.
2016-06-15 04:12:47 +01:00
Richard Davey
b5cc01132c
Body.move tests.
2016-06-14 23:45:00 +01:00
photonstorm
bc00c900e9
BitmapData.smoothProperty is a new property that holds the string based prefix needed to set image scaling on the BitmapData context.
...
BitmapData.copyTransform allows you to draw a Game Object to the BitmapData, using its `worldTransform` property to control the location, scaling and rotation of the object. You can optionally provide
BitmapData.drawGroup now uses the new `copyTransform` method, to provide for far more accurate results. Previously nested Game Objects wouldn't render correctly, nor would Sprites added via `addChild` to another Sprite. BitmapText objects also rendered without rotation taken into account, and the Sprites smoothing property was ignored. All of these things are now covered by the new drawGroup method, which also handles full deep iteration down the display list.
2016-06-14 15:29:56 +01:00
photonstorm
189cbf4132
Added exists property.
2016-06-14 15:29:45 +01:00
photonstorm
6383f6b1fb
Updated docs.
2016-06-14 15:29:38 +01:00
photonstorm
7817d47a25
Updated Cache docs.
2016-06-14 12:18:32 +01:00
photonstorm
ad3641830d
Phaser.Matrix if passed a 0 value would consider it falsy, and replace it with the default by mistake. It now checks if the arguments are undefined
or null
and only then sets the defaults (thanks mmcs)
2016-06-14 12:18:23 +01:00
Richard Davey
7108bc3de3
Merge pull request #2552 from drhayes/dev
...
Distinguish between Arrays and Objects when cloning in Cache.getJSON.
2016-06-14 11:49:02 +01:00
photonstorm
fb3f7721cb
Working through updating BitmapData.copy to use the source matrix instead, so it retains the correct draw sequence order.
2016-06-13 17:01:33 +01:00
photonstorm
1a3b06a9f4
The DisplayObject.worldRotation
value didn't sign the wt.c
value correctly, meaning the rotation would be wrong.
...
The `DisplayObject.worldScale` value didn't multiply the local objects scale into the calculation, meaning the value wasn't a true representation of the objects world scale.
2016-06-13 17:01:03 +01:00
Pete Baron
04980c8096
Remove hack to force WEBGL mode for testing.
2016-06-14 01:02:02 +12:00
Pete Baron
11c5300591
Remove dubious use of tile.index to reference the tilesets list (it seems unlikely that there would ever be a tilesets value for every tile, and a huge waste of memory if it was ever done that way).
...
TODO: look into putting the tileset index (or a tileset reference) into each Tile structure when building them to avoid resolveTilesets entirely too.
2016-06-14 00:43:46 +12:00
Pete Baron
7533005a62
Fix buffer size bug.
2016-06-14 00:00:18 +12:00
Pete Baron
b406d10d94
Comments, and removed reinitialisation of the glBatch list.
2016-06-13 18:40:51 +12:00
Pete Baron
310b151924
Removed pixiTest flag, using renderType instead.
2016-06-13 18:39:52 +12:00
Pete Baron
c7476a6583
Fixed bug where scroll was effectively applied twice.
2016-06-13 18:38:55 +12:00
Pete Baron
05efcfe36e
Modified my PIXI.Tilemap class to accept the glBatch list of tile source and destination coordinates, convert them into a GL TRIANGLE_STRIP data buffer, then draw them as a single batch WebGL draw.
2016-06-13 17:28:35 +12:00
Pete Baron
a8405bd066
add comment
2016-06-13 17:26:33 +12:00
Pete Baron
57a6245f25
Made a copy of Phaser.TilemapLayer which instead extends PIXI.Tilemap, then added functions to build a batch list of tile source and destination coordinates (instead of drawing them directly onto a Canvas). This maintains all the existing Phaser functionality in regards to tile map decoding and interpretation, and also provides maximum performance from the PIXI component by using a TRIANGLE_STRIP to render everything as a single batch job.
2016-06-13 17:25:50 +12:00
Pete Baron
94d49f1196
Add GL variant of the Tileset.draw function for new approach to WebGL tile drawing (utilising most of the existing Phaser code unchanged)
2016-06-13 17:13:13 +12:00
David Hayes
346aed2866
Distinguish between Arrays and Objects when cloning in Cache.getJSON.
...
Fixes #2551 .
2016-06-10 10:33:33 -05:00
photonstorm
0880380ea9
Phaser 2.4.9 RC4.
2016-06-10 16:22:54 +01:00
Richard Davey
1daf897b23
Small styling fixes.
2016-06-09 23:27:19 +01:00
Richard Davey
5415d9b603
Stage and Group postUpdate methods iterate the same way now.
2016-06-09 23:14:24 +01:00
Richard Davey
cd8bb5a216
Removed keyCode modifier ( #2542 )
2016-06-09 22:03:09 +01:00
Richard Davey
57642afc24
Fixed keyboard issue.
2016-06-09 20:55:21 +01:00
photonstorm
88f47e2497
Keyboard now uses a new internal method getKeyCode
to normalize the key code value based on browser support. It first checks for event.key
, then event.keyIdentifier
and finally event.keyCode
(thanks @SVasilev #2542 )
2016-06-09 16:37:32 +01:00
photonstorm
2ac594ca03
TypeScript defs update.
2016-06-09 16:29:09 +01:00
photonstorm
a65f9c7e4b
Group.onChildInputDown is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an onInputDown
signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.
...
Group.onChildInputUp is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an `onInputUp` signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.
Group.onChildInputOver is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an `onInputOver` signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.
Group.onChildInputOut is a new Signal that you can listen to. It will be dispatched whenever any immediate child of the Group emits an `onInputOut` signal itself. This allows you to listen for a Signal from the Group, rather than every Sprite within it.
2016-06-09 16:19:11 +01:00
photonstorm
28331c4f7f
Comment fix.
2016-06-09 15:37:03 +01:00
photonstorm
458a67251d
Fixed input property check.
2016-06-09 15:09:20 +01:00
photonstorm
90e1460320
Added new Debug.displayList function.
2016-06-09 14:58:58 +01:00
photonstorm
24f4abe760
Group.add has a new optional argument index
which controls the index within the group to insert the child to. Where 0 is the bottom of the Group.
...
Group.addAt has been refactored to be a simple call to `Group.add`, removing lots of duplicate code in the process.
Group.create has a new optional argument `index` which controls the index within the group to insert the child to. Where 0 is the bottom of the Group. It also now makes proper use of `Group.add`, cutting down on more duplicate code.
Group.createMultiple now returns an Array containing references to all of the children that the method created.
2016-06-09 14:58:35 +01:00
photonstorm
c64749fef2
Added missing properties.
2016-06-09 14:54:39 +01:00
photonstorm
92d3a5efa8
Adds a callback that is fired every time 'Pointer.processInteractiveObjects' is called.
...
The purpose of `processInteractiveObjects` is to work out which Game Object the Pointer is going to
interact with. It works by polling all of the valid game objects, and then slowly discounting those
that don't meet the criteria (i.e. they aren't under the Pointer, are disabled, invisible, etc).
Eventually a short-list of 'candidates' is created. These are all of the Game Objects which are valid
for input and overlap with the Pointer. If you need fine-grained control over which of the items is
selected then you can use this callback to do so.
The callback will be sent 3 parameters:
1) A reference to the Phaser.Pointer object that is processing the Items.
2) An array containing all potential interactive candidates. This is an array of `InputHandler` objects, not Sprites.
3) The current 'favorite' candidate, based on its priorityID and position in the display list.
Your callback MUST return one of the candidates sent to it.
2016-06-09 14:49:10 +01:00
photonstorm
7c2d1d4ab8
Pointer.interactiveCandidates is a new Array that is erased and re-populated every time this Pointer is updated. It contains references to all of the Game Objects that were considered as being valid for processing by this Pointer, during the most recent update. To be valid they must have suitable a priorityID
, be Input enabled, be visible and actually have the Pointer over them. You can check the contents of this array in events such as onInputDown
, but beware: it is reset every update.
...
Pointer.swapTarget allows you to change the `Pointer.targetObject` object to be the one provided. This allows you to have fine-grained control over which object the Pointer is targeting.
2016-06-09 14:36:15 +01:00
photonstorm
fa43bec19f
PIXI.DisplayObjectContainer.ignoreChildInput is a new property. If true
then the children will _not_ be considered as valid for Input events. Because this has been applied to DisplayObjectContainer
it means it's available in Group, Sprite and any other display level object. Using this boolean you can disable input events for all children in an entire Group, without having to iterate anything or deep-set flags.
...
InputHandler._pointerOverHandler and _pointerOutHandler have new arguments `silent` - if `true` then they will not dispatch any Signals from the parent Sprite.
2016-06-09 14:32:56 +01:00
photonstorm
e8e7e27184
The DisplayObject.renderOrderID
used to run in reverse. I.e. in a display list with 10 sprites on it, the first sprite (at the bottom of the list, rendering behind all the others) would have a renderOrderID
of 9, where-as the top-most sprite, rendering above all others, would have a renderOrderID
of 0. While this didn't cause any side-effects internally, it's arguably illogical. So the process has been reversed, and renderOrderID
s are now accumulative, starting at zero each frame, and increasing as it iterates down the display list. So the higher the ID, the more "on-top" of the output the object is.
...
`InputHandler.validForInput` and `Pointer.processInteractiveObjects` have been updated to reflect the new `renderOrderID` sequence (see above).
2016-06-09 12:32:37 +01:00
Richard Davey
53c579a50c
Merge pull request #2545 from fillmoreb/patch-3
...
Fix Phaser.Rectangle.aabb()
2016-06-09 11:30:19 +01:00
Upperfoot
bab2fac729
Resolved issue with tilemapLayer collision.
2016-06-08 23:52:56 +01:00
fillmoreb
3f5de71add
Fixe Phaser.Rectangle.aabb()
...
Number.MIN_VALUE does not return the most negative number, but rather the smallest representable number above 0. As a result, Phaser.Rectangle.aabb() did not work correctly when the points had negative values.
2016-06-08 16:14:30 -06:00
Craig Whiteside
212a07b9ac
Fixed problem with missing parameter in tileCheckX and tileCheckY.
2016-06-07 14:00:34 +01:00
Richard Davey
1956d3584e
InputHandler.dragStopBlocksInputUp is a boolean that allows you to control what happens with the input events. If false
(the default) then both the onInputUp
and onDragStop
events will get dispatched when a Sprite stops being dragged. If true
then only the onDragStop
event is dispatched, and the onInputUp
is skipped.
2016-06-07 02:21:12 +01:00
Richard Davey
913936f080
jshint fix.
2016-06-07 01:50:38 +01:00
Richard Davey
df92c45420
There are two new Phaser consts available, for help with orientation of games or Game Objects. They are Phaser.HORIZONTAL
, Phaser.VERTICAL
, Phaser.LANDSCAPE
and Phaser.PORTRAIT
.
2016-06-07 01:45:33 +01:00
Richard Davey
66b846cbdb
InputHandler.dragDistanceThreshold gives you more fine control over when a Sprite Drag event will start. It allows you to specify a distance, in pixels, that the pointer must have moved before the drag will begin.
...
InputHandler.dragTimeThreshold gives you more fine control over when a Sprite Drag event will start. It allows you to specify a time, in ms that the pointer must have been held down for, before the drag will begin.
InputHandler.downPoint is a new Point object that contains the coordinates of the Pointer when it was first pressed down on the Sprite.
2016-06-07 01:28:06 +01:00
Craig Whiteside
7a1667fa7e
Fixed typo on collision for TileMapLayers (lesson to triple check your code...)
2016-06-06 15:43:51 +01:00
Richard Davey
a180882d27
Fixed the data object not being created.
2016-06-06 00:31:46 +01:00
Richard Davey
de3d749385
Farthest swapped for the more common Furthest.
2016-06-05 23:01:00 +01:00
Richard Davey
1b67850c82
Merge pull request #2529 from TheJasonReynolds/local_dev
...
Set isPlaying to true if no marker (.play is not called again)
2016-06-05 15:51:43 +01:00
John Rees
e75827d6ab
Signal description typo fix
2016-06-04 19:41:54 +01:00
Jason Reynolds
db0a41bedf
Set isPlaying to true if no marker (.play is not called again)
2016-06-03 17:08:07 -05:00
photonstorm
1a67079ae7
Phew. Added TypeScript defs for the Weapon Plugin. Don't say I never do anything for you!
2016-06-03 17:11:08 +01:00
photonstorm
61f064dfe9
Docs update.
2016-06-03 16:45:47 +01:00
Richard Davey
d81ec7fa0f
Merge pull request #2526 from drhayes/dev
...
Don't extend Phaser.Utils when doing deep copy in Phaser.Cache.getJSON.
2016-06-03 16:42:30 +01:00
Richard Davey
6c292a4607
Merge pull request #2525 from Upperfoot/dev
...
Adds missing fixedToCamera check in TilemapLayer.prototype._renderWebGL
2016-06-03 16:40:00 +01:00
photonstorm
a2d0aac9fd
Docs finished.
2016-06-03 16:38:40 +01:00
photonstorm
93b1f3eba1
Math.between will return a value between the given min
and max
values.
2016-06-03 16:18:35 +01:00
David Hayes
8317563d27
Don't extend Phaser.Utils when doing deep copy in Phaser.Cache.getJSON.
2016-06-03 10:16:07 -05:00
Upperfoot
57e8a35226
Adds missing fixedToCamera check in Phaser.TilemapLayer.prototype._renderWebGL e4ea011353
2016-06-03 16:11:39 +01:00
photonstorm
ee6f277b31
PluginManager.remove has a new argument destroy
(defaults to true
) which will let you optionally called the destroy
method of the Plugin being removed.
2016-06-03 15:52:17 +01:00
photonstorm
c73ccfbddb
Lots more docs updates.
2016-06-03 15:51:06 +01:00
photonstorm
d2269c362d
Docs update.
2016-06-03 15:20:11 +01:00
photonstorm
0da7cf5ffd
There are a bunch of new Phaser consts available to help with setting the angle of a Game Object. They are Phaser.ANGLE_UP
, ANGLE_DOWN
, ANGLE_LEFT
, ANGLE_RIGHT
, ANGLE_NORTH_EAST
, ANGLE_NORTH_WEST
, ANGLE_SOUTH_EAST
and ANGLE_SOUTH_WEST
.
2016-06-03 15:19:18 +01:00
photonstorm
96711f4db9
Added the Weapon Plugin and worked lots on its docs.
2016-06-03 15:09:43 +01:00
Richard Davey
7ec02f79e4
Merge pull request #2520 from seanirby/patch-1
...
Update docstring for TimerEvent
2016-06-03 13:15:43 +01:00
photonstorm
0a5b2673ff
JSHint fixes re: #2522
2016-06-03 13:14:59 +01:00
photonstorm
9ae43757b9
Group.removeAll has a new argument destroyTexture
which allows you to optionally destroy the BaseTexture of each child, as it is removed from the Group (thanks @stoneman1 #2487 )
2016-06-03 13:11:03 +01:00
photonstorm
ae5be7ac92
Merging in the new Weapon Plugin.
2016-06-03 13:00:45 +01:00
photonstorm
84c60d4e87
Within RequestAnimationFrame both updateRAF
and updateSetTimeout
now only call game.update
if isRunning
is true. This should avoid asynchronous Game destroy errors under environments like Angular (thanks @flogvit #2521 )
2016-06-03 13:00:45 +01:00
Richard Davey
05ca827c2b
Merge pull request #2522 from Upperfoot/master
...
Fixing tileMap collision when tileMapLayer is set to a position other than 0,0
2016-06-03 12:45:37 +01:00
photonstorm
e4ea011353
TilemapLayer now adheres to fixedToCamera should it be disabled #2482
2016-06-03 12:13:01 +01:00
Sean Irby
3c2003365d
Update docstring for TimerEvent
...
I think the TimerEvent lifecycle could use some clarification so I updated the docstring to explain what happens when they are finished firing.
2016-06-02 17:47:31 -07:00
Richard Davey
097add1aa6
Game Objects including Sprite, Image, Particle, TilemapLayer, Text, BitmapText and TileSprite have a new property called data
. This is an empty Object that Phaser will never touch internally, but your own code, or Phaser Plugins, can store Game Object specific data within it. This allows you to associate data with a Game Object without having to pollute or change its class shape.
2016-06-03 01:08:32 +01:00
Richard Davey
45bd98ee18
Fixed issue with camera target sync.
2016-06-02 23:20:46 +01:00
Richard Davey
645a614326
Stage has had all of its core update loops modified, so they now iterate through the display list forwards, instead of in reverse. Stage.postUpdate is now also a lot smaller, with no conditional branching if there is a Camera Target or not.
2016-06-02 22:45:31 +01:00
Richard Davey
c822cda452
TilemapLayer.postUpdate could potentially be called several times per frame (depending on device frame rate), which would cause multiple texture redraws, even though only the last texture is used during rendering. This has now been modified so that the local TilemapLayer canvas is only re-rendered once per frame, during the rendering phase, and not during the logic update phase.
2016-06-02 22:44:24 +01:00
Richard Davey
c4f4ceef42
Code format fix.
2016-06-02 22:41:58 +01:00
Richard Davey
09d09aaf84
Removed the updateTransform calls from the frame loop, because it happens automatically as part of Game.updateLogic anyway, so was duplicating the workload for no reason.
2016-06-02 22:41:03 +01:00
Richard Davey
eb1c61826c
The camera now divides its effects (like shake and fade) updates, and the updateTarget into two separate functions.
2016-06-02 22:40:30 +01:00
photonstorm
68c29470cf
The way the display list updates and Camera movements are handled has been completely revamped, which should result is significantly smoother motion when the Camera is following tweened or physics controlled sprites. The Stage.postUpdate
function is now vastly reduced in complexity. It takes control over updating the display list (calling updateTransform
on itself), rather than letting the Canvas or WebGL renderers do this. Because of this change, the Camera.updateTarget
function uses the Sprites worldPosition
property instead, which is now frame accurate (thanks @whig @Upperfoot @Whoisnt @hexus #2482 )
2016-06-02 16:38:21 +01:00
Richard Davey
8da3395407
Merge pull request #2471 from cwleonard/gamepad
...
Gamepad problems in Google Chrome
2016-06-02 15:46:03 +01:00
photonstorm
a81fe3cf02
jshint fixes.
2016-06-02 15:38:05 +01:00
photonstorm
63a1336bd5
Sound.addMarker now has a default value for the duration
argument (1 second) to avoid the DOM Exception 11 error if you accidentally miss it out (thanks @mari8i #2508 )
2016-06-02 15:29:51 +01:00
photonstorm
21b5492e98
Video.onComplete wouldn't fire on iOS if the user hit the 'Done' button before the video had finished playing. It now uses the webkitendfullscreen
event to detect this, and dispatches the onComplete
signal should that event fire (thanks @kelu-smiley #2498 )
2016-06-02 15:26:11 +01:00
photonstorm
dfa8b9dedc
Refactored Group.getClosestTo and Group.getFurthestFrom.
2016-06-02 15:11:23 +01:00
photonstorm
a52bbf621b
Added missing property.
2016-06-02 15:02:44 +01:00
Richard Davey
837d3cba46
Merge pull request #2505 from gotenxds/ReverseAnimation
...
Added a reverse functionality to animations.
2016-06-02 15:01:57 +01:00
Richard Davey
f67d304e99
Merge pull request #2504 from Nuuf/master
...
added functions for getting closest child and farthest child
2016-06-02 14:58:09 +01:00
Richard Davey
56cc7dc155
Merge pull request #2519 from TadejZupancic/patch-1
...
Fixing measurement of text width that produced too narrow canvas
2016-06-02 14:53:17 +01:00
Richard Davey
d18c591c15
Merge pull request #2499 from kevinleedrum/2496
...
Fixing issue #2496 : Wrapped BitmapText not centering
2016-06-02 14:51:09 +01:00
TadejZupancic
317c85db90
Fixing measurement of text width that produced too narrow canvas
...
When using a style on characters (e.g. addColor), the length of the whole line with default style was measured ignoring the different width of the characters with added style.
I've included the measureLine function, which does the same measurements as updateLine, but it does not render the line to canvas - it only returns the line length.
Now this function is used for measuring line of text if some style is added to it.
2016-06-02 11:10:40 +02:00
gotenxds
7fc34c117c
Reverse and reverseOnce will now return the animation to allow linking.
2016-05-31 20:29:02 +03:00
gotenxds
b34860c89b
Reverse and reverseOnce will now return the animation to allow linking.
2016-05-31 20:27:55 +03:00
Vitaliy
cd3742f9f2
Corrected intersects fuction
...
Added protection against incorrect handling collisions. Clashes with the body itself will not be processed.
2016-05-31 01:18:17 +03:00
Gustav
5a1cb006ec
beautified
2016-05-28 00:27:35 +02:00
gotenxds
d243da7a1b
Small fix, should check for -1 not 0
2016-05-27 21:37:56 +03:00
gotenxds
ae3ebf00cd
Added typescript defs; Fixed jshint.
2016-05-27 18:04:33 +03:00
gotenxds
d4636e9e81
Added a reverseOnce method.
2016-05-27 17:58:54 +03:00
gotenxds
b0c4f3bc4c
Added a convenient function.
2016-05-27 17:48:06 +03:00
gotenxds
bb7cbb36f6
If animation is reversed it should start from last frame.
2016-05-27 17:43:36 +03:00
gotenxds
2c752a25c2
Deleted whitespace.
2016-05-27 15:55:46 +03:00
John Doe
911d345571
Merge remote-tracking branch 'origin/ReverseAnimation' into ReverseAnimation
...
Conflicts:
src/animation/Animation.js
typescript/phaser.comments.d.ts
typescript/phaser.d.ts
2016-05-27 15:46:57 +03:00
John Doe
ce17ac9902
Added a reverse functionality to animations.
2016-05-27 15:44:32 +03:00
John Doe
11805b311d
Added a reverse functionality to animations.
2016-05-27 02:24:23 +03:00
Gustav
5b4b41c958
added functions for getting closest child and farthest child
2016-05-26 21:51:56 +02:00
Pete Baron
0904e386de
Use firstgid (TODO: assumes tileset 0 currently, needs to calculate the correct tileset) to fix the 'out by one' tilemap example errors.
...
Handle empty VBO case, and make sure we only drawArrays the correct number of vertices (to fix the large corrupt block in the top-right corner of many example demos).
2016-05-26 14:13:07 +12:00
Pete Baron
0dd3610ee4
Minor optimisation in TilemapLayerGL to remove unnecessary loop.
2016-05-26 14:10:45 +12:00
kevinleedrum
c1a2970488
Fixing issue #2496 : Wrapped BitmapText not centering
2016-05-24 09:09:38 -04:00
photonstorm
07ef075e92
Phaser.Line.intersectsRectangle checks for intersection between a Line and a Rectangle, or any Rectangle-like object such as a Sprite or Body.
2016-05-24 02:30:00 +01:00
photonstorm
c1c2e6bc9d
Removed left-over Body.isCircle checks.
2016-05-23 23:02:04 +01:00
photonstorm
e974ff4ee9
Removed Circle functions and updated setSize docs.
2016-05-23 13:16:21 +01:00
photonstorm
9b9e398c73
InputHandler.checkPointerDown had an incorrect single pipe character |, instead of an OR check ||, and an isDown
check, causing Button Over events to fail (thanks @pengchuan #2486 )
2016-05-23 13:03:11 +01:00
photonstorm
16e9acac84
Updated Body.reset call.
2016-05-23 12:54:41 +01:00
photonstorm
8743e8952c
Reverted worldScale calculation.
2016-05-23 12:54:33 +01:00
photonstorm
09dd84565e
Arcade Physics Body incorrectly positioned if the Sprite had a negative scale (see http://www.html5gamedevs.com/topic/22695-247-248-body-anchoring-any-migration-tips/ ) (thanks @SBCGames @icameron @Nuuf @EvolViper #2488 #2490 )
2016-05-23 12:46:01 +01:00
photonstorm
7844ad927c
Preparing for 2.4.9 dev.
2016-05-23 12:32:37 +01:00
Pete Baron
a9bf339efd
Fully working sci-fly demo using a single gl draw to blit all of the tiles at once. Theoretically extremely fast (requires testing). Works here in FireFox and Chrome at 60 fps on an i7 4770 with Nvidia 780 GTX drawing typically 1989 tiles per frame.
2016-05-23 21:09:13 +12:00
Pete Baron
1b7eaadd06
First (nearly) working batch drawing test. Instead of pushing rectangles as pairs of triangles individually, this version creates a vertex buffer object for all visible tile rectangles, with degenerate triangles separating each one from the next. The drawing is done by a single call to gl.drawArrays.
...
Bizarrely, this version still chokes in Firefox, implying that the previous demo's horrible performance was not down to the GPU blocking as the rectangles are sent to it.
The test is not fully working because it does not scroll the drawing position. So instead of the map moving when you hit a scroll boundary, it simply stops drawing the top or left edges as the scroll region moves away from the visible window. It's an easy fix, but I think I'll leave it until I find out exactly why Firefox still chokes on this demo.
Progress text file updated with latest experiments and progress today.
2016-05-23 17:48:54 +12:00
photonstorm
d1234d1685
Preparing for 2.5.0 dev.
2016-05-19 13:45:51 +01:00
photonstorm
9f28d0659d
Phaser 2.4.8 release.
2016-05-19 12:36:51 +01:00
Upperfoot
4a3e8f2b4a
Take into consideration Tilemap position into collision
2016-05-19 11:06:49 +01:00
Upperfoot
55700e4fec
Take into account position of tilemap in collision
2016-05-19 08:47:31 +01:00
zeterain
cd188ed0ab
Update Documentation in Game.js
...
Updated the documentation in Game.js to indicate that the renderType property could be set to Phaser.HEADLESS.
2016-05-18 10:56:44 -06:00
photonstorm
a6a2c61240
Sprites that had a tint on them, that then had their frame changed via either Sprite.frame
or Sprite.frameName
wouldn't re-tint the new frame, and would become stuck on the old frame in Canvas mode (thaks @spayton #2453 )
2016-05-17 21:04:40 +01:00
photonstorm
d161a7f6bc
Sounds played using the Audio tag, set to loop, would get caught in an endless pause-play loop cycle (thanks @rroylance #2473 )
2016-05-17 16:43:11 +01:00
photonstorm
7018ca2132
Position in Body.reset #2470
2016-05-16 15:20:44 +01:00
photonstorm
54683b7fb2
Sounds played using the Audio tag, that were paused and then resumed again (either directly in code, or via a game pause event) would not resume from the point at which they paused (thanks @rroylance #2473 )
2016-05-16 15:16:19 +01:00
photonstorm
02e8b1ae0a
If you set Game.renderType to Phaser.HEADLESS
it will no longer render the output to the canvas. The canvas is still created (although not added to the DOM), as it's required internally, but no rendering now takes place on it (thanks @ForgeableSum #2464 )
2016-05-16 14:53:11 +01:00
photonstorm
ac89d1aec7
Arcade Physics Body has a new property worldBounce
. This controls the elasticity of the Body specifically when colliding with the World bounds. By default this property is null
, in which case Body.bounce is used instead. Set this property to a Phaser.Point object in order to enable a World bounds specific bounce value (thanks @VitaZheltyakov #2465 )
2016-05-16 13:53:12 +01:00
photonstorm
f9994fac75
Fixed a bug in Arcade Physics Body.preUpdate which would incorrectly apply the position of an offset Body (one which has had Body.setSize used on it) when combined with a Sprite with a non-zero anchor (thanks @SBCGames #2470 )
2016-05-16 13:39:46 +01:00
photonstorm
19dce62734
Arcade Physics has had a new world
argument added to the following functions: distanceBetween
, distanceToXY
, distanceToPointer
, angleBetween
, angleToXY
and angleToPointer
. The argument (which is false by default), when enabled will calculate the angles or distances based on the Game Objects world
property, instead of its x
and y
properties. This allows it to work for objects that are placed in offset Groups, or are children of other display objects (thanks @Skeptron for the thread #2463 )
2016-05-16 13:31:57 +01:00
Richard Davey
6eca457877
Merge pull request #2476 from staff0rd/generate_texture
...
fix generateTexture return type
2016-05-16 12:56:27 +01:00
photonstorm
4fd2524c61
Text.setStyle has a new argument update
which will optionally automatically call updateText
after setting the new style (thanks @staff0rd #2478 )
2016-05-16 12:55:27 +01:00
Pete Baron
5c6ad9cbcb
Fix double subtraction error.
2016-05-13 14:34:24 +12:00
Pete Baron
e396c266b8
Use the correctly scaled scrollX, scrollY parameters for the scroll offsets.
...
This makes the layers in "blank tilemap" example work properly (you'll need to click the 3rd tile in the palette before drawing becomes visible - that's next up)
2016-05-13 14:13:51 +12:00
Pete Baron
5be5ddba25
Protect against zero and negative indexes (-1 is used in e.g. "blank tilemap" example).
2016-05-13 14:06:58 +12:00
Pete Baron
49b3d1a57a
Temporary modification to force webgl renderer without needing to edit all the example files.
2016-05-13 14:06:08 +12:00
Pete Baron
e0008793bd
Prepare Phaser.Tilemap for testing other examples/tilemaps with the TilemapLayerGL code.
...
Ensure that TilemapLayerGL is treated as a valid layer the same as TilemapLayer.
TODO: I've hardwired the PIXI TilemapLayerGL test flag (pixiTest) to be 'on' unless otherwise specified... need to turn this off before final commits!
2016-05-13 12:24:55 +12:00
Pete Baron
a98d0e8e70
First pass of 'clean-up': correcting comments, removing unused code
2016-05-13 12:06:18 +12:00
Pete Baron
4cfcb3b7bd
Implemented _renderMode switch and _renderVisibleTiles functionality. This speeds up the sci-fly demo hugely.
2016-05-13 11:37:33 +12:00
Pete Baron
0855e59972
Added _renderMode to switch between full-map redrawing and visible screen redrawing modes.
2016-05-13 11:36:12 +12:00
stafford
e6b9ca4e22
fix generateTexture return type
2016-05-12 15:30:33 +10:00
photonstorm
f34b567295
BitmapData.copy, and by extension any method that uses it, including BitmapData.draw, drawGroup and drawFull, now all support drawing RenderTexture objects. These can either be passed directly, or be the textures of Sprites, such as from a call to generateTexture.
2016-05-12 03:48:14 +01:00
photonstorm
85d5d9715d
Removed, this has gone to its own branch.
2016-05-11 16:38:56 +01:00
photonstorm
1d18c70371
BitmapData.drawGroupProxy is now capable of iterating through Sprites that have children, and also now uses the world positions for drawing instead.
2016-05-11 16:38:42 +01:00
photonstorm
74af2079b6
Swap to use worldScale instead of worldTransform.
2016-05-11 16:37:31 +01:00
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
Casey Leonard
9ede913609
gamepad bugs in Chrome
...
fixes issues with being unable to connect a gamepad in Chrome and losing
the gamepad when focus is lost to the game
2016-05-07 19:07:16 -04: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
photonstorm
50e126f59e
* Body has two new properties: left
and top
. These are the same as Body.x
and Body.y
but allow you to pass the Body to geometry level functions such as Circle.contains.
...
* Body.setCircle allows you to define a Body as using a circle to collide with instead of a rectangle. You can set the radius of the collision circle and an offset.
* Body.render now renders both circle and rectangle body shapes to the Debug canvas.
* World.intersects has been updated to support both circle and rectangle body shapes, and supports quick-paths for circle vs. circle and rect vs. rect checks.
* World.circleBodyIntersects is a new method that checks for intersection between a Body that has been defined as a circle, and a normal rectangle based Body. This is used internally by World.intersects, but exposed for direct calls as well.
2016-04-07 17:01:16 +01:00
photonstorm
b162ca4d51
Improved Math.clamp and docs.
2016-04-07 16:14:44 +01:00
photonstorm
952b5c04ea
The start of Arcade Physics circle bodies.
2016-04-07 14:32:53 +01:00
photonstorm
b9f62e77e6
You can now pass a TilemapLayer as a Texture to a TileSprite. A limitation of this is that if you pass it to a TileSprite it will make a fill pattern from the TilemapLayer at that instant it's passed, and it won't keep track of the layer in future should it update (thanks @jdnichollsc #1989 )
2016-04-07 03:45:21 +01:00
photonstorm
e4a505d4b6
Lots of new Signals documentation.
2016-04-07 02:44:29 +01:00
photonstorm
e5ceb7e9bc
P2.World.setBounds has been re-written completely. If the World is resized it no longer removes the P2 body instances and re-creates them. Instead it checks to see which walls are required and then just moves the position of the shapes instead, or updates them, or creates or destroys them as required. This is far more efficnent, especially in a game which see's a lot of world bounds changes (i.e. resizes responsively in browser)
2016-04-07 01:56:42 +01:00
photonstorm
5c261821fe
P2.World.updateBoundsCollisionGroup didn't set the _boundsOwnGroup
private var, meaning the World.setBounds
method wasn't able to restore previously set collision masks automatically (thanks @jmp909 #2183 )
2016-04-07 01:25:52 +01:00
photonstorm
4d5a037ae5
P2.World.updateBoundsCollisionGroup wouldn't use the boundsCollisionGroup
mask if you passed true
as the argument, only if it was left undefined.
2016-04-07 01:18:19 +01:00
photonstorm
58af40ca92
Added a bit more info to the SoundManager docs re: #2373
2016-04-07 01:07:19 +01:00
photonstorm
787111c12c
A Game Object with fixedToCamera = true
that was then set for Input, and enabled for dragging from its center (input.enableDrag(true)
) would throw an error upon being dragged (thanks @solusipse #2367 )
2016-04-07 00:44:53 +01:00
photonstorm
fc7b5c79e3
Graphics objects can now have a Physics Body directly attached to them, where-as before it would throw an error due to a lack of anchor property (thanks @NLilley #2400 )
2016-04-07 00:14:41 +01:00
photonstorm
0945083a4b
Removed further mentions of RenderTexture re: TileSprite.
2016-04-06 23:58:34 +01:00
photonstorm
b3757ed862
jsdocs update #2384
2016-04-06 02:33:29 +01:00
photonstorm
896b32a28c
SoundManager.muteOnPause is a new boolean that allows you to control if the Sound system gets muted automatically when a Phaser game pauses, such as when it loses focus. You may need to set this to false
if you wish to control the audio system from outside of your Phaser game, i.e. from DOM buttons or similar ( #2382 )
2016-04-06 02:09:22 +01:00
photonstorm
61bc4a8dca
Sound.play when using an AudioTag would ignore the muted state of the SoundManager and play regardless. It now checks the SoundManager.mute state on play, and sets the volume accorindingly (thanks @brianbunch #2139 )
2016-04-06 01:41:54 +01:00
Richard Davey
8e74f4d06e
Merge pull request #2187 from BdR76/patch-1
...
Bugfix, reuse emitter when parameter explode=false
2016-04-06 01:28:49 +01:00
Richard Davey
2f0231b3cd
Merge pull request #2415 from jakewilson/dev
...
Fixed and added warnings.
2016-04-06 01:21:09 +01:00
photonstorm
988290631f
When setting a global volume for the SoundManager it would previously incorrectly calculate the volumes of AudioTag based Sound objects that were not played at volume 1. The new approach uses Sound.updateGlobalVolume which adjusts the Sound volume to be a percentage of the global volume. So if the global volume is 0.5 and the Sound volume is 0.5, the Sound will play with an actual volume of 0.25 (thanks @VitaZheltyakov #2325 )
2016-04-06 01:19:32 +01:00
Richard Davey
71056ccb69
Merge pull request #2371 from stoneman1/dev
...
Fixed video for future
2016-04-06 01:08:22 +01:00
photonstorm
4d69b13977
Passing a BitmapData to a TileSprite as a texture would fail if the BitmapData had not been previously added to the cache. It now uses the new frameData property (thanks @mzamateo @lucap86 #2380 )
2016-04-06 00:44:55 +01:00
photonstorm
c33b53fa95
BitmapData has a new property frameData
which is a Phaser.FrameData container instance. It contains a single Frame by default, matching the dimensions of the entire BitmapData, but can be populated with additional frames should you wish to create animations from dynamic BitmapData textures.
2016-04-06 00:43:21 +01:00
photonstorm
18c0b150b5
FrameData.destroy will nullify the local arrays used to contain Frame instances.
2016-04-06 00:43:09 +01:00
photonstorm
0c2ac47981
Camera.position would return the view rectangles centerX/Y coordinates, instead of view.x/y (which is what Camera.x/y returns), so it has been updated to return view.x/y instead (thanks @kamparR #2120 )
2016-04-06 00:18:01 +01:00
photonstorm
ecbff44354
Group.getByName searches the Group for the first instance of a child with the name
property matching the given argument. Should more than one child have the same name only the first instance is returned.
2016-04-05 23:59:05 +01:00
photonstorm
65f8f111c8
Game.forceSingleUpdate is now true
by default.
2016-04-05 23:40:15 +01:00
photonstorm
b762e1dc55
Added jsdocs warning re: #2045
2016-04-05 23:28:02 +01:00
photonstorm
4c3a30a6f6
PluginManager.destroy is now called by Game.destroy.
2016-04-05 23:16:52 +01:00
photonstorm
6933b41e6f
Arcade.Body's speed property was only set when the body moved, it now updates regardless (thanks @mark-henry #2417 )
2016-04-05 23:06:57 +01:00
photonstorm
aee0212e11
Camera.follow now uses the Targets world
property to seed the camera coordinates from, rather than its local position. This means Sprites that are members of offset Groups, or transformed display lists, should now be followed more accurately (thanks @rbozan #2106 )
2016-04-05 23:04:31 +01:00
photonstorm
8ad7b25595
The Debug canvas now listens for the ScaleManager.onSizeChange signal and resizes itself accordingly when running under WebGL. This means if your game size changes the Debug canvas won't be clipped off (thanks @francisberesford #1919 )
2016-04-05 21:52:11 +01:00
photonstorm
7b803135c8
Updated jsdocs for getBounds ( #2406 )
2016-04-05 21:13:04 +01:00
Jake Wilson
96a79cd91a
Added warning if physics body is enabled on unknown physics system.
2016-04-05 11:23:17 -04:00