SetBlipColor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Undo revision 46555 by Strong100 (talk))
(Undo revision 46556 by Strong100 (talk))
Line 14: Line 14:


===Returns===
===Returns===
Returns : "true" اذا تم بنجاح "false" اذا لم يتم بنجاح
Returns ''true'' if the blip's color was set successfully. Returns ''false'' if the blip passed to the function is invalid, or any of the colors are out of the valid range.


==مثال==  
==مثال==  

Revision as of 03:06, 10 February 2016

This function will let you change the color of a blip. This color is only applicable to the default blip icon (Blipid0s.png, Blipid0u.png or Blipid0d.png). All other icons will ignore this.

Syntax

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


Required Arguments

  • theBlip: The blip who's color you wish to set.
  • red: The amount of red in the blip's color (0 - 255).
  • green: The amount of green in the blip's color (0 - 255).
  • blue: The amount of blue in the blip's color (0 - 255).
  • alpha: The amount of alpha in the blip's color (0 - 255). Alpha decides transparancy where 255 is opaque and 0 is transparent.

Returns

Returns true if the blip's color was set successfully. Returns false if the blip passed to the function is invalid, or any of the colors are out of the valid range.

مثال

هذا المثال يجلب جميع العلامات الموجودة , ويقوم بتلوينها الى اللون الإبيض اذا لم تكن بيضاء بالفعل .

local blips = getElementsByType ( "blip" )
for blipKey, blipValue in ipairs ( blips ) do
	local red, green, blue, alpha = getBlipColor ( blipValue )
	if ( red ~= 255 or green ~= 255 or blue ~= 255 or alpha ~= 255 ) then
		setBlipColor ( blipValue, 255, 255, 255, 255 )
	end
end

See Also