Add method writing to console
This commit is contained in:
parent
7d71333558
commit
86394ef71b
@ -32,6 +32,14 @@ class UiConsole(UiElement):
|
|||||||
self.addLinesToConsole(["Hello from console!"])
|
self.addLinesToConsole(["Hello from console!"])
|
||||||
self.writeConsoleLines()
|
self.writeConsoleLines()
|
||||||
|
|
||||||
|
# TODO: Should this method be static? We need to instantiate some console before we can write anything to it.
|
||||||
|
def writeToConsole(self, inp: str):
|
||||||
|
"""
|
||||||
|
Writes given string to console without scrolling to bottom.
|
||||||
|
:param inp: String to be written to console.
|
||||||
|
"""
|
||||||
|
self.addLinesToConsole([inp])
|
||||||
|
|
||||||
def writeConsoleLines(self, startingLineInd=0):
|
def writeConsoleLines(self, startingLineInd=0):
|
||||||
self.image.fill(self.bgColor)
|
self.image.fill(self.bgColor)
|
||||||
if startingLineInd < 0:
|
if startingLineInd < 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user