
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 Bnum7=trunc(bonuspoint%10000000/1000000);
		let bx0=GetClipMaxX+166;
		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+150;
		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+134;
		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+118;
		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+102;
		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+86;
		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);

		if(Bnum7>=1)
		{
			Bonusnum7(Bnum7);
		}

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


}
}

task Bonusnum7(Bnum7)
{
		let bx6=GetClipMaxX+70;
		let by6=GetCenterY-24;
		let obj6 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj6, imgBorder);
		ObjEffect_SetPrimitiveType(obj6, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj6, ADD); 
		ObjEffect_CreateVertex(obj6, 4);
		ObjEffect_SetVertexXY(obj6, 0, -7, -8);
		ObjEffect_SetVertexXY(obj6, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj6, 2, 7, 8);
		ObjEffect_SetVertexXY(obj6, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj6, 0,  2+Bnum7*14,  114);
		ObjEffect_SetVertexUV(obj6, 1,  14+Bnum7*14, 114);
		ObjEffect_SetVertexUV(obj6, 2, 14+Bnum7*14,  131);
		ObjEffect_SetVertexUV(obj6, 3, 2+Bnum7*14, 131);
		
		Obj_SetPosition(obj6,bx6,by6);
		ObjEffect_SetLayer(obj6,8);
		yield;
		Obj_Delete(obj6);

}