dianasaur Posted March 18, 2014 Share Posted March 18, 2014 Hello, I'm currently using v1.1.5 and I'm having problems loading up a tileset in my preloader state. Below is a code snippet and the error I get on Chrome's developer console. Preloader State:BasicGame.Preloader = function (game) {};BasicGame.Preloader.prototype = { preload: function() { // In here I successfully load a bunch of images, spritesheets and atlas xml // ... // Tilesets -- this is where the error happens! this.game.load.tileset('base_tileset', 'assets/tiles_spritesheet.png', 70, 70); }, create: function() { text = this.game.add.text(this.game.world.centerX, this.game.world.centerY, 'Loading screen', {font: '65px Arial', fill: '#fff'}); text.anchor.setTo(0.5, 0.5); // Once the load has finished we disable the crop because we're going to sit in // the update loop for a short while as the music decodes this.preloadBar.cropEnabled = false; this.game.state.start('TitleScreen'); }};Error:Uncaught TypeError: Object [object Object] has no method 'tileset' Anyone have any ideas on what I'm doing wrong. All of my other loads are successful, can't figure out what the issue is! Thanks in advance Link to comment Share on other sites More sharing options...
rich Posted March 18, 2014 Share Posted March 18, 2014 You don't need to load tilesets like this any more, you just do load.image. Have a look at the examples to see the new syntax (the above syntax is for old < 1.1.3 versions) Link to comment Share on other sites More sharing options...
dianasaur Posted March 23, 2014 Author Share Posted March 23, 2014 Ah ok perfect! Thanks, I got it working. Is there currently a way to offset the tilemap layer? Can't seem to figure it out. I'm using Tiled Map Editor to generate the json. I set the map offset in Tiled, but dont see it reflected anywhere in the json file... Can I fix it within Phaser? Thanks in advance! Link to comment Share on other sites More sharing options...
Recommended Posts