Wiki

Clone wiki

LuaWidget2 / Home

LuaWidget2

LuaWidget2 is a GUI for NDS MicroLua.

The Widgets:

For now these widgets are available:

Use it:

Call it in your script:

require("luaWidget2")

Create an object:

In exemple, we create a Button in coordinate 0,0 with the text 'bouton' on it.

obj = luaWidget.Tbutton:new{x=0, y=0, text="bouton"}
  • x: The x coordinate of the top left button corner.
  • y: The y coordinate of the top left button corner.
  • text: The text which appear on the button.

Create a Collection:

win = luaWidget.window:new{screen=SCREEN_DOWN}
  • screen: The screen where the collection of widget which appear: SCREEN_UP or SCREEN_DOWN.

Associate object(s) to a Collection:

win.addObjects{obj}

Associate an action to the 'onclick' button event:

In exemple we change the button text on the onClick event.

function obj:onClick()
    obj:modifObject{text="nouveau texte"}
end

Actualize the Widget collection state:

win:held()

Showing the Collection:

win:show()

Destroy an object:

obj:destroy()

Remove an object to a Collection:

win:removeObjects{obj}

Destroy a Collection:

win:destroy()

Updated