• Advertisement
Sign in to follow this  

Level Editor using XNA Studio 4.0

This topic is 1686 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Edited by lucky6969b

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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);
}
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement