Sign in to follow this  
Followers 0
lucky6969b

Level Editor using XNA Studio 4.0

5 posts in this topic

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
0

Share this post


Link to post
Share on other sites

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.

0

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);
}
}
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0