summaryrefslogtreecommitdiff
path: root/Runtime/Camera/RenderLayers/GUIElement.cpp
blob: 73ff0e0ae6a54784acab31bd90b057d7e7040e76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "UnityPrefix.h"
#include "GUIElement.h"
#include "GUILayer.h"
#include "Runtime/Math/Vector2.h"

GUIElement::GUIElement (MemLabelId label, ObjectCreationMode mode)
:	Super(label, mode)
{
}

GUIElement::~GUIElement ()
{
}

void GUIElement::AddToManager ()
{
	GUILayer::ms_GUIElements->add_delayed (this);
}

void GUIElement::RemoveFromManager ()
{
	GUILayer::ms_GUIElements->remove_delayed (this);
}

bool GUIElement::HitTest (const Vector2f& screenSpacePosition, const Rectf& cameraRect)
{
	Rectf rect = GetScreenRect (cameraRect);
	return rect.Contains (screenSpacePosition.x, screenSpacePosition.y);
}

IMPLEMENT_CLASS (GUIElement)