Can you show me some code please?
Also what daily build are you using?
Can you show me some code please?
Also what daily build are you using?
adWilliamHill = widget.newButton{ defaultfile = "images/williamhill.png", width = 400, height = 90, onRelease = adWilliamHill\_Click } adWilliamHill.x = display.contentCenterX adWilliamHill.y = 10
local characterShopButton = widget.newButton{ label = "Character shop", font = "Dadhand", labelColor = { default={ 0, 0, 0, 255 }, over={ 255 } }, defaultColor = { 255, 255, 255, 255 }, overColor = { 255, 255, 255, 200 }, strokeColor = { 102,102,255, 255 }, strokeWidth = 0, emboss = true, width = 160, height = 44, fontSize = 24, onRelease = characterShopButton\_Click } characterShopButton.x = storyboard.globals.leftX + 120 characterShopButton.y = storyboard.globals.topY + 120
You have defaultfile not defaultFile. In that example
This bottom post is how my apps currently use widgets.
Sorry for multiple posts, wouldnt let me put them in one.
Dave
Creating buttons via vector objects was removed and replaced with 9 slice button creation.
Also, if you are on a deadline and don’t have time to migrate right now, you can still use the old widget library: https://github.com/coronalabs/widget-v1
Ok fixed the first one, thanks.
What do you mean via vector objects ?
That button is just text with no graphics.
Dave
By vector objects I am specifically talking about: defaultColor, overColor, strokeWidth.
Currently with widget 2.0 if you want to create a text only button you have to provide a transparent image that matches your texts width/height. Plans for text only buttons are in the works
Anyway I can use the old widgets or are we forced to widgets 2 ?
Dave
You can still use the old widget library if you wish:
https://github.com/coronalabs/widget-v1
Hope all this helps.
It’s not if I want, I have no choice.
There is now way am going through every button and creating a graphic for it.
EDIT: That works perfectly, all my buttons are back. Thanks.
Dave
I am aiming to add support back for text only buttons in widget v2.0 very shortly.
We weren’t aware that it was a commonly used feature whilst developing widget 2.0.
Sorry for any inconvenience, I presume this is the only issue have have preventing you from using widget 2.0?
Any new app I would use Widgets 2.0 but for older apps, it’s too much hassle to change them.
Dave
Hit another problem
I use steppers in this app and widget-v1.lua doesn’t have them.
Can anyone remember what build they where added in ?
I need to make a quick mod to a old game and will just download that build to do it.
EDIT: Think I will be ok with 1033, widgets 2.0 appeared in 1034.
Cheers,
Dave
Just a quick update on this now I have had more time to think and have a play with my code.
I am using the latest public release, so I didn’t need to go back to 1033 as I said above.
For my scenes that used text buttons with no background I used widget-v1, for everything else I used widget 2.0. The reason I used buttons with no background was I used a custom font that looks like handwriting. The buttons then look like writing and not a button (hard to understand but look up “Winning Post” on the app store and see the titlescreen screen shot).
Luckily on the scenes that used steppers I didn’t have text buttons, they where graphics. So just a quick change from default to defaultFile (capital F, thanks Danny!).
The other thing that tripped me up on a older app was I was using -
OnRelease = mybuttonEvent
Then in mybuttonEvent, the first line was -
if event.type == “release”
But for widget 2.0 I had to change it to == “began”
Hope this helps.
Dave