Hello all!
I decided to attempt “upgrading” my current project over to the new widgets (2.0) today. Much to my dismay, I’ve run into lots-o-trouble. The first widget in my app is a tabBar, so that’s the widget I began converting first. I was having a hard time finding the error and such, so I created a new tabBar in the most basic form I could (at least pretty close), however I ran into the same errors. These are some common things the terminal shouted at me…
-
WARNING: display.newImage( imageGroup, frameIndex ) given an invalid frameIndex (0). Defaulting to 1.
-
ERROR: bad argument #4 to display.newImageRect(): width expected, but got nil.
-
ERROR: bad argument #3 to display.newImageRect(): width expected, but got nil.
-
Runtime error ?:0: attempt to index field ‘?’ (a nil value)
Here’s the tabBar widget code…
[lua]
local tabButtons =
{
{
id = “Tab1”,
label = “Tab1”,
labelColor = { default = {0,0,0}, over = {255,255,255} },
defaultFile = “tabHome.png”,
overFile = “tabHomeD.png”,
onPress = onPress,
selected = false
},
{
id = “Tab2”,
label = “Tab2”,
labelColor = { default = {0,0,0}, over = {255,255,255} },
defaultFile = “tabSettings.png”,
overFile = “tabSettingsD.png”,
onPress = onPress,
selected = true
},
–more tabs can follow
}
local tabBar = widget.newTabBar { --------Runtime error begins here
left = 0,
top = display.contentHeight - 60,
width = 240,
height = 60,
backgroundFile = “leather.png”,
buttons = tabButtons
}
[/lua]
If anyone can offer tips, tricks, or help it would be greatly appreciated. If you need more info or if I did something stupid with the above widget let me know…
Thanks [import]uid: 39302 topic_id: 37218 reply_id: 67218[/import]