I want to image sprite of fixed dimension small icon images(~10 to 15) in to one single image and store in to storage.
What is the best way to read each individual image from the sprite. I can store individual image in storage but that is something I don't want to do (jus because I don't like soring lots of small files.)
Any clue how I can achieve this?
Hi - I'd just store all the images (as you'd get from the image generator site) into one big file one after the other and store the offsets somewhere.
var images = require("Storage").read("myimages");
// note 'images' is not actually using up your RAM, it's still stored in flash
The substr will do a copy of the small image into RAM, but honestly if it's a small icon that's not going to cause a big problem.
Thank you @Gordon as always for a super quick response!!
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem