I’m getting started with C# and XNA. All I’m trying to do right now is figure out how to split up the game’s code between multiple classes instead of just cramming it all into a single one.
I think I’ve managed to get everything else working right now, but I cannot for the life of me figure this out. I’ve done about two hours of browsing for the answer to this, and only ended up so much more frustrated as I seem to be having a different kind of problem.
The error is: “An object reference is required for the non-static field, method, or property Summoner_Quest.TextControl.Draw()“
My Game1 class can be viewed here: http://pastebin.com/Wq9S1sFu
My TextControl class can be viewed here: http://pastebin.com/49fSSm27
Some of the answers I’ve seen involved changing a method from static to non-static or vice-versa. Making my TextControl method static is the closest I’ve gotten to “fixing” it, but then the compiler yells at me until I remove about half the code within the method. But I’m pretty certain that’s not the solution I’m looking for.
Thank you for taking the time to read my post. Any help would be greatly appreciated.
You need to create an instance of your TextControl class. So somethinglike.