lkakmobility.blogg.se

Center monitor
Center monitor











Monitorprintcentred("Server Name","left")-print centred on the next line Monitorprintcentred("Welcome To","left")-print centred on that line tCursorPos(1,math.floor(maxh/2))-set cursor to the start of the upper middle line Local maxw, maxh =monitor.getSize() -screen dimensions Local monitor = peripheral.wrap("left") - makes 'monitor' refer to the monitor on the left side tCursorPos(curx,cury+1) -return the cursor to the same position on the next line tCursorPos((maxw-#text)/2,cury) -set it to the point where write will make the text centred Local curx, cury = monitor.getCursorPos() -cursor pos Local maxw, maxh = monitor.getSize() -screen dimensions Local monitorprintcentred = function(text, side) this function will print the text in the centre of the current line of the monitor connected on the specified side It will if you run it on the monitor, but if you really insist on a monitor specific version:

center monitor

Let me just make a quick note here you are showing him a function to print in the middle on the GUI, not on a monitor.













Center monitor