You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the code below. I have to hold down the mouse button on the input box to be able to type in it. Otherwise it looks like it gets focus for a second then loses it. What do I do about this?
if (showGameObjects)
{
if (ImGui::Begin("Game Ojects", &showGameObjects))
{
static int selected = -1;
for (int i = 0; i < meshList.size(); i++)
{
if (ImGui::Selectable(meshList[i].name.c_str(), selected == i))
{
selected = i;
pickedTarget.index = i;
XMVECTOR s, r, t;
XMMatrixDecompose(&s, &r, &t, meshList[i].worldMat);
XMVECTOR dist = XMVector3Length((cam.GetPositionXM() - t));
XMFLOAT3 dis;
XMStoreFloat3(&dis, dist);
pickedTarget.distance = dis.x;
}
}
static char buf[64] = "";
ImGui::InputText("Rename", buf, 64);
if (ImGui::Button("Rename", ImVec2(120, 30)))
{
if (strlen(buf) != 0)
meshList[pickedTarget.index].name = buf;
}
The text was updated successfully, but these errors were encountered:
As you have two widgets with the same identifier, maybe the Button() is overriding some properties of the InputText() call. Try to replace the button call with e.g. ImGui::Button("Rename##2", ImVec2(120,30)) and read the FAQ about identifiers and the ID stack.
I have the code below. I have to hold down the mouse button on the input box to be able to type in it. Otherwise it looks like it gets focus for a second then loses it. What do I do about this?
The text was updated successfully, but these errors were encountered: