Skip to content

Conversation

msosav
Copy link
Contributor

@msosav msosav commented Sep 4, 2025

This pull request makes minor improvements to the sprite drawing code examples in the HowTo_Draw_Sprite_Background.md documentation. The changes clarify how to use the SpriteBatch.Draw method by specifying the position and color parameters, to fix the error CS1501: No overload for the method Draw takes 1 arguments .

  • Documentation improvements:
    • Updated the usage of _spriteBatch.Draw in code examples to include explicit Vector2.Zero for position and Color.White for color. [1] [2]

@msosav msosav marked this pull request as ready for review September 4, 2025 18:17
@AristurtleDev
Copy link
Contributor

Would recommend the following in addition to this within the same PR.

  1. The How To Draw A Sprite has a note admonition about assuming the reader has already read the create a new project tutorial.

> [!NOTE]
> The tutorial assumes you have already [created a new MonoGame project](https://docs.monogame.net/articles/getting_started/index.html#2-creating-a-new-project) using one of the standard templates.

Add a similar admonition to the How To Draw A Sprite Background stating that the page assumes the reader read the previous article on drawing a sprite (in general)

  1. In the How To Draw A Sprite article, update the admonition about using Color.White to further clarify that this value is used for tinting and that tinting is covered in the How To Tint A Sprite article

> [!TIP]
> [Color.White](xref:Microsoft.Xna.Framework.Color) is used to draw the texture without any color effects.

Copy link
Contributor

@AristurtleDev AristurtleDev left a comment

Choose a reason for hiding this comment

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

These changes do fix the code bug, so given that I would approve these changes. Please see my other comment as well, and @SimonDarksideJ if you have any thoughts on that

@msosav
Copy link
Contributor Author

msosav commented Sep 8, 2025

Hello @AristurtleDev 😄

Just made the changes you suggested, I think they help on clarifying a little bit more the documentation.

Thanks!

Copy link
Contributor

@AristurtleDev AristurtleDev left a comment

Choose a reason for hiding this comment

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

Just an adjustment on the links

@msosav
Copy link
Contributor Author

msosav commented Sep 9, 2025

Hello @AristurtleDev !

Just fixed the URLs and changed them to be relative to the file.

And I also changed one of the URLs that was also hardcoded in the HowTo_Draw_A_Sprite.md file.

@SimonDarksideJ SimonDarksideJ merged commit 1682939 into MonoGame:main Sep 11, 2025
2 checks passed
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.

3 participants