Search the Community
Showing results for tags 'loop 8'.
-
hey i have a little problem here when converting a screen from 1600x900 to 800x600 i used some scaling tutorial @IIYAMA so i did loop and had some problem with screen sizes my screen screen user's 800x600: code: local devScreenX = 1920 local devScreenY = 1080 local screenX, screenY = guiGetScreenSize() local scaleValue = screenY / devScreenY scaleValue = math.max(scaleValue, 0.65) -- < here add the limit addEventHandler("onClientResourceStart",resourceRoot, function() setPlayerHudComponentVisible("all", false) end) local dash = { menu = {"Hello There","Hello There2","Hello There3","Hello There4","Hello There5","Hello There6"}, } addEventHandler("onClientRender", root, function () -- create a scaled size local sizeX = scaleValue * 180 local sizeY = scaleValue * 40 -- get the center of the screen local centerX = screenX - screenX local centerY = screenY / 2 -- calculate the starting point of the rectangle local startRectangleX = centerX local startRectangleY = centerY - (sizeY / 0.5) local offsetY = 0 dxDrawRectangle ( startRectangleX, startRectangleY, sizeX, sizeY, tocolor ( 0, 0, 0, 180 ) ) offsetY = offsetY + startRectangleY*0.15 dxDrawRectangle ( startRectangleX, startRectangleY+offsetY, sizeX, sizeY, tocolor ( 0, 0, 0, 180 ) ) offsetY = offsetY + startRectangleY*0.15 dxDrawRectangle ( startRectangleX, startRectangleY+offsetY, sizeX, sizeY, tocolor ( 0, 0, 0, 180 ) ) offsetY = offsetY + startRectangleY*0.15 dxDrawRectangle ( startRectangleX, startRectangleY+offsetY, sizeX, sizeY, tocolor ( 0, 0, 0, 180 ) ) offsetY = offsetY + startRectangleY*0.15 dxDrawRectangle ( startRectangleX, startRectangleY+offsetY, sizeX, sizeY, tocolor ( 0, 0, 0, 180 ) ) offsetY = offsetY + startRectangleY*0.15 dxDrawRectangle ( startRectangleX, startRectangleY+offsetY, sizeX, sizeY, tocolor ( 0, 0, 0, 180 ) ) --[[local offsetY = 0 local posY = startRectangleY * 0.022 dxDrawText("Hello There!", startRectangleX, startRectangleY+posY, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") offsetY = offsetY + startRectangleY * 0.17 dxDrawText("Hello There!", startRectangleX, startRectangleY+offsetY, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") offsetY = offsetY + startRectangleY * 0.15 dxDrawText("Hello There!", startRectangleX, startRectangleY+offsetY, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") offsetY = offsetY + startRectangleY * 0.155 dxDrawText("Hello There!", startRectangleX, startRectangleY+offsetY, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") offsetY = offsetY + startRectangleY * 0.145 dxDrawText("Hello There!", startRectangleX, startRectangleY+offsetY, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") offsetY = offsetY + startRectangleY * 0.15 dxDrawText("Hello There!", startRectangleX, startRectangleY+offsetY, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top")]] -- THIS WORK WITHOUT LOOP local posY = startRectangleY * 1.88 for i,v in ipairs(dash.menu) do dxDrawText(v, startRectangleX, posY-startRectangleY+i*57, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") end end)