Hi, sorry for the delay.
I'm going to make some test and tell you, I've been updated the API so I need to try it on Android (I just put it on Github). The changes were basically:
- No explicit id's are given now
- More flexible contructors
For instance, this was before:
Code: Select all
gooi.newButton("btn1", "Button text", 100, 100, 200, 30)
and this is now:
Code: Select all
gooi.newButton("Button text", 100, 100, 200, 30)
These are other ways of making a button (similar syntax for other components):
Code: Select all
gooi.newButton()
gooi.newButton("A button")
gooi.newButton("A button", 100, 100)
gooi.newButton("A button", 100, 100, 150, 25)
gooi.newButton({
text = "A button",
x = 100,
y = 100,
w = 150,
h = 25,
orientation = "right",
icon = "/imgs/icon.png"
})
And I'm going to leave another example:
Code for this:
Code: Select all
pGrid = gooi.newPanel(350, 290, 420, 290, "grid 10x3")
-- Add in the specified cell:
pGrid:add(gooi.newRadio({text = "Radio 1", selected = true}), "7,1")
pGrid:add(gooi.newRadio({text = "Radio 2"}):roundness(0):bg("#00000000"):fg("#00ff00"), "8,1")
pGrid:add(gooi.newRadio({text = "Radio 3"}):roundness(0):bg("#00000000"):border(1, "#000000"):fg("#ff7700"), "9,1")
pGrid
:setColspan(1, 1, 3)-- In row 1, col 1, cover 3 columns.
:setRowspan(6, 3, 2)
:setColspan(8, 2, 2)
:setRowspan(8, 2, 3)
:add(
gooi.newLabel({text = "(Grid Layout demo)", orientation = "center"}),
gooi.newLabel({text = "Left label", orientation = "left"}),
gooi.newLabel({text = "Centered", orientation = "center"}),
gooi.newLabel({text = "Right", orientation = "right"}),
gooi.newButton({text = "Left button", orientation = "left"}),
gooi.newButton("Centered"),
gooi.newButton({text = "Right", orientation = "right"}),
gooi.newLabel({text = "Left label", orientation = "left", icon = imgDir.."coin.png"}),
gooi.newLabel({text = "Centered", orientation = "center", icon = imgDir.."coin.png"}),
gooi.newLabel({text = "Right", orientation = "right", icon = imgDir.."coin.png"}),
gooi.newButton({text = "Left button", orientation = "left", icon = imgDir.."medal.png"}),
gooi.newButton({text = "Centered", orientation = "center", icon = imgDir.."medal.png"}),
gooi.newButton({text = "Right", orientation = "right", icon = imgDir.."medal.png"}),
gooi.newSlider({value = 0.75}):bg("#00000000"):border(3, "#00ff00"):fg({255, 0, 0}),
gooi.newCheck("Debug"):roundness(1, 1):bg({127, 63, 0, 200}):fg("#00ffff"):border(1, "#ffff00")
:onRelease(function(c)
pGrid.layout.debug = not pGrid.layout.debug
end),
gooi.newBar(0):roundness(0, 1):bg("#77ff00"):fg("#8800ff"):increaseAt(0.05),
gooi.newSpinner(-10, 30, 3):roundness(.65, .8):bg("#ff00ff"),
gooi.newJoy():roundness(0):border(1, "#000000", "rough"):bg({0, 0, 0, 0}),
gooi.newKnob(0.2)
)