Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

AddFigure

Adds a figure to the map overlay and returns its index. The index can later be used to remove the figure via RemoveFigure.

The figure is drawn on the Map page for the current character.

Figures are not cleared on disconnect. To remove all figures, use ClearFigures.

A character holds at most 50 000 figures. Past that limit the figure is not added, the function returns $FFFFFFFF (4294967295) and a warning is written to the system journal once. Remove figures you no longer need with RemoveFigure or ClearFigures.

Добавляет фигуру на оверлей карты и возвращает её индекс. Индекс может быть использован для удаления фигуры через RemoveFigure.

Фигура отображается на вкладке Map для текущего персонажа.

Фигуры не очищаются при отключении. Для удаления всех фигур используйте ClearFigures.

У персонажа может быть не более 50 000 фигур. Сверх лимита фигура не добавляется, функция возвращает $FFFFFFFF (4294967295), а в системный журнал один раз пишется предупреждение. Ненужные фигуры удаляйте через RemoveFigure или ClearFigures.

Pascal

function AddFigure(const Figure: TMapFigure): Cardinal;

Parameters:

  • Figure — record describing the figure to draw.

Type definitions:

TFigureKind = (fkLine, fkEllipse, fkRectangle, fkDirection, fkText);
TFigureCoord = (fcWorld, fcScreen);

TMapFigure = packed record
  kind: TFigureKind;
  coord: TFigureCoord;
  x1: Integer;
  y1: Integer;
  x2: Integer;
  y2: Integer;
  brushColor: TColor;
  brushStyle: TBrushStyle;
  color: TColor;
  worldNum: Byte;
  text: String;
end;
  • kind — shape type: line, ellipse, rectangle, direction arrow, or text label.
  • coord — coordinate system: fcWorld (world map coordinates) or fcScreen (screen pixel coordinates).
  • x1, y1, x2, y2 — bounding coordinates of the figure.
  • brushColor — fill color.
  • brushStyle — fill style (e.g. bsSolid, bsClear, bsHorizontal, etc.).
  • color — outline (pen) color.
  • worldNum — world/facet number.
  • text — text label (used with fkText; also shown as tooltip for other kinds).

Python

def AddFigure(Figure: MapFigure) -> int: ...

Pascal Example

Screen coordinates (overlay on top of map view):

var
  fig: TMapFigure;
begin
  fig.kind := fkRectangle;
  fig.coord := fcScreen;
  fig.x1 := 55;
  fig.y1 := 55;
  fig.x2 := 99;
  fig.y2 := 99;
  fig.brushColor := 8888;
  fig.worldNum := 1;
  fig.text := 'test';
  AddFigure(fig);
end.

World coordinates (marks a spot on the actual UO map):

var
  fig: TMapFigure;
begin
  fig.kind := fkRectangle;
  fig.coord := fcWorld;
  fig.x1 := 3172;
  fig.y1 := 784;
  fig.x2 := 3179;
  fig.y2 := 781;
  fig.brushColor := 8888;
  fig.worldNum := 1;
  fig.text := 'My house';
  AddFigure(fig);
end.

Python Example

fig = MapFigure()
fig.kind = 2       # fkRectangle
fig.coord = 0      # fcWorld
fig.x1 = 3172
fig.y1 = 784
fig.x2 = 3179
fig.y2 = 781
fig.brushColor = 8888
fig.worldNum = 1
fig.text = 'My house'
AddFigure(fig)

See Also

RemoveFigure, ClearFigures