Jump to content

When loading tileset -- has no method 'tileset'


dianasaur
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...