https://github.com/jacklehamster/texture-manager
Rearrange and store textures for use in WebGL
https://github.com/jacklehamster/texture-manager
texture-pack webgl webgl2
Last synced: 2 months ago
JSON representation
Rearrange and store textures for use in WebGL
- Host: GitHub
- URL: https://github.com/jacklehamster/texture-manager
- Owner: jacklehamster
- License: apache-2.0
- Created: 2022-02-10T07:57:55.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-26T21:03:42.000Z (over 2 years ago)
- Last Synced: 2025-01-28T20:19:46.652Z (12 months ago)
- Topics: texture-pack, webgl, webgl2
- Language: JavaScript
- Homepage: https://jacklehamster.github.io/texture-manager/
- Size: 96.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# texture-manager
Rearrange and store textures for use in WebGL
[](https://github.com/jacklehamster/texture-manager/actions/workflows/codeql-analysis.yml)
[](https://github.com/jacklehamster/texture-manager/actions/workflows/pages/pages-build-deployment)
## Setup
### Directly in web page
Include the scripts in html as follow:
```
```
### Through NPM
Add to `package.json`:
```
"dependencies": {
...
"texture-manager": "^1.0.0",
...
}
```
Use Browserify to make classes available in browser
In `package.json`:
```
"scripts": {
...
"browserify": "browserify browserify/main.js -s dok-lib -o public/gen/compact.js",
...
},
```
In `browserify/main.js`:
```
const { TextureManager, TextureUtils, SlotAllocator } = require('texture-manager');
module.exports = {
TextureManager,
TexureUtils,
SlotAllocator
};
```
## Components
### TextureManager
#### Description
TextureManager packs textures in WebGL for use as sprite atlas.
#### Usage
*Work in progress*
### Demo
[demo](https://jacklehamster.github.io/texture-manager/)