Given a buffer with visual map data or pathfinding data from a Tibia 10-compatible *.map
file, tibia-minimap-png
creates a PNG buffer that is compatible with Tibia 11’s minimap.
npm install --save tibia-minimap-png
const fs = require('fs');
const { wrapColorData, wrapWaypointData } = require('tibia-minimap-png');
const buffer = fs.readFileSync('12612507.map');
const colorData = buffer.slice(0, 0x10000);
const waypointData = buffer.slice(0x10000, 0x20000);
fs.writeFileSync(
'Minimap_Color_32256_32000_7.png',
wrapColorData(colorData)
);
fs.writeFileSync(
'Minimap_WaypointCost_32256_32000_7.png',
wrapWaypointData(waypointData)
);
Mathias Bynens |