New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@7c00/canvas-tilemap

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@7c00/canvas-tilemap

smooth tilemap uses canvas render

latest
Source
npmnpm
Version
0.6.0
Version published
Weekly downloads
41
1950%
Maintainers
1
Weekly downloads
 
Created
Source

canvas-tilemap

Super smooth 2d tilemap build with canvas2d.

https://user-images.githubusercontent.com/1709072/216881683-b17ac057-c1f3-435f-8c98-9486d1c631e7.mp4

Install

npm i @7c00/canvas-tilemap

Usage

Create tilemap

<div id="tilemap"></div>
const tilemap = new Tilemap({
  element: "#tilemap",
  size: [12288, 12288],
  origin: [3568, 6286],
});

Add TileLayer

tilemap.tileLayers.add(
  new TileLayer(tilemap, {
    minZoom: 10,
    maxZoom: 13,
    getTileUrl(x, y, z) {
      return `https://assets.yuanshen.site/tiles_yxg2/${z}/${x}_${y}.png`;
    },
  })
);

Add MarkerLayer

const image = new Image();
image.src = "https://assets.yuanshen.site/icons/127.png";
image.addEventListener("load", () => {
  tilemap.draw();
});
const markerLayer = new MarkerLayer(tilemap, {
  positions: [
    [-999, 3766],
    [-1685, 2359],
    [112, 1365],
    [1231, 575],
    [1202, -346],
    [1737, 14],
    [3101, 422],
    [3488, 215],
    [3147, 1495],
    [3455, 801],
    [4229, 888],
    [2804, 2379],
    [3073, 3269],
    [2716, 4054],
    [3845, 2665],
    [4522, 2307],
    [6108, 974],
    [5866, 205],
    [5178, 29],
    [6231, -411],
    [2095, -591],
    [1188, -4131],
    [7413, -2412],
    [4783, 5059],
  ],
  image: image,
});
tilemap.markerLayers.add(markerLayer);

Keywords

canvas

FAQs

Package last updated on 14 Apr 2023

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