Change button color when touched

I have a menu that has square, circle, platform as choices.  When the user touches one of these items on the menu I want the text that was touched to have its color brightened to indicate that it is the currently active shape.  Here is the code I have for one of the shapes.  How do I change the color of circle to a brighter color when the circle text is touched?  

local function button\_circle\_event(event) local phase = event.phase if "ended" == phase then end ended local button\_circle = widget.newButton { left = 1102, top = 50, width = 178, height = 50, label = "Circle", labelColor = { default = { 163, 25, 12 }, over = { 163, 25, 12} }, onEvent = button\_circle\_event, } button\_circle.\_view.\_label.size = 33

Widget.newButton is a convenience method to make simple buttons easy. The keyword there is simple. If you need special button needs you could either get the widget library from our github repository (http://github.com/coronalabs) and add features to support a “selected” feature, but to me that seems like a lot of work when you can just create a display.newText() and add a touch handler to it and perhaps in the touch handler, when you touch the button, change some property of the display.newText (change it’s fill color, scale it up a bit, etc.).

Rob

here this might help. this has to do with when hitting something it will change the color of the thing you want. but i am not sure what exactly your asking but i hope this helps.

https://www.youtube.com/watch?v=9_rkexta0Sk

here is also another way you could possibly do it.

[lua]

function screenTap()

    local r = math.random( 0, 100 )

    local g = math.random( 0, 100 )

    local b = math.random( 0, 100 )

    myTextObject:setFillColor( r/100, g/100, b/100 )

end

display.currentStage:addEventListener( “tap”, screenTap )

[/lua]

Widget.newButton is a convenience method to make simple buttons easy. The keyword there is simple. If you need special button needs you could either get the widget library from our github repository (http://github.com/coronalabs) and add features to support a “selected” feature, but to me that seems like a lot of work when you can just create a display.newText() and add a touch handler to it and perhaps in the touch handler, when you touch the button, change some property of the display.newText (change it’s fill color, scale it up a bit, etc.).

Rob

here this might help. this has to do with when hitting something it will change the color of the thing you want. but i am not sure what exactly your asking but i hope this helps.

https://www.youtube.com/watch?v=9_rkexta0Sk

here is also another way you could possibly do it.

[lua]

function screenTap()

    local r = math.random( 0, 100 )

    local g = math.random( 0, 100 )

    local b = math.random( 0, 100 )

    myTextObject:setFillColor( r/100, g/100, b/100 )

end

display.currentStage:addEventListener( “tap”, screenTap )

[/lua]