Editor:Proposal:Geometry tool

From FIFE development wiki
Jump to: navigation, search

This article is outdated and is just stored for archive purposes. Archived.png

This article became outdated and is just stored for archive purposes in this wiki. There are several reasons why an article could become outdated. The development team may have decided to use a different concept or even the author itself felt that the article is not really up-to-date with the current development status of the project anymore.

Geometry tool

Purpose

The geometry tool could be used as an example tool to find out which programming language / GUI toolkit is suited for our editor. The geometry tool should provide a simple way to create new map geometries, embed them into existing maps and save the maps after that.

For the record: Currently, there is a similiar tool in the FIFE SVN available - the geometry twister. It's a standalone python/Tk app.

Mockup

Geometry tool

Explanation

Geometry browser

This part of the geometry tool features two basic widgets: the first one is an "open file"-dialogue for opening existing FIFE XML maps. The second widget is the browser itself; it'll display the geometries that the editor extracted from the map that was opened with the "open file"-dialogue.

Required information

This part of the geometry tool contains all the required information that is necessary to define a FIFE geometry. That includes:

  • ID: The ID for the geometry. This ID will be used when the geometry will be embedded into a map.
  • Type: Point or rectangular geometry. For more details, see the Map Geometry article.
  • Size: X & Y size for the bounding box of the geometry.

Geometry preview window

This area of the geometry tool is responsible for drawing a preview image of the currently defined geometry. There are two options:

  1. Auto-update: update the preview window everytime a new geometry is chosen in the geometry browser and when the geometry data (required and optinal information) has been changed.
  2. Just update the preview windows if the user presses the "Update preview window"-button beneath.

Geometry preview options

While the "Update preview window"-button forces the preview window to update (maybe just useful if we decide to now go for an auto-update approach of the preview window), the "Show geometry in fullscreen"-button creates a new 640*480 window with the current tile geometry. In fullscreen mode not a single geometry element is displayed but the whole grid. This way it's easier to see if the grid elements fit together or if there are wholes in the geometry. One grid element is highlighted in fullscreen mode; see: fullscreen mockup.

Optional information

This part of the tool is responsible for all kind of geometry information that isn't absolutely necessary but optional for defining FIFE geometries. This includes:

  • Tranform: X and Y tranform values.
  • Shift: X and Y shift values.
  • Flags: enable / disable special geometry flags (unfortunately not documented in the current Map Format article).

Save / apply

Here are the options to save / apply the geometry to a map:

Save selected geometries to active map

Saves the geometries that have been selected in the geometry browser window to the current map file. If there are other geometries in the map that share the same geometry ID, the editor should ask if it should overwrite the IDs from the map with the IDs from the geometry tool. You should also have the option to simply assign a new geometry ID in case there are ID collisions.

Create new layer with the current geometry

Adds a new layer to the currently active elevation of the map and uses the geometry that has been defined in the geometry tool for it.

Apply current geometry to active layer

Applies the currently defined geometry from the geometry tool to the currently active layer in the currently active elevation. This option will overwrite the geometry setting of the layer but will NOT delete the geometry that the layer has used before you changed the geometry.

Phasing