<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=WolfPire</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=WolfPire"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/WolfPire"/>
	<updated>2026-05-24T16:36:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiGetAlpha&amp;diff=35060</id>
		<title>GuiGetAlpha</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiGetAlpha&amp;diff=35060"/>
		<updated>2013-03-02T16:47:49Z</updated>

		<summary type="html">&lt;p&gt;WolfPire: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
Alpha represents the transparency of a gui element.  This function allows retrieval of a gui element's current alpha.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float guiGetAlpha ( element guiElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''guiElement:''' The gui element in which you want to retrieve the alpha of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns a positive integer in between 0 and 1 of the gui element's current alpha, or false if it could not be retrieved.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example provides a ''guiFade'' function, which allows you to fade in/out a GUI.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function guiFade( gui, state )&lt;br /&gt;
	if state == &amp;quot;in&amp;quot; then -- This state will fade IN the GUI&lt;br /&gt;
	fadeIn = setTimer(guiFade, 50, 1, gui, state) -- We loop the function to make it lower the alpha each 50 ms&lt;br /&gt;
	alpha = guiGetAlpha(gui) -- We get the GUI's actual alpha after each loop&lt;br /&gt;
	guiSetAlpha(gui, alpha - 0.1) -- We set the GUI's actual alpha after each loop&lt;br /&gt;
	if alpha == 0 then -- If the loop reached &amp;quot;0&amp;quot;...&lt;br /&gt;
		guiSetVisible(gui, false) -- We set the GUI visibility to 0 so it won't be clickable or editable&lt;br /&gt;
		killTimer(fadeIn) -- ... We kill the timer&lt;br /&gt;
		fadeIn = nil -- And to make sure it doesn't exist anymore, we set it to nil&lt;br /&gt;
		end&lt;br /&gt;
	elseif state == &amp;quot;out&amp;quot; then -- This state will fade OUT the GUI&lt;br /&gt;
		guiSetVisible(gui, true) -- Since the GUI will still be click-able, we'll set it's visibility to &amp;quot;false&amp;quot;&lt;br /&gt;
		fadeOut = setTimer(guiFade, 50, 1, gui, state) -- We loop the function to make it higher the alpha each 50 ms&lt;br /&gt;
		alpha = guiGetAlpha(gui) -- We get the GUI's actual alpha after each loop&lt;br /&gt;
		guiSetAlpha(gui, alpha + 0.1) -- We set the GUI's actual alpha after each loop&lt;br /&gt;
		if alpha == 1 then -- If the loop reached &amp;quot;1&amp;quot;...&lt;br /&gt;
			killTimer(fadeOut) -- ... We kill the timer&lt;br /&gt;
			fadeOut = nil -- And to make sure it doesn't exist anymore, we set it to nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- NOTE: If you're using a button to pop up the GUI-Element. Use &amp;quot;guiSetEnabled&amp;quot; along with the button. You'll have also to set a timer in order to disable it by the time it fades, either way it will bug.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;/div&gt;</summary>
		<author><name>WolfPire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiGetAlpha&amp;diff=34335</id>
		<title>GuiGetAlpha</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiGetAlpha&amp;diff=34335"/>
		<updated>2012-12-26T13:38:47Z</updated>

		<summary type="html">&lt;p&gt;WolfPire: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
Alpha represents the transparency of a gui element.  This function allows retrieval of a gui element's current alpha.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float guiGetAlpha ( element guiElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''guiElement:''' The gui element in which you want to retrieve the alpha of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
This function returns a positive integer in between 0 and 1 of the gui element's current alpha, or false if it could not be retrieved.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example provides a ''guiFade'' function, which allows you to fade in/out a GUI.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function guiFade( gui, state )&lt;br /&gt;
	if state == &amp;quot;in&amp;quot; then -- This state will fade IN the GUI&lt;br /&gt;
	fadeIn = setTimer(guiFade, 50, 1, gui, state) -- We loop the function to make it lower the alpha each 50 ms&lt;br /&gt;
	alpha = guiGetAlpha(gui) -- We get the GUI's actual alpha after each loop&lt;br /&gt;
	guiSetAlpha(gui, alpha - 0.1) -- We set the GUI's actual alpha after each loop&lt;br /&gt;
	if alpha == 0 then -- If the loop reached &amp;quot;0&amp;quot;...&lt;br /&gt;
		killTimer(fadeIn) -- ... We kill the timer&lt;br /&gt;
		fadeIn = nil -- And to make sure it doesn't exist anymore, we set it to nil&lt;br /&gt;
		end&lt;br /&gt;
	elseif state == &amp;quot;out&amp;quot; then -- This state will fade OUT the GUI&lt;br /&gt;
		fadeOut = setTimer(guiFade, 50, 1, gui, state) -- We loop the function to make it higher the alpha each 50 ms&lt;br /&gt;
		alpha = guiGetAlpha(gui) -- We get the GUI's actual alpha after each loop&lt;br /&gt;
		guiSetAlpha(gui, alpha + 0.1) -- We set the GUI's actual alpha after each loop&lt;br /&gt;
		if alpha == 1 then -- If the loop reached &amp;quot;1&amp;quot;...&lt;br /&gt;
			killTimer(fadeOut) -- ... We kill the timer&lt;br /&gt;
			fadeOut = nil -- And to make sure it doesn't exist anymore, we set it to nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;/div&gt;</summary>
		<author><name>WolfPire</name></author>
	</entry>
</feed>