Skip to content

Not sure why, but monitor doesn't show arrows (1.19.2) #1884

Answered by SquidDev
TylerWDoesStuff asked this question in Q&A
Discussion options

You must be logged in to vote

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:

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))

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@TylerWDoesStuff
Comment options

@TylerWDoesStuff
Comment options

Answer selected by TylerWDoesStuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants