MCPcopy Index your code
hub / github.com/Rich-Harris/sevenup

github.com/Rich-Harris/sevenup @v1.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.4.0 ↗ · + Follow
8 symbols 13 edges 1 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

sevenup

Utility for making and loading spritesheets.

CLI

npx sevenup sourcedir destdir

This will read all the .png and .jpg images in sourcedir and create three files:

  • destdir/sprites.png
  • destdir/sprites.json
  • destdir/sprites.css

To create a sprites.png with power-of-two dimensions — useful for WebGL apps, where appropriately-sized textures can have mipmaps generated — use the --pad or -p flag:

npx sevenup -p sourcedir destdir

In browser

import { load } from 'sevenup';

(async function() {
  const spritesheet = await load('destdir');

  // we have a reference to the image
  console.log(spritesheet.image.width, spritesheet.image.height);

  // get a Blob URL
  const url = await spritesheet.url('somefile.png');

  // get a <canvas>
  const canvas = spritesheet.canvas('somefile.png');

  // get a set of UV coordinates, for use in a WebGL shader
  const [u1, v1, u2, v2] = spritesheet.uv('somefile.png');

  // get the bounds of an image
  const { left, top, right, bottom, width, height } = spritesheet.box('somefile.png');
}());

A lower-level spritesheet = create(img, manifest) API also exists.

Alternatively, use CSS:






License

MIT

Core symbols most depended-on inside this repo

get
called by 3
index.mjs
create
called by 1
index.mjs
canvas
called by 1
index.mjs
fn
called by 0
index.mjs
url
called by 0
index.mjs
uv
called by 0
index.mjs
box
called by 0
index.mjs
load
called by 0
index.mjs

Shape

Function 8

Languages

TypeScript100%

Modules by API surface

index.mjs8 symbols

For agents

$ claude mcp add sevenup \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact