Jump to content

ImageLoader and PIXI.TextureCache problem


Recommended Posts

Hi All!


I have strange problem:


I do load of big texture (1,5 MB png) with loadFramedSpriteSheet(64, 64, ...)

After i have got 'loaded' event, i do load json, after that i start creating of sprites with PIXI.TextureCache

And in this moment happens strange - texture not exist yet!

for (var i = 0; i < mapdata.length; i++){        var id = mapdata[i];        var t = PIXI.TextureCache['world-' + name + '-tile-' + id];        if (!t)    {            alert('map parse error: ' + 'world-' + name + '-tile-' + id);            return;        }        var tile = new PIXI.Sprite( t );        self.maptiles[id] = tile;}

You can see this behavior here online: http://jumangee.net/test/

Then you load this page in first time - you see error

Then you reload page second time - you see everything ok (image cached)


But why this happens? i thought, then 'loaded' fired image is ready, but looks like not.


Full src file: http://jumangee.net/test/maxWorld.js

Plz help!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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