Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.12 KB | None | 0 0
  1. local bWidHeight
  2. local bInnerWidHeight
  3.  
  4. local bX
  5. local bY
  6. local biX
  7. local biY
  8.  
  9. local fontName
  10.  
  11. local tiles = {}
  12.  
  13. function GeneratePositions()
  14.     fontName = ScrW() .. "x" .. ScrH()
  15.    
  16.     if (ScrW() < ScrH()) then
  17.         bWidHeight = .9 * ScrW()
  18.     else
  19.         bWidHeight = .9 * ScrH()
  20.     end
  21.    
  22.     bInnerWidHeight = .75 * bWidHeight
  23.    
  24.     bX = math.floor((ScrW() / 2) - (bWidHeight / 2))
  25.     bY = math.floor((ScrH() / 2) - (bWidHeight / 2))
  26.    
  27.     biX = math.floor((ScrW() / 2) - (bInnerWidHeight / 2))
  28.     biY = math.floor((ScrH() / 2) - (bInnerWidHeight / 2))
  29.    
  30.     local lgTileWH = (.25 * bWidHeight) / 2
  31.    
  32.     -- You've passed go. Collect $2 million
  33.     tiles[1] = {
  34.         Width = lgTileWH,
  35.         Height = lgTileWH,
  36.        
  37.     }
  38. end
  39.  
  40. function DrawBoard()
  41.     if (!bWidHeight) or (!tileWidth) or (!tileHeight) or (!fontName) or (!bX) or (!bY) or (!biX) or (!biY) then
  42.         GeneratePositions()
  43.     end
  44.  
  45.     surface.SetFont("Monopoly." .. fontName)
  46.    
  47.     surface.SetDrawColor(0, 0, 0, 255)
  48.         surface.DrawOutlinedRect(x, y, bWidHeight, bWidHeight)
  49.         surface.DrawOutlinedRect(iX, iY, bInnerWidHeight, bInnerWidHeight)
  50. end
  51.  
  52. hook.Add("HUDPaint", "DrawMonopolyBoard", DrawBoard)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement