Fill Color not working for Display Objects in Scroll View, when mask is applied for the scroll view

Below is the plug and play code

[lua]widget = require “widget”
local button = display.newImageRect(“scene.png”,300,300)
button.x = 300
button.y = 300
button:setFillColor(120,120,0)
local scrollView = widget.newScrollView
{
width = 300,height = 300,
maskFile = “mask.png”,
}
scrollView:insert(button)[/lua]

In the above code, the fill color for button doesn’t work.
If I comment out the line
[lua]maskFile = “mask.png”,[/lua]
then the FillColor works perfectly.

Bug? [import]uid: 64174 topic_id: 24843 reply_id: 324843[/import]

I believe this is the same bug that’s preventing me from using bitmap fonts(bmf.lua) in a scrollview, take out the mask and they all appear - put it back and I only get the first line in my scrollView ?!?! [import]uid: 33275 topic_id: 24843 reply_id: 106614[/import]

Do you have a bug number SegaBoy? :slight_smile: [import]uid: 52491 topic_id: 24843 reply_id: 106700[/import]

Ok I filed a bug.
Case 14284 [import]uid: 64174 topic_id: 24843 reply_id: 106811[/import]

Thank you - I will pass that along :slight_smile: [import]uid: 52491 topic_id: 24843 reply_id: 106864[/import]

Hey,

I think I’m experiencing a similar issue…

I’ve masked a scrollview and then I have also masked objects within the scrollview, this works fine in the simulator but does not work on device (ipad 3rd gen)

[import]uid: 129448 topic_id: 24843 reply_id: 110656[/import]

Hey Alloy,

This looks like it was recently reassigned in fogbugz so I believe it is currently being worked on; hopefully we should get a resolution shortly. [import]uid: 52491 topic_id: 24843 reply_id: 110825[/import]

I am having this issue still as well, any word on if it has been looked at yet? Maybe in the daily builds?

Sean [import]uid: 157382 topic_id: 24843 reply_id: 120552[/import]

I am having this issue still as well, any word on if it has been looked at yet? Maybe in the daily builds?

Sean [import]uid: 157382 topic_id: 24843 reply_id: 120552[/import]

I see that opacity for masked objects was just fixed today, was hoping that the fill color was too, but I guess it wasn’t. Having to do some cumbersome workarounds because of this. The ticket has been open for like 8 months, any word on when its going to be fixed? [import]uid: 139660 topic_id: 24843 reply_id: 142112[/import]

I see that opacity for masked objects was just fixed today, was hoping that the fill color was too, but I guess it wasn’t. Having to do some cumbersome workarounds because of this. The ticket has been open for like 8 months, any word on when its going to be fixed? [import]uid: 139660 topic_id: 24843 reply_id: 142112[/import]

Same problem here, and I need to work out the fill color in order to not duplicate images. Is this going to work someday soon? [import]uid: 105667 topic_id: 24843 reply_id: 145680[/import]

Well according to docs, it’s a ‘feature’ and well known issue.

This is there since I remember and from what I know won’t be fixed.

Same problem here, and I need to work out the fill color in order to not duplicate images. Is this going to work someday soon? [import]uid: 105667 topic_id: 24843 reply_id: 145680[/import]

Well according to docs, it’s a ‘feature’ and well known issue.

This is there since I remember and from what I know won’t be fixed.

I just ran into this today.  I’m trying to use white bitmap fonts that I colorize for use against different background colors, but they revert to their default white inside a masked scrollview.  The docs say this is a

“known limitation at the moment”

which leads me to believe there was an intention to fix it.  Given that so much time has passed, is this a true hardware limitation that can’t be fixed or is there some hope that it will eventually be addressed?

Hi @HardBoiledIndustries,

Can you show me a bit of code where you’re inserting and colorizing these text objects? I just tested some colorized fonts inside a scroll view (masked) and it works, so I must be doing it differently somehow.

Thanks,

Brent

Hi Brent,

Strange.  My project is complex so I tried to create a simple test case for you and… it worked!  

I don’t know what I could be doing differently in my actual project as compared to the test.  The big difference is that I am using Text Candy for the fonts and it’s own setColor method so I’ll need to dig deeper to see what it’s doing under the hood.  But the current behavior is that all my text objects that are rendered inside a masked scroll view have the color missing.  If I disable the mask then the colors show up.  

But at least in the simple test case setFillColor does indeed work inside masked scrollviews.

UPDATE:  I made a simple test case and it does indeed seem to be a bug or limitation of Text Candy objects.  I poked around in the TC code but couldn’t figure out what’s causing the issue.  Since TC works fine with scrollviews as long as they don’t have a mask I’m guessing the X-Pressive guys will call it a Corona bug.  I submitted my test case to them anyway in hopes they can isolate it further.

Hi Brent,

I think I found the bug, and its an issue with Corona, not Text Candy.    

Basically, a newImageRect object with alpha, such as a white circle against transparency saved as a .png and imported as a newImageRect, can be color tinted using setFillColor, but it will lose that color if it is inserted into a scrollView with a mask.

If the object is a newRect it will retain the color inside the scrollview, so newRects can’t be used to exhibit the problem (possibly what you used to test it yourself?)

If the scrollview doesn’t have a mask then a newImageRect will retain the color tint inside the Scrollview.

I’ve attached a simple project that exhibits the issue.  I’ve also filed a new bug with the same project file.

(Case 25782) ImageRects loose color tint when inside scrollView that has a mask

What’s a use case limited by this bug?  I am using bitmap fonts via Text Candy for all my in-game text because they are much faster to render.  (I was having long delays between scenes on Android devices when using newText objects so I had to switch over to bitmap fonts).  Bitmap fonts are of course created using newImageRects for each character.  I create each font using a white color with the expectation that I can tint them to any color that I want inside the game.  This works perfectly, _except _in the case where I use text inside a scrollview with a mask, of which I have several inside my in-game store interface.  The only work around is to render separate font image sheets of the same font, for each color.  This is very wasteful in terms of app file size and texture memory since I would  have to store, load, and display multiple copies of the same font, one for each color I intend to use.

Hi @HardBoiledIndustries,

Thanks for filing this bug. I see the same behavior you describe in my latest tests. I believe this will be addressed in Gfx2.0, but let me test it when I have some free time.

Best regards,

Brent