--------------------------------------------------------------------
-- e_flower.lua
-- ‰Ô
-- 
-- author IZUMI STUDIO
-- date 2009-10-05
--------------------------------------------------------------------
require(".\\scripts\\common")

PROJ_FOV        = 3.1415 * 25.0 / 180.0
PROJ_RADIUS     = 40.0 / math.cos( PROJ_FOV / 2.0 )
PROJ_HALF_WIDTH = PROJ_RADIUS * math.sin( PROJ_FOV / 2.0 )
PROJ_WIDTH      = PROJ_HALF_WIDTH * 2.0

IMAGE_NAME = "hibiscus_photo"

function createElement_Flower_In( _delay, _endFrame, _x, _y )
	mover = Effect.CreateAnimator_Still(
		_x, _y, 0.0,
		0.0, 0.0, 0.0 )

	rotator = Effect.CreateAnimator_Still(
		0.0, 0.0, 0.0,
		0.0, 0.0, 0.0 )
	
	Effect.CreateElement_Sprite( 
		IMAGE_NAME,
		148.0/800.0*1.333*PROJ_WIDTH, 148.0/800.0*1.333*PROJ_WIDTH, INTERPOLATION_LINEAR,
		148.0/600.0*PROJ_WIDTH, 148.0/600.0*PROJ_WIDTH, INTERPOLATION_LINEAR,
		0.0, 1.0, INTERPOLATION_LINEAR,
		EFFECT_BLEND_NORMAL,
		EFFECT_BILLBOARD_NORMAL,
		_delay, _endFrame, 1,
		EFFECT_OPTION_SHADOW,
		mover,
		rotator )
end

function createElement_Flower( _delay, _endFrame, _x, _y )
	
	mover = Effect.CreateAnimator_Still(
		_x, _y, 0.0,
		0.0, 0.0, 0.0 )

	rotator = Effect.CreateAnimator_Still(
		0.0, 0.0, 0.0,
		0.0, 0.0, 0.0 )
	
	Effect.CreateElement_Sprite( 
		IMAGE_NAME,
		148.0/800.0*1.333*PROJ_WIDTH, 148.0/800.0*1.333*PROJ_WIDTH, INTERPOLATION_LINEAR,
		148.0/600.0*PROJ_WIDTH, 148.0/600.0*PROJ_WIDTH, INTERPOLATION_LINEAR,
		1.0, 1.0, INTERPOLATION_LINEAR,
		EFFECT_BLEND_NORMAL,
		EFFECT_BILLBOARD_NORMAL,
		_delay, _endFrame, 0,
		EFFECT_OPTION_SHADOW,
		mover,
		rotator )
end

createElement_Flower_In( 
	90, 20, 
	(701.0-400.0)/400.0*1.333*PROJ_HALF_WIDTH, 
	(300.0-379.0)/300.0*PROJ_HALF_WIDTH )

createElement_Flower( 
	110-1, 100, 
	(701.0-400.0)/400.0*1.333*PROJ_HALF_WIDTH, 
	(300.0-379.0)/300.0*PROJ_HALF_WIDTH )



