creatine
creatine copied to clipboard
Insert image objects in TMXMap initialization
PreloadJS have some issues when loading images from path, e.g.:
var bitmap = new createjs.Bitmap('assets/img/myimage.png')
The recommended way is using directly the result from LoadQueue, e.g.:
var bitmap = new createjs.Bitmap(loader.getResult('image'));
(see https://github.com/CreateJS/PreloadJS/issues/105)
Currently, TMXTileset and TMXImageLayer do not consider this, so it may be necessary to present the image object to them. I'm thinking that this can be achieved in two ways:
-
having a function that insert the loader result inside the data structure, e.g.:
creatine.magicalFunction(data, loader)
-
or loader can be passed as parameter to TMXMap, e.g.:
var map = creatine.TMXMap(data, loader)
The second option seems better (more straightforward), but looking for alternatives.
Oh, this is currently a big problem on iOS and Android