Added ImageWidget (#139)
* Added ImageWidget * Remove useless ResizeToContent function * Add ResizeToContent function * Forgot operators * Added textures & colors functions * oops
This commit is contained in:
46
SDK/include/NDK/Widgets/ImageWidget.inl
Normal file
46
SDK/include/NDK/Widgets/ImageWidget.inl
Normal file
@@ -0,0 +1,46 @@
|
||||
// Copyright (C) 2017 Samy Bensaid
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
||||
|
||||
#include <NDK/Widgets/ImageWidget.hpp>
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
inline const Nz::Color& ImageWidget::GetColor() const
|
||||
{
|
||||
return m_sprite->GetColor();
|
||||
}
|
||||
|
||||
inline const Nz::TextureRef& ImageWidget::GetTexture() const
|
||||
{
|
||||
return m_sprite->GetMaterial()->GetDiffuseMap();
|
||||
}
|
||||
|
||||
inline const Nz::Rectf& ImageWidget::GetTextureCoords() const
|
||||
{
|
||||
return m_sprite->GetTextureCoords();
|
||||
}
|
||||
|
||||
inline void ImageWidget::SetColor(const Nz::Color& color)
|
||||
{
|
||||
m_sprite->SetColor(color);
|
||||
}
|
||||
|
||||
inline void ImageWidget::SetTexture(const Nz::TextureRef& texture, bool resizeToContent)
|
||||
{
|
||||
m_sprite->SetTexture(texture, false);
|
||||
|
||||
if (resizeToContent)
|
||||
ResizeToContent();
|
||||
}
|
||||
|
||||
inline void ImageWidget::SetTextureCoords(const Nz::Rectf& coords)
|
||||
{
|
||||
m_sprite->SetTextureCoords(coords);
|
||||
}
|
||||
|
||||
inline void ImageWidget::SetTextureRect(const Nz::Rectui& rect)
|
||||
{
|
||||
m_sprite->SetTextureRect(rect);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user