Jump to content

مشكله . في قياسات النافذه


Recommended Posts

السلام عليكم ورحمة الله وبركاته

ي شباب حاولت بجميع الاكواد اللي تخلي النافذه بمقاس واحد على كل الشاشات . ولا في فايده

مع العلم . اني اجربها مع نفسي . اسوي نافذه واحط كود القياسات واغير حجم اللعبه واجرب

1280 × 720 - قياسات الشاشه يوم سويت النافذه +

Code testing

function guiSetPositionAllScreen(guiElement,ScreenH,ScreenW) 
    local LocalScreenH,LocalScreenW = guiGetScreenSize() 
    if ( isElement(guiElement) ) then 
        if ( ScreenH and ScreenW ) then 
            local x,y = guiGetPosition(guiElement,false) 
            guiSetPosition(guiElement,LocalScreenH*(x/ScreenH),LocalScreenW*(y/ScreenW),false) 
        end 
    end 
end 
  
GUIEditor = { 
    button = {}, 
    window = {}, 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(308, 72, 634, 613, "TEST", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
         guiSetPositionAllScreen(GUIEditor.window[1],1280,720) 
        GUIEditor.button[1] = guiCreateButton(218, 183, 165, 118, "Button Test", false, GUIEditor.window[1])    
    end 
) 
    bindKey("F3","down",function() 
    if ( guiGetVisible( GUIEditor.window[1] ) == true ) then 
    guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
    elseif ( guiGetVisible(GUIEditor.window[1]) == false ) then 
    guiSetVisible(GUIEditor.window[1],true) 
    showCursor(true) 
    end 
    end 
    ) 
  

Link to comment
        guiWindowSetSizable(GUIEditor.window[1], false) 
         guiSetPositionAllScreen(GUIEditor.window[1],1280,720) 

تقفل تحجيم الشاشة بعدها تحججمها على كل الشاشات !!! هذا الخطا الموجود

جرب

    function guiSetPositionAllScreen(guiElement,ScreenH,ScreenW) 
        local LocalScreenH,LocalScreenW = guiGetScreenSize() 
        if ( isElement(guiElement) ) then 
            if ( ScreenH and ScreenW ) then 
                local x,y = guiGetPosition(guiElement,false) 
                guiSetPosition(guiElement,LocalScreenH*(x/ScreenH),LocalScreenW*(y/ScreenW),false) 
            end 
        end 
    end 
  
        GUIEditor.window[1] = guiCreateWindow(308, 72, 634, 613, "TEST", false) 
         guiSetPositionAllScreen(GUIEditor.window[1],1280,720) 
        GUIEditor.button[1] = guiCreateButton(218, 183, 165, 118, "Button Test", false, GUIEditor.window[1])   
         guiSetPositionAllScreen(GUIEditor.button[1],1280,720) 
    end 
) 
    bindKey("F3","down",function() 
    if ( guiGetVisible( GUIEditor.window[1] ) == true ) then 
    guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
    elseif ( guiGetVisible(GUIEditor.window[1]) == false ) then 
    guiSetVisible(GUIEditor.window[1],true) 
    showCursor(true) 
    end 
    end 
    ) 
  

Link to comment

[quote name=™!>VàLéNTiNô

        guiWindowSetSizable(GUIEditor.window[1], false) 
         guiSetPositionAllScreen(GUIEditor.window[1],1280,720) 

تقفل تحجيم الشاشة بعدها تحججمها على كل الشاشات !!! هذا الخطا الموجود

جرب

    function guiSetPositionAllScreen(guiElement,ScreenH,ScreenW) 
        local LocalScreenH,LocalScreenW = guiGetScreenSize() 
        if ( isElement(guiElement) ) then 
            if ( ScreenH and ScreenW ) then 
                local x,y = guiGetPosition(guiElement,false) 
                guiSetPosition(guiElement,LocalScreenH*(x/ScreenH),LocalScreenW*(y/ScreenW),false) 
            end 
        end 
    end 
  
        GUIEditor.window[1] = guiCreateWindow(308, 72, 634, 613, "TEST", false) 
         guiSetPositionAllScreen(GUIEditor.window[1],1280,720) 
        GUIEditor.button[1] = guiCreateButton(218, 183, 165, 118, "Button Test", false, GUIEditor.window[1])   
         guiSetPositionAllScreen(GUIEditor.button[1],1280,720) 
    end 
) 
    bindKey("F3","down",function() 
    if ( guiGetVisible( GUIEditor.window[1] ) == true ) then 
    guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
    elseif ( guiGetVisible(GUIEditor.window[1]) == false ) then 
    guiSetVisible(GUIEditor.window[1],true) 
    showCursor(true) 
    end 
    end 
    ) 
  

طيب ي ليت تجربه عندك . لاهنت

لان انلحس . مخي ماعاد اعرف هو زبط ولالا :mrgreen:

حط مقاس اللعبه 600 × 800

وبعدين 720 × 1280

