Monday, December 10, 2007

Map Editor

I've made progress on the map editor. You can now edit tiles. There you go.

Anyway, it was hard work. I had to modify my listbox control. Originally it only displayed text for every element, so I had to split it in two: the first part is a base class that displays no text and each element is an object with unknown contents; the second inherits the first part, reading each element as a string, and displaying them on the box. The reason I did this is because I needed to use the base class without the text for displaying the tiles for the map editor.

Therefore, I made a second child of the listbox class, this one taking images with a caption, scaling them to fit in the element, and displaying them. Of course, the picture is the tile and the caption is the tile's name. This took some work because I had to make some decisions while I was at it. I had to rewrite some code a few times.

I also added some new functionality to the base Control class. Each control now has a 'Visible' property. Obviously, when set to false, the control disappears. I didn't do this before because I didn't need it. However, I need it for the map editor because the user is going to switch between edit modes (tiles, sprite objects, and geo-objects), each requiring a different toolbar. I'll only display the one being used.

For the tilesets and sprite object animation, I have each tile or frame in the same bitmap. So far, I've manually glued them together with Gimp. However, I just found a program that can do it automatically for me. This will save me alot of time. The only trouble was that it lines them up vertically while Sever was coded to read from left to right. But it wasn't hard to fix that.

Anyway, I'm getting there. Next step: sprite objects. After that, geo-objects. After that, grouping sprite objects with geo-objects. That's the daunting one. The idea is that you take something like my arch in the last post and draw a circular geo-object at each foot; then you can take that arch and put it in as many levels as you want without having to draw the geo-objects every time.

Progress has been made. Suggestions? Questions?

clevceo

No comments: