arrays - Embedding loads of images -


i got 42 images want embed , put on array. tried within loop, doesn't seem work. how can avoid have 42 embed lines + long line array ?

the way embed multiple images without embed line each 1 use sprite sheet (sometimes called 'texture atlas', or 'sprite'). take folder of images, , generate 1 large image. , give data file (use xml or json) of images in folder , they're positioned inside sprite sheet.

you can embed sprite sheet once.

for need 2 things:

1/ software create sprite sheet... there many tools available, 1 use example texture packer: http://www.codeandweb.com/texturepacker

2/ actionscript class or framework, designed handle referencing images sprite sheet... native feature of starling, if you're not ready support flash player 11 can find publicly available frameworks this: example: spriter: http://abeltoy.com/projects/spriteras3/usage.html has class called bitmapspriter handle sprite sheets natively in as3.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

javascript - Backbone.js getting target attribute -

html - Repeat image to extend header to fill screen -