So fügen Sie in ImGui einen Hover-Soundeffekt hinzuC++

Programme in C++. Entwicklerforum
Anonymous
 So fügen Sie in ImGui einen Hover-Soundeffekt hinzu

Post by Anonymous »

Wie nehme ich diesen Soundeffekt:

Code: Select all

menuSound.loadSound("hover_sound", "Audio/Sound/button_hover_sound1.wav", 0.5);
Und stellen Sie es so ein, dass der Soundeffekt einmal abgespielt wird, wenn ich mit der Maus über eine ImGui-Schaltfläche fahre.
Beispiel für diese Schaltfläche:

Code: Select all

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;
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post