Hi guys,
im creating a function that allows you to create a pattern form a texture for a model.
Code:
void patterSkin(ENTITY* ent,STRING* textureName,var factor){
	BMAP* tmpBmp;
	BMAP* txtBmp=bmap_create(textureName);
	var txtSize=bmap_width(txtBmp);
	var posx,posy,Size=clamp(factor,1,64);
	tmpBmp=bmap_createblack((txtSize*Size),(txtSize*Size),32);
	for(posy=0;posy<Size;posy++){
		for(posx=0;posx<Size;posx++){
			bmap_blit(tmpBmp,txtBmp,vector(posx*txtSize,posy*txtSize,0),vector(txtSize,txtSize,0));
		}
	}
	ent_cloneskin(ent);
	ent_setskin(ent,tmpBmp,0);
	set(ent,NULL);
	return;
}
//thats the way you can use the function
you=ent_create("block.mdl",nullvector,NULL);
createPattern(you,"test.bmp",4);//createPattern(entity pointer,external texture,size factor)

You can only create constant pattern with this function.
I hope this is usefull and my english is not to bad (im terribly tired).
EDIT: Here is a little example of the function


Ralph

Last edited by Ralph; 10/01/08 07:34.