<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=Graphics%3A%3AdrawSpotLight</id>
	<title>Graphics::drawSpotLight - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=Graphics%3A%3AdrawSpotLight"/>
	<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Graphics::drawSpotLight&amp;action=history"/>
	<updated>2026-07-24T19:44:51Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://rage.grandroleplay.ru/index.php?title=Graphics::drawSpotLight&amp;diff=10248&amp;oldid=prev</id>
		<title>imported&gt;Mos: /* Example */</title>
		<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Graphics::drawSpotLight&amp;diff=10248&amp;oldid=prev"/>
		<updated>2019-08-28T20:00:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Example&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Parameters:&amp;lt;br&amp;gt;* pos - coordinate where the spotlight is located&amp;lt;br&amp;gt;* dir - the direction vector the spotlight should aim at from its current position&amp;lt;br&amp;gt;* r,g,b - color of the spotlight&amp;lt;br&amp;gt;* distance - the maximum distance the light can reach&amp;lt;br&amp;gt;* brightness - the brightness of the light&amp;lt;br&amp;gt;* roundness - &amp;#039;smoothness&amp;#039; of the circle edge&amp;lt;br&amp;gt;* radius - the radius size of the spotlight&amp;lt;br&amp;gt;* falloff - the falloff size of the light&amp;#039;s edge (example: www.i.imgur.com/DemAWeO.jpg)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Example in C# (spotlight aims at the closest vehicle):&amp;lt;br&amp;gt;Vector3 myPos = Game.Player.Character.Position;&amp;lt;br&amp;gt;Vehicle nearest = World.GetClosestVehicle(myPos , 1000f);&amp;lt;br&amp;gt;Vector3 destinationCoords = nearest.Position;&amp;lt;br&amp;gt;Vector3 dirVector = destinationCoords - myPos;&amp;lt;br&amp;gt;dirVector.Normalize();&amp;lt;br&amp;gt;Function.Call(Hash.DRAW_SPOT_LIGHT, pos.X, pos.Y, pos.Z, dirVector.X, dirVector.Y, dirVector.Z, 255, 255, 255, 100.0f, 1f, 0.0f, 13.0f, 1f);&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;mp.game.graphics.drawSpotLight(posX, posY, posZ, dirX, dirY, dirZ, colorR, colorG, colorB, distance, brightness, roundness, radius, falloff);&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Required Arguments ===&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;posX:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;posY:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;posZ:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;dirX:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;dirY:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;dirZ:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;colorR:&amp;#039;&amp;#039;&amp;#039; int&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;colorG:&amp;#039;&amp;#039;&amp;#039; int&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;colorB:&amp;#039;&amp;#039;&amp;#039; int&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;distance:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;brightness:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;roundness:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;radius:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;falloff:&amp;#039;&amp;#039;&amp;#039; float&lt;br /&gt;
===Return value===&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Undefined&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates an illumination on top of the player and reflecting on the ground as well, light is flashing blue &lt;br /&gt;
{{ClientsideCode|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
let lightRender&lt;br /&gt;
function switchLight() {&lt;br /&gt;
  if (!lightRender) {&lt;br /&gt;
    // light ON&lt;br /&gt;
    lightRender = new mp.Event(&amp;#039;render&amp;#039;, ()=&amp;gt; {&lt;br /&gt;
      let pos = mp.players.local.position&lt;br /&gt;
      mp.game.graphics.drawSpotLight(pos.x,pos.y,pos.z+10, 0,0,-1, 0,0,255, 20,20,5,10,1)&lt;br /&gt;
    })&lt;br /&gt;
  } else {&lt;br /&gt;
    // light OFF&lt;br /&gt;
    lightRender.destroy()&lt;br /&gt;
    lightRender = null&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
let lightInterval = setInterval(switchLight, 500)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Graphics_s_function_c}}&lt;br /&gt;
[[Category:Clientside API]]&lt;br /&gt;
[[Category:TODO: Example]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Mos</name></author>
	</entry>
</feed>