Weird issue with image alpha - changes after a frame.

Hi,

We have a scene in our game, where part of the screen is covered in a black rectangle with alpha set to 0.5 [rectangle 4x4 loaded from imagesheet].

Unfortunately, it looks like the alpha is modified after the rectangle is on screen.

We can see [so it takes at least single frame] that it gets ‘darker’ after less then a second from showing the rectangle on screen.

There are no masks applied anywhere.

We are using graphics 2.0, Corona Pro 2170.

Thing we have checked:

  • nothing modifies the rectangle nor group the rectangle is in, nor their parents. [rectangle->group1->group2]

  • there’s no transition added to the rectangle nor any group it is in, nor any object in the groups [actually right now there’s simply no transitioning going on at all]

  •  We have added enterFrame event, which displays alpha of the object in question - it does not change. It is 0.5 all the time.

- We have checked if there are new object created which could overlay our rectangle - nada. Display object count in the hierarchy does not change.

  • If we change the alpha of the rectangle in question, it always looks like it is incremented by half of what it was (so if we set it to 0.5, it looks like it is 0.75 after a frame/few frames).

We have tried to recreate this issue with a sample project, but we can’t.

Some funny things:

  • changing rectangle loaded from imagesheet into rectangle created using display.newRect solves the issue

  • removing group1 from group2 solves the issue

  • removing a different group from group2 solves the issue

  • disabling FPS counter [totally unrelated, in a different group etc.] solves the issue

Still, even knowing above, I can’t recreate the issue in a sample project.

I’ve got the same logic [removed game logic however], same graphic files etc. in my sample project.

I’m wondering if someone had a similar issue, or has any idea what more we could check. I consider the list of ‘funny things’ as a list of things that ‘mask’ the real problem, however I fail to see what it is.

Any input will be appreciated.

A little bit more input.

Here’s a sample project we were able to create. It does not make sense, sure, but it proves my point.

When you run it in simulator, you’ll see that after a second, the blue graphics changes opacity. Tadam… 

My question is: WHY does it happen?

Now I know of at least 4 ways not to make it happen, none of them are connected [there are more, but I just want to keep it as simple as possible].

So, do one of the following [there’s no need to do all of them to make it work!].

Comment out line 15 or 16 [marked as CODE 1]. One of them is enough, doesn’t matter which one. Cool, huh?

2. 

Uncomment line 32 and comment 49 put [marked as CODE 2]. 

Comment out line 47 [marked as CODE 3]

Comment out line 37 and uncomment 38 & 39 [marked as CODE 4]

As you can see there are few ways to make this work, I don’t care how many other ways there are, I need to know WHY is corona behaving this way?!

This is a very simple sample, so you may think: ahh just change one line and you’ll be grand… but that’s not an option.

Link to the sample project:

https://www.dropbox.com/s/120oj7apz4xyoqi/alphaIssue.zip

A little bit more input.

Here’s a sample project we were able to create. It does not make sense, sure, but it proves my point.

When you run it in simulator, you’ll see that after a second, the blue graphics changes opacity. Tadam… 

My question is: WHY does it happen?

Now I know of at least 4 ways not to make it happen, none of them are connected [there are more, but I just want to keep it as simple as possible].

So, do one of the following [there’s no need to do all of them to make it work!].

Comment out line 15 or 16 [marked as CODE 1]. One of them is enough, doesn’t matter which one. Cool, huh?

2. 

Uncomment line 32 and comment 49 put [marked as CODE 2]. 

Comment out line 47 [marked as CODE 3]

Comment out line 37 and uncomment 38 & 39 [marked as CODE 4]

As you can see there are few ways to make this work, I don’t care how many other ways there are, I need to know WHY is corona behaving this way?!

This is a very simple sample, so you may think: ahh just change one line and you’ll be grand… but that’s not an option.

Link to the sample project:

https://www.dropbox.com/s/120oj7apz4xyoqi/alphaIssue.zip