طيب ليش ماتستخدم كودي اسهل لك وبدون تعقيد
function guiSetPos ( theGUI, x, y, Relative )
if ( ( isElement ( theGUI ) ) and ( getElementType ( theGUI ):find( "gui-" ) ) ) then
if ( ( theGUI ) and ( x ) and ( y ) ) then
local px, py = guiGetScreenSize ( );
local hx, hy = guiGetPosition ( theGUI, Relative );
guiSetPosition ( theGUI, hx * px / x, hy * py / y, Relative );
return true
else
return false
end
else
return false
end
end
btnLogin = guiCreateStaticImage(550,675,570,113,"images/login.png",false,mainWindow)
guiSetPos ( btnLogin, 1280, 1045, false )