moving active inventory object
This commit is contained in:
parent
4ff416757f
commit
a6a275a934
@ -214,15 +214,29 @@ void RenderSystem::drawUI(const GameObjectManager& gameObjects) {
|
|||||||
for (const auto& [name, item] : inventoryMap) {
|
for (const auto& [name, item] : inventoryMap) {
|
||||||
renderer.PushMatrix();
|
renderer.PushMatrix();
|
||||||
|
|
||||||
|
if (item.isSelected) {
|
||||||
|
float xPos = Environment::width
|
||||||
|
- gameObjects.INVENTORY_MARGIN
|
||||||
|
- gameObjects.INVENTORY_ICON_SIZE+25;
|
||||||
|
float yPos = gameObjects.INVENTORY_MARGIN
|
||||||
|
+ i * (gameObjects.INVENTORY_ICON_SIZE+25
|
||||||
|
+ gameObjects.INVENTORY_MARGIN);
|
||||||
|
renderer.TranslateMatrix(Vector3f{xPos, yPos, 0.0f});
|
||||||
|
glBindTexture(GL_TEXTURE_2D, item.texture->getTexID());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
float xPos = Environment::width
|
float xPos = Environment::width
|
||||||
- gameObjects.INVENTORY_MARGIN
|
- gameObjects.INVENTORY_MARGIN
|
||||||
- gameObjects.INVENTORY_ICON_SIZE;
|
- gameObjects.INVENTORY_ICON_SIZE;
|
||||||
float yPos = gameObjects.INVENTORY_MARGIN
|
float yPos = gameObjects.INVENTORY_MARGIN
|
||||||
+ i * (gameObjects.INVENTORY_ICON_SIZE
|
+ i * (gameObjects.INVENTORY_ICON_SIZE
|
||||||
+ gameObjects.INVENTORY_MARGIN);
|
+ gameObjects.INVENTORY_MARGIN);
|
||||||
|
|
||||||
renderer.TranslateMatrix(Vector3f{xPos, yPos, 0.0f});
|
renderer.TranslateMatrix(Vector3f{xPos, yPos, 0.0f});
|
||||||
glBindTexture(GL_TEXTURE_2D, item.texture->getTexID());
|
glBindTexture(GL_TEXTURE_2D, item.texture->getTexID());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
renderer.DrawVertexRenderStruct(gameObjects.inventoryIconMeshMutable);
|
renderer.DrawVertexRenderStruct(gameObjects.inventoryIconMeshMutable);
|
||||||
|
|
||||||
renderer.PopMatrix();
|
renderer.PopMatrix();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user