open-index/open-npm huggingface dataset:
npm package: @oasis-engine/tool-atlas
Description: atlas tool for oasis engine
Author: singlecoder
Latest version: 0.5.9

# tool-atlas
Atlas tool for oasis engine

# Usage in terminal

## 1、Install

```
npm i @oasis-engine/tool-atlas -g
```

## 2、Use command in terminal

### 2.1、pack or p
Pack images to atlas
```
// Pack images to atlas.
oasis-tool-atlas p ./atlas-test/111 -f oasis -o outputName -p 2

// Option help.
oasis-tool-atlas p -h
```
Options detail

| option | instruction |
| --- | --- |
|f/format|the format for atlas (default: "oasis")|
|o/output|output atlas filename (default: "oasis")|
|a/algorithm|the algorithm for pack (default: "maxrects")|
|ar/allowRotate|mark whether image allow rotate when pack (default: false)|
|p/padding|between images (default: 1)|
|mw/maxWidth|the texture max width (default: 1024)|
|mh/maxHeight|the texture max height (default: 1024)|
|s/square|the texture size forced square (default: false)|
|pot|the texture size forced power of 2 (default: false)|

### 2.2、formatConversion or fc
Convert other atlas formats to oasis atlas
```
// Convert other atlas formats to oasis atlas.
oasis-tool-atlas fc -t texture-packer -o oasis-atlas

// Option help.
oasis-tool-atlas fc -h
```
Options detail

| option | instruction |
| --- | --- |
|t/type|atlas format (default: "texture-packer")|
|o/output|the name of output (default: "oasis-atlas")|


# Usage in node project
## 1、Install

```
npm i @oasis-engine/tool-atlas --save
```

## 2、Call api

```
const core = require("@oasis-engine/tool-atlas");

// Pack images to atlas.
const imageFiles = [ // the images to pack
  "./",
  "./test.png",
  "https://test/test.png"
];
core.pack(imageFiles, {
  format: 'oasis', // the format for atlas (default: "oasis")
  output: 'oasis', // output atlas filename (default: "oasis")
  algorithm: 'maxrects', // the algorithm for pack (default: "maxrects")
  allowRotate: false, // mark whether image allow rotate when pack (default: false)
  padding: 1, // between images (default: 1)
  maxWidth: 1024, // the texture max width (default: 1024)
  maxHeight: 1024, // the texture max height (default: 1024)
  square: false, // the texture size forced square (default: false)
  pot: false, // the texture size forced power of 2 (default: false)
}).then((ret) => {
  /*
  ret = {
    "code": 0, // return 0 if success
    "msg": '', // if code not 0, msg is the error info
    "info": {
      "imageFile": "", // the absolute path of the image file
      "atlasFile": "", // the absolute path of the atlas file
    }
  }
  */
});

// Convert other atlas formats to oasis atlas.
const filePath = "./test.json"; // the file exported by texture packer
core.formatConversion(filePath, {
  "type": texture-packer, // atlas format
  "output": oasis-atlas // the name of output
});
```
npm package: @oasis-engine/tool-atlas-lottie
Description: Transform lottie JSON file to atlas format in oasis engine.
Author: Bob
Latest version: 0.7.0

# tool-atlas-lottie

Transform lottie JSON file to atlas format in oasis engine. This tool will generate a folder which contains three files: a processed lottie JSON file, an atlas file and an image.

# Usage in terminal

1. Install

```bash
npm i @oasis-engine/tool-atlas-lottie -g
```

2. Use command in terminal

if lottie file has base64 images:
```bash
oasis-atlas-lottie -s lottieFile.json
```

if lottie file has images in a directory:
```bash
oasis-atlas-lottie -s lottieFile.json -i ./images
```

# Usage in node project

1. Install

```bash
npm i @oasis-engine/tool-atlas-lottie --save
```

2. Call api

```javascript
const lottieTransform = require("@oasis-engine/tool-atlas-lottie");

lottieTransform('lottieFile.json'); 
```