Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sx,sy = guiGetScreenSize()
- local ScreenS = {guiGetScreenSize()}
- local PanelS = {300,300}
- local screenX, screenY = guiGetScreenSize()
- local panelType = "login"
- local font = dxCreateFont("font.ttf", 20)
- local guifont = dxCreateFont("roboto.ttf", 15)
- --[[function createGui(tip)
- if tip == "login" then
- ]]
- function renderPanel()
- local now = getTickCount()
- local elapsedTime = now
- local progress = elapsedTime / 1500
- local SizeN = {interpolateBetween(0,0,0,PanelS[1],PanelS[2],0,progress,"OutElastic")}
- lusername = guiCreateEdit(ScreenS[1]/2-SizeN[1]/2+50,ScreenS[2]/2-SizeN[2]/2+56, 230, 30, "",false)
- lpassword = guiCreateEdit(ScreenS[1]/2-SizeN[1]/2+50,ScreenS[2]/2-SizeN[2]/2+116, 230, 30, "",false)
- guiSetFont(lpassword,"sa-gothic")
- guiSetAlpha(lpassword,0)
- guiEditSetMaxLength(lpassword, 45)
- guiSetFont(lusername, "sa-gothic")
- guiSetAlpha(lusername,0)
- guiEditSetMaxLength(lusername, 45)
- local name = guiGetText(lusername)
- local password = guiGetText(lpassword)
- -- if name == "" then
- -- name = "Felhasználónév"
- -- end
- -- outputChatBox("" .. name .. "")
- 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))
- dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2,ScreenS[2]/2-SizeN[2]/2,SizeN[1],SizeN[2], tocolor(0,0,0,80))
- dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2,ScreenS[2]/2-SizeN[2]/2,SizeN[1],30, tocolor(0,0,0,80))
- 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")
- 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))
- dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2+50,ScreenS[2]/2-SizeN[2]/2+56, 230, 30, tocolor(0, 0, 0, 100))
- 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")
- 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))
- dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2+50,ScreenS[2]/2-SizeN[2]/2+116, 230, 30, tocolor(0, 0, 0, 100))
- dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2+35,ScreenS[2]/2-SizeN[2]/2+206, 230, 30, tocolor(0, 0, 0, 100))
- dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2+35,ScreenS[2]/2-SizeN[2]/2+256, 230, 30, tocolor(0, 0, 0, 100))
- 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")
- 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")
- -- 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")
- if isMouseInPosition(ScreenS[1]/2-SizeN[1]/2+35,ScreenS[2]/2-SizeN[2]/2+206, 230, 30) then
- dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2+37,ScreenS[2]/2-SizeN[2]/2+208, 226, 26, tocolor(103, 232, 163, 100))
- end
- if isMouseInPosition(ScreenS[1]/2-SizeN[1]/2+35,ScreenS[2]/2-SizeN[2]/2+256, 230, 30) then
- dxDrawRectangle(ScreenS[1]/2-SizeN[1]/2+37,ScreenS[2]/2-SizeN[2]/2+258, 226, 26, tocolor(0, 204, 204, 100))
- end
- end
- addEventHandler("onClientRender", root, renderPanel)
- function isMouseInPosition ( x, y, width, height )
- if ( not isCursorShowing( ) ) then
- return false
- end
- local sx, sy = guiGetScreenSize ( )
- local cx, cy = getCursorPosition ( )
- local cx, cy = ( cx * sx ), ( cy * sy )
- if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
- return true
- else
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement