Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local c = require("component")
- local unicode = require("unicode")
- local holo = c.hologram
- local symbols = require("symbols")
- if not holo then error("This program reqiures holoram projector.") end
- local hologram = {}
- ---------------------------------------
- local function clear()
- holo.clear()
- end
- function hologram.drawSymbol(x, y, z, symbol, color)
- for i = 1, #symbol do
- for j = 1, #symbol[i] do
- if symbol[i][j] == 1 then
- holo.set(x + j - 1, y - i + 1, z, color)
- end
- end
- end
- end
- function hologram.text(x, y, z, text, color)
- local length = unicode.len(text)
- local smeshenie = 0
- for i = 1, length do
- local sym = unicode.sub(text, i, i)
- hologram.drawSymbol(x + smeshenie, y, z, symbols[sym], color)
- smeshenie = smeshenie + 6
- end
- end
- ---------------------------------------
- local args = {...}
- local text = "Open Computers"
- if args[1] then
- text = tostring(args[1])
- else
- print("No text specified, using default value 'Open Computers'.")
- end
- local text = text .. " "
- local scale = tonumber(args[2]) or 1
- local height = tonumber(args[3]) or 10
- local date
- holo.setScale(scale)
- while true do
- holo.clear()
- hologram.text(1, height, 24, text:upper(), 2)
- os.sleep(1)
- end
- ---------------------------------------
- return hologram
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement