setFillColor() doesn't seem to do anything - What's missing here?

Hi,

This line of code seems to simply be ignored. I have a rectangle image sprite that I want to change colors when hitting the player. 

The rest of the code in this if statement is executed correctly so it looks like this line is skipped or not done:

 function newbadguy.sprite:collision( event ) 

    if(event.other.type == “player”) then

      event.target:setFillColor(255, 0, 0)        <------doesn’t do anything.

Thanks in advance

Is the sprite masked in any way (or is it in a group that’s masked)?  

Not sure if this is still the case, but you couldn’t call setFillColor on something that had been masked the last time I looked.

It’s not masked - at least I didn’t mask it. Perhaps some included code is masking it. Any other ideas?

First, put some print statement under your setFillCollor and check if it’s executed - maybe code does not reach filling function

Is the sprite masked in any way (or is it in a group that’s masked)?  

Not sure if this is still the case, but you couldn’t call setFillColor on something that had been masked the last time I looked.

I’m having the same problem.  SetFillColor works on my buttons from an image sheet but not on display.newImage.  Just recently started to use tinting so maybe I am missing something as well.

        local favimg = display.newImage( row, imageSheet , imageSheetInfo:getFrameIndex(“like_fill”))

        favimg:setFillColor ( 255,0,0,255 )

Using Build #1206    

Just saw this thread regarding a mask on a ScrollView which is indeed what is going on in my case (Except mine is a TableView).  If I remove the mask from the TableView the image turns red as it should.  

The issue has been assigned a defect# and the indication is it is fixed or will be fixed in Graphics 2.0

You can’t tint things in a masked group, which is what a scrollView and tableView is.  This is a graphics 1 limitation that’s solved is G2.0 as @dbvoren said.

It’s not masked - at least I didn’t mask it. Perhaps some included code is masking it. Any other ideas?

First, put some print statement under your setFillCollor and check if it’s executed - maybe code does not reach filling function

When will G2.0 be out?

It’s in public beta now and we are rolling out daily builds with it.  No set ETA on it’s release though.

I’m having the same problem.  SetFillColor works on my buttons from an image sheet but not on display.newImage.  Just recently started to use tinting so maybe I am missing something as well.

        local favimg = display.newImage( row, imageSheet , imageSheetInfo:getFrameIndex(“like_fill”))

        favimg:setFillColor ( 255,0,0,255 )

Using Build #1206    

Just saw this thread regarding a mask on a ScrollView which is indeed what is going on in my case (Except mine is a TableView).  If I remove the mask from the TableView the image turns red as it should.  

The issue has been assigned a defect# and the indication is it is fixed or will be fixed in Graphics 2.0

You can’t tint things in a masked group, which is what a scrollView and tableView is.  This is a graphics 1 limitation that’s solved is G2.0 as @dbvoren said.

When will G2.0 be out?

It’s in public beta now and we are rolling out daily builds with it.  No set ETA on it’s release though.