# IMaterial

- **İngilizce aslı:** https://wiki.facepunch.com/gmod/IMaterial
- **Çeviri tarihi:** 2025-09-08

Bir materyal nesnesidir. Bir oyun materyalini, tıpkı bir `.vmt` dosyasının yaptığı gibi temsil eder; bu dosyalar aslında bir **IMaterial** nesnesine yüklenir.

Çoğu durumda oyun, dosya yolları söz konusu olduğunda materyallerle çalışır. Materyaller daha sonra kullandıkları farklı [ITexture](https://gmod.tr/wiki/ITexture)'lara (`.vtf` dosyaları) işaret eder.
Bunlar aynı şey değildir ve birbirlerinin yerine kullanılamazlar.

Bir materyal nesnesi, [Material](https://gmod.tr/wiki/Global.Material) veya [CreateMaterial](https://gmod.tr/wiki/Global.CreateMaterial) ile oluşturulabilir.

## Metotlar

[Color](https://gmod.tr/wiki/Color) IMaterial:[GetColor](https://gmod.tr/wiki/IMaterial:GetColor)( [number](https://gmod.tr/wiki/number) x, [number](https://gmod.tr/wiki/number) y )

$basetexture'ün belirtilen pikselinin rengini döndürür, yalnızca PNG dosyalarından oluşturulan materyaller için çalışır. Temelde IMaterial:GetTexture( "$basetexture" ) üzerinde kullanılan ITexture:GetColor ile aynıdır.

[number](https://gmod.tr/wiki/number) IMaterial:[GetFloat](https://gmod.tr/wiki/IMaterial:GetFloat)( [string](https://gmod.tr/wiki/string) materialFloat )

Belirtilen materyal değerini bir float olarak döndürür, eğer değer ayarlanmamışsa nil döndürür.

[number](https://gmod.tr/wiki/number) IMaterial:[GetInt](https://gmod.tr/wiki/IMaterial:GetInt)( [string](https://gmod.tr/wiki/string) materialInt )

Belirtilen materyal değerini bir int olarak döndürür, eğer değer bir float ise yuvarlar, eğer değer ayarlanmamışsa nil döndürür. Not: Lütfen $model gibi belirli materyal bayraklarının $flags değişkeninde saklandığını ve bu fonksiyonla doğrudan alınamadığını unutmayın. Tam listeyi burada görebilirsiniz: Material Flags

[table](https://gmod.tr/wiki/table) IMaterial:[GetKeyValues](https://gmod.tr/wiki/IMaterial:GetKeyValues)()

Materyal için tanımlanmış tüm anahtar değerlerini alır.

[VMatrix](https://gmod.tr/wiki/VMatrix) IMaterial:[GetMatrix](https://gmod.tr/wiki/IMaterial:GetMatrix)( [string](https://gmod.tr/wiki/string) materialMatrix )

Belirtilen materyal matrisini döndürür, eğer değer ayarlanmamışsa veya bir matris değilse nil döndürür.

[string](https://gmod.tr/wiki/string) IMaterial:[GetName](https://gmod.tr/wiki/IMaterial:GetName)()

Materyalin adını, çoğu durumda dosya yolunu döndürür.

[string](https://gmod.tr/wiki/string) IMaterial:[GetShader](https://gmod.tr/wiki/IMaterial:GetShader)()

Materyalin shader'ının adını döndürür. Bu fonksiyon Linux SRCDS'de sunucu tarafında çalışmaz. Hata Takipçisi: 3256

[string](https://gmod.tr/wiki/string) IMaterial:[GetString](https://gmod.tr/wiki/IMaterial:GetString)( [string](https://gmod.tr/wiki/string) materialString )

Belirtilen materyal string'ini döndürür, eğer değer ayarlanmamışsa veya bir string'e dönüştürülemiyorsa nil döndürür.

[ITexture](https://gmod.tr/wiki/ITexture) IMaterial:[GetTexture](https://gmod.tr/wiki/IMaterial:GetTexture)( [string](https://gmod.tr/wiki/string) param )

Girilen shader parametresine dayalı bir ITexture döndürür.

[Vector](https://gmod.tr/wiki/Vector) IMaterial:[GetVector](https://gmod.tr/wiki/IMaterial:GetVector)( [string](https://gmod.tr/wiki/string) materialVector )

Belirtilen materyal vektörünü döndürür, eğer değer ayarlanmamışsa nil döndürür. Ayrıca bakınız IMaterial:GetVectorLinear

[number](https://gmod.tr/wiki/number), [number](https://gmod.tr/wiki/number), [number](https://gmod.tr/wiki/number), [number](https://gmod.tr/wiki/number) IMaterial:[GetVector4D](https://gmod.tr/wiki/IMaterial:GetVector4D)( [string](https://gmod.tr/wiki/string) name )

Belirtilen materyal vektörünü 4 bileşenli bir vektör olarak döndürür.

[Vector](https://gmod.tr/wiki/Vector) IMaterial:[GetVectorLinear](https://gmod.tr/wiki/IMaterial:GetVectorLinear)( [string](https://gmod.tr/wiki/string) materialVector )

Belirtilen materyalin doğrusal renk vektörünü döndürür, eğer değer ayarlanmamışsa nil döndürür. Bkz. https://en.wikipedia.org/wiki/Gamma_correction Ayrıca bakınız IMaterial:GetVector

[number](https://gmod.tr/wiki/number) IMaterial:[Height](https://gmod.tr/wiki/IMaterial:Height)()

$basetexture için ayarlanan üye dokunun yüksekliğini döndürür.

[boolean](https://gmod.tr/wiki/boolean) IMaterial:[IsError](https://gmod.tr/wiki/IMaterial:IsError)()

Materyalin geçerli olup olmadığını, yani diskten başarılı bir şekilde yüklenip yüklenmediğini döndürür.

IMaterial:[Recompute](https://gmod.tr/wiki/IMaterial:Recompute)()

Materyalin anlık görüntüsünü yeniden hesaplar. Materyalinizdeki değişkenleri değiştirdiyseniz ve bir değişiklik görmüyorsanız bu fonksiyonun çağrılması gerekir. Yine de dikkatli olun - bu fonksiyon yavaştır - bu yüzden sadece gerektiğinde çağırmaya çalışın!

IMaterial:[SetDynamicImage](https://gmod.tr/wiki/IMaterial:SetDynamicImage)( [string](https://gmod.tr/wiki/string) path )

Materyali verilen resme dönüştürür. Dahili: Bu dahili olarak kullanılır - kullanabiliyor olsanız da muhtemelen kullanmamalısınız. Bu, arkaplan tarafından resmi değiştirmek için kullanılır.

IMaterial:[SetFloat](https://gmod.tr/wiki/IMaterial:SetFloat)( [string](https://gmod.tr/wiki/string) materialFloat, [number](https://gmod.tr/wiki/number) float )

Belirtilen materyal float'ını belirtilen float değerine ayarlar, tür uyuşmazlığında hiçbir şey yapmaz.

IMaterial:[SetInt](https://gmod.tr/wiki/IMaterial:SetInt)( [string](https://gmod.tr/wiki/string) materialInt, [number](https://gmod.tr/wiki/number) int )

Belirtilen materyal değerini belirtilen int değerine ayarlar, tür uyuşmazlığında hiçbir şey yapmaz. Not: Lütfen $model gibi belirli materyal bayraklarının $flags değişkeninde saklandığını ve bu fonksiyonla doğrudan ayarlanamadığını unutmayın. Tam listeyi burada görebilirsiniz: Material Flags

IMaterial:[SetMatrix](https://gmod.tr/wiki/IMaterial:SetMatrix)( [string](https://gmod.tr/wiki/string) materialMatrix, [VMatrix](https://gmod.tr/wiki/VMatrix) matrix )

Belirtilen materyal değerini belirtilen matrise ayarlar, tür uyuşmazlığında hiçbir şey yapmaz.

IMaterial:[SetShader](https://gmod.tr/wiki/IMaterial:SetShader)( [string](https://gmod.tr/wiki/string) shaderName )

Kullanımdan Kaldırıldı: Bunu kullanmamanızı tavsiye ederiz. Gelecekteki bir güncellemede değiştirilebilir veya kaldırılabilir. Bu fonksiyon hiçbir şey yapmaz. Bu fonksiyonun işlevselliği, neden olduğu çok sayıda çökme nedeniyle kaldırılmıştır.

IMaterial:[SetString](https://gmod.tr/wiki/IMaterial:SetString)( [string](https://gmod.tr/wiki/string) materialString, [string](https://gmod.tr/wiki/string) string )

Belirtilen materyal değerini belirtilen string'e ayarlar, tür uyuşmazlığında hiçbir şey yapmaz.

IMaterial:[SetTexture](https://gmod.tr/wiki/IMaterial:SetTexture)( [string](https://gmod.tr/wiki/string) materialTexture, [ITexture](https://gmod.tr/wiki/ITexture) texture )

Belirtilen materyal dokusunu belirtilen dokuya ayarlar, tür uyuşmazlığında hiçbir şey yapmaz.

IMaterial:[SetUndefined](https://gmod.tr/wiki/IMaterial:SetUndefined)( [string](https://gmod.tr/wiki/string) materialValueName )

Belirtilen materyal değeri için ayarlanmış değeri kaldırır.

IMaterial:[SetVector](https://gmod.tr/wiki/IMaterial:SetVector)( [string](https://gmod.tr/wiki/string) MaterialVector, [Vector](https://gmod.tr/wiki/Vector) vec )

Belirtilen materyal vektörünü belirtilen vektöre ayarlar, tür uyuşmazlığında hiçbir şey yapmaz.

IMaterial:[SetVector4D](https://gmod.tr/wiki/IMaterial:SetVector4D)( [string](https://gmod.tr/wiki/string) name, [number](https://gmod.tr/wiki/number) x, [number](https://gmod.tr/wiki/number) y, [number](https://gmod.tr/wiki/number) z, [number](https://gmod.tr/wiki/number) w )

Belirtilen materyal vektörünü belirtilen 4 bileşenli vektöre ayarlar, tür uyuşmazlığında hiçbir şey yapmaz.

[number](https://gmod.tr/wiki/number) IMaterial:[Width](https://gmod.tr/wiki/IMaterial:Width)()

$basetexture için ayarlanan üye dokunun genişliğini döndürür.

- [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/IMaterial
