I've set myself the task of scripting a tile editor. Firstly though, I thought I'd take a look at some other tile editors and base my first attempt on what I can gather from them. I took a look at
oo_jazz_oo's editor and coded my own from what I saw in his.
Basically, the editor works when it comes to laying tiles and such. That part I found easy. I'm quite embarrassed to say that the part I'm finding the most difficult to perfect is drawing the selecting border correctly and setting the selected tiles by dragging and such. There's a lot of math going on, and that isn't my strong point.
Here's a list of current buys I currently have.
- Selecting tiles from the tileset image isn't working 100& correctly. It sometimes flicks back and doesn't position itself correctly.
- After selecting tiles, the selecting border doesn't always go away and doesn't select the tiles correctly. This usually happens when drawing sideways-right rectangles.
- When scrolling to select tiles on the other side of the panel, the GUI control detects the onMouseDown event and begins to select tiles while I'm using the scroll bars.
And here's a list of what I still need to add.
- Selecting tiles from the level. It's only currently possible to select tiles from the tile editor, which is quite annoying.
- Showing the player's current selection while the mouse is outside the drawing panel control.
- Flood filling.
I'd like to say thank you to Dusty for his
ImageToTile() function, and also oo_jaz_oo for his editor, so I could study it.
If anybody is able to help me out fixing these bugs, I'd be grateful!
Level Editor Code