Page 1 of 1

images vs sprites...

Posted: Thu May 08, 2014 9:04 am
by tjo7777
I made a simple game that requires images to be displayed rapidly. So far I have used images and manipulated them with setting the filehandle and using show/hide image.

I notice that sometimes the images do not seem to appear/disappear/change as quickly as I would like. I saw that some games use sprites. Would sprites be noticeably faster than using images?

Also will sprites work with somewhat detailed images like pictures or photographs?

Thanks for any advice or suggestions.

TJ.

Re: images vs sprites...

Posted: Thu May 08, 2014 12:25 pm
by Klaus
Hi TJ,

there are no "sprites" in Livecode! The most similar thing is using images as icons in buttons :D
Just set the ICON of a button to any image ID.

The images have to be in the stack already, be it as referenced or imported images.
This way they will be loaded when the stack opens and are immediately ready for us as icons in buttons.
This will be much faster than what you are currently using.

Please don't let the term "icon" irritate you!
We are used to see an ICON as a small image of some kind, but in Livecode this can be ANY image of ANY size!

Hope that helps!


Best

Klaus

Re: images vs sprites...

Posted: Thu May 08, 2014 5:34 pm
by tjo7777
Thanks Klaus!