Jump to content

Cost of scaling and tileset scaling


Skeptron
 Share

Recommended Posts

Hi all!

 

I'm doing a platformer game and I'm thinking about optimisation. I was wondering if it could be a good idea to scale down all my original assets, and scale them up in the game (to reduce loadings). So my first question is : what's the cost of scaling? Is this technique worth it or are the gains meaningless?

 

Then, I was trying to apply that to the tilesets of my map and I'm struggling with API. These three methods seem to badly interact : 

  • cache.getImage() : return an HTML image (how is that useful, really?) or an image. Here I fetch my downscaled image.
  • tilemap.addTileset() : takes a string key or a bitmapData. Not an image! So I create a bitmapData from the image (fetched in cache), and scale it up
  • tileset.setImage() : takes an image! Damn. I have to change my newly created bitmapData back to image.

 

In my game I change the tilesets' images every now and then, so I have to use these 3 methods. The fact that tilemap.addTileset() doesn't take an image as parameter is very weird and forces me to go from image to bitmapData, and bitmapData to image. Is there something I'm missing? Is there an easier way to do that?

 

Thanks guys!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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