Open Cazka opened 2 years ago
this function will translate arenaPosition to canvasPosition so that it will be inside the minimap
function toMinimapPosition(vector) {
const unscale = diepAPI.arena.unscale(vector);
const minimapPos = diepAPI.Vector.multiply(diepAPI.minimap.minimapDim, unscale);
return diepAPI.Vector.add(diepAPI.minimap.minimapPos, minimapPos);
}
I would like to have the ability to draw on the minimap using CanvasAPI.
the canvas should have the dimensions of the arena so we dont have to convert the coordinates.