Create ring shaped progress bar. Is it posible?

Thanks for the kind words, James! Glad that my little module is helping folks out. :smile:

No Problem Jason!

The guys at Corona Geek have been talking about it for awhile…it’s really slick! Nice work!

UPDATE: With daily build #2015.2544, Corona Labs fixed the finalize() bug that prevented objects’ finalize events from being triggered when their parent display group was removed. Woohoo! However, my progressRing module had a bug that only manifests itself now that finalize() is working again. I had utilized a workaround developed by @sergeylerg, but there was an error in my implementation of that fix that causes a crash when run on build 2015.2544 and later. I fixed that error by adding a 1ms timer when checking to see if finalize events are being triggered as they should. The finalize() fix is not necessary for up-to-date Corona builds, but I’m leaving it in for folks who might be running legacy Corona builds.

Please get the updated version of the progressRing module at http://www.jasonschroeder.com/2014/12/21/progress-ring-module-for-corona-sdk/

Hi Jason! First of all, thank you for this module! :slight_smile:

I updated recently to Corona build 2607 and the progress ring looks broken when the sample code is ran on the iPhone 6 simulator.  I tested it on an actual device and the same output.  Have you tried it?  iPhone 5 build and simulator works great though.  Any idea why?

Hi @egarayblas: Unfortunately there are still a few kinks related to the way I dynamically generate the mask file that can cause the error you describe when you’re working with a device that has a different resolution than the one specified in your config.lua - to test this theory, try changing the content width & height in your config.lua to the iPhone 6’s native resolution…or remove the config.lua file altogether (for simulator viewing only - you need that config.lua to build for device I believe). Basically, because mask files have very specific requirements regarding size, exporting an image file (which I do to generate the mask file) that is scaled can result in a mask file that doesn’t meet those requirements (usually the one involving a width & height evenly divisible by 4). I’ve been trying in my spare time to come up with an algorithm that will kick out a workable mask image in all circumstances, but I’ve been swamped with work and honestly haven’t had the time to keep working at it. If I manage to find a solution, I’ll be sure to post about it here. In the meantime, you can get around that issue by making your own mask image and modifying the code to use that pre-fabricated image.

Thanks,

Jason

Thank you for the update Jason!  I’ll find a workaround then. :slight_smile:

Hi Jason! First of all, thank you for this module! :slight_smile:

I updated recently to Corona build 2607 and the progress ring looks broken when the sample code is ran on the iPhone 6 simulator.  I tested it on an actual device and the same output.  Have you tried it?  iPhone 5 build and simulator works great though.  Any idea why?

Hi @egarayblas: Unfortunately there are still a few kinks related to the way I dynamically generate the mask file that can cause the error you describe when you’re working with a device that has a different resolution than the one specified in your config.lua - to test this theory, try changing the content width & height in your config.lua to the iPhone 6’s native resolution…or remove the config.lua file altogether (for simulator viewing only - you need that config.lua to build for device I believe). Basically, because mask files have very specific requirements regarding size, exporting an image file (which I do to generate the mask file) that is scaled can result in a mask file that doesn’t meet those requirements (usually the one involving a width & height evenly divisible by 4). I’ve been trying in my spare time to come up with an algorithm that will kick out a workable mask image in all circumstances, but I’ve been swamped with work and honestly haven’t had the time to keep working at it. If I manage to find a solution, I’ll be sure to post about it here. In the meantime, you can get around that issue by making your own mask image and modifying the code to use that pre-fabricated image.

Thanks,

Jason

Thank you for the update Jason!  I’ll find a workaround then. :slight_smile: