Thank you for replying. Here’s code that makes a button:
— file: pagStart.lua
— function: createButton
— summary: creates a standardized button
— parameters: id as String, an internal reference to the button
— text as String, the caption
— x as integer, the x position
— y as integer, the y position
— returns: none
— note: the rest of the button properties are set here.
— todo: 1. Consider moving this to a file to be shared.
— 2. Have a way of setting default values (e.g. font, size, color)
local function createButton( id, text, x, y )
local button = widget.newButton
{
id = id,
width = 240,
height = 40,
label = text,
labelColor = { default={1,1,1}, over={1,0,0}},
labelAlign = “left”,
font = native.systemFontBold,
fontSize = 24,
onRelease = onTap
}
button.x = x
button.y = y
sceneGroup:insert( button )
return button
end