# surface.DrawTexturedRect

- **Ortam:** İstemci, Menü
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/surface.DrawTexturedRect
- **Çeviri tarihi:** 2025-09-08

```lua
surface.DrawTexturedRect( number x, number y, number width, number height )
```

## Açıklama

[surface.SetMaterial](https://gmod.tr/wiki/surface.SetMaterial) ile ayarlanmış mevcut aktif dokuyu (texture) kullanarak, ekranda verilen konum ve boyutlarda dokulu bir dikdörtgen çizer. Ayrıca [surface.SetDrawColor](https://gmod.tr/wiki/surface.SetDrawColor)'dan da etkilenir.

Ayrıca bakınız: [render.SetMaterial](https://gmod.tr/wiki/render.SetMaterial) ve [render.DrawScreenQuadEx](https://gmod.tr/wiki/render.DrawScreenQuadEx).
Ayrıca bakınız: [surface.DrawTexturedRectUV](https://gmod.tr/wiki/surface.DrawTexturedRectUV) ve [surface.DrawTexturedRectRotated](https://gmod.tr/wiki/surface.DrawTexturedRectRotated).

> **NOT:** Bu, 2 boyutlu (2D) bir render bağlamı gerektiren bir render fonksiyonudur.
>
> Bu, yalnızca [2D Render Hook'ları](https://gmod.tr/wiki/2D_Rendering_Hooks) içinde çalışacağı anlamına gelir.

## Argümanlar

1. [number](https://gmod.tr/wiki/number) **x**: X tam sayı koordinatı.
2. [number](https://gmod.tr/wiki/number) **y**: Y tam sayı koordinatı.
3. [number](https://gmod.tr/wiki/number) **width**: Dikdörtgenin tam sayı cinsinden genişliği.
4. [number](https://gmod.tr/wiki/number) **height**: Dikdörtgenin tam sayı cinsinden yüksekliği.

### Örnek

Tel kafes (wireframe) dokusunu kullanarak 512x512 boyutlarında dokulu bir dikdörtgen çizer.

```lua
-- Material() fonksiyonunu her karede çağırmak oldukça masraflıdır
-- Bu yüzden onu bir kez, herhangi bir hook'un dışında çağırır ve sonucu yerel bir değişkende önbelleğe alırız
local ourMat = Material( "models/wireframe" )

hook.Add( "HUDPaint", "PutAUniqueHookNameHere", function()
	surface.SetDrawColor( 255, 255, 255, 255 ) -- Çizim rengini ayarla
	surface.SetMaterial( ourMat ) -- Önbelleğe alınmış materyalimizi kullan
	surface.DrawTexturedRect( 0, 0, 512, 512 ) -- Dikdörtgeni fiilen çiz
end )
```

- [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/surface.DrawTexturedRect
