This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Warping Text
Started by bicobajas, 30 July 2012 - 09:47 AMPosted 30 July 2012 - 11:47 AM
Hi is it possible to make text dissappear and show a new word and loop like this Apature then apature word dissappears and then Pines Come And So On Loop?
Posted 30 July 2012 - 02:08 PM
yes, you just clear the screen and write again or set the cursor position to the location of where you want to overwrite and write in, use term.clear() to clear the screen and term.setCursorPos(x,y) to set the cursor position.
I have yet to see an impressive startup logo etc that is animated, good luck
I have yet to see an impressive startup logo etc that is animated, good luck
Posted 30 July 2012 - 04:05 PM
But Loop?
Posted 30 July 2012 - 04:21 PM
how do i loop it
Posted 30 July 2012 - 04:30 PM
ok i did
it dident come any errors but the A wouldent Show only M Btw I need Loop
m = peripheral.wrap("right")
m.clear()
m.setTextScale(2)
m.write("M")
sleep(2)
m.clear()
m.write("A")
sleep(2)
m.clear()
it dident come any errors but the A wouldent Show only M Btw I need Loop
Posted 30 July 2012 - 06:03 PM
that's strange, let me re-write it and just give it a try
give it a try
mon=peripheral.wrap("right")
mon.setTextScale(2)
while true do
mon.clear()
mon.setCursorPos(1,1)
m.write("M")
sleep(1)
mon.clear()
mon.setCursorPos(1,1)
mon.write("A")
sleep(1)
end
give it a try
Posted 02 August 2012 - 04:12 PM
ok ty
Posted 02 August 2012 - 04:17 PM
TYYYYYYYYYY IT WORKED
Posted 02 August 2012 - 04:18 PM
Challenge accepted…I have yet to see an impressive startup logo etc that is animated, good luck
I will try to do this as soon as I get home from work today. Prepare to be amazed!
Posted 02 August 2012 - 09:15 PM
This should be good!
Posted 03 August 2012 - 09:15 AM
there we go! those who make OSs etc take note, this would be an epic addition, add it on startup etc
Posted 03 August 2012 - 01:36 PM
Well….not so much… I thought I could use parallel to run the title loop, but it just loops over and over, not letting the input be given… But I am going to get this working! Will post code as soon as I can!
Posted 03 August 2012 - 01:48 PM
just make a startup screen that has an animated logo for 3 secs
Posted 03 August 2012 - 01:50 PM
and if you want to loop the logo and accept input that should work EXCEPT: you MUST set the cursor position back to its original position after generating the logo, maybe that will work
Posted 03 August 2012 - 02:57 PM
I already have a dancing kirby, but I want it to dance while waiting for an input. Right now it's either looping kirby, or stopping and waiting for the input. my code for the parallel is this: parallel.waitForAny(select(),kirbyIdle()). It depends on which one I have first as to which one will loop or stop.just make a startup screen that has an animated logo for 3 secs
I already have the cursors doing what I want, but as I said, I don't know how I can have kirby dance the entire time while waiting for input. OH!!!! I think I just thought of something! If I have kirby Idle, and within the idle, not loop it, but call back to restart the kirbyIdle() function! I'll try that now!and if you want to loop the logo and accept input that should work EXCEPT: you MUST set the cursor position back to its original position after generating the logo, maybe that will work
Posted 03 August 2012 - 03:07 PM
OK, Here's what I have so far:
-- screen functions
function border()
term/setCursorPos(1,1)
write("+------------------------------------------+")
term.setCursorPos(1,2)
write("|")
term.setCursorPos(mX,2)
write("|")
term.setCursorPos(1,3)
write("|")
term.setCursorPos(mX,3)
write("|")
write("+------------------------------------------+")
end
function kirbyEnter(mY)
term.setCursorPos(2,2)
write(">")
term.setCursorPos(2,2)
sleep(.2)
write("V)")
term.setCursorPos(2,2)
sleep(.2)
write("('.')>")
term.setCursorPos(2,2)
sleep(.2)
write(" (V')")
term.setCursorPos(2,2)
sleep(.2)
write(" <( )>")
term.setCursorPos(2,2)
sleep(.2)
write(" ('V)")
term.setCursorPos(2,2)
sleep(.2)
write(" <('.')>")
term.setCursorPos(2,2)
sleep(.2)
write(" (V')")
term.setCursorPos(2,2)
sleep(.2)
write(" <( )>")
term.setCursorPos(2,2)
sleep(.2)
write(" ('V)")
term.setCursorPos(2,2)
sleep(.2)
write(" <('.')>")
end
function kirbyDance(mY)
local mY = mY/2
write("^('.')>")
term.setCursorPos(12,mY)
sleep(.5)
write("<('.')^")
term.setCursorPos(12,mY)
sleep(.5)
write("^('.')>")
term.setCursorPos(12,mY)
sleep(.5)
write("<('.')^")
term.setCursorPos(12,mY)
sleep(.5)
write("^('.')>")
term.setCursorPos(12,mY)
sleep(.5)
write("<('.')^")
term.setCursorPos(12,mY)
sleep(.5)
write(" (>'.')>")
term.setCursorPos(12,mY)
sleep(.5)
write("<('.'<) ")
term.setCursorPos(12,mY)
sleep(.5)
write(" (>'.')>")
term.setCursorPos(12,mY)
sleep(.5)
write("<('.'<) ")
term.setCursorPos(12,mY)
sleep(.5)
write(" (>'.')>")
term.setCursorPos(12,mY)
sleep(.5)
write("<('.'<) ")
term.setCursorPos(12,mY)
sleep(.5)
write("<('.')> ")
sleep(2)
end
function select()
term.setCursorPos(1,9)
print("Make your selection")
print("")
print("Dance")
term.setCursorPos(1,18)
write("Selection: ")
--other options available in the future
local input = read()
while true do
if input == "dance" then
kirbyDance(mY)
else
print("INVALID")
sleep(1)
term.setCursorPos(11,18)
end
end
end
function kirbyIdle(mY)
term.setCursorPos(12,mY)
write("<('.')>")
sleep(5)
term.setCursorPos(12,mY)
write("<(-.-)>")
sleep(.2)
kirbyIdle(mY)
end
-- end screen functions
mX, mY = term.getSize()
border()
kirbyEnter()
parallel.waitForAny(select(),kirbyIdle())
I haven't tested this new one, so I'm counting on you guys to squash those bugs!Posted 03 August 2012 - 09:05 PM
You don't have to call the functions in the parallel call, you just pass the functions as arguments, and parallel runs them for you:
Also, don't use recursive functions to make a loop, it will overflow the stack and crash the computer.
parallel.waitForAny(select, kyrbyIdle)
Basically, just remove the brackets :P/>/>Also, don't use recursive functions to make a loop, it will overflow the stack and crash the computer.