1
Vote

Custom Sprites, Levels and Animation have to be in the executing or calling assembly to be loaded

description

Custom Sprites, Levels and Animation can be loaded in Agro2D at the moment, but, only as long as they are in the executing or calling assembly.
The ones in Agro2D aren't a problem.
 
Common usage would be :
Agro --> MyGame - which works fine (make sure the namespaces are specified)
but
Agro2D and MyLib -> MyGame (MyLib containing a custom Sprite, Level or animation) - wouldn't be the executing or calling assembly and there for nothing would be loaded.
 
One way around this, we think at the moment, is by passing in a reference to the Type from the assembly. This could be passed into SpriteFactory/LevelManager; there might be
multiple assemblies (libraries) included in the executing projects, each one of these could be registered with Agro2D.
I've seen in C++ projects the use of:
bool registered = SpriteFactory.RegisterClass("rocket", createRocket);
createRocket being
Sprite CreateRocket()
{
return new Rocket();
}
 
This could be done, but perhaps just return typeof(Rocket).
 
The other option is to have an attachable event when a Sprite (for example) is created so that this can return the correct sprite.

comments