Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.89 KB | None | 0 0
  1. local sourceX, sourceY = 1366, 768
  2. local screenX, screenY = guiGetScreenSize( )
  3.  
  4. function sx( var ) return screenX*( var/sourceX ) end
  5. function sy( var ) return screenY*( var/sourceY ) end
  6. items = {
  7.  
  8.     {"img/1.png"},
  9.     {"img/2.png"},
  10.     {"img/3.png"},
  11.     {"img/4.png"},
  12.     {"img/5.png"},
  13.     {"img/6.png"},
  14.  
  15. }
  16. startX, startY, width, height, iPR = sx(150), sy(980), sx(75), sy(50), 3
  17.  
  18. addEventHandler('onClientRender', root,
  19.     function ()
  20.             local row, index = 1, 1
  21.             dxDrawRectangle(sx(20), sy(180), sx(248), sy(300), tocolor(100,100,50,150))
  22.             dxDrawText( "OBJETOS", sx(55), sy(180), sx(250), sy(300), tocolor(255, 255,255), (screenY/sourceY)*0.8, "bankgothic" )
  23.             dxDrawText( "Click en un item para nusarlo o cederlo\na otro jugador que este cerca", sx(45), sy(130), sx(250), sy(300), tocolor(255, 255,255), (screenY/sourceY)*0.8, "default", "center", "center" )
  24.             for i = 1, 12 do
  25.                 x = (startX * index)*0.55; y = (startY * row)*0.06
  26.                 if ( i%iPR == 0 ) then
  27.                     row = row + 1
  28.                     index = 1
  29.                 else
  30.                     index = index + 1
  31.                 end
  32.                 if items[i] then
  33.                     local imagen = items[i][1]
  34.                     if isMouseInPosition( x-55, y+230, width, height ) then
  35.                         if getKeyState( "mouse1" ) == true then
  36.                             dxDrawRectangle(x-55, y+230, width, height, tocolor(100,200,50,150))
  37.                             dxDrawImage(x-55, y+230, width, height, imagen)
  38.                         else
  39.                             dxDrawRectangle(x-55, y+230, width, height, tocolor(100,150,50,150))
  40.                             dxDrawImage(x-55, y+230, width, height, imagen)                    
  41.                         end
  42.                     else
  43.                         dxDrawRectangle(x-55, y+230, width, height, tocolor(100,100,50,150))
  44.                         dxDrawImage(x-55, y+230, width, height, imagen)                
  45.                     end
  46.                 else
  47.                     dxDrawRectangle(x-55, y+230, width, height, tocolor(0,0,0,50))
  48.                 end
  49.             end
  50.     end
  51. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement