Image Display Objects do not update FIllColor on touch events

Setting the fill color on an image in an event does not change the fill color, unless you change another property that forces it to update. Vector display objects do update fill color normally

[code]
local defaultColor = {255,255,255,255 }
local touchColor = {255,100,100,255 }

---- CHANGING FILL COLOR IN EVENT WORKS ON CIRCLE DISPLAY OBJECT –
local function buttonTouchEvent( event )

local phase = event.phase
local target = event.target
if “began” == phase then
target:setFillColor(touchColor[1],touchColor[2],touchColor[3])
target.isFocus = true
display.getCurrentStage():setFocus( target, event.id )
elseif “ended” == phase or “cancelled” == phase then
target:setFillColor(defaultColor[1],defaultColor[2],defaultColor[3])
display.getCurrentStage():setFocus( target, nil )
target.isFocus = false
end
end

local button1 = display.newCircle( display.contentWidth/2, display.contentHeight/2 - 200, 50 )
button1.x ,button1.y = display.contentWidth/2, display.contentHeight/2 - 200
button1:addEventListener( “touch”, buttonTouchEvent )

---- CHANGING FILL COLOR IN EVENT ON IMAGE DISPLAY OBJECT DOES NOT –
local button2 = display.newImage(“waveCircle.png”)
button2.x ,button2.y = display.contentWidth/2, display.contentHeight/2
button2:addEventListener( “touch”, buttonTouchEvent )

---- UNLESS YOU DO THIS (forcing an update?) –
local function buttonTouchEventFix( event )

local phase = event.phase
local target = event.target
if “began” == phase then
target.isVisible = false target.isVisible = true – fix
target:setFillColor(touchColor[1],touchColor[2],touchColor[3])
target.isFocus = true
display.getCurrentStage():setFocus( target, event.id )
elseif “ended” == phase or “cancelled” == phase then
target:setFillColor(defaultColor[1],defaultColor[2],defaultColor[3])
target.alpha = 0.5 target.alpha = 1 --another fix
display.getCurrentStage():setFocus( target, nil )
target.isFocus = false
end
end

local button3 = display.newImage(“waveCircle.png”)
button3.x ,button3.y = display.contentWidth/2, display.contentHeight/2 + 200
button3:addEventListener( “touch”, buttonTouchEventFix )

[/code] [import]uid: 88628 topic_id: 21713 reply_id: 321713[/import]

Hi Ernest,

We saw a bug report for this recently and I believe we are still looking into it; if I can find out any news I will let you know.

Thanks,
Peach :slight_smile: [import]uid: 52491 topic_id: 21713 reply_id: 86282[/import]