Jump to content

gui shown


#Honda-R

Recommended Posts

Hello.

GUIEditor = { 
    label = {} 
} 
  
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
     
        GUIEditor.label[1] = guiCreateLabel(277, 221, 111, 15, "MY TEXT", false) 
        guiSetFont(GUIEditor.label[1], "default-bold-small") 
        guiLabelSetHorizontalAlign(GUIEditor.label[1], "left", true) 
        guiSetProperty(GUIEditor.label[1], "AlwaysOnTop", "True") 
  
        GUIEditor.label[2] = guiCreateLabel(277, 261, 111, 15, "MY TEXT", false) 
        guiSetFont(GUIEditor.label[2], "default-bold-small") 
        guiSetProperty(GUIEditor.label[2], "AlwaysOnTop", "True") 
         
    end 
) 
  

There is a problem. the labels shows when i dont need it.

When i join to server. The labels are shown.

How to hide it.

I need to hide it , bec im willing to use bind key.

Link to comment
addEventHandler( "onClientResourceStart", resourceRoot, 
    function ( ) 
        GUIEditor.label[1] = guiCreateLabel(277, 221, 111, 15, "MY TEXT", false) 
        guiSetFont(GUIEditor.label[1], "default-bold-small") 
        guiLabelSetHorizontalAlign(GUIEditor.label[1], "left", true) 
        guiSetProperty(GUIEditor.label[1], "AlwaysOnTop", "True") 
        guiSetVisible ( GUIEditor.label[1], false ) 
  
        GUIEditor.label[2] = guiCreateLabel(277, 261, 111, 15, "MY TEXT", false) 
        guiSetFont(GUIEditor.label[2], "default-bold-small") 
        guiSetProperty(GUIEditor.label[2], "AlwaysOnTop", "True") 
        guiSetVisible ( GUIEditor.label[2], false ) 
    end 
) 

Link to comment

Thanks!

Now i want to ask another qestion .

function onResourceStart () 
local Window = guiGetVisible (GUIEditor.button[1]) --We predefine a variable for Window 
  
 if (Window) == true then -- If window is shown 
guiSetVisible ( GUIEditor.button[1], false ) --We hide it 
showCursor ( false )  --We hide it's cursor 
else   --else we.. 
guiSetVisible ( GUIEditor.button[1], true ) --Show the window 
showCursor ( true ) --We show it's cursor 
end 
end 
bindKey ( "F7", "down", onResourceStart )  --And we bind it with 'f1' key 
  
  

You see GUIEditor.button[1

What add to script like if i want to make visible GUIEditor.button[2] GUIEditor.button[3]

and ect.

Link to comment

Well you see

function onResourceStart () 
local Window = guiGetVisible (GUIEditor.button[1]) --We predefine a variable for Window 
  
 if (Window) == true then -- If window is shown 
guiSetVisible ( GUIEditor.button[1], false ) --We hide it 
showCursor ( false )  --We hide it's cursor 
else   --else we.. 
guiSetVisible ( GUIEditor.button[1], true ) --Show the window 
showCursor ( true ) --We show it's cursor 
end 
end 
bindKey ( "F7", "down", onResourceStart )  --And we bind it with 'f1' key 
  

And i need to make visible other elements.

Like GUIEditor.button[2] GUIEditor.button[3] ect

Link to comment

Try this :

bindKey('F7','down', 
    function ( ) 
        for i = 1,3 do 
        guiSetVisible ( GUIEditor.button[i] , not guiGetVisible ( GUIEditor.button[i] ) ) 
        showCursor ( guiGetVisible ( GUIEditor.button[i] ) ) 
      end 
end 
) 

This only for 3 buttons 'elements' not tested but should work .

Link to comment
Try this :

bindKey('F7','down', 
    function ( ) 
        for i = 1,3 do 
        guiSetVisible ( GUIEditor.button[i] , not guiGetVisible ( GUIEditor.button[i] ) ) 
        showCursor ( guiGetVisible ( GUIEditor.button[i] ) ) 
      end 
end 
) 

This only for 3 buttons 'elements' not tested but should work .

Well my script has UIEditor.staticimage[3] Images and GUIEditor.label[9] labels

Link to comment

Try this not tested :

bindKey('F7','down', 
    function ( ) 
     for i = 1,9 do 
        guiSetVisible ( GUIEditor.label[i] , not guiGetVisible ( GUIEditor.label[i] ) ) 
        showCursor ( guiGetVisible ( GUIEditor.label[i] ) ) 
      end 
      for i = 1,3 do 
      guiSetVisible ( GUIEditor.button[i] , not guiGetVisible ( GUIEditor.button[i] ) ) 
      guiSetVisible ( GUIEditor.staticimage[i] , not guiGetVisible ( GUIEditor.staticimage[i] ) ) 
      showCursor ( guiGetVisible ( GUIEditor.button[i] ) ) 
      end 
end 
) 
Link to comment
Try this not tested :

bindKey('F7','down', 
    function ( ) 
     for i = 1,9 do 
        guiSetVisible ( GUIEditor.label[i] , not guiGetVisible ( GUIEditor.label[i] ) ) 
        showCursor ( guiGetVisible ( GUIEditor.label[i] ) ) 
      end 
      for i = 1,3 do 
      guiSetVisible ( GUIEditor.button[i] , not guiGetVisible ( GUIEditor.button[i] ) ) 
      guiSetVisible ( GUIEditor.staticimage[i] , not guiGetVisible ( GUIEditor.staticimage[i] ) ) 
      showCursor ( guiGetVisible ( GUIEditor.button[i] ) ) 
      end 
end 
) 

o ma gad!

Thanks very mutch!

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...