Quote Originally Posted by Wiering View Post
Interesting to read a thread like this...
@Ñuño Martínez, sorry for not replying, I don't remember ever seeing your mail.
Don't worry. You're here now!

Quote Originally Posted by Wiering View Post
Anyway, I've tried get Tile Studio to compile in Lazarus many times over the years and always failed, until this time.

Now I got the tile editor working (almost) completely. The map editor however doesn't do much. There are some really strange things going on with the Canvas.Draw function with transparent bitmaps.
I know, I had the same problems. No idea why it doesn't work correctly.

Quote Originally Posted by Wiering View Post
It took me quite a while to figure out that the behavior of TabControl.TabIndex and Form.Resize are different from Delphi in whether events are fired or not. I don't know if such things are bugs or maybe intentional choices.
I recommend to use TPageControl instead. The advantage is you don't need to "draw" the stuff by yourself tracking the tab changes. The bad thing is that it may need more memory but I think it is not your case.

Quote Originally Posted by Wiering View Post
Anyway, the newest source code is available on github: https://github.com/Wiering/Tile-Studio/tree/lazarus, maybe some of you lazarus experts immediately see what the issues are, any help would be appreciated!
Ok, I've look at the GitHub project and I have to say something:

Use subdirectories! Please. "src" for sources and "bin" for the final binary. And "docs" for documentation. Really, it will help a lot.

The main problem I had when I worked with your code is that most of it is in the main form. That mean thousand controls and it's hard to keep track of they all. You should split the stuff, using TFrame for different control groups (i.e. I did a TFrame for the "brush" selector, another one for the tiles selector, etc). This will also group your code and increase the order.

Also separate "logic" and "GUI" should help too. For example, split the "tile selector" in two units, one for the logic (i.e. add, remove, replace, load, save...) and the other will be the GUI that just renders the tiles and allows the user to select one of them.