Widgets: Add ImageWidget
This commit is contained in:
47
include/Nazara/Widgets/ImageWidget.hpp
Normal file
47
include/Nazara/Widgets/ImageWidget.hpp
Normal file
@@ -0,0 +1,47 @@
|
||||
// Copyright (C) 2021 Samy Bensaid
|
||||
// This file is part of the "Nazara Engine - Widgets module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_WIDGETS_IMAGEWIDGET_HPP
|
||||
#define NAZARA_WIDGETS_IMAGEWIDGET_HPP
|
||||
|
||||
#include <Nazara/Graphics/Sprite.hpp>
|
||||
#include <Nazara/Math/Vector2.hpp>
|
||||
#include <Nazara/Renderer/Texture.hpp>
|
||||
#include <Nazara/Widgets/BaseWidget.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_WIDGETS_API ImageWidget : public BaseWidget
|
||||
{
|
||||
public:
|
||||
ImageWidget(BaseWidget* parent);
|
||||
ImageWidget(const ImageWidget&) = delete;
|
||||
ImageWidget(ImageWidget&&) = default;
|
||||
~ImageWidget() = default;
|
||||
|
||||
inline const Color& GetColor() const;
|
||||
inline const std::shared_ptr<Material>& GetMaterial() const;
|
||||
inline const Rectf& GetTextureCoords() const;
|
||||
|
||||
inline void SetColor(const Color& color);
|
||||
inline void SetMaterial(const std::shared_ptr<Material>& texture);
|
||||
inline void SetTextureCoords(const Rectf& coords);
|
||||
inline void SetTextureRect(const Rectf& rect);
|
||||
|
||||
ImageWidget& operator=(const ImageWidget&) = delete;
|
||||
ImageWidget& operator=(ImageWidget&&) = default;
|
||||
|
||||
private:
|
||||
void Layout() override;
|
||||
|
||||
entt::entity m_entity;
|
||||
std::shared_ptr<Sprite> m_sprite;
|
||||
};
|
||||
}
|
||||
|
||||
#include <Nazara/Widgets/ImageWidget.inl>
|
||||
|
||||
#endif // NAZARA_WIDGETS_IMAGEWIDGET_HPP
|
||||
Reference in New Issue
Block a user