
task Bdraw//ボーナスポイント表示のタスク
{
while(GetCommonDataDefault("BONUSPOINT",0)==0)
{
yield;
}
bonuspoint=GetCommonDataDefault("BONUSPOINT",0);

loop{
if(bonuspoint>=1000000)
{
bonuspoint=999990;
}
let Bnum1=trunc(bonuspoint%10);
let Bnum2=trunc(bonuspoint%100/10);
let Bnum3=trunc(bonuspoint%1000/100);
let Bnum4=trunc(bonuspoint%10000/1000);
let Bnum5=trunc(bonuspoint%100000/10000);
let Bnum6=trunc(bonuspoint%1000000/100000);
		let bx0=GetClipMaxX+162;
		let by0=GetCenterY-24;
		let scax=1;
		let scay=1;
		let obj0 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj0, imgBorder);
		ObjEffect_SetPrimitiveType(obj0, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj0, ADD); 
		ObjEffect_CreateVertex(obj0, 4);
		ObjEffect_SetVertexXY(obj0, 0, -7, -8);
		ObjEffect_SetVertexXY(obj0, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj0, 2, 7, 8);
		ObjEffect_SetVertexXY(obj0, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj0, 0,  2,  114);
		ObjEffect_SetVertexUV(obj0, 1,  14, 114);
		ObjEffect_SetVertexUV(obj0, 2, 14,  131);
		ObjEffect_SetVertexUV(obj0, 3, 2, 131);
		
		ObjEffect_SetScale(obj0, scax,scay);
		Obj_SetPosition(obj0,bx0,by0);
		ObjEffect_SetLayer(obj0,8);

		let bx1=GetClipMaxX+146;
		let by1=GetCenterY-24;
		let scax=1;
		let scay=1;
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgBorder);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -7, -8);
		ObjEffect_SetVertexXY(obj, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj, 2, 7, 8);
		ObjEffect_SetVertexXY(obj, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj, 0,  2+Bnum2*14,  114);
		ObjEffect_SetVertexUV(obj, 1,  14+Bnum2*14, 114);
		ObjEffect_SetVertexUV(obj, 2, 14+Bnum2*14,  131);
		ObjEffect_SetVertexUV(obj, 3, 2+Bnum2*14, 131);
		
		ObjEffect_SetScale(obj, scax,scay);
		Obj_SetPosition(obj,bx1,by1);
		ObjEffect_SetLayer(obj,8);

		let bx2=GetClipMaxX+130;
		let by2=GetCenterY-24;
		let obj2 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj2, imgBorder);
		ObjEffect_SetPrimitiveType(obj2, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj2, ADD); 
		ObjEffect_CreateVertex(obj2, 4);
		ObjEffect_SetVertexXY(obj2, 0, -7, -8);
		ObjEffect_SetVertexXY(obj2, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj2, 2, 7, 8);
		ObjEffect_SetVertexXY(obj2, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj2, 0,  2+Bnum3*14,  114);
		ObjEffect_SetVertexUV(obj2, 1,  14+Bnum3*14, 114);
		ObjEffect_SetVertexUV(obj2, 2, 14+Bnum3*14,  131);
		ObjEffect_SetVertexUV(obj2, 3, 2+Bnum3*14, 131);
		
		Obj_SetPosition(obj2,bx2,by2);
		ObjEffect_SetLayer(obj2,8);

		let bx3=GetClipMaxX+114;
		let by3=GetCenterY-24;
		let obj3 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj3, imgBorder);
		ObjEffect_SetPrimitiveType(obj3, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj3, ADD); 
		ObjEffect_CreateVertex(obj3, 4);
		ObjEffect_SetVertexXY(obj3, 0, -7, -8);
		ObjEffect_SetVertexXY(obj3, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj3, 2, 7, 8);
		ObjEffect_SetVertexXY(obj3, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj3, 0,  2+Bnum4*14,  114);
		ObjEffect_SetVertexUV(obj3, 1,  14+Bnum4*14, 114);
		ObjEffect_SetVertexUV(obj3, 2, 14+Bnum4*14,  131);
		ObjEffect_SetVertexUV(obj3, 3, 2+Bnum4*14, 131);
		
		Obj_SetPosition(obj3,bx3,by3);
		ObjEffect_SetLayer(obj3,8);

		let bx4=GetClipMaxX+98;
		let by4=GetCenterY-24;
		let obj4 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj4, imgBorder);
		ObjEffect_SetPrimitiveType(obj4, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj4, ADD); 
		ObjEffect_CreateVertex(obj4, 4);
		ObjEffect_SetVertexXY(obj4, 0, -7, -8);
		ObjEffect_SetVertexXY(obj4, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj4, 2, 7, 8);
		ObjEffect_SetVertexXY(obj4, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj4, 0,  2+Bnum5*14,  114);
		ObjEffect_SetVertexUV(obj4, 1,  14+Bnum5*14, 114);
		ObjEffect_SetVertexUV(obj4, 2, 14+Bnum5*14,  131);
		ObjEffect_SetVertexUV(obj4, 3, 2+Bnum5*14, 131);
		
		Obj_SetPosition(obj4,bx4,by4);
		ObjEffect_SetLayer(obj4,8);

		let bx5=GetClipMaxX+82;
		let by5=GetCenterY-24;
		let obj5 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj5, imgBorder);
		ObjEffect_SetPrimitiveType(obj5, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj5, ADD); 
		ObjEffect_CreateVertex(obj5, 4);
		ObjEffect_SetVertexXY(obj5, 0, -7, -8);
		ObjEffect_SetVertexXY(obj5, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj5, 2, 7, 8);
		ObjEffect_SetVertexXY(obj5, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj5, 0,  2+Bnum6*14,  114);
		ObjEffect_SetVertexUV(obj5, 1,  14+Bnum6*14, 114);
		ObjEffect_SetVertexUV(obj5, 2, 14+Bnum6*14,  131);
		ObjEffect_SetVertexUV(obj5, 3, 2+Bnum6*14, 131);
		
		Obj_SetPosition(obj5,bx5,by5);
		ObjEffect_SetLayer(obj5,8);

		yield;
		Obj_Delete(obj0);
		Obj_Delete(obj);
		Obj_Delete(obj2);
		Obj_Delete(obj3);
		Obj_Delete(obj4);
		Obj_Delete(obj5);
}
}