Advertisement
Guest User

Untitled

a guest
Jun 29th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. local sx,sy = guiGetScreenSize()
  2. local ScreenS = {guiGetScreenSize()}
  3. local PanelS = {300,300}
  4. local screenX, screenY = guiGetScreenSize()
  5. local panelType = "login"
  6. local font = dxCreateFont("font.ttf", 20)
  7. local guifont = dxCreateFont("roboto.ttf", 15)
  8. --[[function createGui(tip)
  9. if tip == "login" then
  10. ]]
  11.  
  12. function renderPanel()
  13. local now = getTickCount()
  14. local elapsedTime = now
  15. local progress = elapsedTime / 1500
  16. local SizeN = {interpolateBetween(0,0,0,PanelS[1],PanelS[2],0,progress,"OutElastic")}
  17. lusername = guiCreateEdit(ScreenS[1]/2-SizeN[1]/2+50,ScreenS[2]/2-SizeN[2]/2+56, 230, 30, "",false)
  18. lpassword = guiCreateEdit(ScreenS[1]/2-SizeN[1]/2+50,ScreenS[2]/2-SizeN[2]/2+116, 230, 30, "",false)
  19.  
  20. guiSetFont(lpassword,"sa-gothic")
  21. guiSetAlpha(lpassword,0)
  22. guiEditSetMaxLength(lpassword, 45)
  23.  
  24. guiSetFont(lusername, "sa-gothic")
  25. guiSetAlpha(lusername,0)
  26. guiEditSetMaxLength(lusername, 45)
  27. local name = guiGetText(lusername)
  28. local password = guiGetText(lpassword)
  29. -- if name == "" then
  30. -- name = "Felhasználónév"
  31. -- end
  32. -- outputChatBox("" .. name .. "")
  33. dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2-5,ScreenS[2]/2-SizeN[2]/2-5,SizeN[1]+10,SizeN[2]+10, tocolor(0,0,0,80))
  34. dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2,ScreenS[2]/2-SizeN[2]/2,SizeN[1],SizeN[2], tocolor(0,0,0,80))
  35. dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2,ScreenS[2]/2-SizeN[2]/2,SizeN[1],30, tocolor(0,0,0,80))
  36. dxDrawText("Reality-World", ScreenS[1]/2-SizeN[1]/2+150,ScreenS[2]/2-SizeN[2]/2, _, _, tocolor(255,255, 255, 255),0.8, font, "center")
  37. dxDrawImage(ScreenS[1]/2-SizeN[1]/2,ScreenS[2]/2-SizeN[2]/2+50, 45, 46, "user.png", 0, 0, 0, tocolor(255, 255, 255, 255))
  38. dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2+50,ScreenS[2]/2-SizeN[2]/2+56, 230, 30, tocolor(0, 0, 0, 100))
  39. dxDrawText(name,ScreenS[1]/2-PanelS[1]/2+50,ScreenS[2]/2-PanelS[2]/2+PanelS[2]/4,tocolor(255,255,255,255),1, "sa-gothic", "left","center")
  40. dxDrawImage(ScreenS[1]/2-SizeN[1]/2,ScreenS[2]/2-SizeN[2]/2+110, 45, 46, "password.png", 0, 0, 0, tocolor(255, 255, 255, 255))
  41. dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2+50,ScreenS[2]/2-SizeN[2]/2+116, 230, 30, tocolor(0, 0, 0, 100))
  42. dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2+35,ScreenS[2]/2-SizeN[2]/2+206, 230, 30, tocolor(0, 0, 0, 100))
  43. dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2+35,ScreenS[2]/2-SizeN[2]/2+256, 230, 30, tocolor(0, 0, 0, 100))
  44. dxDrawText("Bejelentkezés", ScreenS[1]/2-SizeN[1]/2+150,ScreenS[2]/2-SizeN[2]/2+206, _, _, tocolor(255,255, 255, 255),0.8, font, "center")
  45. dxDrawText("Regisztráció", ScreenS[1]/2-SizeN[1]/2+150,ScreenS[2]/2-SizeN[2]/2+256, _, _, tocolor(255,255, 255, 255),0.8, font, "center")
  46. -- dxDrawText(guiGetText(lusername), ScreenS[1]/2-SizeN[1]/2+50,ScreenS[2]/2-SizeN[2]/2+56, _, _, tocolor(255, 255, 255, 255), 0.5, "font", "center")
  47. if isMouseInPosition(ScreenS[1]/2-SizeN[1]/2+35,ScreenS[2]/2-SizeN[2]/2+206, 230, 30) then
  48. dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2+37,ScreenS[2]/2-SizeN[2]/2+208, 226, 26, tocolor(103, 232, 163, 100))
  49. end
  50. if isMouseInPosition(ScreenS[1]/2-SizeN[1]/2+35,ScreenS[2]/2-SizeN[2]/2+256, 230, 30) then
  51. dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2+37,ScreenS[2]/2-SizeN[2]/2+258, 226, 26, tocolor(0, 204, 204, 100))
  52. end
  53. end
  54. addEventHandler("onClientRender", root, renderPanel)
  55.  
  56.  
  57.  
  58.  
  59. function isMouseInPosition ( x, y, width, height )
  60. if ( not isCursorShowing( ) ) then
  61. return false
  62. end
  63. local sx, sy = guiGetScreenSize ( )
  64. local cx, cy = getCursorPosition ( )
  65. local cx, cy = ( cx * sx ), ( cy * sy )
  66. if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
  67. return true
  68. else
  69. return false
  70. end
  71. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement