Here is a great class for creating buttons in Gideros Mobile SDK It implements two states of button, making your buttons more responsive :

  • standard state
  • pushed state

Another great feature is that it implements click event, which executes only for this button. By default mouse interaction events are called for all siblings, no matter if you clicked on specific object or not. That's why usually you need to call hitTestPoint to check whether event was called for this object. Click event in button class already handles that for you, so you don't need to worry about it.

Here is an example usage of button class in Gideros Mobile:

local button_default ="images/start.png"))
local button_pushed ="images/start_down.png"))

local startButton =, button_pushed)

local x = ((application:getDeviceWidth()-startButton:getWidth())/2)
local y = ((application:getDeviceHeight()-startButton:getHeight())-20)

startButton:setPosition(x, y)

		//do what you want on click