NeOzay

textObject.lua

Aug 4th, 2021
776
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local mdl = {}
  2.  
  3. function mdl.TextObject(text, foregroundColor, backgroundColor)
  4.     local tO = {}
  5.     tO.text = text
  6.     tO.foregroundColor = foregroundColor
  7.     tO.backgroundColor = backgroundColor
  8.     return tO
  9. end
  10.  
  11.  
  12. function mdl.drawtO(tO, x, y)
  13.     local bg = tO.backgroundColor
  14.     local fg = tO.foregroundColor
  15.     gpu.setBackground(bg.color, bg.isPaletteIndex)
  16.     gpu.setForeground(fg.color, fg.isPaletteIndex)
  17.     gpu.set(x, y, tO.text)
  18. end
  19.  
  20. return mdl
  21.  
RAW Paste Data