Link to comment
[quote name=™!>VàLéNTiNô
        guiWindowSetSizable(GUIEditor.window[1], false) 
         guiSetPositionAllScreen(GUIEditor.window[1],1280,720) 

تقفل تحجيم الشاشة بعدها تحججمها على كل الشاشات !!! هذا الخطا الموجود

جرب

    function guiSetPositionAllScreen(guiElement,ScreenH,ScreenW) 
        local LocalScreenH,LocalScreenW = guiGetScreenSize() 
        if ( isElement(guiElement) ) then 
            if ( ScreenH and ScreenW ) then 
                local x,y = guiGetPosition(guiElement,false) 
                guiSetPosition(guiElement,LocalScreenH*(x/ScreenH),LocalScreenW*(y/ScreenW),false) 
            end 
        end 
    end 
  
        GUIEditor.window[1] = guiCreateWindow(308, 72, 634, 613, "TEST", false) 
         guiSetPositionAllScreen(GUIEditor.window[1],1280,720) 
        GUIEditor.button[1] = guiCreateButton(218, 183, 165, 118, "Button Test", false, GUIEditor.window[1])   
         guiSetPositionAllScreen(GUIEditor.button[1],1280,720) 
    end 
) 
    bindKey("F3","down",function() 
    if ( guiGetVisible( GUIEditor.window[1] ) == true ) then 
    guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
    elseif ( guiGetVisible(GUIEditor.window[1]) == false ) then 
    guiSetVisible(GUIEditor.window[1],true) 
    showCursor(true) 
    end 
    end 
    ) 
  

طيب ي ليت تجربه عندك . لاهنت

لان انلحس . مخي ماعاد اعرف هو زبط ولالا :mrgreen:

حط مقاس اللعبه 600 × 800

وبعدين 720 × 1280

انسى كل الهرايس اللى فوق اكوادك كلها غلط اصلا ... كود فتح النافذة خطا + انت متاكد من قياسات النافذة هذه انا سويت نافذة جديدة وظبطت وكل شى !!

Link to comment

[quote name=™!>VàLéNTiNô

[quote name=™!>VàLéNTiNô
        guiWindowSetSizable(GUIEditor.window[1], false) 
         guiSetPositionAllScreen(GUIEditor.window[1],1280,720) 

تقفل تحجيم الشاشة بعدها تحججمها على كل الشاشات !!! هذا الخطا الموجود

جرب

    function guiSetPositionAllScreen(guiElement,ScreenH,ScreenW) 
        local LocalScreenH,LocalScreenW = guiGetScreenSize() 
        if ( isElement(guiElement) ) then 
            if ( ScreenH and ScreenW ) then 
                local x,y = guiGetPosition(guiElement,false) 
                guiSetPosition(guiElement,LocalScreenH*(x/ScreenH),LocalScreenW*(y/ScreenW),false) 
            end 
        end 
    end 
  
        GUIEditor.window[1] = guiCreateWindow(308, 72, 634, 613, "TEST", false) 
         guiSetPositionAllScreen(GUIEditor.window[1],1280,720) 
        GUIEditor.button[1] = guiCreateButton(218, 183, 165, 118, "Button Test", false, GUIEditor.window[1])   
         guiSetPositionAllScreen(GUIEditor.button[1],1280,720) 
    end 
) 
    bindKey("F3","down",function() 
    if ( guiGetVisible( GUIEditor.window[1] ) == true ) then 
    guiSetVisible(GUIEditor.window[1],false) 
    showCursor(false) 
    elseif ( guiGetVisible(GUIEditor.window[1]) == false ) then 
    guiSetVisible(GUIEditor.window[1],true) 
    showCursor(true) 
    end 
    end 
    ) 
  

طيب ي ليت تجربه عندك . لاهنت

لان انلحس . مخي ماعاد اعرف هو زبط ولالا :mrgreen:

حط مقاس اللعبه 600 × 800

وبعدين 720 × 1280

انسى كل الهرايس اللى فوق اكوادك كلها غلط اصلا ... كود فتح النافذة خطا + انت متاكد من قياسات النافذة هذه انا سويت نافذة جديدة وظبطت وكل شى !!

طيب ورني الكود اللي سويته بجربه

Link to comment
function guiSetPositionAllScreen(guiElement,ScreenH,ScreenW) 
        local LocalScreenH,LocalScreenW = guiGetScreenSize() 
        if ( isElement(guiElement) ) then 
            if ( ScreenH and ScreenW ) then 
                local x,y = guiGetPosition(guiElement,false) 
                guiSetPosition(guiElement,LocalScreenH*(x/ScreenH),LocalScreenW*(y/ScreenW),false) 
            end 
        end 
    end 
  
    wnd = guiCreateWindow(163,196,779,458,"",false) 
    guiSetPositionAllScreen(wnd,1024,768) 
            guiSetVisible (wnd, false)   
          
  
function OpenWin() 
    if guiGetVisible (  
  
wnd ) then 
       guiSetVisible (  
  
wnd, false ) 
       showCursor(false) 
       guiSetInputEnabled(false) 
    else 
        guiSetVisible (  
  
wnd, true ) 
        showCursor(true) 
        guiSetInputEnabled(true) 
  
    end 
end 
bindKey("F4", "down", OpenWin) 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...