Tile Map Error: WebGL: texParameter: no texture is bound to this target

Hi i am trying to load a tmx file, but the console throws this error…
here is my code


 var CtiyMap = cc.Scene.extend({

      ctor : function()
      {
           this._super();
           var tiledMap = new cc.TMXTiledMap("res/tile maps/map.tmx");
           this.addChild(tiledMap);
      }
});

cc.LoaderScene.preload(['res/tile maps/map.tmx'],function(){
      cc.director.runScene(new CityMap());
 });

and the tmx file is loaded correctly… does it require that the tmx should use sprite sheets or i can use collection of images too, because i am currently using a collection of image as my tile set
why is this error happening please help just a newbie in cocos2d :blush: thanks

Collection of images is currently unsupported AFAIK.

owh… thats sad.
why is this still not supported… its been years :frowning:

Official tilemap has received no love in recent months, unfortunately, I may have to release an update to the core to support the latest functionality some of which we use internally on our own games. A quick and simple implementation to support non-batched tiles shouldn’t be too hard to add.

1 Like

thanks…
please informed us when you finished updated it…
our graphic artist is bugging me because of this issue hehe… thanks sir @stevetranby :smile:

@stevetranby its still not working… :frowning:
im using spritesheet now is it because my initialization isnt right?

Is the spritesheet in the same directory as the .tmx file?
Try creating a simple 10x10 map, fill in tiles, and XML with no compression.
How did you export it?
Into what file format and compression?
Isometric or Orthogonal?

@eydamson I had to add my spritesheet to the resource.js file or load it with cc.loader.load(['res/spritesheetname.png'], callbackfunction, this); then create the tilemap after the spritesheet is loaded. Also you might want to try removing the space in your tilemap directory path. I’m new too so no promises!

Ah yes, I should familiarize myself with the differences in JS version mostly related to app setup and asset loading.
It’s probably a path issue. I do notice in the js-tests folder in the cocos2d-x root they don’t include the res/ segment. Removing spaces is also a good idea just for sanity (easy to make sure spaces can’t be the problem), but it’s a bug if using them is a problem.

// have you tried this
var tiledMap = new cc.TMXTiledMap("tile maps/map.tmx");

Edit: and prob need to also change to:

cc.LoaderScene.preload(['tile maps/map.tmx'] ...

thanks guys… i already make it working…
i still have a question, when i make a object layer and put an image to it, it does not render in the scene.
have you experience this? they said that embedding images are not supported, is putting an image(image tool) in a object layer literraly means embedding a image? thanks for the tips guys… :wink:

btw my tmx uses one tile set per layer only because cocos2d is crying about each layer should only use one tile set. :smile:

Many many restrictions and incompleteness of the cocos default tilemap renderer :frowning:

hi, i meet same error when i load tile map, please help me!!
Console show error : WebGL: frameworks/cocos2d-html5/cocos2d/core/textures/TexturesWebGL.js:613 WebGL: INVALID_OPERATION: texParameter: no texture bound to GL_TEXTURE_2D