Posted 11 November 2012 - 12:57 PM
So basically I was making a splash screen and it was working great until I ran it and all my ascii text got distorted. I can't seem to find the problem, and my code looks alright. Note: In the code below, the ascii art is disorted because of the font, that is not the problem.
Thanks, Lazerman
Code
Screenshot
Thanks, Lazerman
Code
Spoiler
term.clear()
bRun = true
term.setTextColor(colors.red)
w, h = term.getSize()
logo = {
" _ ____ _____ ",
" | | / __ \ / ____|",
" | | __ _ _______ _ __| | | | (___ ",
" | | / _| |_ / _ \ '__| | | |\___ \ ",
" | |___| (_| |/ / __/ | | |__| |____) |",
" |______\__,_/___\___|_| \____/|_____/ ",
}
dimensions = {
logoTop = h / 2 - 3,
logoBottom = h / 2 + 3,
loadBar = h / 2 + 4,
loadStatus = h / 2 + 5
}
function splash()
local logoX = w / 2 - #logo[1] / 2
local state = 1
local states = {
"O o o",
"o O o",
"o o O"
}
for i=dimensions.logoTop,dimensions.logoBottom do
term.setCursorPos(logoX, i)
print(logo[i - dimensions.logoTop])
end
while bRun do
local length = w / 2 - #states[1] / 2
term.setCursorPos(length, dimensions.loadBar)
print(states[state])
if state == #states then state = 1
else state = state + 1 end
sleep(1)
end
end
function load()
--do stuffs
sleep(2)
bRun = false
end
parallel.waitForAll(splash, load)
Screenshot