Sign in to follow this  
kubapl

XNA Level Editor

Recommended Posts

Hi. I'm making a 2D level editor (something similar to the starcraft editor) in XNA for a game I am working on. And I was wondering what item from the toolbox should I use for the map so if I drag and drop onto it it'll update and show the object on it.

Share this post


Link to post
Share on other sites

For this you'll either need to create a custom control (don't know the exact terminology, but one where you override OnPaint) and paint the stuff you want yourself using GDI. Another option which takes a bit more work to set up, but is probably more useful in the long run, would be to host an XNA game on a Control. For more information on that, go here.

I'd go with the 2nd option, since you'll likely can reuse a lot of XNA code then which you'll already have to draw the level in the first place. It also allows for a bit of WYSIWYG editing, meaning the user will see the world in the editor as it will appear in the game, which is a nice convenience.

Hope this is the info you were looking for :)

Share this post


Link to post
Share on other sites
What you'll probably want to do is have a class that derives from Control that will serve as the "view" for your map, which you can embed in your main Form. If you want this control to be able to handle drag and drop, you'll need to handle the DragDrop event (along with a few others).

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