How to use the skinview-utils.loadSkinToCanvas function in skinview-utils

To help you get started, we’ve selected a few skinview-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bs-community / blessing-skin-server / resources / assets / src / scripts / textureUtils.ts View on Github external
image.onload = () => {
      if (image.width !== image.height) {
        resolve(false)
        return
      }

      const canvas = document.createElement('canvas')
      loadSkinToCanvas(canvas, image)

      const ratio = canvas.width / 64
      const context = canvas.getContext('2d')
      if (!context) {
        resolve(false)
        return
      }

      for (let x = 46 * ratio; x < 48 * ratio; x += 1) {
        for (let y = 52 * ratio; y < 64 * ratio; y += 1) {
          if (!checkPixel(context, x, y)) {
            resolve(false)
            return
          }
        }
      }

skinview-utils

Utilities for working with Minecraft skins

MIT
Latest version published 8 months ago

Package Health Score

56 / 100
Full package analysis

Popular skinview-utils functions

Similar packages