Sign in to follow this  
DylanD

Sprite Sheets that are not Uniform

Recommended Posts

Hello again everyone!

I was wondering if there was a way to get all the sprites in a sprite sheet automatically like they do here http://doc.babylonjs.com/babylon101/sprites but with sprites that are not uniform size (cellSize is not uniform).  I know I could manually do it but I have many sprites and that could be very time consuming, and very messy.

So I'm hoping there is a way to have sprite manager automatically make the cells.  

Any ideas?

Share this post


Link to post
Share on other sites

not without a json mapping or something of the sprites, something needs to tell where each sprite start & end :) 
uniform sprite sheets can be done like that because you just add the sprite size each time you need to find the next one.

Share this post


Link to post
Share on other sites
11 minutes ago, aWeirdo said:

Oh i thought you ment a spritesheet where different sprites have different sizes? 
like there might be a man 100x100 and then a tree 100x200

yes this is what I meant.

 

40 minutes ago, aWeirdo said:

not without a json mapping or something of the sprites, something needs to tell where each sprite start & end :) 
uniform sprite sheets can be done like that because you just add the sprite size each time you need to find the next one.

How could I do a json mapping ?

 

 

 

 

20 minutes ago, Deltakosh said:

You can also directly define manager.cellWidth and manager.cellHeight :)

 

22 minutes ago, Deltakosh said:

Quote from the doc:

 

I have tried this but its all manual...

 

Thanks for the response though.

Share this post


Link to post
Share on other sites

often, spritesheet editing/creation tools have json exports.. (they map the sprites as you add them to the sheet)

but i don't think you can automaticly create them from an already finished spritesheet,
it simply would have no way of telling where one starts and the next ends.

Share this post


Link to post
Share on other sites
Just now, aWeirdo said:

often, spritesheet editing/creation tools have json exports.. (they map the sprites as you add them to the sheet)

but i don't think you can automaticly create them from an already finished spritesheet,
it simply would have no way of telling where one starts and the next ends.

oh.  A .png.meta file wouldn't have this information would it?

Share this post


Link to post
Share on other sites
2 minutes ago, DylanD said:

oh.  A .png.meta file wouldn't have this information would it?

I don't know, sorry, but sounds like it might be worth researching.
i hope you figured it out :) 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.