I’m trying to implement the widget:tabBar - see code below.
What bothers me, though, are two things:
-
How could I offset the icon image, so that it is not centered on the tab?
-
Why can background (and selectedFrames) only be drawn using image files and not using vector construction?
Thanks for any tips and explanations!
-- table to setup tabBar buttons buttons = { {goto = "scenes.home", label = \_\_("Home"), selected = true, defaultFile = "images/Domov.png", overFile = "images/DomovOver.png", params = {}}, {goto = "scenes.map", label = \_\_("Map"), selected = false, defaultFile = "images/Zemljevid.png", overFile = "images/ZemljevidOver.png", params = {}}, ... --list continues } local tabButtons = {} for i=1,#buttons do tabButtons[i] = { --button description id = i, label = buttons[i].label, labelColor = set.tabBarLabel, font = native.systemFont, size = 12, width = 24, height = 24, defaultFile = buttons[i].defaultFile, --how to offset the image?? overFile = buttons[i].overFile, onPress = handleTabBarEvent, selected = buttons[i].selected } end -- create the actual tabBar widget local tabBar = widget.newTabBar { id = "main\_tabBar", top = dim.Y-dim.tabBar.H, width = dim.X, height = dim.tabBar.H, backgroundFile = "images/blue.jpg", --only IMAGE file possible?? tabSelectedLeftFile = "images/yellow.jpg", tabSelectedMiddleFile = "images/yellow.jpg", tabSelectedRightFile = "images/yellow.jpg", tabSelectedFrameWidth = 1, tabSelectedFrameHeight = 1, buttons = tabButtons }