HU/setBlipColor

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

Ez a funkció lehetővé teszi, hogy megváltoztassa a blip színét. 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

bool setBlipColor ( blip theBlip, int red, int green, int blue, int alpha )

OOP Syntax Help! I don't understand this!

Method: blip:setColor(...)
Counterpart: getBlipColor


Kötelező argumentumok

  • theBlip: The blip who's color you wish to set.
  • red: A piros mennyisége a blip színében (0 - 255).
  • green: A zöld mennyisége a blip színében (0 - 255).
  • blue: A kék mennyisége a blip színében (0 - 255).
  • alpha: Az telítettség mennyisége a blip színében (0 - 255). Az alpha dönti el az átlátszóságot, ahol a 255 az átláthatatlan és a 0 pedig teljesen átlátszó.

Visszaadott érték

Visszaadja a blip színét, ha sikeresen be lett állítva. false értéket ad vissza, ha a függvény érvénytelen, vagy ha bármelyik szín kívül esik az érvényes tartományon.

Példa

This example will find all the blips that exist and set them all to white if they aren't white already.

-- Retrieve a table containing all the blips that exist
local 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
	local 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

  • Surge