Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Cool looking login system.
- http://i46.tinypic.com/2yyoa3b.png
- ]]--
- local logoB = {
- "ffffff000000000ffffff",
- "fff000bbbbbbbbb000fff",
- "ff0bbbbbbb0000bbbb0ff",
- "ff0bbb11110f00bbbb0ff",
- "f0bbbb1bbb0000bbbbb0f",
- "f0bbbbbb000000bbbbb0f",
- "0bbbbbbbc1c11cbbbbbb0",
- "0bbbbb000000000bbbbb0",
- "0bbbbb0000c0000bbbbb0",
- "0bbbbb000cec000bbbbb0",
- "0bbbbb00ceeec00bbbbb0",
- "f0bbbb000cec000bbbb0f",
- "f0bbbb0000c0000bbbb0f",
- "ff0bbbb0000000bbbb0ff",
- "ff0bbbbbbb0bbbbbbb0ff",
- "fff000bbbbbbbbb000fff",
- "ffffff000000000ffffff",
- }
- local logo = {
- " 000000000 ",
- " 000bbbbbbbbb000 ",
- " 0bbbbbbb0000bbbb0 ",
- " 0bbb11110f00bbbb0 ",
- " 0bbbb1bbb0000bbbbb0 ",
- " 0bbbbbb000000bbbbb0 ",
- "0bbbbbbbc1c11cbbbbbb0",
- "0bbbbb000000000bbbbb0",
- "0bbbbb0000c0000bbbbb0",
- "0bbbbb000cec000bbbbb0",
- "0bbbbb00ceeec00bbbbb0",
- " 0bbbb000cec000bbbb0 ",
- " 0bbbb0000c0000bbbb0 ",
- " 0bbbb0000000bbbb0 ",
- " 0bbbbbbb0bbbbbbb0 ",
- " 000000000000000 ", -- " 000bbbbbbbbb000 ",
- " 000000000 ",
- }
- local off = 5 -- + off
- local words = {
- [8] = {[9] = "C",[11] = "I",[13] = "A"},
- [14] = {[8] = "C",[9] = "e",[10] = "n",[11] = "t",[12] = "r",[13] = "a",[14] = "l"},
- [16] = {[1 + off] = "I",[2+ off] = "n",[3+ off] = "t",[4+ off] = "e",[5+ off] = "l",[6+ off] = "l",[7+ off] = "i",[8+ off] = "g",[9+ off] = "e",[10+ off] = "n",[11+ off] = "c",[12+ off] = "e"}
- }
- local test = {"0123456789abcdef"}
- local col = {
- ["0"] = 1,
- ["1"] = 2,
- ["2"] = 4,
- ["3"] = 8,
- ["4"] = 16,
- ["5"] = 32,
- ["6"] = 64,
- ["7"] = 128,
- ["8"] = 256,
- ["9"] = 512,
- ["a"] = 1024,
- ["b"] = 2048,
- ["c"] = 4096,
- ["d"] = 8192,
- ["e"] = 16384,
- ["f"] = 32768,
- }
- --[[
- term.setBackgroundColor(colors.black)
- term.clear()
- ]]--
- local backGround = colors.lightBlue
- local function draw(image,centerX,centerY,scale,invt)
- local img = image
- local offX = centerX - math.floor(#img[1]/2)*scale
- local offY = centerY - math.floor(#img/2) - 1
- local wdth = math.ceil(#img[1]*scale)
- for i = 1, #img do
- local line = img[i]
- if invt then
- line = string.reverse(line)
- end
- term.setCursorPos(offX,offY + i)
- for a = 1,wdth do
- local char = math.modf((a/scale)+0.5)
- local color = col[string.sub(line,char,char)]
- --if color then
- term.setBackgroundColor(color or backGround)
- term.write(words[i] and words[i][char] or " ")
- --end
- end
- end
- end
- -- test
- local function clear()
- term.setBackgroundColor(backGround)
- term.setTextColor(colors.black)
- term.clear()
- end
- local invt = false
- local rate = 0.1
- while true do
- for i = 0,1,0.1 do
- clear()
- draw(logo,25,10,i,not invt)
- sleep(rate)
- end
- if invt then
- sleep(10)
- end
- for i = 1,0,-0.1 do
- clear()
- draw(logo,25,10,i,not invt)
- sleep(rate)
- end
- invt = not invt
- sleep(rate)
- end
- --[[
- -- test example
- local scale = 1
- local inc = 0.1
- while true do
- term.setBackgroundColor(colors.black)
- term.clear()
- draw(logo,25,10,scale,true)
- term.setBackgroundColor(colors.black)
- term.setCursorPos(1,1)
- term.write(tostring(scale).." "..tostring(inc))
- local event = {os.pullEvent()}
- if event[1] == "key" then
- if event[2] == 203 then -- left
- scale = scale - inc
- elseif event[2] == 205 then -- right
- scale = scale + inc
- elseif event[2] == 14 then
- return
- end
- end
- end
- ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement