Jumangee Posted August 30, 2014 Share Posted August 30, 2014 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.TextureCacheAnd 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 errorThen 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! Quote Link to comment Share on other sites More sharing options...
Jumangee Posted August 30, 2014 Author Share Posted August 30, 2014 Looks like i solved this probleb with two loads: .load, and after 'loaded', second call with .loadFramedSpriteSheet Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.