Update documentation of creating Music and Cursor

This commit is contained in:
copyrat90 2024-06-11 16:23:05 +09:00 committed by Lukas Dürrenberger
parent 571eee359f
commit 37ac80dbe5
3 changed files with 5 additions and 14 deletions

View File

@ -29,9 +29,7 @@
/// sf::Text text(font, "Hello SFML", 50);
///
/// // Load a music to play
/// sf::Music music;
/// if (!music.openFromFile("nice_music.ogg"))
/// return EXIT_FAILURE;
/// auto music = sf::Music::openFromFile("nice_music.ogg").value();
///
/// // Play the music
/// music.play();

View File

@ -299,14 +299,8 @@ private:
///
/// Usage example:
/// \code
/// // Declare a new music
/// sf::Music music;
///
/// // Open it from an audio file
/// if (!music.openFromFile("music.ogg"))
/// {
/// // error...
/// }
/// // Open a music from an audio file
/// auto music = sf::Music::openFromFile("music.ogg").value();
///
/// // Change some parameters
/// music.setPosition(0, 1, 10); // change its 3D position

View File

@ -245,9 +245,8 @@ private:
///
/// // ... create window as usual ...
///
/// sf::Cursor cursor;
/// if (cursor.loadFromSystem(sf::Cursor::Type::Hand))
/// window.setMouseCursor(cursor);
/// const auto cursor = sf::Cursor::loadFromSystem(sf::Cursor::Type::Hand).value();
/// window.setMouseCursor(cursor);
/// \endcode
///
/// \see sf::WindowBase::setMouseCursor