Hi folks. Question of the day:
I have a sprite class which currently runs on a single sprite sheet. It self advances and retreats as needed, works lovely.
But at present the Parent class holds the Texture, the child just holds pointers and returns an empty Rectangle for the draw routine to use.
I’m now at the point where some sprites are needing multiple sheets. I want to pass all the sheets to the class and store them in a list, but this poses a problem. This means the child class has to pass a texture back to the parent class for drawing.
Or is this a problem? Is creating the required texture in the child class going to be that expensive?
At the moment it’s only one sprite in the game that needs to be coded this way, but I’d like to unify the code as much as possible, meaning many, many sprites will work this way.
From looking around it looks as if I can either create a Render Target, or copy the data with SetData.
Do you folks have any views on which way to go? I need to contain the code in the child class otherwise the parent class is going to get out of control!
Thanks.