-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.SetMaterialTexture
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) NOTE: Previous texture should be manually unloaded
| Parameter | Default Value | Note |
|---|---|---|
| material | ||
| mapType | ||
| texture |
None.
mat = raylib.LoadMaterialDefault
tex = raylib.LoadTexture("diffuse.png")
raylib.SetMaterialTexture mat, raylib.MATERIAL_MAP_DIFFUSE, tex
// mat now uses tex as its diffuse texture
raylib.UnloadMaterial mat
raylib.UnloadTexture tex