-
Notifications
You must be signed in to change notification settings - Fork 44
Updated Pull request targetting [Base] #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated Pull request targetting [Base] #20
Conversation
Updated the `HowTo_ChangePitchAndVolume.md` file to enhance readability and clarity of the code and instructions. Changes include bold formatting for method and class names, added explanations for pitch and volume concepts, `using` statements, fields for sound effect and its properties, and modifications to the `Game.LoadContent` method. Also included notes on sound looping, state checking, and usage of `MathHelper.Clamp` method. Extended example added for key press detection and sound effect adjustment. Updated the copyright year to 2024. The subproject commit in MonoGame has been updated to `81ed391a4d0fd81e3ee4bfe2492ad9a0e7f4cfc5`.
Updated the heading "An extended example" to "An Extended Example" for improved readability and consistency in capitalization. Added a new method "IsKeyPressed" under the "Game.Draw" method to check if a specified key is pressed, returning a boolean value.
…ub.io into documentation-reviews
…ub.io into documentation-reviews
…e7777/docs.monogame.github.io into documentation-reviews
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor updates and reviews.
Make sure to always build the site locally to watch for broken links or bad API references before submitting
- dotnet tool restore
- dotnet docfx docfx.json --serve
|
||
2. In the [Game.LoadContent](xref:Microsoft.Xna.Framework.Game.LoadContent) method, set the **SoundEffectInstance** object to the return value of [SoundEffect.CreateInstance](xref:Microsoft.Xna.Framework.Audio.SoundEffect.CreateInstance). | ||
|
||
3. In the **[Game.LoadContent](xref:Microsoft.Xna.Framework.Game.LoadContent)** method, set the **SoundEffectInstance** object to the return value of **[SoundEffect.CreateInstance](xref:Microsoft.Xna.Framework.Audio.SoundEffect.CreateInstance)**. We also optionally define a variable **soundFile** to store the location of the sound file being used with the **[TitleContainer.OpenStream](xref:Microsoft.Xna.Framework.TitleContainer#Microsoft_Xna_Framework_TitleContainer_OpenStream_System_String_)** method, which is accessed with the **using** keyword, and include a field member variable called **soundEffect**, to hold the stream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text does not match the code below, consider revising
> [!NOTE] | ||
> Usings are declared at the top of the file to ensure that the necessary namespaces are available to the class. The fields are declared at the top of the class to ensure that they are accessible to all methods in the class. | ||
|
||
2. In the [Game.LoadContent](xref:Microsoft.Xna.Framework.Game.LoadContent) method, set the **SoundEffectInstance** object to the return value of [SoundEffect.CreateInstance](xref:Microsoft.Xna.Framework.Audio.SoundEffect.CreateInstance). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated SoundEffectInstance to SoundEffectInstance to match the styling used elsewhere in the doc. Please ensure to use consistent styling when referring to elements or classes.
soundEffect = SoundEffect.FromStream(soundfile); | ||
soundInstance = soundEffect.CreateInstance(); | ||
``` | ||
|
||
3. Adjust the sound to the desired level using the [SoundEffectInstance.Pitch](xref:Microsoft.Xna.Framework.Audio.SoundEffectInstance.Pitch) and [SoundEffectInstance.Volume](xref:Microsoft.Xna.Framework.Audio.SoundEffectInstance.Volume) properties. | ||
4. Adjust the sound to the desired level using the [SoundEffectInstance.Pitch](xref:Microsoft.Xna.Framework.Audio.SoundEffectInstance.Pitch) and [SoundEffectInstance.Volume](xref:Microsoft.Xna.Framework.Audio.SoundEffectInstance.Volume) properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Text does not match the code, I suggest the code needs to change here.
|
||
## An Extended Example | ||
|
||
1. Below the **[Game.Draw](xref:Microsoft.Xna.Framework.Game#Microsoft_Xna_Framework_Game_Draw_Microsoft_Xna_Framework_GameTime_)** method, create a new method called **IsKeyPressed**, which will check if a specified key is pressed and return a boolean value of true if it has been pressed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the API references, as they work differently to the original XNA interpreter.
Note the change from
(xref:Microsoft.Xna.Framework.Game.Draw)
To
(xref:Microsoft.Xna.Framework.Game#Microsoft_Xna_Framework_Game_Draw_Microsoft_Xna_Framework_GameTime_)
Browse the API docs on the website to get the Method links
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which site?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need a quick hand at how to make the # extension not done web anchors in 15 years... and was unable to find that anchor...
Chapter 18: Texture Sampling
HowTo_ChangePitchAndVolume.md
file to enhance readability and clarity of the code and instructions.using
statements, fields for sound effect and its properties, and modifications to theGame.LoadContent
method.MathHelper.Clamp
method.81ed391a4d0fd81e3ee4bfe2492ad9a0e7f4cfc5
.