MavricMC

CardAPI

Apr 10th, 2021 (edited)
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. --Made by Mavric on YouTube--
  2. --"\3", "\4", "\5" and "\5" are the emojis for the different suits--
  3. function drawCard(x, y, char, suit)
  4.     if (suit == "\5" or suit == "\6") then
  5.         color = colors.black
  6.     else
  7.         color = colors.red
  8.     end
  9.     local pic = paintutils.loadImage("/blackjack/card.nfp")
  10.     paintutils.drawImage(pic, x, y)
  11.     term.setCursorPos(x + 1, y + 1)
  12.     term.setBackgroundColor(1)
  13.     term.setTextColor(color)
  14.     print(char)
  15.     term.setCursorPos(x + 3, y + 3)
  16.     print(suit)
  17.     if char == 10 then
  18.         term.setCursorPos(x + 4, y + 5)
  19.     else
  20.         term.setCursorPos(x + 5, y + 5)
  21.     end
  22.     print(char)
  23. end
Add Comment
Please, Sign In to add comment