

function SetEffectObject(let effectfile,let layer)
{
	let obj=Obj_Create(OBJ_EFFECT);
	ObjEffect_SetTexture(obj,effectfile);
	ObjEffect_SetLayer(obj,layer);
	ObjEffect_SetPrimitiveType(obj,PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj,4);
	return obj;
}

function SetEffectObjectRect(let obj,let left,let up,let right,let down)
{
	let texture_rect=[left,up,right,down];
	let leng_h=texture_rect[2]-texture_rect[0];
	let leng_v=texture_rect[3]-texture_rect[1];
	
	ObjEffect_SetVertexXY(obj,0,-leng_h/2,-leng_v/2);
	ObjEffect_SetVertexXY(obj,1,-leng_h/2, leng_v/2);
	ObjEffect_SetVertexXY(obj,2, leng_h/2,-leng_v/2);
	ObjEffect_SetVertexXY(obj,3, leng_h/2, leng_v/2);
	
	ObjEffect_SetVertexUV(obj,0,texture_rect[0],texture_rect[1]);
	ObjEffect_SetVertexUV(obj,1,texture_rect[0],texture_rect[3]);
	ObjEffect_SetVertexUV(obj,2,texture_rect[2],texture_rect[1]);
	ObjEffect_SetVertexUV(obj,3,texture_rect[2],texture_rect[3]);
}