Theme masks - impossible to delete

I’ll try to explain… not easy.

I was trying to find out which mask image file was being used by corona in different approachs, when personalizing a switch button:

a ) making a custom theme

b ) creating a custom switch on the fly, using an image sheet an mask

At some moment I decided to erase (or rename) some of the mask files to see which one was being used:

I have the “normal”, the “@2x” and the “@4x

To my surprise, the theme and its switch still work when I deleted all 3 files. Or if I rename them.

I was going nuts - checked everything: no other mask file for sure. Exited simulator, entered again, same. Relaunch project, clean sandbox…

Last I built the project for windows, and *magically*, a new mask image file with the correct name was generated - one that was NOT in the project folder.

All this with version 2017.3130 in Windows 10.

So the mask file is somewhere in Corona’s cache - which makes me feel uneasy.

Also, it seems only the “normal” mask file is used in any case.

Best regards,

jaime

Hi @jaime,

Where are you “erasing” mask files from? Those are part of the core of the widget library, so I’m not sure how you even have access to them. Did you copy over the open-source widget repo and implement it within your project, along with all of its files?

Brent

Hi Brent,

sorry I was not clear enough - I’m customizing a switch, so I’m providing an image sheet with the background, handle, etc… and an external png file with the mask.

All these files are located in the project folder, and that’s where I remove the mask from.

As explained here:

https://docs.coronalabs.com/api/library/widget/newSwitch.html

Best regards,

jaime

Hi Jaime,

Most widgets have a certain amount of “default” elements that they’ll be constructed with if you don’t supply your own custom ones. These are in the core of Corona and you can’t simply delete them.

Basically, the idea with customizing widgets is that – if the documentation notes that something is required – you really need to supply it and follow the specifications. If you don’t, the widget might fall-back to defaults and produce results that you aren’t expecting. What I mean is, widget customization is generally an “all of nothing” process. :slight_smile:

Brent

Hi Brent,

thanks for the reply - crystal clear.

I was trying to find out what specific files were needed depending on the screen configuration, but no way if Corona is supplying them - which is nice on the other hand. :slight_smile:

Best regards,

jaime

Hi @jaime,

Where are you “erasing” mask files from? Those are part of the core of the widget library, so I’m not sure how you even have access to them. Did you copy over the open-source widget repo and implement it within your project, along with all of its files?

Brent

Hi Brent,

sorry I was not clear enough - I’m customizing a switch, so I’m providing an image sheet with the background, handle, etc… and an external png file with the mask.

All these files are located in the project folder, and that’s where I remove the mask from.

As explained here:

https://docs.coronalabs.com/api/library/widget/newSwitch.html

Best regards,

jaime

Hi Jaime,

Most widgets have a certain amount of “default” elements that they’ll be constructed with if you don’t supply your own custom ones. These are in the core of Corona and you can’t simply delete them.

Basically, the idea with customizing widgets is that – if the documentation notes that something is required – you really need to supply it and follow the specifications. If you don’t, the widget might fall-back to defaults and produce results that you aren’t expecting. What I mean is, widget customization is generally an “all of nothing” process. :slight_smile:

Brent

Hi Brent,

thanks for the reply - crystal clear.

I was trying to find out what specific files were needed depending on the screen configuration, but no way if Corona is supplying them - which is nice on the other hand. :slight_smile:

Best regards,

jaime