microstudio
microstudio copied to clipboard
Clear console programmatically
Suggested solution:
print("/d")
I propose to have a console
object that could in future expands to embedd other commands:
clear
setColor
input
It may looks not so elegant to leave an alias print
for console.print
but it will not break backwards compatibility and will be an easy entry point for newcomers.
I like the idea of having more options to control the console output. I use it quite often for debugging.
Regarding the console.xxx( )
, I like that too. But I can already smell that someone wants to make a text only adventure and to make things easier will request a console.draw(x,y,w,h)
command :)
Width and height in characters?
As in, draw the console content to the game screen.
Perhaps there could also be a way to read the console text? Either as a multi-line string or as a list. Maybe you could have a function console.getInputs()
and console.getOutputs()
. getInputs would return all the things inputted into the console, and getOutputs would return the results. Maybe there could also be console.show()
and console.hide()
(which would both show the console to the user, next to or below the project), in addition to console.acceptInputs(inputs)
, console.denyInput(inputs)
, console.denyAll()
, and console.acceptAll()
, which would pick which commands/variables the user can enter (inputs
, in both functions, is a list filled with strings listing the commands). Naturally, all inputs would be disabled by default. Maybe even system.project.show()
and system.project.hide()
could be a thing?
It could be enough to implement some simple meta formatting inside print(). Maybe if string starts with "ERROR", then it should display in red, and if with "WARNING", then in yellow.