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
3d2cb3f8b3
Docs update.
2016-07-23 12:28:16 +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
75272974e9
The Emitter.makeParticles collide
argument didn't work, as a result of #2661 , but is now properly respected thanks to that change (thanks @samme #2662 )
2016-07-23 10:08:34 +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
7de3cc2745
Phaser 2.7.0 Beta 2 Release.
2016-07-22 17:14:59 +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
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
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
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