Pfap
Member
When I run this in a draw event I get a crashing error
The sprite visual_guide is drawn fine until global.my_turn is set to false; at which point the game crashes and I get the trying to draw non-existing sprite error.
I'm not sure what's going on and I don't think it's a bug. I have 3 other objects with draw events in the room and I've also imported a lot of sprites by using the add existing option and grabbing stuff from other projects.
Also, I found a work around by setting the sprite_index of the object from the resource tree and then running this.
Just wondering if anybody has any insight as to what could be going on here? Or if it could be my resource tree is messed up somehow?
Code:
if global.my_turn{
draw_set_valign(fa_middle);
draw_set_halign(fa_left);
draw_sprite(32,64,0,visual_guide); }
else{
draw_set_valign(fa_middle);
draw_set_halign(fa_right);
draw_sprite(256,64,0,visual_guide); }
}
I'm not sure what's going on and I don't think it's a bug. I have 3 other objects with draw events in the room and I've also imported a lot of sprites by using the add existing option and grabbing stuff from other projects.
Also, I found a work around by setting the sprite_index of the object from the resource tree and then running this.
Code:
if global.my_turn == false{
//this object's x = 256 y = 64
draw_self();
}