Sdk/BaseWidget: Add a way to change background color

This commit is contained in:
Lynix
2017-01-15 12:11:59 +01:00
parent 14e327c603
commit 5865679891
3 changed files with 18 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ namespace Ndk
//virtual BaseWidget* Clone() const = 0;
inline const Nz::Color& GetBackgroundColor() const;
inline Canvas* GetCanvas();
inline const Padding& GetPadding() const;
inline const Nz::Vector2f& GetContentSize() const;
@@ -52,6 +53,7 @@ namespace Ndk
virtual void ResizeToContent() = 0;
void SetBackgroundColor(const Nz::Color& color);
inline void SetContentSize(const Nz::Vector2f& size);
inline void SetPadding(float left, float top, float right, float bottom);
void SetSize(const Nz::Vector2f& size);

View File

@@ -43,6 +43,11 @@ namespace Ndk
SetPosition((parentSize.x - mySize.x) / 2.f, (parentSize.y - mySize.y) / 2.f);
}
inline const Nz::Color& BaseWidget::GetBackgroundColor() const
{
return m_backgroundColor;
}
inline Canvas* BaseWidget::GetCanvas()
{
return m_canvas;