Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sourceX, sourceY = 1366, 768
- local screenX, screenY = guiGetScreenSize( )
- function sx( var ) return screenX*( var/sourceX ) end
- function sy( var ) return screenY*( var/sourceY ) end
- items = {
- {"img/1.png"},
- {"img/2.png"},
- {"img/3.png"},
- {"img/4.png"},
- {"img/5.png"},
- {"img/6.png"},
- }
- startX, startY, width, height, iPR = sx(150), sy(980), sx(75), sy(50), 3
- addEventHandler('onClientRender', root,
- function ()
- local row, index = 1, 1
- dxDrawRectangle(sx(20), sy(180), sx(248), sy(300), tocolor(100,100,50,150))
- dxDrawText( "OBJETOS", sx(55), sy(180), sx(250), sy(300), tocolor(255, 255,255), (screenY/sourceY)*0.8, "bankgothic" )
- 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" )
- for i = 1, 12 do
- x = (startX * index)*0.55; y = (startY * row)*0.06
- if ( i%iPR == 0 ) then
- row = row + 1
- index = 1
- else
- index = index + 1
- end
- if items[i] then
- local imagen = items[i][1]
- if isMouseInPosition( x-55, y+230, width, height ) then
- if getKeyState( "mouse1" ) == true then
- dxDrawRectangle(x-55, y+230, width, height, tocolor(100,200,50,150))
- dxDrawImage(x-55, y+230, width, height, imagen)
- else
- dxDrawRectangle(x-55, y+230, width, height, tocolor(100,150,50,150))
- dxDrawImage(x-55, y+230, width, height, imagen)
- end
- else
- dxDrawRectangle(x-55, y+230, width, height, tocolor(100,100,50,150))
- dxDrawImage(x-55, y+230, width, height, imagen)
- end
- else
- dxDrawRectangle(x-55, y+230, width, height, tocolor(0,0,0,50))
- end
- end
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement