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.
Добавляет фигуру на оверлей карты и возвращает её индекс. Индекс может быть использован для удаления фигуры через RemoveFigure.
Фигура отображается на вкладке Map для текущего персонажа.
Фигуры не очищаются при отключении. Для удаления всех фигур используйте ClearFigures.
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) orfcScreen(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).
def AddFigure(Figure: MapFigure) -> int: ...
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.
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)