tabBar icon yOffset

I’m trying to implement the widget:tabBar - see code below.

What bothers me, though, are two things:

  1. How could I offset the icon image, so that it is not centered on the tab?

  2. 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 }

Ok, I’ll answer myself in case anybody in the future will be searching for the same thing.

Reading through the implementation on github https://github.com/coronalabs/framework-widget/blob/master/widgetLibrary/widget_tabbar.lua I found the following.

ad 1.) After testing for a little while, (although it is kinda back-dooring)

 tabBar.\_viewButtons[1].y  tabBar.\_viewButtons[1].\_over.y

are the references to the default file’s y and over file’s y (respectively for the x and everything else an image has).

Check lines: 92-134, 213, 224

ad 2.) It is just implemented that way. See line 69. Probably can be overriden, but am not interested at the moment.

Ok, I’ll answer myself in case anybody in the future will be searching for the same thing.

Reading through the implementation on github https://github.com/coronalabs/framework-widget/blob/master/widgetLibrary/widget_tabbar.lua I found the following.

ad 1.) After testing for a little while, (although it is kinda back-dooring)

 tabBar.\_viewButtons[1].y  tabBar.\_viewButtons[1].\_over.y

are the references to the default file’s y and over file’s y (respectively for the x and everything else an image has).

Check lines: 92-134, 213, 224

ad 2.) It is just implemented that way. See line 69. Probably can be overriden, but am not interested at the moment.