Jump to content

problem guiCreateLabel


WASSIm.

Recommended Posts

hi all

i have problem guiSetVisible not working with guiCreatetextLabel

    function guiCreatetextLabel(text, x, y, w, h, r, g, b, font, relative) 
    local Label1 = guiCreateLabel ( x, y, w, h, text, relative ) 
                    guiLabelSetColor ( Label1, r, g, b ) 
                    guiSetFont ( Label1, font ) 
    end 
  
                    local map =       guiCreatetextLabel("Map",x*0.2, y*0.1, x*0.1, y*0.1, 140, 140, 140,"sans",false) 
                    local brief =       guiCreatetextLabel("Brief",x*0.3, y*0.1, x*0.1, y*0.1, 140, 140, 140,"sans",false) 
                    local stats =      guiCreatetextLabel("Stats",x*0.4, y*0.1, x*0.1, y*0.1, 140, 140, 140,"sans",false) 
                    local controls = guiCreatetextLabel("Controls",x*0.5, y*0.1, x*0.1, y*0.1, 140, 140, 140,"sans",false) 
                    local audio =      guiCreatetextLabel("Audio",x*0.6, y*0.1, x*0.1, y*0.1, 140, 140, 140,"sans",false) 
                    local display =   guiCreatetextLabel("Display",x*0.7, y*0.1, x*0.1, y*0.1, 140, 140, 140,"sans",false) 
                    local graphics = guiCreatetextLabel("Graphics",x*0.8, y*0.1, x*0.1, y*0.1, 140, 140, 140,"sans",false) 
                    local game =      guiCreatetextLabel("Game",x*0.9, y*0.1, x*0.1, y*0.1, 140, 140, 140,"sans",false) 

Link to comment
Mind explaining a little more? such as, what is the problem? do you get any error?

if make exp this

  function guiCreatetextLabel(text, x, y, w, h, r, g, b, font, relative) 
    local Label1 = guiCreateLabel ( x, y, w, h, text, relative ) 
                    guiLabelSetColor ( Label1, r, g, b ) 
                    guiSetFont ( Label1, font ) 
    end 
  
local map =       guiCreatetextLabel("Map",x*0.2, y*0.1, x*0.1, y*0.1, 140, 140, 140,"sans",false) 
guiSetVisible (map,false) 

not working and put debugsc...

bad Arguments "guiSetVisible"

Link to comment

That's because you forgot to return the element.

function guiCreatetextLabel ( text, x, y, w, h, r, g, b, font, relative ) 
    local Label1 = guiCreateLabel ( x, y, w, h, text, relative ) 
    guiLabelSetColor ( Label1, r, g, b ) 
    guiSetFont ( Label1, font ) 
  
    return Label1 
end 

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