J
JFitch
Guest
If you create a sprite using sprite_add, is it possible to access it using asset_get_index?
I'm making a game in which the characters that are only available through in app purchases will be stored online so the game won't waste memory on them when they're not usable anyway.
The sprites are named so the character's name, direction (0 through 23), and state (standing, walking, punching, etc.) determine what sprite to use. This is how I set the sprite.
Is there a way to do that with sprites created using sprite_add?
I'm making a game in which the characters that are only available through in app purchases will be stored online so the game won't waste memory on them when they're not usable anyway.
The sprites are named so the character's name, direction (0 through 23), and state (standing, walking, punching, etc.) determine what sprite to use. This is how I set the sprite.
Code:
name = "johnfitch";
facing = 16;
state = "punching";
sprite_index = asset_get_index(name + "_" + string(facing) + "_" +state);
// This sets the sprite to johnfitch_16_punching.