print can be used similar to echo
This commit is contained in:
parent
64a8aefeb8
commit
fd40716b58
1 changed files with 6 additions and 9 deletions
|
|
@ -89,15 +89,12 @@ template printError*(error: typed) =
|
||||||
let (filename, line) = instantiationInfo()
|
let (filename, line) = instantiationInfo()
|
||||||
godotPrintError(cstring($error), nil, cstring(filename), line.cint)
|
godotPrintError(cstring($error), nil, cstring(filename), line.cint)
|
||||||
|
|
||||||
proc print*(message: string) {.inline.} =
|
proc print*(parts: varargs[string, `$`]) =
|
||||||
## Prints ``message`` to Godot log.
|
## Prints concatenated ``parts`` to Godot log.
|
||||||
var s = message.toGodotString()
|
var combined = ""
|
||||||
godotPrint(s)
|
for v in parts:
|
||||||
s.deinit()
|
combined.add(v)
|
||||||
|
var s = combined.toGodotString()
|
||||||
proc print*(message: cstring) {.inline.} =
|
|
||||||
## Prints ``message`` to Godot log.
|
|
||||||
var s = message.toGodotString()
|
|
||||||
godotPrint(s)
|
godotPrint(s)
|
||||||
s.deinit()
|
s.deinit()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue