HU/getBlipColor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Server client function}} __NOTOC__ This function will tell you what color a blip is. This color is only applicable to the default blip icon (12px, I...")
 
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Server client function}}
{{Shared function hu}}
__NOTOC__
__NOTOC__
This function will tell you what color a blip is. This color is only applicable to the default blip icon ([[Image:Blipid0s.png|12px]], [[Image:Blipid0u.png|12px]] or [[Image:Blipid0d.png|12px]]). All other icons will ignore this.
Ez a funkció megmondja, hogy milyen színű a blip. Ez a szín csak az alapértelmezett blip ikonra érvényes ([[Image:Blipid0s.png|12px]], [[Image:Blipid0u.png|12px]] vagy [[Image:Blipid0d.png|12px]]). Az összes többi ikont figyelmen kívül fogja hagyni.


==Syntax==  
==Szintaxis==  
<syntaxhighlight lang="lua">int int int int getBlipColor ( blip theBlip )</syntaxhighlight>
<syntaxhighlight lang="lua">int int int int getBlipColor ( blip theBlip )</syntaxhighlight>
{{OOP||[[blip]]:getColor||setBlipColor}}
{{OOP||[[blip]]:getColor||setBlipColor}}


===Required Arguments===  
===Kötelező argumentumok===  
*'''theBlip:''' The blip whose color you wish to get.
*'''theBlip:''' a blip, aminek a színét meg akarja kapni.


===Returns===
===Visszaadott érték===
Returns four integers in RGBA format, with a maximum value of 255 for each. The values are, in order, ''red'', ''green'', ''blue'', and ''alpha''.  Alpha decides the transparancy where 255 is opaque and 0 is fully transparent. ''false'' is returned if the blip is invalid.
Visszaad négy egész számot RGBA formátumban, a 255 maximális értékével. A ''red'', ''green'', ''blue'', és ''alpha'' sorrend szerint érvényesekAz alpha dönti el az átlátszóságot, ahol a 255 az átláthatatlan és a 0 pedig teljesen átlátszó. ''false'' értéket ad vissza, ha a blip érvénytelen.


==Example==  
==Példa==  
This example will find all the blips that exist and set them all to white if they aren't white already.
Ez a példa megtalálja az összes létező blip-et, és mindet fehérre állítja, ha nem fehér volt alapból.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
-- Retrieve a table containing all the blips that exist
-- Retrieve a table containing all the blips that exist
Line 30: Line 30:
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==Lásd még==
{{Blip_functions}}
{{Blip_functions_hu}}


[[en:getBlipColor]]
[[en:getBlipColor]]
==Fordította==
* '''''[https://wiki.multitheftauto.com/wiki/User:Surge Surge]'''''

Latest revision as of 13:01, 21 August 2018

Ez a funkció megmondja, hogy milyen színű a blip. Ez a szín csak az alapértelmezett blip ikonra érvényes (Blipid0s.png, Blipid0u.png vagy Blipid0d.png). Az összes többi ikont figyelmen kívül fogja hagyni.

Szintaxis

int int int int getBlipColor ( blip theBlip )

OOP Syntax Help! I don't understand this!

Method: blip:getColor(...)
Counterpart: setBlipColor


Kötelező argumentumok

  • theBlip: a blip, aminek a színét meg akarja kapni.

Visszaadott érték

Visszaad négy egész számot RGBA formátumban, a 255 maximális értékével. A red, green, blue, és alpha sorrend szerint érvényesek. Az alpha dönti el az átlátszóságot, ahol a 255 az átláthatatlan és a 0 pedig teljesen átlátszó. false értéket ad vissza, ha a blip érvénytelen.

Példa

Ez a példa megtalálja az összes létező blip-et, és mindet fehérre állítja, ha nem fehér volt alapból.

-- Retrieve a table containing all the blips that exist
blips = getElementsByType ( "blip" )
-- Loop through the list, storing the blip from the table in the variable blipValue
for blipKey, blipValue in ipairs(blips) do
	-- Retrieve the blip's colors into the variables red, green, blue and alpha
	red, green, blue, alpha = getBlipColor ( blipValue )
	-- If the blip's icon isn't white already
	if ( red ~= 255 or green ~= 255 or blue ~= 255 or alpha ~= 255 ) then
		-- Set the blip's color to white
		setBlipColor ( blipValue, 255, 255, 255, 255 )
	end
end

Lásd még

Fordította