osb/source/windowing/StarPortraitWidget.hpp

45 lines
896 B
C++
Raw Normal View History

2023-06-20 04:33:09 +00:00
#ifndef STAR_PORTRAIT_WIDGET_HPP
#define STAR_PORTRAIT_WIDGET_HPP
#include "StarWidget.hpp"
#include "StarPlayer.hpp"
namespace Star {
STAR_CLASS(Player);
STAR_CLASS(PortraitWidget);
class PortraitWidget : public Widget {
public:
PortraitWidget(PortraitEntityPtr entity, PortraitMode mode = PortraitMode::Full);
PortraitWidget();
virtual ~PortraitWidget() {}
void setEntity(PortraitEntityPtr entity);
void setMode(PortraitMode mode);
void setScale(float scale);
void setIconMode();
bool sendEvent(InputEvent const& event);
protected:
virtual RectI getScissorRect() const;
virtual void renderImpl();
private:
void init();
void updateSize();
PortraitEntityPtr m_entity;
PortraitMode m_portraitMode;
2023-06-24 15:16:40 +00:00
AssetPath m_noEntityImageFull;
AssetPath m_noEntityImagePart;
2023-06-20 04:33:09 +00:00
float m_scale;
bool m_iconMode;
2023-06-24 15:16:40 +00:00
AssetPath m_iconImage;
2023-06-20 04:33:09 +00:00
Vec2I m_iconOffset;
};
}
#endif