Skip to content

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

Conversation

SimonDarksideJ
Copy link
Collaborator

@SimonDarksideJ SimonDarksideJ commented May 29, 2024

  • 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.

MrValentine7777 and others added 6 commits May 29, 2024 04:43
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.
Copy link
Collaborator Author

@SimonDarksideJ SimonDarksideJ left a 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.
Copy link
Collaborator Author

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).
Copy link
Collaborator Author

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.
Copy link
Collaborator Author

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.
Copy link
Collaborator Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which site?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

@SimonDarksideJ SimonDarksideJ merged commit 1a29b79 into MonoGame:feature/docsmigration May 30, 2024
@SimonDarksideJ SimonDarksideJ deleted the documentation-reviews branch May 30, 2024 14:30
SimonDarksideJ pushed a commit to SimonDarksideJ/docs.monogame.github.io that referenced this pull request May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants