[Completed] [Level Editor] A few questions on concepts I'm not sure of.

EDIT: Maybe a bit of break is all I needed. :cranky: It’s futile continuing to think without taking some rest. Thus, I’m also modifying some parts of the questions.

I have somewhat created a level editor for my Pokémon Walking project.

This is all just a basic setup for creating a new area. I’m fed up with myself having to use Paint.NET to draw almost completely transparent data onto bitmaps, so I decided to create my own custom level editor.

The top part of the editor is the main toolbar for creating, saving, and opening a game area.
On the left of the editor is the Tiles Selection Panel, where all the tiles are stacked together neatly. I can choose what tiles I wanted by clicking on the tiles.
In the center is the Editor Canvas, where it is showing a white BufferedImage bitmap in the center. I can pan the bitmap around by dragging it with my right mouse button.

Now, the problems I am having are issues and “writer’s blocks” all jumbled up together the moment I notice them. I’ll list the things I know of after I had taken a break from tinkering the editor out below:

  • Apparently, panning is good. It’s great for moving around the map in an intuitive way. One sure thing, is that it adds complexity to a simple algorithm:
y * imageWidth + x = pixel located at (x, y)

Therefore, I just need to know how to tweak that algorithm above so that it works even after panning the whole canvas.

[list][li]I need to do some way of easily sorting all the messy data, into neat arrays. Then I can use that new data to create tile IDs so that the editor knows what I’m drawing.

  • Saving/Loading area map is for saving/loading files. That’ll do.

  • I am left with “how to draw tiles onto the white bitmap?” problem. Other than writing the RGB color to the raster, I have no other alternate methods of doing this. Any suggestions?

This is all I can think of. Now, I need help on the first and the last bullet-point issues I’m having. If anyone can tell me what I need to do, I’ll be grateful for your help.[/list]