Add size set function to GuiComponent

Similar to #92...
This commit is contained in:
Bim 2013-07-03 01:48:39 +02:00
parent ac51656527
commit 45ed6ae4da
2 changed files with 16 additions and 0 deletions

View file

@ -102,6 +102,19 @@ Vector2u GuiComponent::getSize()
return mSize;
}
void GuiComponent::setSize(Vector2u size)
{
mSize = size;
onSizeChanged();
}
void GuiComponent::setSize(unsigned int w, unsigned int h)
{
mSize.x = w;
mSize.y = h;
onSizeChanged();
}
//Children stuff.
void GuiComponent::addChild(GuiComponent* cmp)
{

View file

@ -36,6 +36,9 @@ public:
virtual void onOffsetChanged() {};
Vector2u getSize();
void setSize(Vector2u size);
void setSize(unsigned int w, unsigned int h);
virtual void onSizeChanged() {};
void setParent(GuiComponent* parent);
GuiComponent* getParent();