Jump to content

How Can I Create diferent size spritesheets using the same image on Phaser


Jason87
 Share

Recommended Posts

Hello, I am relatevely new on phaser, I started building a prototype of a slide puzzle with phaser, wich is pretty basic stuff, just to get started, I have managed it pretty well so far, the thing is I want to put several dificulty levels, by dividing the image on more smaller squares, wich makes it harder, so, I use spritesheets like this:

 

this.game.load.spritesheet("tilesHard","assets/1.jpg",160,96);

 

this.game.load.spritesheet("tilesHarder","assets/1.jpg",120,96);

 

The thing is that aparently this way I have to load the image every time for each diferent size spritesheet. Wich for a large ammount of images, it is a problem, loading the same one several times.

 

My cuestion, is there a way of fixing this, meaning: Can I make the different size spritesheets, from the same image, loading it only one time ?

 

Thanks a lot

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

Don't really understand how your spritesheet works . You could use copyRect/BitmapData etc to create a partial copy of the image you need .

What's the problem with loading it more than once though?

Why is this in the Phaser 3 forum though? It's not even released yet is it?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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