[lua]
display.setStatusBar(display.HiddenStatusBar)
local centerX = display.contentCenterX
local centerY = display.contentCenterY
–forward references
local buttons
local function mainmenu()
local background1 = display.newImage(“Background.png”)
background1.x = display.contentWidth / 2
background1.y = display.contentHeight / 2
buttons()
end
function buttons()
local widget = require( “widget” )
local function handleButtonEvent( event )
if ( “ended” == event.phase ) then
print( “Button was pressed and released” )
end
end
local button1 = widget.newButton(
{
label = “button”,
onEvent = handleButtonEvent,
emboss = false,
shape = “roundedRect”,
width = 200,
height = 40,
cornerRadius = 2,
fillColor = { default={1,0,0,1}, over={1,0.1,0.7,0.4} },
strokeColor = { default={1,0.4,0,1}, over={0.8,0.8,1,1} },
strokeWidth = 4
}
)
button1.x = display.contentCenterX
button1.y = display.contentCenterY+150
– Change the button’s label text
button1:setLabel( “Shape” )
end
local function Ball()
local circle = display.newCircle(160,160,0)
circle.path.radius = 10
end
mainmenu()
[/lua]
this is my first project in corona and i have no idea where my mistake is :mellow:
the button doesn’t show up, but it is there and it’s transparent, when i click around the area where i have placed my button it runs the statement (**print( “Button was pressed and released” )), **what i think is the function setFillColour is not working, because when i change it there is not effect on the button.
i have uploaded the image of this codes simulation.