CreateMaterial
Örnek
render.SetColorMaterial fonksiyonuna bir alternatif, esasen Entity:SetMaterial ile kullanım için.
CreateMaterial( "colortexshp", "VertexLitGeneric", {
["$basetexture"] = "color/white",
["$model"] = 1,
["$translucent"] = 1,
["$vertexalpha"] = 1,
["$vertexcolor"] = 1
} )
Örnek
Materyal proxy'lerinin kullanımına dair bir örnek. Unutmayın, her proxy türünden yalnızca 1 tane örneğe sahip olabilirsiniz! Bu, Lua tablolarının çalışma şeklinden kaynaklanan bir kısıtlamadır.
local mat = CreateMaterial( "combine_ball_animated", "UnlitGeneric", {
["$basetexture"] = "effects/comball/comball",
["Proxies"] = {
["AnimatedOffsetTexture"] = {
["animatedtexturevar"] = "$basetexture",
["animatedtextureframenumvar"] = "$frame",
["animatedtextureframerate"] = 30
}
}
} )
hook.Add( "HUDPaint", "HUDPaint_DrawATexturedBox", function()
surface.SetMaterial( mat )
surface.SetDrawColor( 255, 255, 255, 255 )
surface.DrawTexturedRect( 50, 50, 128, 128 )
end )
Tüm sunucular · GmodTR Launcher · Rehber · GMod Wiki · GmodTR nedir? · Sunucu ekle · Discord