I list the code below in case someone may find them useful.
Of course, any improvements would be welcomed.
5.42LTS and tested on OSX and Windows 10.
Code: Select all
Macro HexaaaagonVertical(X,Y,W,H)
MovePathCursor(X, Y)
AddPathLine(X + W/2, Y + W/2)
AddPathLine(X + W/2, Y + H + W/2)
AddPathLine(X,Y + H + W)
AddPathLine(X - W/2,Y + H + W/2)
AddPathLine(X - W/2,Y + W/2)
ClosePath()
EndMacro
Macro HexaaaagonHorizontal(X,Y,W,H)
MovePathCursor(X, Y)
AddPathLine(X + W/2,Y - W/2)
AddPathLine(X + W/2 + H,Y - W/2)
AddPathLine(X + W + H,Y)
AddPathLine(X + W/2 + H,Y + W/2)
AddPathLine(X + W/2,Y + W/2)
ClosePath()
EndMacro
Macro MakeNumber(X,Y,W,H,Num)
If Num & %0000001
HexaaaagonHorizontal(X,Y,W,H)
EndIf
If Num & %0000010
HexaaaagonVertical(X - 1,Y + 1,W,H)
EndIf
If Num & %0000100
HexaaaagonVertical(X + W + H + 1,Y + 1,W,H)
EndIf
If Num & %0001000
HexaaaagonHorizontal(X,Y + W + H + 2,W,H)
EndIf
If Num & %0010000
HexaaaagonVertical(X - 1,Y + W + H + 3,W,H)
EndIf
If Num & %0100000
HexaaaagonVertical(X + W + H + 1,Y + W + H + 3,W,H)
EndIf
If Num & %1000000
HexaaaagonHorizontal(X,Y + W + W + H + H + 4,W,H)
EndIf
EndMacro
Global Dim Digits.i(9)
Digits(0) = %1110111
Digits(1) = %0100100
Digits(2) = %1011101
Digits(3) = %1101101
Digits(4) = %0101110
Digits(5) = %1101011
Digits(6) = %1111011
Digits(7) = %0100101
Digits(8) = %1111111
Digits(9) = %1101111
If OpenWindow(0, 0, 0, 400, 100, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 0, 0, 600, 500)
If StartVectorDrawing(CanvasVectorOutput(0))
For M = 0 To 9
MakeNumber(20 + M * 33,20,4,10,Digits(M))
Next M
VectorSourceColor(RGBA(0, 0, 255, 255))
FillPath()
;
StopVectorDrawing()
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf