Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

manic-map-renderer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

manic-map-renderer

A tool for generating PNG images of 2D map tiles for the game Manic Miners. Converts tile arrays into visually appealing images with custom biome colors and patterns.

  • 1.2.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Manic Miners Map Renderer

Description

Manic Miners Map Renderer is a tool designed to generate PNG images of 2D map tiles with a brushstroke effect for the game Manic Miners. This tool converts tile arrays into visually appealing images with custom biome colors and patterns, and includes functionalities for generating thumbnails as well.

Features

  • Converts 2D tile arrays into PNG images.
  • Generates both full-sized screenshots and thumbnails.
  • Processes entire directories of map files.

Installation

To install the dependencies, run:

npm install

Usage

Generating a PNG Image

To generate a PNG image from a map file:

import { generatePNGImage } from 'manic-miners-map-renderer';

const result = await generatePNGImage({
    filePath: 'path/to/mapfile.dat',
    outputFileName: 'output_image.png',
});

Generating Map Images for an Entire Directory

To generate images for all map files in a directory:

import { generateMapImage } from 'manic-miners-map-renderer';

const result = await generateMapImage({
    type: 'both', // 'png', 'thumbnail', or 'both'
    directoryPath: 'path/to/map/files',
    progressCallback: progress => {
        console.log(`Processed ${progress.processedCount} of ${progress.totalCount}`);
    },
});

Configuration

Ensure you have a .env.local file with the following configuration:

MMT_CATALOG_DIR=path/to/your/map/files

Scripts

  • resetdist: Removes the dist directory.
  • build: Compiles the TypeScript code.
  • start: Compiles the TypeScript code and starts the application.

Dependencies

  • canvas: Used for rendering the map tiles.
  • chardet: For detecting the character encoding of map files.
  • dotenv: For loading environment variables.
  • sharp: For image processing.

Dev Dependencies

  • @types/chardet: Type definitions for chardet.
  • @types/dotenv: Type definitions for dotenv.
  • @types/node: Type definitions for Node.js.

Author

Waleed Judah

License

MIT

FAQs

Package last updated on 07 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc