0.1.2 • Published 1 year ago

gdxjs-texture-packer v0.1.2

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

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);