This project is read-only.

Problem creating a screen (still!)

Jan 9, 2010 at 11:36 PM
Edited Jan 9, 2010 at 11:40 PM

I am still having trouble creating a Screen object. I receive a TypeInitializationException any time I try to call a Screen constructor. For creating a GUI project, will I need to reference anything other thanNuclex.UserInterface.dll?

I am using the binaries that you currently have up on the downloads page.

I am using your exact code from the Initialize() method in the UserInterfaceDemoGame project in my own new project without any success.

 

 

public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
GuiManager _gui;

public Game1()
{
graphics = new GraphicsDeviceManager(this);
_gui = new GuiManager(this);
Content.RootDirectory = "Content";
}

protected override void Initialize()
{
base.Initialize();

Viewport viewport = GraphicsDevice.Viewport;

//exception is thrown here
Screen mainScreen = new Screen();

_gui.Screen = mainScreen;
}
}

 

 

Jan 16, 2010 at 9:54 AM

Hi!

Sorry for the late reply, somehow CodePlex has stopped sending me email notifications on new posts (or my mail server stopped accepting them - will find out soon :S).

Does the example (Nuclex.UserInterface.Demo.exe) work?

 

You need Nuclex.UserInterface.dll, Nuclex.Graphics.dll and Nuclex.Support.dll (see the picture on the documentation page to quickly find out what needs what). Even though you're only interacting with Nuclex.UserInterface.dll, unless you also reference the other two, Visual Studio will not copy them into the project's bin\x86\debug|release folder. That's one of the annoying issues with using binaries in Visual Studio...

Jan 16, 2010 at 6:25 PM

That exactly what I needed. I wasn't referencing the other two DLL's. Thanks!