@galacean/engine-toolkit-skeleton-viewer
v1.3.9
Published
The `Skeleton Viewer` tool can help you display all bone entities in the model, and display bone placeholders of different sizes according to the layer weight. You can also configure the size, proportion, color and other functions of the bone placeholders
Downloads
478
Maintainers
Keywords
Readme
Skeleton Viewer
The Skeleton Viewer
tool can help you display all bone entities in the model, and display bone placeholders of different sizes according to the layer weight. You can also configure the size, proportion, color and other functions of the bone placeholders.
Features
- 🖇 midStep - Distance from connector to bone, [0~1].
- ⚖ midWidthScale -The scale of the linker.
- ⚾︎ ballSize - Ball size.
- 📉 scaleFactor - Skeleton Decrease Factor.
- ⚫️ colorMin - The min color.
- ⚪️ colorMax - The max color.
npm
The Outline
is published on npm with full typing support. To install, use:
$ npm install @galacean/engine-toolkit-skeleton-viewer
This will allow you to import package entirely using:
import * as TOOLKIT from "@galacean/engine-toolkit-skeleton-viewer";
or individual classes using:
import { SkeletonViewer } from "@galacean/engine-toolkit-skeleton-viewer";
Usage
// The entity you want to show skeleton
const skeletonViewer = entity.addComponent(SkeletonViewer);
// hidden skeleton viewer
skeletonViewer.enabled = false;
// reshow skeleton viewer
skeletonViewer.enabled = true;
// destroy resource
skeletonViewer.destroy();
// some configuration
skeletonViewer.midStep = 0.2;
skeletonViewer.midWidthScale = 0.1;
skeletonViewer.ballSize = 0.1;
skeletonViewer.scaleFactor = 0.1;
skeletonViewer.colorMin.set(1, 1, 1, 1);
skeletonViewer.colorMax.set(1, 1, 1, 1);
Links
License
The engine is released under the MIT license. See LICENSE file.