5 posts
Location
omg, im in sweden!!!!!!!
Posted 17 November 2014 - 05:48 PM
How do i show everything on the computer screen on a monitor while i use it? :mellow:/> :mellow:/>
I have been looking everywhere for an answer yet still not found one. :o/>
Please help, :(/>
// Oscar124
3057 posts
Location
United States of America
Posted 17 November 2014 - 06:14 PM
There is not default way to do this. As far as I know, nobody has made an api that does this on CC 1.6 yet. Other than that, just make a function that writes to the monitor and the terminal at the same time, and use that in your program.
5 posts
Location
omg, im in sweden!!!!!!!
Posted 17 November 2014 - 06:16 PM
There is not default way to do this. As far as I know, nobody has made an api that does this on CC 1.6 yet. Other than that, just make a function that writes to the monitor and the terminal at the same time, and use that in your program.
Hmm…
3057 posts
Location
United States of America
Posted 17 November 2014 - 06:18 PM
function writeBoth( text )
mon.write( text )
term.write( text )
end
function setBothCursor( x, y )
term.setCursorPos( x, y )
mon.setCursorPos( x, y )
end
--#etc.
5 posts
Location
omg, im in sweden!!!!!!!
Posted 17 November 2014 - 07:43 PM
Yeah..i know..
1220 posts
Location
Earth orbit
Posted 17 November 2014 - 08:08 PM
I have a feeling you're already aware of this, but … fwiw, if you're only dealing with text, I'd combine both functions into a single function like this…
local function drawBoth(x, y, text)
term.setCursorPos(x, y)
term.write(text)
mon.setCursorPos(x, y)
mon.write(text)
end
drawBoth(2, 2, "Test")
I realize it's not exactly what you're looking for, but it would allow you code everything once per text/line and display it on both screens. This is definitely less efficient than KingofGamesYami's implementation if you're writing a line of text in multiple colors; but if you're only using a single color, this would reduce your code a bit more than KingofGamesYami's suggestion.
Edited on 17 November 2014 - 07:13 PM