class ScannerCrosshairLogicController extends inkLogicController
{
	private var m_rootWidget : weak< inkWidget >;
	private var m_projection : inkScreenProjection;

	protected event OnInitialize()
	{
		m_rootWidget = GetRootWidget();
		m_rootWidget.SetAnchorPoint( Vector2( 0.5, 0.0 ) );
	}

	public function CreateProjectionData() : inkScreenProjectionData
	{
		var projectionData : inkScreenProjectionData;
		projectionData.userData = this;
		projectionData.fixedWorldOffset = Vector4( 0.0, 0.0, 0.0, 0.0 );
		projectionData.slotComponentName = 'UI_Slots';
		projectionData.slotName = 'UI_Interaction';
		return projectionData;
	}

	public function GetProjection() : inkScreenProjection
	{
		return m_projection;
	}

	public function SetProjection( projection : inkScreenProjection )
	{
		m_projection = projection;
	}

	public function SetEntity( entityObject : weak< Entity > )
	{
		m_projection.SetEntity( entityObject );
	}

	public function UpdateProjection()
	{
		var margin : inkMargin;
		if( m_projection )
		{
			margin.left = m_projection.currentPosition.X;
			margin.top = m_projection.currentPosition.Y;
			m_rootWidget.SetMargin( margin );
		}
	}

}

