Timeline for Phaser is not loading the same map created in Tiled software
Current License: CC BY-SA 3.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 28, 2018 at 5:21 | comment | added | Ashish | Better I should switch to the official version before its too late. | |
Feb 27, 2018 at 11:57 | comment | added | vassildador | @Ashish You're welcome! I'm glad you figured it out. There is also phaser-ce a community-updated version of 2.X which should be compatible with your code. The official version is now Phaser 3, so if you didn't create too much yet I recommend switching to that :) | |
Feb 27, 2018 at 10:37 | vote | accept | Ashish | ||
Feb 27, 2018 at 10:36 | comment | added | Ashish | Yep! Its working !!! The problem was version of phaser. I was using phaser 2.0.4 and now I have changed it to 2.6.2. Thanx man. | |
Feb 27, 2018 at 7:49 | comment | added | Ashish | Ok @vassildador I'll let you after fixing this bug.. | |
Feb 26, 2018 at 12:42 | comment | added | vassildador |
@Ashish As I mentioned in my previous comment, I actually did test it with a json file like this: preload: game.load.tilemap('map', 'map.json', null, Phaser.Tilemap.TILED_JSON); Create: map = game.add.tilemap('map'); And everything works and renders as intended. This means the problem is somewhere on your end, possibly in code you didn't list. Perhaps a bug in your phaser version? I can't say, as what you posted just works.
|
|
Feb 26, 2018 at 12:14 | comment | added | Ashish | the example is working with the json (file)data using inside the project. If I am loading json file in create or preload function then there is no luck. I do not understand this behavior of phaser. Maybe some problem with game.cache.addTilemap() or game.load.tilemap(). I have added code something like this - game.cache.addTilemap('map', null, 'background.json', Phaser.Tilemap.TILED_JSON); Can you try it? Please let me know if any positive result coming? | |
Feb 26, 2018 at 8:27 | comment | added | vassildador | @Ashish did you manage to fix it? I'm quite curious :) | |
Feb 24, 2018 at 11:07 | comment | added | vassildador | @Ashish I tested your example locally, using your way to load the json data, and it worked flawlessly. I only changed it in the fiddle as the json data isn't hosted anywhere, so I had to load it inline. | |
Feb 24, 2018 at 3:24 | comment | added | Ashish | You have loaded the JSON data in a different way, But does it not working by directly loading ? Any idea? | |
Feb 22, 2018 at 16:53 | comment | added | vassildador | @Ashish Any chance you're modifying tile data in any other part than the create? I've recreated your example based on your create function, and even though you seem to load phaser twice (.min.js and .js) it seems to render properly. I also turned it into a (slightly altered to load the mapdata inline) fiddle: jsfiddle.net/u7kqrq5f/1 | |
Feb 22, 2018 at 14:47 | comment | added | vassildador | Will do, as soon as I'm home! | |
Feb 22, 2018 at 7:51 | comment | added | Ashish | There is no margin or spacing in between the tileset image and while creating tilemap I have added tile size of 30X30. But this should not affect the map while loading.I have included all source files, please do check. | |
Feb 19, 2018 at 21:27 | review | First posts | |||
Feb 20, 2018 at 0:01 | |||||
Feb 19, 2018 at 21:24 | history | answered | vassildador | CC BY-SA 3.0 |