xna - Is there a way to tell if SpriteBatch.Begin has been called on a particular SpriteBatch object? -
I have recently started playing with XAN and nothing about this question has been found on the web. . Can you tell whether SpriteBatch.Beggin (and vice versa) has been called on a special Spritebatch object?
For the moment, I am using only one essentially Global SpriteBatch object for the system, mainly because it is the preferred method of articles I read. I'm assuming that creating a spritebatch example for each object will cause too much upper part, anyway, I'm having trouble keeping SpriteBatch. Especially when drawing objects can have other drawing objects. If I could check whether the start / end has been called, then my problems go away. I think I can try something like sub-clinging of Spriteback class, but I think that this operation is so basic that there must be a built-in method to tell. I could not understand how.
Thank you for any information you can provide!
If you take a look at this link, then I think this will answer your question. Sorry, if the link is a different version than the one you are using:
As the developer does find out that if they are writing then the code will start and end Will be You want to make sure that you hold "everything" until you "start" that call and then want to draw it.
In addition to this you can see some articles on "Game Loop" and how it works, it will help you to understand how to code in such a way that you do not have this problem.
Hope it helps !: -)
For example, create an interface, which you can get from which is the draw method. In the loop, make sure you rotate through all the objects (which is the interface ) And your drawing method is called within the initial lines. The code can be directed to the code within each object, but you should know when it will be said.
Comments
Post a Comment