Как включить звук при наведении в Dear ImGuiC++

Программы на C++. Форум разработчиков
Anonymous
Как включить звук при наведении в Dear ImGui

Сообщение Anonymous »

Как добавить:
menuSound.loadSound("hover_sound", "Audio/Sound/button_hover_sound1.wav", 0.5f);

звуковой эффект для всех кнопок в ImGui, чтобы при наведении на них курсора мыши издавался этот звук, пример:
if (ImGui::Button("Respawn", ImVec2(500, 60)))
{
menuSound.playSound("select_sound");
camera.cameraPhysics.position = glm::vec3(55.0f, 5.0f, 5.0f);
camera.cameraPhysics.velocity = glm::vec3(0.0f);

glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);

ImGui::End();
gui.endFrame();
return GAME_STATE_PLAYING;
}


Подробнее здесь: https://stackoverflow.com/questions/798 ... dear-imgui

Вернуться в «C++»