Advertisement
hevohevo

CC: mon4

Apr 18th, 2016
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. -- mon4
  2. -- 様々な文字色・背景色を表示する
  3. local mon = peripheral.wrap("top") -- 変数monに各種操作関数を詰め込む
  4. mon.clear()
  5. mon.setTextScale(0.5)  -- 文字のサイズを0.5にする(標準は1)
  6.  
  7. mon.setCursorPos(1,1)
  8. mon.setTextColor(colors.red)  -- 文字色 赤
  9. mon.setBackgroundColor(colors.white)  -- 背景色 白
  10. mon.write("Hello")
  11.  
  12. mon.setCursorPos(1,2)
  13. mon.setTextColor(colors.blue)  -- 文字色 青
  14. mon.setBackgroundColor(colors.brown)  -- 背景色 茶色
  15. mon.write("CC")
  16.  
  17. mon.setCursorPos(1,3)
  18. mon.setTextColor(colors.yellow)  -- 文字色 黄色
  19. mon.setBackgroundColor(colors.black)  -- 背景色 黒
  20. mon.write("World!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement