Commit graph

659 commits

Author SHA1 Message Date
Michael Hadley
0993af649a Bug fix: extend from empty object 2017-11-30 12:26:07 -06:00
Richard Davey
2e7a336ef9 Handling new style settings for fonts and padding. 2017-11-30 17:17:29 +00:00
Richard Davey
5e975eda2c font has been removed and replaced with fontFamily, fontSize and fontStyle.
fill has been replaced with color as it just makes more sense.
2017-11-30 17:17:28 +00:00
Richard Davey
4d71806bea Text padding is passed to the Text.setPadding method to handle. 2017-11-30 17:17:27 +00:00
Richard Davey
7bd8bf2075 The testString can now be set in the Text config. 2017-11-30 17:17:27 +00:00
Michael Hadley
b53f68c84a Factor layer scale into tile culling 2017-11-30 11:15:35 -06:00
Michael Hadley
85e75eafa8 Fix for coord transform between world <-> tile + expose tile -> world methods 2017-11-30 09:22:54 -06:00
Michael Hadley
bde77f7b95 Blank layers - pass along map's base tile size 2017-11-30 06:56:35 -06:00
Michael Hadley
76b74c677c Tile culling: use tile's worldXY and w/h so maps with different tileset sizes work 2017-11-30 06:56:13 -06:00
Michael Hadley
a3b8a25521 Allow tilemap to change base tile size for all tiles 2017-11-29 23:16:48 -06:00
Michael Hadley
1be6d7a681 Tilemap & Dynamic: new method for putting a 2D array of tiles at a location 2017-11-29 21:59:11 -06:00
Michael Hadley
e548b73e80 Proper support for multiple tile sizes in a tilemap
- Adds base tile size to Tile class. Tiled positions tiles based on the base size.
- Supports proper translation of Tiled's bottom left coord system to Phaser's top left coord for tiles that are bigger or smaller than the base tile size.
- Update static renderer to read position/size from tile
2017-11-29 20:06:52 -06:00
Michael Hadley
2ae4bfa85a Jsdocs: StaticTilemapLayer & DynamicTilemapLayer 2017-11-29 19:23:42 -06:00
Michael Hadley
36a92d15e7 Add note about ImageCollection being a direct v2 port 2017-11-29 19:23:42 -06:00
Michael Hadley
59cdf89836 Jsdocs: Tilemap 2017-11-29 19:23:42 -06:00
Richard Davey
d1cc12693c If a GameObject has a preDestroy method then call it before running the standard destroy calls. 2017-11-30 01:20:22 +00:00
Richard Davey
3964c7a2ac Added in support for RTL text in the Text Game Object. 2017-11-30 01:20:02 +00:00
Richard Davey
3c8a5b4132 Fixed issue where an array passed in the constructor wasn't properly displayed
fix #3094
2017-11-30 00:03:22 +00:00
Michael Hadley
d6f8812f49 Jsdoc: Tile 2017-11-29 15:37:23 -06:00
Michael Hadley
a76e270c78 Jsdoc fixup: Number -> Integer, array -> Type[] 2017-11-29 15:07:56 -06:00
Michael Hadley
191f621dad Jsdocs: Tileset 2017-11-29 14:39:30 -06:00
Michael Hadley
5f3156e2b8 Jsdocs: Tilemap parsing 2017-11-29 14:02:45 -06:00
Michael Hadley
0ee08b76a8 Jsdocs: ParseToTilemap 2017-11-29 13:53:05 -06:00
Michael Hadley
382d8edfcc Jsdocs: Tilemap Creator & Factor 2017-11-29 13:46:29 -06:00
Michael Hadley
f0e59b3d3d Blank Layer: remove unnecessary setting of tile size 2017-11-29 13:23:01 -06:00
Michael Hadley
b8695342e1 Prefer UK spelling over US: indices -> indexes 2017-11-29 13:22:30 -06:00
Michael Hadley
80a16065e2 Update to allow multiple tileset sizes within one map
Tileset is source of truth for tile size, so this update makes sure that layers are sync'd with the tileset
2017-11-29 12:52:34 -06:00
Michael Hadley
184cfd1979 When creating a Tilemap layer, use Tiled layer offset if no xy specified 2017-11-29 11:59:25 -06:00
Michael Hadley
a7df7c2df9 Tidying up linting, notes and comments 2017-11-29 11:46:19 -06:00
Michael Hadley
f4a6888d86 Tilemap: add method for converting layer from dynamic to static 2017-11-29 11:36:36 -06:00
Michael Hadley
0b4a08730c Adding debug rendering method to tilemap and layers 2017-11-29 09:05:53 -06:00
Michael Hadley
60f20aa05b setTileLocationCallback 2017-11-29 08:20:24 -06:00
Michael Hadley
da79734b22 SetTileIndexCallback 2017-11-29 07:53:04 -06:00
Michael Hadley
b4d89fb554 createFromObjects: return an array of sprites 2017-11-29 07:35:26 -06:00
Michael Hadley
a0b4362979 createFromObjects: allow sprite to have any origin while still matching Tiled 2017-11-29 07:25:04 -06:00
Michael Hadley
ee5190660c Tilemap: upgraded version of createFromObjects from v2 2017-11-28 22:40:48 -06:00
Michael Hadley
e5a8600686 BuildGameObject bug: origin was being set to position xy 2017-11-28 21:57:52 -06:00
Michael Hadley
68634a0deb Tilemap & layer methods: FilterTiles & CreateFromTiles 2017-11-28 20:49:24 -06:00
Felipe Alfonso
3b296162cf Camera input transform update 2017-11-28 19:18:05 -03:00
Michael Hadley
bd8a2fa39b More tilemap jsdocs 2017-11-27 07:33:30 -06:00
Michael Hadley
e45bc5c71d PutTileAt: copy all tile properties from source tile 2017-11-27 07:19:20 -06:00
Michael Hadley
dabe3d27ff Tilemap: more jsdocs 2017-11-26 09:33:19 -06:00
Michael Hadley
80185eb5eb Fill update: jsdocs & allow fill to update tile collisions + faces 2017-11-26 09:19:57 -06:00
Michael Hadley
09224b724e Tilemap: adding jsdocs 2017-11-26 09:07:27 -06:00
Michael Hadley
6ca7c9ecfd Copy update: copy all tile props and recalculate faces within dest region 2017-11-26 08:58:38 -06:00
Michael Hadley
8ec6528d20 Tilemap & layers: replace v2 raycasting with getTilesWithinShape 2017-11-26 07:55:44 -06:00
Michael Hadley
9d29948a02 Update tile culling to factor in the new scale 2017-11-25 20:47:47 -06:00
Michael Hadley
aaa0d41f5d Fix dynamic layer scale bug 2017-11-25 20:47:20 -06:00
Michael Hadley
c31147df19 Add filtering options to forEachTile, GetTilesWithin, GetTilesWithinWorldXY 2017-11-25 18:03:21 -06:00
Michael Hadley
998ae1bd40 Factor layer scale into WorldToTile calculation 2017-11-25 17:12:24 -06:00
Michael Hadley
b21fc88660 Dynamic Tilemap WebGL - respect layer scale in rendering 2017-11-25 17:09:56 -06:00
Michael Hadley
557ac4fe6e Add GetTilesWithinWorldXY method to tilemap and layers 2017-11-25 08:42:19 -06:00
Michael Hadley
432c1c0f6d GetTilesWithin: clip rectangular area to map bounds 2017-11-25 08:40:07 -06:00
Michael Hadley
4c34d09955 Optional snapToFloor parameter added to WorldToTile methods 2017-11-25 07:08:06 -06:00
Michael Hadley
7a90d55dd5 Fix: WorldXY now passes recalculateFaces to TileXY methods 2017-11-25 07:06:14 -06:00
Michael Hadley
7844927256 Image layers added to Tilemap 2017-11-24 09:15:02 -06:00
Michael Hadley
0d02f7d941 Extend Tiled importer to handle offsetx and offsety for the various layers 2017-11-24 08:59:36 -06:00
Michael Hadley
d3aa842bfe Adding collision prop to Tilemap 2017-11-24 08:23:40 -06:00
Michael Hadley
0e73bae5bc Extend Tileset to have methods for accessing properties and data per tile 2017-11-24 08:23:22 -06:00
Michael Hadley
805c0a0125 Break Tiled parser into modular pieces & extended capabilities
New features:
- Parsing text object
- Parsing "tiles" prop of tileset which contains collision & terrain information
2017-11-24 08:22:55 -06:00
Michael Hadley
fa8178f47b Port of ImageCollection from v2 2017-11-24 08:21:09 -06:00
Felipe Alfonso
f1ea070256 Switched inverted rotation transform 2017-11-23 16:02:41 -03:00
Felipe Alfonso
c6d674af8d strokeRect fix 2017-11-23 15:53:15 -03:00
Michael Hadley
0fd6779107 Adding a couple notes about methods that manipulate multiple tiles 2017-11-21 19:19:13 -06:00
Michael Hadley
e19de28932 Tilemap & layers now recalc faces (with a parameter for disabling recalc) 2017-11-21 19:18:34 -06:00
Michael Hadley
bdea565586 Better optimized calc/recalc faces methods for tiles
These eliminate the need for the preventRecalc method from v2. If an individual tile is changed with putTileAt, only the min number of faces will be recalculated (vs all faces being recalculated in v2)
2017-11-21 19:16:46 -06:00
Michael Hadley
dd8bbfa625 Update SetCollision methods to track which indices have been set to collide 2017-11-21 19:13:43 -06:00
Michael Hadley
e3dbf7c2d0 Fixing internal method name typos 2017-11-21 19:07:22 -06:00
Felipe Alfonso
500da5d07f Canvas GeometryMask rendering 2017-11-21 20:21:43 -03:00
Michael Hadley
105dc755ce Tilemap & layers: optimized SetCollision methods
v2 was structured in a way where a full pass through ALL tiles would occur if SetCollisionBetween or SetCollisionByExclusion was used. That's a huge penalty for large tilemaps, so this version duplicates some loop code for the sake of speed.
2017-11-20 20:08:50 -06:00
Michael Hadley
21584f922c Fix for last commit 2017-11-18 16:11:51 -06:00
Michael Hadley
3f14382951 Make naming consistent for accessing individual tiles (e.g. getTile vs getTileAt) 2017-11-18 15:41:26 -06:00
Michael Hadley
759252a078 Better handling of resizing a tilemap
Force the tilesets and tiles to inherit their tile size from the tilemap
2017-11-18 15:40:27 -06:00
Michael Hadley
e2960486a9 Filling out Tile with some methods & props from v2 2017-11-18 15:38:46 -06:00
Michael Hadley
b48d82daee Format name typo 2017-11-18 08:41:57 -06:00
Michael Hadley
d2f72fbe58 Create CullTiles component to allow static and dynamic layers to cull when needed
Fixes performance issue with canvas static tile renderer on large maps
2017-11-18 08:31:59 -06:00
Michael Hadley
b5fb0b8879 Refactor in order to update TilemapCreator & TilemapFactory 2017-11-17 15:55:12 -06:00
Michael Hadley
f82217e868 Move Parse to tilemap/Parse 2017-11-17 15:54:18 -06:00
Michael Hadley
49854bfd1b Format Typo 2017-11-17 15:49:32 -06:00
Michael Hadley
6da642bd99 Set alpha in dynamic layer canvas renderer
Set it directly because of the explicit save/restore commands throw the renderer's internal alpha out-of-sync
2017-11-17 15:31:41 -06:00
Michael Hadley
5535af2a17 Bug fix: tilemap layer renderer didn't account for layer xy position 2017-11-17 13:53:11 -06:00
Michael Hadley
09ed883f4d Remove old todos in static layer 2017-11-17 13:52:32 -06:00
Michael Hadley
b8e8d9d3aa Made data structure for maps and layers more explicit via classes & default props 2017-11-17 13:16:39 -06:00
Richard Davey
5f1c022866 lint fix 2017-11-17 18:29:50 +00:00
Michael Hadley
3266974ea0 Tilemap & layer WorldXY methods: get, has, put, remove 2017-11-17 07:58:33 -06:00
Richard Davey
6ccae5ec49 Particle Manager no longer uses BuildGameObject and instead manages its own addition to the system lists. 2017-11-17 13:30:29 +00:00
Richard Davey
d74018f3d0 Rogue null check borked the creation of emitters when a null frame was specified. 2017-11-17 13:30:07 +00:00
Richard Davey
153d1a113a Fixed factory name. 2017-11-17 13:29:33 +00:00
Richard Davey
f29d94356c eslint tidy 2017-11-17 13:29:23 +00:00
Michael Hadley
b34d18e10c World to Tile conversion on maps and layers - both accounting for camera scroll 2017-11-16 20:36:45 -06:00
Michael Hadley
205675c387 Tilemap: prevent methods from acting on a static tilemap layer & warn user 2017-11-16 19:58:35 -06:00
Michael Hadley
b34f8a9dcc Associate tilemap layer data with the static or dynamic tilemap layer that "owns" it
This enforces 1x tilemap layer data <-> 1x static/dynamic tilemap layer and allows the Tilemap instance to look up the static/dynamic tilemap layer when needed.
2017-11-16 19:55:17 -06:00
Michael Hadley
83b7df2a73 Tilemap: destroy, removeAllLayers, setTileSize 2017-11-16 19:09:28 -06:00
Michael Hadley
63fb2e863f Tilemap & layer: ReplaceByIndex, FindByIndex, SwapByIndex 2017-11-16 19:08:58 -06:00
Michael Hadley
4c306d60a7 Last Tileset API method to match v2 2017-11-16 15:25:45 -06:00
Michael Hadley
e6c6d1ddce TIlemap & layers: GetTileAtWorldXY 2017-11-16 13:27:52 -06:00
Michael Hadley
c2268f3dee PutTile, RemoveTile & Tile#Copy 2017-11-16 13:09:07 -06:00
Michael Hadley
2b08daff32 Tilemap: modularize empty map generators & add createBlankDynamicLayer 2017-11-16 11:44:24 -06:00
Richard Davey
a60562a634 'add' shouldn't control the update state. 2017-11-16 16:47:13 +00:00
Michael Hadley
efae7f5796 DynamicTilemapLayer updates that should have been in the last commit 2017-11-15 20:16:43 -06:00