restart.lua 875 B

12345678910111213141516171819202122232425262728293031
  1. return {
  2. tag = 'callbacks',
  3. summary = 'Called when restarting.',
  4. description = [[
  5. This callback is called when a restart from `lovr.event.restart` is happening. A value can be
  6. returned to send it to the next LÖVR instance, available as the `restart` key in the argument
  7. table passed to `lovr.load`. Object instances can not be used as the restart value, since they
  8. are destroyed as part of the cleanup process.
  9. ]],
  10. arguments = {},
  11. returns = {
  12. {
  13. type = '*',
  14. name = 'cookie',
  15. description = 'The value to send to the next `lovr.load`.'
  16. }
  17. },
  18. notes = [[
  19. Only nil, booleans, numbers, and strings are supported types for the return value.
  20. ]],
  21. example = [[
  22. function lovr.restart()
  23. return currentLevel:getName()
  24. end
  25. ]],
  26. related = {
  27. 'lovr.event.restart',
  28. 'lovr.load',
  29. 'lovr.quit'
  30. }
  31. }