npm.io
0.1.2 • Published 3 years ago

gdxjs-texture-packer

Licence
Version
0.1.2
Deps
3
Size
5 kB
Vulns
0
Weekly
0

gdxjs-texture-packer

A little utility to pack a texture atlas at runtime. Written in typescript, used for gdxjs.

Installation

$ npm install gdxjs-texture-packer

Usage

import { packRuntimeAtlas } from "./gdxjs-texture-packer";

...

const regionsToPack: TextureRegion[] = [];

regionsToPack.push(...originalAtlas.findRegions('name_of_regions_1'));
regionsToPack.push(...originalAtlas.findRegions('name_of_regions_2'));

const runtimeAtlas = packRuntimeAtlas(gl, regionsToPack);