content browser and textures on entity sprites
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include "imgui.h"
|
||||
#include <editor_component.hpp>
|
||||
#include <open_engine.hpp>
|
||||
|
||||
@@ -106,6 +107,16 @@ namespace OpenEngine {
|
||||
{
|
||||
auto& sprite = registry.get<SpriteRendererComponent>(entity);
|
||||
ImGui::ColorEdit4("color", glm::value_ptr(sprite.color));
|
||||
ImGui::Button("Texture", { 100, 0 });
|
||||
|
||||
if (ImGui::BeginDragDropTarget()) {
|
||||
if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("CONTENT_BROWSER_PAYLOAD"))
|
||||
sprite.texture = Texture2D::Create(((const char*)payload->Data));
|
||||
|
||||
ImGui::EndDragDropTarget();
|
||||
}
|
||||
|
||||
ImGui::DragFloat("Tiling factor", &sprite.tiling_factor);
|
||||
};
|
||||
|
||||
void CameraOnImGuiRender(entt::registry& registry, entt::entity entity)
|
||||
|
||||
Reference in New Issue
Block a user