Improve error message formatting;
@@ -173,14 +173,16 @@ void lovrInit(lua_State* L, int argc, char** argv) {
"end "
"function lovr.errhand(message) "
- " local stackTrace = debug.traceback('Error: ' .. tostring(message), 1) "
+ " local stackTrace = debug.traceback('Error: ' .. tostring(message), 3) "
" local message = stackTrace:gsub('\\n[^\\n]+$', ''):gsub('\\t', ''):gsub('stack traceback', 'Stack') "
" print(message) "
" lovr.graphics.reset() "
" lovr.graphics.setBackgroundColor(26, 25, 28) "
" lovr.graphics.setColor(220, 220, 220) "
" local function render() "
- " lovr.graphics.print(message, 0, 0, -2) "
+ " local z = lovr.headset.isPresent() and -2 or -20 "
+ " local w = lovr.graphics:getFont():getWidth(message, 20) "
+ " lovr.graphics.print(message, -w / 2, 0, z, 1, 0, 0, 0, 0, 20, 'left') "
" end "
" while true do "
" lovr.event.pump() "
