Friday, July 2, 2010

Progress Report #1

Finished editing the TileLayer class to handle its own rendering. It makes more since, since the class should handle its own behavior. Now working on getting more tools functional, and some clipping mask tools.

Went ahead and typed up a description of the Tile Writing Pipe-line for the eventual Developer's Guide for the editor.

There are 4 steps the tile writing pipeline:
1. The user either clicks or drags their mouse on the map. From this event the program calculates a rectangular area formed by a primary point, and a secondary point, the primary point being the rectangles upper left corner and the secondary point the rectangles bottom right corner. If the mouse event was a drag, the point where the mouse was first pressed becomes the primary point and the point where the mouse was released the secondary point. If the event was a click, that point becomes the primary point, and the secondary point just the primary point offset by the dimensions of the bounding rectangle of the currently selected tiles.

2. The rectangular area is passed to the SelectionShapeModifier which alters the rectangle further based on user preferences, for example making the selection proportional, or centering it on the primary point.

3. Next the rectangle is passed to the active SelectionTool, which decides which points within the rectangular area are part of the final selection, and which are not. Examples include Rectangular, Elliptical, and Flood Fill selection.

4. The Selection is then passed to a tile writer. Most tile writers do a final comparison against a mask to determine which parts of the selection make it to the underlying TileLayer.

No comments:

Post a Comment