Skip to main content

Field types (regular)

Checkbox field

A checkbox for selecting TRUE or FALSE.

Emitted variable type: BOOL

Clip field

A pointer to a sprite clip art resource.

Emitted variable type: CLIP

Note: This field stores a manually chosen clip. If the symbol's figure is a clip, you probably want the figure clip field type instead.

Color field

A color palette index.

Emitted variable type: BYTE, PAIR, or INT

Special settings:

  • Initial value: The color for newly created symbols of this type.

Note: This field stores an arbitrary color. If the symbol's figure has a color, use the figure color field type instead.

Func field

A function pointer to a class constructor from your program.

Emitted variable type: TYPE ACTION IS FUNC()

For example, if the field set to (NEW THING), then the pointer can be used to create an object whose class is THING.

Special settings:

  • Example: An example class name to show in the preview of emitted code. (This name is just for informational purposes; it has no actual effect.)

Index field

Calculates the position of this symbol within a specified collection.

Emitted variable type: BYTE, PAIR, or INT

Special settings:

  • Collection kind: If the kind is global, then the collection is all symbols with this symbol type. If the kind is board, then each board has its own collection. In other words, the numbering starts over from 0 on each board.
  • Assign the same index to connected symbols: If checked, then "connected" symbols will get the same index number. They are considered "connected" if they are linked by a symbol field (in either direction) or a symbol buddy field.

Metric field

Calculates a visual measurement of the symbol's figure, such as its location or size.

Emitted variable type: BYTE, PAIR, or INT

Special settings:

  • Property: The value to measure: left X, center X, right X, width, half width, top Y, center Y, bottom Y, height, half height. For debugging, you also choose zero which is simply the constant value 0.
  • Relative to: Values such as left X or top Y are normally measured from the board's (0,0) location, called absolute coordinates. This checkbox makes relative coordinates by subtracting a specified property of another symbol. To specify that other symbol, this checkbox requires the symbol type to also have a symbol field, symbol buddy field, symbol children field, or symbol parent field.
  • Units: Board coordinates are normally measured in pixels. You can alternatively choose tile units (divide by 8) or jumbo tile units (divide by 16).

Tip: In the property pane, if you hover your mouse over a metric field, the pop-up tooltip will show its math formula, as well as the individual numbers being subtracted.

Number field

A number value.

Emitted variable type: BYTE, PAIR, or INT

Special settings:

  • Initial value: The number value for newly created symbols of this type.

Number Constant field

A number value that cannot be edited; it is the same for all symbols with this symbol type.

Emitted variable type: BYTE, PAIR, or INT

This field type is useful when the same class is emitted by different symbol types. For example, suppose you have two symbol types called TEXT_INPUT and NUMBER_INPUT, and they share most of the same fields. Your code might be simpler with a single emitted class S_INPUT:

CLASS S_INPUT
# 1 = TEXT_INPUT SYMBOL
# 2 = NUMBER_INPUT SYMBOL
VAR INPUT_KIND: BYTE

VAR TITLE: STRING
VAR X: INT, Y: INT

VAR MAX_LENGTH: BYTE # ONLY USED WHEN INPUT_KIND=1
END CLASS

The TEXT_INPUT and NUMBER_INPUT symbol types would each have a number constant field called INPUT_KIND to ensure 1 or 2 is emitted appropriately.

Special settings:

  • Constant value: The value of the constant.

String field

A text string value.

Emitted variable type: BYTE[] or STRING

Special settings:

  • Initial value: The text value for newly created symbols of this type. By default, it is an empty string.
  • Example: An example text string to show in the preview of emitted code. (This value is just for informational purposes; it has no actual effect.)

Symbol field

A link to another symbol on the board.

Emitted variable type: a custom class from your program

Special settings:

  • Symbol type: Specifies which symbol types can be linked by this field.

Symbol buddy field

A bidirectional link to another symbol with a corresponding buddy field.

Emitted variable type: a custom class from your program

The basic idea of buddy fields:

  • Like a regular symbol field, the symbol buddy field stores a link to another symbol.
  • The other symbol must have a corresponding symbol buddy field.
  • If you add a link in one direction, the other direction is automatically added, by automatically assigning the corresponding symbol buddy field.
  • If you remove a link (by assigning NULL or some other pointer), the corresponding symbol buddy field automatically gets reset to NULL.

Here are three stereotypical usages of buddy fields:

  • A two-way portal: A symmetric link. For example, DOOR_A.DESTINATION takes you to DOOR_B, and DOOR_B.DESTINATION takes you back to DOOR_A. The buddy fields have the same name DESTINATION, and usually they belong to the same symbol type.
  • A source and its target: A directional link. For example, THING.BOUNDS takes you to BOUNDING_BOX, and BOUNDING_BOX.OWNER takes you back to THING. The buddy fields have different names BOUNDS and OWNER, and usually belong to separate symbol types.
  • Doubly-linked list: An arbitrarily long chain of links. For example, POINT_1.NEXT takes you to POINT_2, and POINT_2.PREV takes you back to POINT_1. But then POINT_2.NEXT takes you to POINT_3, and POINT_3.PREV takes you back to POINT_2. You can traverse a chain of points by following POINT_1.NEXT.NEXT.NEXT, or in the other direction by following POINT_4.PREV.PREV.PREV. The buddy fields have different names PREV and NEXT, but usually they belong to the same symbol type.

Special settings:

  • Symbol type: Specifies which symbol types can be linked by this field.
  • Buddy field name: The name of the corresponding buddy field on the other symbol. By default, it is the same as this field name.

Symbol children field

Calculates an array of symbols that are immediate descendants under this symbol in the tree of symbols.

Emitted variable type: a custom class from your program

Special settings:

  • Array: Determines whether the field value is an array or a single item. If unchecked, and there are multiple children, then the field value is the first child.
  • Include children: a filter that determines which symbol types should be included in the result. For example, in the board diagram, suppose our symbol's actual immediate children are DOG, CAR, HAMBURGER, MOUSE. If the filter accepts symbol types ANIMAL and VEHICLE, then symbol children field array will contain three symbols: DOG, CAR, and MOUSE.

Tip: If your emitted array is empty, check that include children filter is not set to "(NONE)".

Symbol parent field

Calculates the first matching ancestor in the tree of symbols.

Emitted variable type: a custom class from your program

Special settings:

  • Parent type: a filter that determines which symbol types can be matched. For example, suppose the symbol HAT has an immediate parent symbol HEAD, whose immediate parent symbol is BODY, whose immediate parent symbol is BOSS. If the filter accepts BODY or BOSS, then the symbol parent field for HAT will return BODY because, walking up the tree, that is the first symbol that matches this filter.

Tip: If your emitted value is null, check that the parent type filter is not set to "(NONE)".

Tilemap field

A pointer to a tilemap art resource.

Emitted variable type: TILEMAP

Note: This field stores a manually chosen tilemap. If the symbol's figure is a tilemap, you probably want the figure tilemap field type instead.

Special settings:

  • Require the tilemap to be Palix-sized: A designer error is reported if the tilemap's dimensions are not Palix-sized.

Tileset field

A pointer to a tileset art resource.

Emitted variable type: TILESET

Note: This field stores a manually chosen tileset. If the symbol's figure has a tileset, you probably want the figure tileset field type instead.