creatine icon indicating copy to clipboard operation
creatine copied to clipboard

Insert image objects in TMXMap initialization

Open renatopp opened this issue 10 years ago • 1 comments

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:

  1. having a function that insert the loader result inside the data structure, e.g.:

    creatine.magicalFunction(data, loader)
    
  2. 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.

renatopp avatar Dec 21 '14 11:12 renatopp

Oh, this is currently a big problem on iOS and Android

renatopp avatar Dec 21 '14 11:12 renatopp