Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1.             surface.DrawTexturedRect( 100, 61, 16, 16 )
  2.  
  3.             draw.SimpleText( data.name, "bleur_menu16", 120, 9, Color( 255, 255, 255, 200 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP )
  4.             draw.SimpleText( "$" .. self.price, "bleur_menu16", 120, 35, Color( 255, 255, 255, 200 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP )
  5.             draw.SimpleText( data.category, "bleur_menu16", 120, 61, Color( 255, 255, 255, 200 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP )
  6.         end
  7.  
  8.         function ent:OnCursorEntered()
  9.             self:SetCursor( "hand" )
  10.         end
  11.  
  12.         function ent:OnCursorExited()
  13.             self:SetCursor( "arrow" )
  14.         end
  15.  
  16.         function ent:OnMousePressed()
  17.             RunConsoleCommand( "say", "/" .. data.cmd )
  18.         end
  19.  
  20.         local model = vgui.Create( "DModelPanel", ent )
  21.         model:SetSize( 90, 90 )
  22.         model:SetPos( 5, 5 )
  23.         model:SetModel( data.model )
  24.  
  25.         local mn, mx = model.Entity:GetRenderBounds()
  26.         local size = 0
  27.         size = math.max( size, math.abs(mn.x) + math.abs(mx.x) )
  28.         size = math.max( size, math.abs(mn.y) + math.abs(mx.y) )
  29.         size = math.max( size, math.abs(mn.z) + math.abs(mx.z) )
  30.         model:SetFOV( 50 )
  31.         model:SetCamPos( Vector( size, size, size ) )
  32.         model:SetLookAt( ( mn + mx ) * 0.5 )
  33.  
  34.         function model:LayoutEntity()
  35.             return false
  36.         end
  37.     end
  38. end }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement