Advertisement
NanoBob

Terminator

Jan 7th, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1. glasses=peripheral.wrap("left")
  2. sensor=peripheral.wrap("right")
  3.  
  4. --local currentPlayer=nil
  5. local currentPlayer="darkbobo00"
  6. local guiSize="normal"
  7.  
  8. local guiSizes={
  9.     ["small"]={["x"]=1920,["y"]=1057},
  10.     ["normal"]={["x"]=960,["y"]=540},
  11.     ["large"]={["x"]=640,["y"]=353},
  12.     --["auto"]={["x"]=,["y"]=},
  13. }
  14. local screenX=0
  15. local screenY=0
  16.  
  17. function setScreenSize(guiSize,x,y)
  18.     if guiSize==nil then
  19.         screenX=x
  20.         screenY=y
  21.         return true,screenX,screenY
  22.     else
  23.         screenX=guiSizes[guiSize]["x"]
  24.         screenY=guiSizes[guiSize]["y"]
  25.         return true,screenX,screenY
  26.     end
  27.     return false
  28. end
  29.  
  30. local function drawBackground()
  31.     glasses.clear()
  32.     backgroundBox=glasses.addBox(0,0,screenX,screenY,0xff0000,0.2)
  33.     glasses.addBox(0,0,screenX,10,0x000000,255)
  34.     glasses.addBox(0,screenY-10,10,screenY,0x000000,255)
  35.     glasses.addBox(screenX-10,0,10,screenY,0x000000,255)
  36.     glasses.addBox(0,0,10,screenY,0x000000,255)
  37. end
  38.  
  39. local function drawSituation(player)
  40.     local allData=sensor.getPlayerData(player)
  41.     local x=screenX*0.1
  42.     local y=screenX*0.4
  43.     healthBox=glasses.addBox(x-3,y-3,x+6,y+6,0x000000,0.2)
  44.     healthBox=glasses.addBox(x,y,x,y/2,0xff0000,0.2)
  45. end
  46.  
  47. function systemBoot()
  48.     setScreenSize(guiSize)
  49.     drawBackground()
  50.     drawSituation(currentPlayer)
  51. end
  52. systemBoot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement