Advertisement
Guest User

Untitled

a guest
May 26th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. local pos_x, pos_y = 0, 0
  2. local subpanels = {}
  3. local col = Color( 200, 200, 200, 240 )
  4. local space = 8
  5. for i = 0, 30 do
  6.  
  7.     local p = vgui.Create( "DPanel" )
  8.     p:SetSize( 32, 32 )
  9.     p:SetPos( pos_x, pos_y )
  10.     p:SetBackgroundColor( col )
  11.  
  12.     pos_x = pos_x + space
  13.  
  14.     if pos_x > 3 * space then
  15.  
  16.         pos_x = 0
  17.         pos_y = pos_y + space
  18.  
  19.     end
  20.  
  21.     table.insert( subpanels, p )
  22.  
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement