32 lines
810 B
C++
32 lines
810 B
C++
#pragma once
|
|
|
|
#include <sophia/entity.hpp>
|
|
#include <sophia/frame_info.hpp>
|
|
#include <sophia/handles.hpp>
|
|
#include <sophia/ui/panel.hpp>
|
|
#include <string>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
class InspectorPanel : public sophia::Panel {
|
|
public:
|
|
// Stand-in for an asset browser: the textures a sprite can pick from.
|
|
using TextureList =
|
|
std::vector<std::pair<std::string, sophia::TextureHandle>>;
|
|
|
|
InspectorPanel(sophia::Entity& selected, const TextureList& textures)
|
|
: Panel{{.name = "Inspector"}}, selected{selected}, textures{textures} {}
|
|
|
|
void onUpdate(const sophia::FrameInfo& frameInfo) override;
|
|
|
|
private:
|
|
void drawTag();
|
|
void drawTransform();
|
|
void drawCamera();
|
|
void drawSprite();
|
|
void drawAddComponent();
|
|
|
|
sophia::Entity& selected;
|
|
const TextureList& textures;
|
|
};
|