Jump to content

[HELP] Change text color when clicked


Recommended Posts

Hello, I am creating a gui, and I want to use text instead of buttons. I want to change the color of the text when its beeing clicked.

Here is the "button":

 GUIEditor.label[2] = guiCreateLabel(30, 45, 88, 22, "Stay", false, GUIEditor.staticimage[1]) 

Link to comment
addEventHandler('onClientGUIClick', getRootElement(), 
    function(button, state, absoluteX, absoluteY) 
        if(source == GUIEditor.label[2]) 
            if(button == 'left') then 
                if(state == 'down') then 
                    guiLabelSetColor(source, red, green, blue) -- set your color when mouse is pushed 
                elseif(state == 'up') then 
                    guiLabelSetColor(source, red, green, blue) -- set your color when mouse is released 
                end 
            end 
        end 
    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...