# surface.DrawTexturedRectRotated

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

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

## Açıklama

Mevcut aktif dokuyu kullanarak, ekranda verilen konum, boyutlar ve açı ile dokulu, döndürülmüş bir dikdörtgen çizer.

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

> **NOT:** Bu, 2 boyutlu bir çizim bağlamı gerektiren bir çizim fonksiyonudur.
>
> Bu, yalnızca [2 Boyutlu Çizim Kancaları (2d Rendering Hooks)](https://gmod.tr/wiki/2D_Rendering_Hooks) içinde çalışacağı anlamına gelir.

## Argümanlar

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

### Örnek

Dönüş başlangıç noktasını geçersiz kılmanıza olanak tanıyan bir fonksiyon.

x0 ve y0, dikdörtgenin merkezine görelidir.

```lua
function surface.DrawTexturedRectRotatedPoint( x, y, w, h, rot, x0, y0 )

	local c = math.cos( math.rad( rot ) )
	local s = math.sin( math.rad( rot ) )

	local newx = y0 * s - x0 * c
	local newy = y0 * c + x0 * s

	surface.DrawTexturedRectRotated( x + newx, y + newy, w, h, rot )

end
```

### Örnek

Sürekli dönen basit bir kırmızı kutu çizer.

```lua
function draw.RotatedBox( x, y, w, h, ang, color )
	draw.NoTexture()
	surface.SetDrawColor( color or color_white )
	surface.DrawTexturedRectRotated( x, y, w, h, ang )
end

hook.Add( "HUDPaint", "my_rotated_box", function()
	draw.RotatedBox( 100, 100, 100, 100, CurTime() % 360, Color( 255, 0, 0) )
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.DrawTexturedRectRotated
