let path = "script/yukari_yakumo_fuchsia/img/non_spell_bg.png";

@Initialize {
	SetCameraFocusX(0);
	SetCameraFocusY(0);
	SetCameraFocusZ(0);
	SetCameraRadius(350);
	SetCameraElevationAngle(-50);
	SetFogParam(0,3000,64,0,64);
	TCallBg();
}

@MainLoop {

	yield;
}

task TCallBg () {

	ascent (i in -3..3) {
	
		ascent (k in -2..10) {
			TDraw(i * 512, k * 128);
		}
		
	}
	
}

task TDraw (x, y) {
	let a = 0;
	let obj = ObjPrim_Create(OBJ_SPRITE_3D);
	ObjRender_SetBlendType(obj, BLEND_ALPHA);
	Obj_SetRenderPriorityI(obj, 20);
	ObjPrim_SetTexture(obj, path);
	ObjSprite3D_SetSourceDestRect(obj, 0, 0, 512, 128);
	ObjRender_SetPosition(obj, x + ObjRender_GetX(obj), y + ObjRender_GetY(obj), 0);
	let x2 = 0;
	let y2 = 0;
	
	loop {
		ObjSprite3D_SetSourceRect(obj, 0, 0 + y2, 512, 128 + y2);
		SetCameraAzimuthAngle(sin(a) * 5 + 90);
		x2 += 20;
		y2 += 5;
		a += 0.75;
		yield;
	}
	
}