<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/GUI_Classes/Button:ColorOnHover?action=history&amp;feed=atom</id>
	<title>GUI Classes/Button:ColorOnHover - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/GUI_Classes/Button:ColorOnHover?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GUI_Classes/Button:ColorOnHover&amp;action=history"/>
	<updated>2026-05-23T04:02:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GUI_Classes/Button:ColorOnHover&amp;diff=44506&amp;oldid=prev</id>
		<title>Ccw: /* Example */</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GUI_Classes/Button:ColorOnHover&amp;diff=44506&amp;oldid=prev"/>
		<updated>2015-02-11T16:35:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Example&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:35, 11 February 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l27&quot;&gt;Line 27:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 27:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Color of the label on button will change.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Color of the label on button will change.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;getThisResource( ) &lt;/del&gt;),&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(),&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     function( )&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     function( )&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         --create a button object&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         --create a button object&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki_dev_:diff::1.12:old-18485:rev-44506 --&gt;
&lt;/table&gt;</summary>
		<author><name>Ccw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GUI_Classes/Button:ColorOnHover&amp;diff=18485&amp;oldid=prev</id>
		<title>50p: New page: &lt;pageclass class=&quot;client&quot; subcaption=&quot;GUI Class method&quot;&gt;&lt;/pageclass&gt; __NOTOC__   This method allows you to set/get a color of label on the button when you hover over it.  ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt;...</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GUI_Classes/Button:ColorOnHover&amp;diff=18485&amp;oldid=prev"/>
		<updated>2009-03-01T02:43:53Z</updated>

		<summary type="html">&lt;p&gt;New page: &amp;lt;pageclass class=&amp;quot;client&amp;quot; subcaption=&amp;quot;GUI Class method&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt; __NOTOC__   This method allows you to set/get a color of label on the button when you hover over it.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pageclass class=&amp;quot;client&amp;quot; subcaption=&amp;quot;GUI Class method&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
&lt;br /&gt;
This method allows you to set/get a color of label on the button when you hover over it.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool Button:ColorOnHover ( string hex )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string Button:ColorOnHover ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''hex:''' hexadecimal string of the new color (format is &amp;quot;RRGGBBAA&amp;quot;, red, green, blue, alpha)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*'''true''' if color was changed successfully (used &amp;quot;set&amp;quot;) &lt;br /&gt;
*'''string''' of color (used &amp;quot;get&amp;quot;)&lt;br /&gt;
*'''false''' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates an edit box alongside an &amp;quot;Output!&amp;quot; button.  When the button is clicked, it will output the message in the text box into the Chat Box.&lt;br /&gt;
&lt;br /&gt;
Color of the label on button will change.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement( getThisResource( ) ),&lt;br /&gt;
    function( )&lt;br /&gt;
        --create a button object&lt;br /&gt;
        local button = Button:Create( 0.7, 0.1, 0.2, 0.1, &amp;quot;Output!&amp;quot;, true );&lt;br /&gt;
        -- change the color when cursor is moved on top of the button&lt;br /&gt;
        button:ColorOnHover( &amp;quot;FF0000FF&amp;quot; );&lt;br /&gt;
        --Create a TextBox (formally edit box)&lt;br /&gt;
        textBox = TextBox:Create( 0.3, 0.1, 0.4, 0.1, &amp;quot;Type your message here!&amp;quot;, true )&lt;br /&gt;
        textBox:MaxLength( 128 ) --the max chatbox length is 128, so force this&lt;br /&gt;
&lt;br /&gt;
        -- and attach the outputTextBox function to the button&lt;br /&gt;
        button:AddOnClick( outputTextBox );&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
--setup our function to output the message to the chatbox&lt;br /&gt;
function outputTextBox( )&lt;br /&gt;
        local text = textBox:Text( ) --get the text from the TextBox&lt;br /&gt;
        outputChatBox ( text ) --output that text&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[[GUI_Classes|Back to GUI Classes page]]&lt;br /&gt;
{{GUI_Classes_allfunctions}}&lt;/div&gt;</summary>
		<author><name>50p</name></author>
	</entry>
</feed>