# DModelPanel:SetDirectionalLight

- **Ortam:** İstemci
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/DModelPanel:SetDirectionalLight
- **Çeviri tarihi:** 2026-05-13

```lua
DModelPanel:SetDirectionalLight( number direction, Color color )
```

## Açıklama

Görüntülenen varlık üzerinde kullanılan yönsel aydınlatmayı belirler.

## Argümanlar

1.. [numara](https://gmod.tr/wiki/number) **yönü**: Işık yönü, bak. [BOX listesi](https://gmod.tr/wiki/Enums/BOX).
2.. [Renk](https://gmod.tr/wiki/Color) **Renkli**: [Renk](https://gmod.tr/wiki/Color) Yönlendirme aydınlatması.

### Örnek

Dr. Kleiner sadece çevre ışığı ile aydınlatılır [DModelPanel:SetAmbientLight](https://gmod.tr/wiki/DModelPanel:SetAmbientLight).

```lua
-- Siyah arka plan paneli
BGPanel = vgui.Create("DPanel")
BGPanel:SetPos(20, 20)
BGPanel:SetSize(400, 400)
BGPanel:SetBackgroundColor(Color(0, 0, 0, 255))

local mdl = vgui.Create("DModelPanel", BGPanel)
mdl:SetSize(BGPanel:GetSize())

-- Kurulum modeli ve kamera
mdl:SetModel("models/kleiner.mdl")
mdl:SetCamPos(Vector(20, 20, 60))
mdl:SetLookAt(Vector(0, 0, 60))

- Kleiner'ın hızını artır.
mdl:GetEntity():SetSequence(mdl:GetEntity():LookupSequence("pace_all"))

-- Yönlendirme aydınlatmasını kapatın.
mdl:SetDirectionalLight(BOX_TOP, Color(0, 0, 0))
mdl:SetDirectionalLight(BOX_FRONT, Color(0, 0, 0))

- Daha hızlı dön ve animasyon oynat.
function mdl:LayoutEntity(ent)
	ent:SetAngles(Angle( 0, self.LastPaint*60,  0))
	self:RunAnimation()
end
```

**Çıkış:** ![](https://gmod.tr/api/uploads/wiki/d76a2e8c487d5f923623.jpg)

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/DModelPanel:SetDirectionalLight
