//===================================================================
// Fujiwara no Mokou's include
//===================================================================

//-------------------------------------------------------------------
// Define already mentioned directories
//-------------------------------------------------------------------

/** directory to Image folder */
let dirPathImage = GetCurrentScriptDirectory() ~ "Image\";
/** Image paths */
let ImageBoss = dirPathImage ~ "Sprite.png";
let ImageCutIn = dirPathImage ~ "CutIn.png";
let ImageBG1 = dirPathImage ~ "Flame.png";
let ImageBG2 = dirPathImage ~ "Udon.png";
/** The frame image */
let ImageFrame = dirPathImage ~ "Frame.png";

//-------------------------------------------------------------------
// Fujiwara no Mokou's Spell BG
//-------------------------------------------------------------------

/**
*	Draw the spell BG
*/
function DrawSpellBG{
	SetGraphicRect( 0, 0, 512, 512 );
	DrawCenter( ImageBG1 );
	SetAlpha( 120 );
	SetGraphicRect( 0, 0, 512, 512 );
	SetGraphicScale( 1.2, 1.2 );
	SetGraphicAngle( 0, 0, - BGCount % 360 );
	DrawCenter( ImageBG2 );
	SetAlpha( 255 );
	SetGraphicScale( 1, 1 );
	SetGraphicAngle( 0, 0, 0 );
	BGCount ++;
}

//-------------------------------------------------------------------
// STG Frame
//-------------------------------------------------------------------

/**
*	Draw the black STG_Frame
*/
task DrawFrame{
	yield;
	let obj = Obj_Create( OBJ_EFFECT );
	ObjEffect_SetRenderState( obj, ALPHA );
	ObjEffect_SetTexture( obj, ImageFrame );
	ObjEffect_SetLayer( obj, 8 );
	ObjEffect_SetPrimitiveType( obj, PRIMITIVE_TRIANGLEFAN );
	ObjEffect_CreateVertex( obj, 4 );
	ObjEffect_SetVertexXY( obj, 0, 0, 0 );
	ObjEffect_SetVertexXY( obj, 1, 640, 0 );
	ObjEffect_SetVertexXY( obj, 2, 640, 480 );
	ObjEffect_SetVertexXY( obj, 3, 0, 480 );	
	ObjEffect_SetVertexUV( obj, 0, 640, 0 );
	ObjEffect_SetVertexUV( obj, 1, 1280, 0 );
	ObjEffect_SetVertexUV( obj, 2, 1280, 480 );
	ObjEffect_SetVertexUV( obj, 3, 640, 480 );
	ascent( let i in 0 .. 4 ){ ObjEffect_SetVertexColor( obj, i, 255, 255, 255, 255 ); }
	Obj_SetPosition( obj, 0, 0 );
}
	


