Not sure why, but monitor doesn't show arrows (1.19.2) #1884
Answered
by
SquidDev
TylerWDoesStuff
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
SquidDev
Jul 1, 2024
Replies: 1 comment 2 replies
-
I'm afraid I'm not super familiar with all the Create peripherals, but from what I can tell from the implementation of The easiest fix here is either to truncate the local width, height = monitor.getSize()
local floorString = elevFloor.getLine(1):sub(1, width - 1) Or set the cursor position when writing the arrow: local width, height = monitor.getSize()
monitor.setCursorPos(1, width)
monitor.write(string.char(24)) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
TylerWDoesStuff
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm afraid I'm not super familiar with all the Create peripherals, but from what I can tell from the implementation of
getLine
, it returns a string which is always 32 characters long. This means when you write it to the monitor, the cursor is pushed off-screen to the right. This means the arrow won't actually be written to the screen!The easiest fix here is either to truncate the
floorString
to be less than the monitor's width:Or set the cursor position when writing the arrow: