Commit current work
Former-commit-id: 79be9d4e937a73626cd5ec02c1d2e2fcbd440d18
This commit is contained in:
44
SDK/include/NDK/Widgets/LabelWidget.hpp
Normal file
44
SDK/include/NDK/Widgets/LabelWidget.hpp
Normal file
@@ -0,0 +1,44 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NDK_WIDGETS_LABELWIDGET_HPP
|
||||
#define NDK_WIDGETS_LABELWIDGET_HPP
|
||||
|
||||
#include <NDK/Prerequesites.hpp>
|
||||
#include <NDK/BaseWidget.hpp>
|
||||
#include <Nazara/Utility/AbstractTextDrawer.hpp>
|
||||
#include <Nazara/Graphics/TextSprite.hpp>
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
class World;
|
||||
|
||||
class NDK_API LabelWidget : public BaseWidget
|
||||
{
|
||||
public:
|
||||
LabelWidget(const WorldHandle& world, BaseWidget* parent = nullptr);
|
||||
LabelWidget(const LabelWidget&) = delete;
|
||||
LabelWidget(LabelWidget&&) = default;
|
||||
~LabelWidget() = default;
|
||||
|
||||
//virtual LabelWidget* Clone() const = 0;
|
||||
|
||||
void ResizeToContent();
|
||||
|
||||
inline void UpdateText(const Nz::AbstractTextDrawer& drawer);
|
||||
|
||||
LabelWidget& operator=(const LabelWidget&) = delete;
|
||||
LabelWidget& operator=(LabelWidget&&) = default;
|
||||
|
||||
private:
|
||||
EntityHandle m_textEntity;
|
||||
Nz::TextSpriteRef m_textSprite;
|
||||
};
|
||||
}
|
||||
|
||||
#include <NDK/Widgets/LabelWidget.inl>
|
||||
|
||||
#endif // NDK_WIDGETS_LABELWIDGET_HPP
|
||||
13
SDK/include/NDK/Widgets/LabelWidget.inl
Normal file
13
SDK/include/NDK/Widgets/LabelWidget.inl
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
||||
|
||||
#include <NDK/Widgets/LabelWidget.hpp>
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
inline void LabelWidget::UpdateText(const Nz::AbstractTextDrawer& drawer)
|
||||
{
|
||||
m_textSprite->Update(drawer);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user