I have been researching for the last 6 hrs are you able to scroll an image on an advanced monitor?
-- I want to draw a picture (Minecraft Bee from Forestry Mod) in the advanced computer paint program and i want to display this on a *6X8 monitor and i would like to scroll the image to the left as if the bee is moving to the left I want to scroll this across multiple screens. (I think this would take multiple computers)
If you could provide any help that would be great I don't even know where I would start with coding this.
Help with putting an image on an monitor.
Started by dom123, Jan 03 2014 03:01 PM
2 replies to this topic
#1
Posted 03 January 2014 - 03:01 PM
#2
Posted 03 January 2014 - 03:22 PM
I think the easiest way to do this is to make a function to draw the image that allows an x offset
something like this
Needless to say you will not be able to copypaste any of that, but i hope it gives you an idea of what to do.. and yes, all the variables are made up, i hope it's clear enough what i mean with it
maybe someone else has more time to write out something more detailed but i encourage you to try and do this with as little help as possible, for the sake of learning how to actually do this..
something like this
function draw(offset)
term.setCursorPos(offset,1)
write(" ")
term.setCursorPos(offset+1,2)
write(" ")
...etcetera
end
for i=1,width do draw(i) end
as for the multiple monitor thing, include something like thisif offset+imagewidth > monitorwidth then drawOnSecondMonitorWithOffset(monitorwidth-offset-imagewidth) --(not sure if this would work but i think so)
Needless to say you will not be able to copypaste any of that, but i hope it gives you an idea of what to do.. and yes, all the variables are made up, i hope it's clear enough what i mean with it
maybe someone else has more time to write out something more detailed but i encourage you to try and do this with as little help as possible, for the sake of learning how to actually do this..
#3
Posted 03 January 2014 - 08:31 PM
Paintutils API lets you specify the coordinates to display your image. Syntax:
Hope this isn't too vague!
paintutils.drawImage(table image handle, number x-position, number y-position)A full 8x6 monitor is 82x40 pixels, so:
local x = 1
local y = 1
repeat
monitor = peripheral.wrap("right")
term.redirect(monitor) -- Redirects everything to be displayed on monitor instead of the computer
img = paintutils.loadImage("ImageFileNameHere")
paintutils.drawImage(img, x, y)
x = x+1
sleep(0.5)
term.clear()
term.restore() -- Stops redirecting to monitor
until x == 82
this should display the image for 0.5 seconds (change if you want), then move it one pixel to the right. Once it starts disappearing off the right side of the monitor, you need a second computer to kick in and start displaying the image from its first pixel. I havn't tried this at all so don't expect anything to work 1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











