GetMarkerColor: Difference between revisions
Jump to navigation
Jump to search
JonChappell (talk | contribs) No edit summary |
Black Dragon (talk | contribs) No edit summary |
||
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. | |||
This function returns three | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">int int int getMarkerColor ( marker myMarker )</syntaxhighlight> | |||
This function also has three variants that allow you to retrieve data from just one of the three axes. | This function also has three variants that allow you to retrieve data from just one of the three axes. | ||
<syntaxhighlight lang="lua">int getMarkerColor|getMarkerColorRed ( marker myMarker )</syntaxhighlight> | |||
<syntaxhighlight lang="lua">int getMarkerColor|getMarkerColorGreen ( marker myMarker )</syntaxhighlight> | |||
<syntaxhighlight lang="lua">int getMarkerColor|getMarkerColorBlue ( marker myMarker )</syntaxhighlight> | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''marker''': The [[marker]] that you wish to retrieve the color of. | *'''marker''': The [[marker]] that you wish to retrieve the color of. | ||
===Returns=== | |||
Returns three [[int]]s corresponding to the amount of red, green and blue (respectively) in the marker's color. | |||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua">newMarker = createMarker ( 1, 1000, 1000, 1000, 1,0,0 ) | |||
r,g,b = | r,g,b = getMarkerColor ( newmarker ) | ||
if (r) then | if (r) then | ||
OutputChatBox ( ("Current marker color: ",r,",",g,",",b,"."), player ) | |||
end | end</syntaxhighlight> |
Revision as of 16:48, 18 May 2006
This function returns three ints 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.
Syntax
int int int getMarkerColor ( marker myMarker )
This function also has three variants that allow you to retrieve data from just one of the three axes.
int getMarkerColor|getMarkerColorRed ( marker myMarker )
int getMarkerColor|getMarkerColorGreen ( marker myMarker )
int getMarkerColor|getMarkerColorBlue ( marker myMarker )
Required Arguments
- marker: The marker that you wish to retrieve the color of.
Returns
Returns three ints corresponding to the amount of red, green and blue (respectively) in the marker's color.
Example
newMarker = createMarker ( 1, 1000, 1000, 1000, 1,0,0 ) r,g,b = getMarkerColor ( newmarker ) if (r) then OutputChatBox ( ("Current marker color: ",r,",",g,",",b,"."), player ) end