// Copyright (C) 2023 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 #include #include #include namespace Nz { class NAZARA_WIDGETS_API ImageWidget : public BaseWidget { public: ImageWidget(BaseWidget* parent, std::shared_ptr material); ImageWidget(const ImageWidget&) = delete; ImageWidget(ImageWidget&&) = delete; ~ImageWidget() = default; inline const Color& GetColor() const; inline const std::shared_ptr& GetMaterial() const; inline const Rectf& GetTextureCoords() const; inline void SetColor(const Color& color); inline void SetMaterial(const std::shared_ptr& texture); inline void SetTextureCoords(const Rectf& coords); inline void SetTextureRect(const Rectf& rect); ImageWidget& operator=(const ImageWidget&) = delete; ImageWidget& operator=(ImageWidget&&) = delete; private: void Layout() override; inline void UpdatePreferredSize(); entt::entity m_entity; std::shared_ptr m_sprite; }; } #include #endif // NAZARA_WIDGETS_IMAGEWIDGET_HPP