SpiecsEngine
 
Loading...
Searching...
No Matches

◆ DrawThis()

void Spices::EntityComponent::DrawThis ( )
overridevirtual

This interface defines how to draw this component to property panel.

Reimplemented from Spices::Component.

Definition at line 24 of file EntityComponent.cpp.

25 {
27
28 if (ImGui::BeginChild("Entity Attachments", ImVec2(0, std::min(m_Entities.size() + 0.2f, 10.0f) * ImGuiH::GetLineItemSize().x), ImGuiChildFlags_None, ImGuiWindowFlags_HorizontalScrollbar))
29 {
30 for (auto& item : m_Entities)
31 {
32 std::stringstream ss;
33 ss << "Attchments [" << item << "]";
34
35 ImGuiH::DrawPropertyItem(ss.str().c_str(), 0, nullptr, [&]() {
36 ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x - ImGuiH::GetLineItemSize().x);
37 char buffer[12] = {};
38 ImGui::InputTextWithHint("##", std::to_string(item).c_str(), buffer, sizeof(buffer));
39 ImGui::PopItemWidth();
40 ImGui::SameLine();
42 });
43 }
44
45 ImGui::EndChild();
46 }
47 }
#define SPICES_PROFILE_ZONE
std::set< uint32_t > m_Entities
child entities.
static ImVec2 GetLineItemSize()
Get Line Width's Square Size.
static bool DrawResetIcon(const bool &isMove)
Draw Reset Icon.
static void DrawPropertyItem(const std::string &itemName, float columeWidth, std::function< void()> nameFunc, std::function< void()> valFunc)
Draw a single property.
std::string to_string(GFSDK_Aftermath_Result result)
Convert GFSDK_Aftermath_Result to string.