Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cobalt = dofile('cobalt')
- cobalt.ui = dofile('cobalt-ui/init.lua')
- local Panel = cobalt.ui.new({ w = "50%", marginleft="25%", h = "50%", margintop = "25%" })
- local Button = Panel:add("button", { wrap="center", y = 4})
- Button.onclick = function()
- print("hi")
- end
- function cobalt.update( dt )
- --your code
- cobalt.ui.update( dt )
- end
- function cobalt.draw()
- --your code
- cobalt.ui.draw( )
- end
- function cobalt.mousepressed(x, y, button)
- --your code
- if x ~= nil and y ~= nil then
- else
- print("nil")
- end
- cobalt.ui.mousepressed(x, y, button)
- end
- function cobalt.mousereleased(x, y, button)
- --your code
- if x ~= nil and y ~= nil then
- else
- print("nil")
- end
- cobalt.ui.mousereleased(x, y, button)
- end
- function cobalt.keypressed(keycode, key)
- --your code
- cobalt.ui.keypressed(keycode, key)
- end
- function cobalt.keyreleased(keycode, key)
- --your code
- cobalt.ui.keyreleased(keycode, key)
- end
- function cobalt.textinput(t)
- --your code
- cobalt.ui.textinput(t)
- end
- cobalt.initLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement