main_experimental.lua 489 B

12345678910111213141516171819202122232425262728293031
  1. require 'goo/goo'
  2. function love.load()
  3. goo.load()
  4. myBox = goo.box:new()
  5. myBox:setpos( 50, 50 )
  6. myBox:setsize( 50, 50 )
  7. myButton = goo.button:new( myBox )
  8. myButton:sizetotext()
  9. function myButton:onClick( x, y, button )
  10. print('click')
  11. end
  12. end
  13. function love.update(dt)
  14. goo.update(dt)
  15. end
  16. function love.draw()
  17. goo.draw()
  18. end
  19. function love.mousepressed(x,y,button)
  20. goo.mousepressed(x,y,button)
  21. end
  22. function love.mousereleased(x,y,button)
  23. goo.mousereleased(x,y,button)
  24. end