SetBlipColor: Difference between revisions

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


==مثال==  
==مثال==  
هذا المثال سوف يجد كل العلامات وتلوينهم باللون الأبيض , اذا لم تكن بيضاء بالفعل .  
هذا المثال يجلب جميع العلامات الموجودة , ويقوم بتلوينها الى اللون الإبيض اذا لم تكن بيضاء بالفعل .
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local blips = getElementsByType ( "blip" )
local blips = getElementsByType ( "blip" )

Revision as of 15:26, 7 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: العلامة المراد تلوينها .
  • red: (0 - 255) تلوين العلامة باللون الاحمر .
  • green: (0 - 255) تلوين العلامة باللون الاخضر .
  • blue: (0 - 255) تلوين العلامة باللون الازرق .
  • alpha: شفافية العلامة .

Returns

Returns : "true" اذا تم بنجاح "false" اذا لم يتم بنجاح

مثال

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

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