

task Cdraw//自機中心の陣のタスク
{
		let scax=1;
		let scay=1;
		let angle=0;
		let Malpha=0;
  		let obj = Obj_Create(OBJ_EFFECT);
		Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
		ObjEffect_SetTexture(obj, imgBorder);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		//ObjEffect_SetRenderState(obj, ADD);
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -32, -32);
		ObjEffect_SetVertexXY(obj, 1,  32, -32);
		ObjEffect_SetVertexXY(obj, 2,  32,  32);
		ObjEffect_SetVertexXY(obj, 3, -32,  32);
		
		ObjEffect_SetVertexUV(obj, 0,  64,  0);
		ObjEffect_SetVertexUV(obj, 1,  128, 0);
		ObjEffect_SetVertexUV(obj, 2, 128, 64);
		ObjEffect_SetVertexUV(obj, 3, 64, 64);

		ObjEffect_SetVertexColor(obj,0,Malpha,255,255,255);
		ObjEffect_SetVertexColor(obj,1,Malpha,255,255,255);
		ObjEffect_SetVertexColor(obj,2,Malpha,255,255,255);
		ObjEffect_SetVertexColor(obj,3,Malpha,255,255,255);

		ObjEffect_SetLayer(obj, 2);
		ObjEffect_SetAngle(obj, 0,0,angle);
		while(!Obj_BeDeleted(obj))
		{
			Obj_SetPosition(obj,GetPlayerX,GetPlayerY);
			ObjEffect_SetAngle(obj, 0,0,angle);
			angle+=1.5;
			if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH || GetKeyState(VK_SLOWMOVE)==KEY_HOLD)
			{
				if(Malpha<150)
				{
				Malpha+=10;
				}
			}
			else
			{
				if(Malpha>0)
				{
				Malpha-=10;
				}
			}
		ObjEffect_SetVertexColor(obj,0,Malpha,255,255,255);
		ObjEffect_SetVertexColor(obj,1,Malpha,255,255,255);
		ObjEffect_SetVertexColor(obj,2,Malpha,255,255,255);
		ObjEffect_SetVertexColor(obj,3,Malpha,255,255,255);
			yield;
		}

}