GetMarkerColor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Fixed syntax, added templates and sections, removed broken example)
Line 1: Line 1:
__NOTOC__
__NOTOC__
This function returns three [[int]]s corresponding to the amount of red, green and blue (respectively) in the marker's color. It can be useful for coloring objectives text to the same color as the marker.
{{Server client function}}
This function returns the color and transparency for a marker element.


==Syntax==
==Syntax==
<section name="Server and Client" class="both" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
int int int getMarkerColor ( marker myMarker )
int int int int getMarkerColor ( marker theMarker )
</syntaxhighlight>
</syntaxhighlight>


===Required Arguments===
===Required Arguments===
*'''myMarker''': The [[marker]] that you wish to retrieve the color of.
*'''theMarker''': The [[marker]] that you wish to retrieve the color of.


===Returns===
===Returns===
Returns three [[int]]s corresponding to the amount of red, green and blue (respectively) in the marker's color. If the function fails, it'll return ''false''. Check this by checking the ''red'' [[int]]'s value for ''false''.
Returns four [[int]]s corresponding to the amount of ''red'', ''green'', ''blue'' and ''alpha'' (respectively) of the marker, ''false'' if invalid arguments were passed.
</section>


==Example==
==Example==
This example does
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
-- Create a new marker
...
newMarker = createMarker ( 1, 1000, 1000, 1000, 1,0,0 )
-- Get the marker's color components into the three variables, red, green and blue.
red,green,blue = getMarkerColor ( newMarker )
if ( red ) then
outputChatBox ( ("Current marker color: " .. r .. "," .. g .. "," .. b .. ".") )
end
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Marker functions}}
{{Marker functions}}

Revision as of 22:29, 4 August 2007

This function returns the color and transparency for a marker element.

Syntax

Click to collapse [-]
Server and Client
int int int int getMarkerColor ( marker theMarker )

Required Arguments

  • theMarker: The marker that you wish to retrieve the color of.

Returns

Returns four ints corresponding to the amount of red, green, blue and alpha (respectively) of the marker, false if invalid arguments were passed.

Example

This example does

...

See Also