It looks like you're new here. If you want to get involved, click one of these buttons!
local pad = Pad.new{ w = 300, h = 300, -- pixel pad size rows = 3, -- number of rows columns = 3, -- number of columns color = 0x272727, -- background color margin = 4, -- margin from pad's cornders innerMargin = 2 -- margin between buttons inside } pad:addButton{ x = 0, -- 0 based layout x index y = 0, -- 0 based layout y index scaleX = 4, -- textfiled scale x scaleY = 4, -- textfiled scale x bgColor = 0x323232, -- button bg color txtColor = 0xffffff, -- button text color name = "Erase", -- button name text = "<" -- text to display } function padClick(e) local name = e.name -- button name local btext = e.text -- button text print(name, btext) end -- handle click on button pad:addEventListener("click", padClick) stage:addChild(pad)</pre> |