This plugin loads an image inside a sprite at runtime (lazy loading).
To use this, add the object to the layout, position it (currently I only support top-left hotspot), then add the action to load from url.
If you need to lazy load an image outside construct2 this is the plugin you need (read the FAQ).
This plugin works with every browser either mobile or desktop. If you find a bug/error please report it so I can update the plugin.
Get the
latest version (v0.5b)
CHANGELOG:
v0.5b (April, 18th 2012)
-First public release
---------------------------------------------------------------FAQS
Considering that we already have one behaviour and one plugin that does exactly the same thing as mine why should you use this one?
Short answer: it's the only one that works.
Technical answer:
Loading an image at runtime it's an hack, basically something that c2 wasn't made to do, both the existing plugins do not treat it as such because they were tested only on new browsers. Both of those plugins DO NOT work on android and iOS (on 4.x they make c2 crash, on 5.x they are unpredictable) and have glitches when ran inside webGL.
Why you may ask? With the help of Ashley in this thread and with days of testing I found out that on older (or slower) browsers, the image at one point as a value that could be less than zero, null/false and even unpredictable values, this means that when ctx.drawImage gets called all sort of error happens, errors that can result in a complete crash or glitches. My plugin checks if the image has been REALLY loaded and ONLY then it draws it, as far as my knowledge goes this can be done only in a plugin because you have complete control of the drawing part.