This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
laserpanda's profile picture

paintutils.drawImage on Advanced monitor

Started by laserpanda, 31 March 2013 - 04:58 AM
laserpanda #1
Posted 31 March 2013 - 06:58 AM
I'm trying to draw an image to the monitor. It works fine in the terminal, and I tried using term.redirect to get it to the monitor, as suggested in another thread and that's where things go wrong.

my code:

logo = paintutils.loadImage("logo1")
term.redirect(mon)
mon.paintutils.drawimage(logo,1,4)
term.restore()

I get error: "attempt to index (?) a nil value" at the drawImage line.
MudkipTheEpic #2
Posted 31 March 2013 - 07:00 AM
There is no mon.paintutils, just use paintutils.

And did you put local mon=peripheral.wrap("side of monitor goes here")?

And wrong section, I think.
laserpanda #3
Posted 31 March 2013 - 08:10 AM
just use paintutils
ah thanks, that fixed it

And did you put local mon=peripheral.wrap("side of monitor goes here")?

Yeah, but it was quite a long bit of code as it's designed to run on any computer configuration so it has to check to see where all the peripherals are. Should have mentioned that I had already done that.