Hi,
Anyone have any idea if I’m doing something wrong here?
I’m trying to replace the buttons in my app with the new Widget 2.0 buttons but there seems to be no way of setting a background colour, stroke colour, stroke width or corner radius. The new approach seems purely based on images but I really don’t want to have to create images for all my button types - there are lots!!!
Furthermore, when I add a width and height to my buttons, the central part of the background disappears and I just get the 2 ends of the button! The text label still displays but no background. If I remove the width and height attributes the background reappears but it’s just the default grey background (which I don’t want obviously).
Code below…
Any ideas? Either I’m doing something majorly wrong or this is not working at all as it should. I’m on yesterday’s daily build (1056)
Thanks in advance!
Ian
[lua] local widget = require(“widget”)
local btn = widget.newButton
{
width = params.w,
height = params.h,
label = params.txt,
labelAlign = “center”,
labelYOffset = params.textOffset,
fontSize = params.fontSize,
labelColor = {
default = {params.textCol[1],params.textCol[2],params.textCol[3]},
over = {params.textColOver[1],params.textColOver[2],params.textColOver[3]}
},
--onEvent = buttonHandler
}
btn.x = params.px;
btn.y = params.py;
local layer = params.layer or buttonsLayer;
layer:insert( btn, true );[/lua]