SOLVED: Tinting images and alpha not working in nested displayGroups

Hi there!

I’m working on a new game where it seems tinting and setting alpha does not work as expected.

I have a image that is inserted in a displayGroup in a displayGroup (nested 2 levels deep, so to speak). Tinting this image does not work. Setting the alpha on this image does not work either, except for with values 0 and 1 (so full on or full off).

If I remove the image from the displayGroups all works as expected. Is this a known limitation of displayGroups and tinting / alpha? [import]uid: 70134 topic_id: 25909 reply_id: 325909[/import]

p.s. It’s not the bug/issue where the display only updates tinting after the object is moved. I added some code like image.x = math.random(100) to move the object after tinting, just for testing, and as said above the image does move, but tinting does not happen. [import]uid: 70134 topic_id: 25909 reply_id: 104855[/import]

Hey thomas.

Would you mind posting a bug report here: bugs.anscamobile.com after reading the below guidelines:

Hello, In order to test your case we need a simple test case that we can run without requiring any third party libraries (if applicable) or modules (if applicable). We simply cannot test bug reports that only contain bits and pieces of code from your project. It must be stripped down to a tiny, reproducible test case so we can then see if it is in fact a bug with corona or an issue with your own code.

In order for us to evaluate this we need:

  1. A test case confined if possible to a single main.lua file, this helps eradicate any possible user bugs contained in separate lua files/modules.

  2. Remove any un-unused variables that are not being used in the sample.

  3. Make the code as simple and commented as possible (imagine you were programming it as an example for a new user) This will make it 100x quicker to establish whether or not it is a Corona issue or user issue.

  4. Adequately named variables. Please name your variables so they are clear to understand their meaning. Example, you have a variable defined for a tree.

Good :

local tree

Bad:

local tImage
If you can make a test case that is as simple as possible and as few lines of code as possible with adequately named variables we can get this confirmed one way or the other and get it resolved asap.

[import]uid: 84637 topic_id: 25909 reply_id: 104897[/import]

Hi Danny,

I just did a test and was able to trace the problem: apparently the problem was not nested displayGroups but a mask on the image. Is this a known limitation, that images with masks can not be tinted?

Thanks,
Thomas [import]uid: 70134 topic_id: 25909 reply_id: 104911[/import]

Well, I found it in the docs: tinting does not work with masking, it’s a known limitation unfortunately. Too bad… For my specific case there is a workaround, fortunately, but it’s pretty messy :wink:

Thomas
[import]uid: 70134 topic_id: 25909 reply_id: 104924[/import]