ValveCantCount

Untitled

Nov 5th, 2020
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. local cobalt = dofile( "cobalt" )
  2. cobalt.ui = dofile( "cobalt-ui/init.lua" )
  3.  
  4. local Panel = cobalt.ui.new({ w = "50%", marginleft="25%", h = "50%", margintop = "25%" })
  5. local Button = Panel:add("button", { wrap="center", y = 4})
  6. Button.onclick = function()
  7. Button.backColour = 2 ^ math.random( 1, 15 )
  8. end
  9.  
  10. function cobalt.draw()
  11. cobalt.ui.draw()
  12. end
  13.  
  14. function cobalt.mousepressed( x, y, button )
  15. cobalt.ui.mousepressed( x, y, button )
  16. end
  17.  
  18. function cobalt.mousereleased( x, y, button )
  19. cobalt.ui.mousereleased( x, y, button )
  20. end
  21.  
  22. cobalt.initLoop()
Add Comment
Please, Sign In to add comment