All docs

Vector Editor

Draw and edit .vec vector assets — the building blocks for every sprite, platform, and background in a VPy game.

The Vector Editor opens automatically when you create or double-click a .vec file. It is a 2D (and optionally 3D) path editor that works directly in Vectrex coordinate space (−128 to +127 on both axes).

Vector Editor with a player character drawn — canvas in the centre, layers panel on the left, properties on the right


Canvas and coordinate system

The canvas shows the Vectrex screen boundary as an outlined rectangle. The origin (0, 0) is in the centre. X increases to the right; Y increases upward — the same convention used in your VPy code.

Use scroll wheel to zoom (1×–8×) and middle-mouse drag to pan.


Tools

ToolShortcutUse
SelectSClick or drag-box to select points; drag to move
PenPClick to add points to the current path
LineLDraw straight two-point segments
BezierBDraw smooth curves with tangent handles
PolygonGPlace a regular polygon (set sides in properties)
CircleCDraw a circle approximated as a polyline
ArcADraw an arc segment
Walkable AreaWPaint a horizontal shelf where enemies can walk (used by the wander AI)
PanSpace+dragNavigate the canvas without deselecting

Layers

The left panel lists every layer in the file. Each layer contains one or more paths.

  • Click the eye icon to toggle layer visibility.
  • Click a layer name to select all paths in it.
  • Use the + Layer button to add a new layer.
  • Drag layers to reorder them (draw order, bottom to top).

Layers panel — three layers listed, middle layer selected, paths visible in the tree


Path properties

Select a path to edit its properties in the right panel:

PropertyDescription
IntensityBeam brightness, 0–127. Higher = brighter.
ClosedConnect the last point back to the first.
NameOptional label, used for debugging.

Select individual points to move them by dragging or by typing coordinates in the input fields.


Walkable areas

Switch to the Walkable Area tool and drag horizontally across a platform to define the shelf where enemies patrol. Each area has a Y level, an x_min, and an x_max. The Playground editor reads these to derive enemy patrol routes automatically.

Walkable area drawn across a platform — green horizontal band with handles at each end


3D view

Click the 3D button in the toolbar to enter perspective mode. Use pitch and yaw sliders to rotate the view. Paths remain flat (Z = 0) unless you explicitly add Z coordinates to points — useful for tracing reference geometry before flattening to 2D.


Background image

Drag any PNG or JPG onto the canvas to load it as a tracing reference. Use the opacity slider to dim it while drawing. The background image is not saved in the .vec file — it is editor-only.

The Edge Detection button (Canny algorithm) processes the background image and overlays detected edges as a guide. Adjust the threshold sliders to tune sensitivity.

VectorEditor with a background reference image loaded and edge detection overlay active


Import

File → Import supports:

  • DXF — 2D CAD drawings. Select the XY, XZ, or YZ plane to project onto.
  • OBJ — 3D meshes. The editor extracts silhouette edges and projects them to a flat plane.

Both formats are converted to polyline paths. Adjust the angle threshold to filter edges by sharpness.


File format

.vec files are plain JSON. A minimal example:

{
  "version": "1.0",
  "name": "player",
  "canvas": { "width": 256, "height": 256, "origin": "center" },
  "layers": [
    {
      "name": "body",
      "visible": true,
      "paths": [
        {
          "name": "outline",
          "intensity": 127,
          "closed": true,
          "points": [{"x": 0, "y": 10}, {"x": 8, "y": -10}, {"x": -8, "y": -10}]
        }
      ]
    }
  ]
}