In-Game: sprite_delete() after drawing that sprite in the same event makes the sprite fail to draw #8598
Labels
documentation
Improvements or additions to documentation are required by this issue
project
This issue has a sample project attached
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
35cfbada-ab70-42b0-bcca-aca90754a500
The text was updated successfully, but these errors were encountered: