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