I would like to change the color of a button to give the feedback that it has been Activated:
local btn = Widget.newButton( { shape = "roundedRect", strokeColor = { default={211 /255, 84 /255, 0 /255}, over={0.2,0.2,1,1} }, strokeWidth = 2, fillColor = { default={1,0,0}, over={0,0,0} }, onRelease = btnPressed } )
After I click the button, the code below doesn’t run unless I create the button without the “fillColor” property assigned. Now, I don’t care for the “over” part of it, but, I would like to give it a starting color. But, when I remove the “over” part, it gives me an error.
local function btnPressed( event ) local btn = event.target btn:setFillColor( 0,1,0 ) end
Am I missing something here?