Posted By: gamers
Changing Three textures for one model ? - 09/09/14 10:18
Hi, I want to change the model's external texture when pressing a key between 3 bitmaps ? Is there any way to do this? Please give me an example. Thanks...
var skin_num; //We need to increase the skin number function set_skinnum() { if(skin_num <= 3) { skin_num +=1; } } //Skin Bitmaps BMAP* FirstSKIN = <skin1.bmp>; BMAP* SecondSKIN = <skin2.bmp>; BMAP* ThirdSKIN = <skin3.bmp>; //Now,we will assign a skin to the model function set_entskin(ENTITY* ent) { while(skin_num == 1) { ent_setskin(ent,FirstSKIN,1); } while(skin_num == 2) { ent_setskin(ent,SecondSKIN,1); } while(skin_num == 3) { ent_setskin(ent,ThirdSKIN,1); } } //Assign set_entskin() to your entity //Now you need to call set_skinnum() in main() function function main() { ... on_e = set_skinnum; ... }