Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

In starling, it's faster if you use BitmapText instead of traditional text. Which is well great except for one issue. Right now the sprite sheet I was making was with a single Fla. I just created the sheet from Flash IDE.

The bitmap text however is generated using a tool like BMFont . Which generates it's own sprite sheet. Now, imagine I have three or four types of texts . Also for some reason I have multiple Sprite sheets of assets.

So the question is, how do I stick multiple sprite sheets together. Is there any available tool for it?

Does using multiple sprite cause performance issues?

share|improve this question
    
Combining bitmap fonts with other sprite sheets seems like a very odd requirement. Are you sure you actually need to do that? –  jhocking Nov 20 '13 at 12:55

4 Answers 4

I'm not aware of any existing tool for that purpose. What I would do is write a custom script (I'd use Python, but using some other scripting language would work just as well) that first invokes ImageMagick to combine the separate images, then reads in the accompanying XMLs to get data for each of the spritesheets, modifies the data as needed, and then writes the modified data into a new combined XML.

share|improve this answer

To combine multiple sprite-sheets you'll have to revert to a method like jhocking describes in his post (eg. combine the images and make sure coordinates in the XML files are being updated accordingly).

That's a suboptimal way to go about it though. Instead of exporting several sprite sheets, why not export just one? Texture-Packer is a really great tool for this. You can simply create a folder, export all your sprites there (eg. animations as image-sequence) and drag the folder into texture-packer. The tool will combine all the images from that folder into a sprite-sheet and even auto-detect new images when you add them.

When it comes to special sprite-sheets such as fonts, you usually have to resort to other methods. In case of the starling framework, this is a non-issue though. You can pack your font-bitmap (the whole sheet) into a sprite-sheet like any other sprite. Then in starling you do something like this:

var font:BitmapFont = new BitmapFont(atlas.getTexture("fontName"), xmlData);

Where atlas is the loaded texture atlas. "fontName" references the font-sheet inside the atlas. The xmlData parameter is the loaded font data (file sometimes has .fnt extension).

share|improve this answer
    
Thanks Bummzack, texture packer would do. So can I pack my fonts and other sprites together? Basically right now I think my game would have atleast 5 variations of fonts (I want them to be bitmap fonts) . What would you recommend, pack them in one or have different atlas's for each? –  Fahim Akhter Feb 22 '13 at 10:31
    
@FahimAkhter You can pack the fonts and sprites into one sheet. Depending on the devices you're targeting I wouldn't use sheets greater than 2048x2048 or even 1024x1024. –  bummzack Feb 22 '13 at 11:49
    
X number of sheets. No sheet exceeding 1024x1024, got it :) –  Fahim Akhter Feb 22 '13 at 12:30

Not sure if i understand you right but it seems you are looking for something like http://www.codeandweb.com/texturepacker for creating a textureatlas

share|improve this answer
1  
He's talking about stitching together multiple spritesheets, not generating a new spritesheet. –  jhocking Feb 21 '13 at 16:30

This forum post also explains how it's done. http://forum.starling-framework.org/topic/bitmapfonts-sharing-a-textureatlas

share|improve this answer
1  
You might want to make a summary of the method behind that link. Links can become invalid... –  sm4 Jun 18 '13 at 16:09
    
Also, link only answers are better suited as comment. –  petervaz Jun 18 '13 at 17:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.