Skip to content
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

Manual Content: sprite_delete() should be documented that calling in the same event after drawing a sprite makes that sprite fail to draw #8598

Closed
gm-bug-reporter bot opened this issue Dec 2, 2024 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation are required by this issue project This issue has a sample project attached
Milestone

Comments

@gm-bug-reporter
Copy link

Description

Calling sprite_delete on a sprite in the same step/event after drawing it results in the sprite failing to draw, if the vertex batch hasn't been broken. (In the attached sample project, it results in drawing solid white.)

Deleting it in a subsequent event, such as Draw End or the next step's Draw, and there isn't a problem. Breaking the vertex batch also lets that batch draw correctly.

Unsure if this is a bug or intended behavior - if intended, I don't see any warning against doing it in the manual, not in https://manual.gamemaker.io/monthly/en/GameMaker_Language/GML_Reference/Asset_Management/Sprites/Sprite_Manipulation/sprite_delete.htm or elsewhere.

Otherwise, sprite_delete maybe should break and submit the batch to draw?

Steps To Reproduce

Draw using an added sprite.
Delete the sprite in the same event without breaking the batch.

Which version of GameMaker are you reporting this issue for?

IDE v2024.800.0.618 Runtime v2024.800.0.642

Which operating system(s) are you seeing the problem on?

Windows 6.1.7601.0

Which platform(s) are you seeing the problem on?

Windows

Attached Files

  • screenshot.png

35cfbada-ab70-42b0-bcca-aca90754a500

@gm-bug-reporter gm-bug-reporter bot added project This issue has a sample project attached runner-bug In-game bugs with the "GameMaker Studio 2" runtimes labels Dec 2, 2024
@YYDan YYDan changed the title Calling sprite_delete after drawing it in the same event makes it fail to draw In-Game: sprite_delete() after drawing that sprite in the same event makes the sprite fail to draw Dec 3, 2024
@stuckie stuckie added documentation Improvements or additions to documentation are required by this issue and removed runner-bug In-game bugs with the "GameMaker Studio 2" runtimes labels Dec 3, 2024
@stuckie
Copy link

stuckie commented Dec 3, 2024

You may need to do a draw_flush before deleting the sprite.

@stuckie stuckie moved this from Triage to Backlog in Team Workload Dec 3, 2024
@gurpreetsinghmatharoo gurpreetsinghmatharoo moved this from Backlog to Todo in Team Workload Dec 9, 2024
gurpreetsinghmatharoo added a commit to YoYoGames/GameMaker-Manual that referenced this issue Dec 9, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Team Workload Dec 9, 2024
@gurpreetsinghmatharoo gurpreetsinghmatharoo moved this from Done to Ready for QA in Team Workload Dec 9, 2024
@YYDan YYDan changed the title In-Game: sprite_delete() after drawing that sprite in the same event makes the sprite fail to draw Manual Content: sprite_delete() should be documented that calling in the same event after drawing a sprite makes that sprite fail to draw Dec 9, 2024
@YYDan YYDan added this to the 2024.11 milestone Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation are required by this issue project This issue has a sample project attached
Projects
Status: Ready for QA
Development

No branches or pull requests

3 participants