Home Forums
10 | 29 | 2020
We have 2748 guests and 1 member online
JoomlaNook Forums
Welcome, Guest
Please Login or Register.    Lost Password?
ImageLoader and PIXI.TextureCache problem
(0 viewing) 
Imageloader
Go to bottom
TOPIC: ImageLoader and PIXI.TextureCache problem
#15194
carterturner
Posts: 105
User Offline Click here to see the profile of this user
ImageLoader and PIXI.TextureCache problem 3 Years, 1 Month ago  
Hi,

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;}


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.
Please help.

Thanks!

I didn't find the right solution from the Internet.

References:www.html5gamedevs.com/topic/8898-imagelo...exturecache-problem/

Flat Intro Animation
 
Logged Logged
 
Last Edit: 2017/09/26 08:28 By carterturner.
  The administrator has disabled public write access.
Go to top