Level Editor using XNA Studio 4.0

Started by
4 comments, last by lucky6969b 10 years, 10 months ago

Hello,

If I am using the XNA studio, how can I get a panel in the middle of the form and click button down the bottom.

As you see, XNA will populate game content to the whole window. As I am writing a level editor here, I need some interaction between the contents and some controls. If not possible, I would revert back to Direct3D using C#, but it doesn't seem to be any documentation available.

Let me know

Thanks

Jack

Advertisement

I'm not sure i understand ...

Are you asking how to make the GUI Controls, or how to make objects interact with the GUI Controls?

If your just in XNA you'll have to make the GUI controls yourself, or use WinForms or WPF.

As for interaction, there are hundred of ways depending on the GUI you use.

In order to do what you want you will have to use a WinForm project and drop in two files that will allow you to use the XNA graphics. You need to get GraphicsDeviceService.cs, and GraphicsDeviceControl.cs, you can find these in an example project on AppHub. Then when you drop your mapdisplay in the WinForm you do something like the following:


class MapDisplay : WinFormsGraphicsDevice.GraphicsDeviceControl
{
public event EventHandler OnInitialize;
public event EventHandler OnDraw;

protected override void Initialize()
{
if (OnInitialize != null)
OnInitialize(this, null);
}

protected override void Draw()
{
if (OnDraw != null)
OnDraw(this, null);
}
}

Take a look at Nick Gravelyn's Tile Editor series, he makes an editor using Winforms (Editor start at tutorial 3B)

">

you could also check out this tutorial site for XNA 4.0, this is where I got my Editor information:

http://xnagpa.net/xna4/rpgtutorials/xna4rpgtutorial11a.pdf

thanks

This topic is closed to new replies.

Advertisement