Re: Tavo's GUI for Android
Posted: Mon Mar 09, 2015 1:49 am
Done, looks like it works fine nowalberto_lara wrote:norubal wrote: To Germanunkol, you're totally right, I almost forget the polygons, let me try that!
Done, looks like it works fine nowalberto_lara wrote:norubal wrote: To Germanunkol, you're totally right, I almost forget the polygons, let me try that!
Code: Select all
gui.get("btn1").events.onPress = function(c) foo() end
Code: Select all
gui.get("btn1"):onPress(function(c) foo() end)
Code: Select all
local style = {
bgColor = {32, 32, 32},
fgColor = {255, 255, 255},
cornerRadius = 20,
...
}
gooi.setStyle(style)
Code: Select all
gooi.newPanel("thePanel", 10, 10, 500, 400, "grid 13x3")-- 13 rows and 3 colums.
:setRowspan(6, 1, 2)-- rowspan for 'super check' checkbox.
:setColspan(6, 2, 2)-- colspan for the 'xxx' text field.
:setRowspan(10, 1, 4)-- For the giant slider.
:setColspan(10, 1, 3)-- For the giant slider.
:add(
gooi.newLabel(1, "Left Label"):setOrientation("left"),
gooi.newLabel(2, "Center Label"):setOrientation("center"),
gooi.newLabel(3, "Right Label"),
gooi.newLabel(4, "Left Label"):setOrientation("left"):setImage(dirImgs.."h.png"),
gooi.newLabel(5, "Center Label"):setOrientation("center"):setImage(dirImgs.."h.png"),
gooi.newLabel(6, "Right Label"):setImage(dirImgs.."h.png"),
gooi.newButton(7, "Left Button"):setOrientation("left"),
gooi.newButton(8, "Center Button"),
gooi.newButton(9, "Right Button"):setOrientation("right"),
gooi.newButton(10, "Left Button"):setOrientation("left"):setImage(dirImgs.."coin.png"),
gooi.newButton(11, "Center Button"):setImage(dirImgs.."coin.png"),
gooi.newButton(12, "Right Button"):setOrientation("right"):setImage(dirImgs.."coin.png"),
gooi.newSlider(13),
gooi.newRadio(14, "Radio 1"):setRadioGroup("g1"):select(),
gooi.newRadio(15, "Radio 2"):setRadioGroup("g1"),
gooi.newCheck(16, "super check"),
gooi.newText(17, "xxx"),
gooi.newBar(18),
gooi.newSpinner(19),
gooi.newJoy(20),
gooi.newPanel("panel_child"):add(
gooi.newSlider("sli1"),
gooi.newButton("btn2", "Btn"),
gooi.newButton("btn3", "Btn")
)
)
-- Add component in that row, col:
gooi.get("thePanel"):add(gooi.newButton("btn_x", "Button in 9,2"), "9,2")
gooi.get("thePanel"):add(gooi.newSlider("sli_x"), "10,1")
Code: Select all
seriousBlack = {
bgColor = {0, 0, 0, 127},
fgColor = {255, 255, 255, 255},
howRound = 0,
showBorder = false,
font = gr.newFont(dirFonts.."ProggySquare.ttf", 16)
}
gooi.setStyle(seriousBlack)
Code: Select all
roshita = {
bgColor = "#AD00AD",
fgColor = "#ffffff",
howRound = 1,
showBorder = true,
borderColor = "#990044",
font = gr.newFont(dirFonts.."Grundschrift-Bold.otf", 16)
}
Code: Select all
gooi.draw("cutePanels")