fredsa / playn

Cross platform game library for N≥4 platforms
0 stars 1 forks source link

Alpha channel in setFillColor of ImmediateLayer.Renderer behaves unexpected #179

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Alpha channel in setFillColor of ImmediateLayer.Renderer behaves unexpected in 
version 1.3.1 as compared to 1.2. The intuitive behavior was the earlier one.

What is the expected output? What do you see instead?

Expected output is that color becomes transparent and shows underlying layers 
when using a lower value than 0xff in setFillColor(0x80ff0000) in the renderer 
of an immediatelayer.

What version of the product are you using? On what operating system?
It used to work fine in 1.2 and broke down when I upgraded to 1.3.1
OS: Win XP
PlayN version: 1.3.1

Please provide any additional information below.

Code to put in ImmediateLayer.Renderer implementation:

Expected and used to work in 1.2
surface.setFillColor(0x80ffffcc);
surface.fillRect(...);
-> We used to get a transparent colored rectangle as illustrated in one of the 
figures below. Doesn't work anymore

Work-around, what we have to do in 1.3.1 to get approximately same visual 
behavior:
surface.setFillColor(0xffffffcc);
surface.setAlpha(0.5f);
surface.fillRect(...);
-> Drawback is it sets alpha for the entire layer and makes everything 
transparent.

Using the original code seems to yield an extremely faint transparency on some 
color channels.

To illustrate the latter, I've attached a figure with both 50% transparency on 
the layer and the color.
surface.setFillColor(0x80ffffcc);
surface.setAlpha(0.5f);
surface.fillRect(...);

The result is the not-expected figure attached.

Original issue reported on code.google.com by tab...@broadinstitute.org on 30 May 2012 at 2:47

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in 3f5f4bc0385bc3f4812327b90c99a2cd855588aa.

Original comment by m...@samskivert.com on 30 May 2012 at 5:28