UI for new sprite option

This commit is contained in:
Antoine Pilote
2023-09-30 14:27:38 -04:00
parent db1ce08c42
commit 27d1af86af
4 changed files with 44 additions and 3 deletions

View File

@@ -65,6 +65,22 @@ public:
ImGui::Checkbox("##lockYRotation", &component.LockYRotation);
ImGui::TableNextColumn();
ComponentTableReset(component.LockYRotation, false);
}
ImGui::TableNextColumn();
{
ImGui::Text("Position Based");
if (ImGui::BeginItemTooltip())
{
ImGui::Text("Orientation is based on the position of the camera or the orientation of the camera.");
ImGui::EndTooltip();
}
ImGui::TableNextColumn();
ImGui::Checkbox("##positionbased", &component.PositionFacing);
ImGui::TableNextColumn();
ComponentTableReset(component.LockYRotation, false);
}
}

View File

@@ -638,6 +638,23 @@ namespace Nuake {
ImGui::PopStyleColor();
}
ImGui::TableNextColumn();
{
// Title
ImGui::Text("Ambient Term");
ImGui::TableNextColumn();
// Here we create a dropdown for every sky type.
ImGui::DragFloat("##AmbientTerm", &env->AmbientTerm, 0.001f, 0.00f, 1.0f);
ImGui::TableNextColumn();
// Reset button
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1, 1, 1, 0));
std::string ResetType = ICON_FA_UNDO + std::string("##ambient");
if (ImGui::Button(ResetType.c_str())) env->AmbientTerm = 0.25f;
ImGui::PopStyleColor();
}
ImGui::EndTable();
}
END_COLLAPSE_HEADER()

View File

@@ -42,9 +42,10 @@ namespace Nuake
json SpriteComponent::Serialize()
{
BEGIN_SERIALIZE();
SERIALIZE_VAL(Billboard)
SERIALIZE_VAL(LockYRotation)
SERIALIZE_VAL(SpritePath)
SERIALIZE_VAL(Billboard);
SERIALIZE_VAL(LockYRotation);
SERIALIZE_VAL(SpritePath);
SERIALIZE_VAL(PositionFacing);
END_SERIALIZE();
}
@@ -60,6 +61,11 @@ namespace Nuake
LockYRotation = j["LockYRotation"];
}
if (j.contains("PositionFacing"))
{
PositionFacing = j["PositionFacing"];
}
if (j.contains("SpritePath"))
{
SpritePath = j["SpritePath"];

View File

@@ -11,6 +11,8 @@ namespace Nuake
public:
bool Billboard;
bool LockYRotation;
bool PositionFacing;
std::string SpritePath;
Ref<Mesh> SpriteMesh;