lovr.restart

This callback is called when a restart from lovr.event.restart is happening. A value can be returned to send it to the next LÖVR instance, available as the restart key in the argument table passed to lovr.load. Object instances can not be used as the restart value, since they are destroyed as part of the cleanup process.

function lovr.restart()
  -- your code here
end

Arguments

None

Returns

NameTypeDescription
abort*The value to send to the next lovr.load.

Notes

Only nil, booleans, numbers, and strings are supported types for the return value.

Example

function lovr.restart()
  return currentLevel:getName()
end

See also