Im currently using Nuclex.GameWindow to make an editor for my game, however some of the GameComponents im using require passing a reference to a Game object in the constructor, and I cat find any reference to a Game class anywhere. Am I just being realy thick here, and missing it totally?
Not Possible
Bad news:
Because I cannot inherit from
Gameor otherwise fabricate aGameinstance from thin air, theGameComponentclass cannot be used. Sorry.I have written my own
GameComponentthat is identical in behavior and usage to the XNAGameComponentclass in every way except that its constructor expects aGameServicecollection instead of theGameclass, so it works with the XNAGameand with myGameComponent.You can get this class from here: Drawable.cs (required base class) and DrawableComponent.cs. An example using this class is here: DebugDrawer.cs, but except for the constructor, it's really 100% identical to the
GameComponentclass.So any component built off
So any component built off the XNA standard GameComponent class cant be used?
Bugger.
I know...
There are other solutions out there which will work with the standard
GameComponentclass but then break when you have more than one XNA control active.Until XNA 2.0 comes out, you can only choose between having a defective
Gameclass or working around the problem by the price of loosingGameComponentcompatibility :-/Post new comment