for error messages, yes... you can make a simple shortcut function to ease the \n pain:
function debug(msg) {
::print(msg + "\n")
}
debug("Here is one line")
debug("Here is another")
you can also add debug objects if you want something onscreen
Try this:
class Debugger
{
obj = null
reload_key = "custom1"
constructor() {
obj = ::fe.add_text("", 0, fe.layout.height - 40, fe.layout.width, 30)
obj.set_rgb(200, 200, 0)
::fe.add_signal_handler(this, "on_signal")
}
function msg(msg) {
obj.msg = msg
}
function on_signal(str) {
if ( str == reload_key ) ::fe.signal("reload")
}
}
local myText = fe.add_text("[Title]", 50, 50, 300, 30)
local debugger = Debugger()
debugger.msg("myText loc = x:" + myText.x + " y:" + myText.y + " w: " + myText.width + " h:" + myText.height)