Progress on Map.NET

Published May 19, 2007
Advertisement
Map.NET


I'm pretty pleased with the progress on Map.NET really. The fiddly bit of drawing the map, scrolling it around, click-dragging a region with the mouse and filling it with blocks is all done.

I couldn't find a built in component that would display the available blocks that was what I wanted, so I implemented the palette above myself. It is based on the Visual Studio C# component panel and highlights the selected item as well as the item being hovered over.

It automatically scales down the associated image so it fits in a 32x32 square, which looks pretty good.

I decided to not have it own its list of components, so it has a few delegate functions that call back its owner (the main form in this case) to retrieve the total count of items, the image and text for each item and the currently selected index.

The idea is that the same palette will be able to display item templates instead of blocks when the item tool is selected. To implement this, I can just make the main form functions that are assigned to the palette's delegate members return the item information instead of the block information.

Should work.

[LATER]

Cut, copy, paste and delete all work on the map cells now. Cut and copy load the clipboard in a format that you can paste into Excel as well which is quite cool.

There's a Tools toolbar down the left of the main window too. Only "Select Cells" and "Paint Cells" implemented at the moment.
Next Entry Properties
0 likes 2 comments

Comments

Mushu
I think there's some hackish way to get a ListView object to look sorta like that (though not nearly as nice). It looks good though. I really need to look up how to create new controls and stuff, I've always been really daunted by that :[
May 19, 2007 09:15 AM
Aardvajk
Quote:Original post by Mushu
I think there's some hackish way to get a ListView object to look sorta like that (though not nearly as nice). It looks good though. I really need to look up how to create new controls and stuff, I've always been really daunted by that :[


I haven't actually created a new control. I'm very daunted by that as well [smile].

It's just a form with a PictureBox and a VScrollBar. It implements like the PictureBox Paint(), MouseMove(), MouseLeave() and MouseDown() events.

Nothing too clever really. I'd love to know how to build that into a reusable control I could plonk on the form at design time.
May 19, 2007 09:49 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement