diff --git a/Escape-the-Dawn/Frame.cpp b/Escape-the-Dawn/Frame.cpp
index bf996ed..1c3c753 100644
--- a/Escape-the-Dawn/Frame.cpp
+++ b/Escape-the-Dawn/Frame.cpp
@@ -3,51 +3,74 @@
GUI::Frame::Frame()
{
rectangle = new Rectangle();
+ texture = nullptr;
}
int GUI::Frame::GetWidth()
{
- return rectangle;
+ return rectangle->Width();
}
int GUI::Frame::GetHeight()
{
- return rectangle.Height();
+ return rectangle->Height();
}
int GUI::Frame::GetX()
{
- return rectangle;
+ return rectangle->X();
}
int GUI::Frame::GetY()
{
- return rectangle.Y();
+ return rectangle->Y();
}
-void GUI::Frame::SetWidth(int wid)
+int GUI::Frame::GetRight()
{
- rectangle.width(wid);
+ return rectangle->Right();
}
-void GUI::Frame::SetHeight(int hei)
+int GUI::Frame::GetLeft()
{
- rectangle.height(hei);
+ return rectangle->Left();
}
-void GUI::Frame::SetX(int xcord)
+int GUI::Frame::GetBottom()
{
- rectangle.X(xcord)
+ return rectangle->Bottom();
}
-void GUI::Frame::SetY(int ycord)
+int GUI::Frame::GetTop()
{
- rectangle.Y(ycord)
+ return rectangle->Right();
}
+void GUI::Frame::SetWidth(int _width)
+{
+ rectangle->Width(_width);
+}
+
+void GUI::Frame::SetHeight(int _height)
+{
+ rectangle->Height(_height);
+}
+
+void GUI::Frame::SetX(int _x)
+{
+ rectangle->X(_x);
+}
+
+void GUI::Frame::SetY(int _y)
+{
+ rectangle->Y(_y);
+}
+
+
+
Rectangle GUI::Frame::AbsouluteRectangle()
{
-
+
}
bool GUI::Frame::Visible()
@@ -85,8 +108,48 @@ void GUI::Frame::Update(double dt)
}
+void AddChild(GUI::Frame childFrame)
+{
+ childFrame.Parent = this;
+ if (!Children.Contains(childFrame))
+ Children.Add(childFrame);
+}
+
+///
+/// Remove a child frame from the frame.
+///
+/// The child frame to remove.
+void RemoveChild(GUI::Frame childFrame)
+{
+ if (Children.Contains(childFrame))
+ Children.Remove(childFrame);
+}
+
+///
+/// Destroys the frame and all its children.
+///
+void Destroy()
+{
+ if (Parent != null)
+ Parent.RemoveChild(this);
+
+ Manager.Remove(this);
+}
+
+void GUI::Frame::SetTexture(std::string fileName)
+{
+ //texture == någonTextureIDunno;
+}
+
void GUI::Frame::Draw()
{
-
+ if (Visible)
+ {
+ if (texture != nullptr)
+ {
+ //Drawshit
+ }
+ }
}
+
*/
\ No newline at end of file
diff --git a/Escape-the-Dawn/Frame.h b/Escape-the-Dawn/Frame.h
index 2e9a3f4..69dd6d7 100644
--- a/Escape-the-Dawn/Frame.h
+++ b/Escape-the-Dawn/Frame.h
@@ -1,4 +1,4 @@
-/*#ifndef Frame_h__
+#ifndef Frame_h__
#define Frame_h__
#include