Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Graphix API v2: Coded by datcoder1208 also known as MCFunRide
- --[[
- Copyright (c) 2015, The CubeSpaceCC Team
- Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted,
- provided that the above copyright notice and this permission notice appear in all copies.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
- INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
- DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
- OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- --]]
- function center(yPos,sText)
- local w, h = term.getSize()
- local x = term.getCursorPos()
- x = math.max(math.floor((w / 2) - (#sText / 2)), 0)
- term.setCursorPos(x,yPos)
- print(sText)
- end
- function centerWrite(yPos,sText)
- local w, h = term.getSize()
- local x = term.getCursorPos()
- x = math.max(math.floor((w / 2) - (#sText / 2)), 0)
- term.setCursorPos(x,yPos)
- write(sText)
- end
- function centerSlowPrint(yPos,sText)
- local w, h = term.getSize()
- local x = term.getCursorPos()
- x = math.max(math.floor((w / 2) - (#sText / 2)), 0)
- term.setCursorPos(x,yPos)
- textutils.slowPrint(sText)
- end
- function totalClear()
- term.setCursorPos(1,1)
- term.clear()
- end
- function bgColor(color)
- term.setBackgroundColor(color)
- totalClear()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement