ADD: Icons for Buildings
This commit is contained in:
parent
9f0d1e0f19
commit
285af0ae47
BIN
assets/buildings/forest_hut/textures/icon.png
Normal file
BIN
assets/buildings/forest_hut/textures/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 210 KiB |
BIN
assets/buildings/stone_mason/textures/icon.png
Normal file
BIN
assets/buildings/stone_mason/textures/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 202 KiB |
@ -33,6 +33,8 @@ void UILayer::onAttach() {
|
||||
|
||||
AssetManager::loadTexture("background", "assets/textures/texture.png", Loader::instance());
|
||||
AssetManager::loadTexture("inventory_background", "assets/textures/inventory_background.png", Loader::instance());
|
||||
AssetManager::loadTexture("forest_hut_icon", "assets/buildings/forest_hut/textures/icon.png", Loader::instance());
|
||||
AssetManager::loadTexture("stone_mason_icon", "assets/buildings/stone_mason/textures/icon.png", Loader::instance());
|
||||
|
||||
|
||||
rootContainer = std::make_unique<UiContainer>();
|
||||
|
||||
@ -4,14 +4,25 @@
|
||||
|
||||
#include "UiBuildingMenuContainer.h"
|
||||
|
||||
#include "../../../engine/core/gui/uiComponent/UiImage.h"
|
||||
#include "../../../engine/renderer/loader/AssetManager.h"
|
||||
|
||||
UiBuildingMenuContainer::UiBuildingMenuContainer() {
|
||||
uiPositioner.getLayout().height = SizeValue(200.f, SizeUnit::Pixels);
|
||||
uiPositioner.getLayout().width = SizeValue(.6f, SizeUnit::Percent);
|
||||
uiPositioner.getLayout().flexDirection = FlexDirection::Row;
|
||||
uiPositioner.getLayout().justifyContent = JustifyContent::Center;
|
||||
uiPositioner.getLayout().justifyContent = JustifyContent::Start;
|
||||
uiPositioner.getLayout().alignItems = AlignItems::Center;
|
||||
|
||||
LayoutStyle iconStyle;
|
||||
iconStyle.width = SizeValue(150, SizeUnit::Pixels);
|
||||
iconStyle.height = SizeValue(150.f, SizeUnit::Pixels);
|
||||
|
||||
auto forest_icon = std::make_unique<UiImage>(AssetManager::getTexture("forest_hut_icon")->getTextureID(), AssetManager::getTexture("background")->getTextureID(), iconStyle);
|
||||
addChild(std::move(forest_icon));
|
||||
|
||||
auto stone_mason_icon = std::make_unique<UiImage>(AssetManager::getTexture("stone_mason_icon")->getTextureID(), AssetManager::getTexture("background")->getTextureID(), iconStyle);
|
||||
addChild(std::move(stone_mason_icon));
|
||||
}
|
||||
|
||||
void UiBuildingMenuContainer::onCollectRenderData(UiRenderBundle &uiRenderBundle) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user