I am currently trying to create muliple instances of a MenuEntry class in a ScreenManager program and only draw specific instances. I create these instances like so:
private MenuEntry menuEntry = new MenuEntry("text", new Vector2(200,200), Color.Black);
Then I add all of these to a static list of menu entries called 'entries'.
MenuEntry.entries.Add(menuEntry);
These instances are in many different classes like a MainMenu class, OptionsMenu class and so forth. So instead of calling Draw() foreach of these instances and want to use a foreach loop so something similar like so:
foreach (MenuEntry entry in MenuEntry.entries)
{
entry.Draw(spriteBatch);
}
However, I only want to draw the instances in one class at a time.
So, my question is can I draw specific instances on MenuEntries without reffering to each and every instances.
Sorry if that was a bit confusing but it was my first time positin here.
I have thought about making a scope class or method or something, but I don't know where to start.
Any help appreciated,
Daniel

New Topic/Question
Reply




MultiQuote




|