blob: 44f20efab79bb8e1d7f2f4e459a4e7114d22b54e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include "inventoryitem.h"
InventoryItem::InventoryItem(const char* worldLabelFile, const char* inventoryLabelFile,
glm::vec2 worldLabelScale,
glm::vec2 inventoryLabelScale,
std::set<std::string>& m_shownScreens)
{
TextureData worldLabelTex = Global::graphics.loadTextureFromFile(worldLabelFile);
TextureData inventoryLabelTex = Global::graphics.loadTextureFromFile(inventoryLabelFile);
m_world_label = std::make_shared<UIDisplay>(worldLabelTex, glm::vec2(0.f), worldLabelScale, m_shownScreens, AspectRatio::LAND_FIT);
m_inventory_label = std::make_shared<UIDisplay>(inventoryLabelTex, glm::vec2(0.f), inventoryLabelScale, m_shownScreens, AspectRatio::LAND_FIT);
}
void InventoryItem::updateWorldLabelPos(glm::vec2 pos){
m_world_label->setPos(pos);
}
glm::mat4 InventoryItem::getWorldLabelTransformationMat(){
return m_world_label->getTransformationMat();
}
GLuint InventoryItem::getWorldLabelTexID(){
return m_world_label->getTexID();
}
float InventoryItem::getWorldLabelTexAspect(){
return m_world_label->getTextureScaleAspect();
}
std::shared_ptr<UIDisplay> InventoryItem::getUIDisplay(){
return m_world_label;
}
|