Editor Asset explorer setup
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
#include <iostream>
|
||||
#include "../../YoggieEngine/src/Scene/Components.h"
|
||||
#include "../../YoggieEngine/src/Scene/Entity.h"
|
||||
|
||||
class Editor;
|
||||
|
||||
void ComponentView(const std::string& componentName, voidFunction func)
|
||||
@ -169,7 +170,49 @@ void Console() {
|
||||
}
|
||||
|
||||
void AssetsFinder() {
|
||||
static YoggieEngine::Texture folderIcon ("rsc/folderIcon.png");
|
||||
static YoggieEngine::Texture AssetIcon("rsc/assetIcon.png");
|
||||
static int iconSize = 60;
|
||||
|
||||
ImGui::Begin("Asset-Finder", false);
|
||||
ImGui::Dummy(ImVec2{ 128, 128 });
|
||||
ImGui::DragInt("IconSize", &iconSize, 1, 30, 90);
|
||||
|
||||
|
||||
if (ImGui::BeginTable("##resources", 3))
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.f, 0.f, 0.f, 0.f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.f, 0.f, 0.f, 0.f));
|
||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(1.f, 1.f, 1.f, 0.2f));
|
||||
|
||||
for (int row = 0; row < 4; row++) {
|
||||
ImGui::TableNextRow();
|
||||
for (int column = 0; column < 3; column++) {
|
||||
ImGui::TableSetColumnIndex(column);
|
||||
|
||||
if (column % 2) {
|
||||
ImGui::ImageButton(
|
||||
(ImTextureID)folderIcon.GetID(),
|
||||
ImVec2{ (float)iconSize,(float)iconSize });
|
||||
ImGui::Text("Folder %d", row);
|
||||
}
|
||||
else {
|
||||
ImGui::ImageButton(
|
||||
(ImTextureID)AssetIcon.GetID(),
|
||||
ImVec2{ (float)iconSize, (float)iconSize });
|
||||
ImGui::Text("Asset %d", row);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(3);
|
||||
ImGui::EndTable();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ImGui::End();
|
||||
}
|
Reference in New Issue
Block a user