Flat Environment Specification 2.0

This document covers environment specifications that are compatible with Flat v5 and higher.
These specifications are ignored by earlier versions of flat, so the file format is mostly backward-compatible.
However, earlier versions of Flat are picky about the number of spaces between arguments. Flat v5 and higher are not.

FLAT Environment Extensions v2.0

All of the previous documentation is still valid. In version 2.0, some limitations have been eased and options for color and filled objects have been added.

Extended syntax

Each "%_gdraw_" line specifying an object may be followed (on a separate line) by an "%_options:" line specifying one or more of the options described below. The options apply only to the object defined by the previous gdraw line. The bodyColor option may be used with any object, but the other options are valid only for rectangle, polygon, circle or arc objects. Only one option line may be specified for each object.

Format restrictions removed

The previous version of the environment file required exactly one space after some commands, such as polygon, and between some pairs of numbers. This is no longer true. Any number of spaces may in these locations. In addition (and like the previous version) this version accepts "polygon" and "rectangle" as synonyms for "poly" and "rect", respectively.

Table of options 2.0

Color arguments are hex strings of the form rrggbb.
Options are specified in the form option=value, for example: filled=true.

option Arguments DESCRIPTION
filled true or false Draws a filled object with an outline rather than just an outline.
The outline and the body can be different colors.
Used only with rectangle, polygon, circle and arc objects.
outlineColor hex value RRGGBB Specifies the color of the object outline.
Used only with rectangle, polygon, circle and arc objects.
bodyColor hex value RRGGBB Specifies the color of the object body.
Can be used with all objects.

Example file

The following environment is from /u/robot/flat-root/flat5/env/test-all-2.env, which generates an environment that looks like this:

# -----------------------
# BOUNDING BOX
%_gdraw_ rect    5 5 500 275
%_options: outlineColor=44FF44
# -----------------------
# ARCS - are not recognized by the sonar simulator.
#    filled arc
%_gdraw_ arc     70 100 80 60 320 175 
%_options: filled=true outlineColor=FF0055 bodyColor=FFAA55
%_gdraw_ string  "Arc1" 35 100
%_options: bodyColor=FFAA55
#    non-filled arc
%_gdraw_ arc     80 50 80 60 320 145 
%_options: outlineColor=FF0055
%_gdraw_ string  "Arc2" 80 35
%_options: bodyColor=FF0055
# -----------------------
# CIRCLES - are not recognized by the sonar simulator.
%_gdraw_ circle  220 100 40
%_options: filled=true  outlineColor=aabbcc bodyColor=aabbcc
%_gdraw_ string  "Circle" 200 93
%_options: bodyColor=FFFFFF
# -----------------------
# CONNECTED LINES
%_gdraw_ lines 320 70 420 140 420 70 320 140
%_options: bodyColor=55dd99
%_gdraw_ string  "Lines" 384 98
%_options: bodyColor=55dd99
# -----------------------
# POLYGON
%_gdraw_ poly 100 150 130 150 148 175 148 200 130 230 100 230 82 200 82 175
%_options: filled=true  outlineColor=000000 bodyColor=aaccbb
%_gdraw_ string  "Poly" 100 180
%_options: bodyColor=000000
# -----------------------
# POINTS
%_gdraw_ point    215 220
%_options: bodyColor=000000
%_gdraw_ point    220 220
%_options: bodyColor=444444
%_gdraw_ point    225 220
%_options: bodyColor=888888
%_gdraw_ point    230 220
%_options: bodyColor=CCCCCC
%_gdraw_ string  "Points" 200 195
%_options: bodyColor=000000
# -----------------------
# RECTANGLE
%_gdraw_ rect    300 180 105 30
%_options: filled=true  outlineColor=000000 bodyColor=ddbb22
%_gdraw_ string  "Rect" 340 190
%_options: bodyColor=000000
# -----------------------


[FLAT home]


Author: Micheal S. Hewett
Email: hewett@cs.utexas.edu
Last Updated: Thursday, March 11, 1999