#if defined _focus_included
  #endinput
#endif
#define _focus_included

stock obj: CreateFocus( const script[] )
{
	new obj: _focus = CreatePlane3x3( Scene() );
	SetTexture( _focus, imgGetResource( TEX_FOCUS ) );
	SetOptionI( _focus, TAG("ALPH"), ALPHA_BLEND_ADD );
	AttachScript( _focus, _, script );

	return _focus;
}

stock obj: DestroyFocus( obj: _focus )
{
	SendMessage( _focus, TAG("KILL") );
}

stock bool: IsFocusMoving( obj: _focus )
{
	return bool:(AnimGetState( _focus, ANIM_TYPE_MOVE )!=ANIM_STATE_NONE);
}

stock SetFocus( obj: _focus, obj: _focused,
				float:_zoffs = 0.0, 
				float:_sharpness = 0.5,
            	float:_offs_width = 60.0,
            	float:_offs_height = 60.0,
            	bool:_smooth = true
                )
{
	if( ! _focus ) return;

	SetPubVar( _focus, "focused", _focused );
	SetPubVar( _focus, "class", TAG("") );
	SetPubVar( _focus, "zoffs", _zoffs );
	SetPubVar( _focus, "sharpness", _sharpness );
	SetPubVar( _focus, "offs_width", _offs_width );
	SetPubVar( _focus, "offs_height", _offs_height );
    SetPubVar( _focus, "smooth", _smooth );
}

stock SetFocus_Label( obj: _focus, obj: _focused,
                  	  float:_zoffs = 0.0,
                  	  float:_sharpness = 0.5,
                  	  float:_offs_width = 60.0,
                      float:_offs_height = 60.0,
		           	  bool:_smooth = true
                      )
{
	if( ! _focus ) return;

	SetPubVar( _focus, "focused", _focused );
	SetPubVar( _focus, "class", TAG("LABL") );
	SetPubVar( _focus, "zoffs", _zoffs );
	SetPubVar( _focus, "sharpness", _sharpness );
	SetPubVar( _focus, "offs_width", _offs_width );
	SetPubVar( _focus, "offs_height", _offs_height );
    SetPubVar( _focus, "smooth", _smooth );
}
