Spine viewer for Windows based on Runtime for DxLib (2.1, 3.5 to 4.2).
- Multiple rendering
- Runtime manipulation
- Exclude slot
- Mix skins
- Mix animations
- Replace attachment
- Media export
- Transparent/borderless window style
Multiple rendering-1 (via selecting multiple files)
Multiple-rendering-1.mp4
Multiple rendering-2 (via opening a folder)
Multiple-rendering-2.mp4
Mix animations
Mix.animation.mp4
Exclude slot
Exclude.slot.mp4
Replace attachment
Replace.attachment.mp4
Media export
Media.export.mp4
Transparent window
Transparent.window.mp4
Add effect
Add.effect.mp4
Import Cocos-1 (Json containing both atlas and skeleton)
Import.Cocos-1.mp4
Import Cocos-2 (Json containing only atlas and requiring skeleton separately)
Import.Cocos-2.mp4
- First select atlas file(s) to load.
- Then select skel file(s) which is/are pair(s) of atlas.
- From menu
File->Load option, specify atlas and skeleton extensions. - From menu
File->Open folder, select a folder containing atlas/skel(s) with specified extensions.
Open folderis to load all the Spine files in a folder and render them synchronically.- Of course it is appropriate to open a folder containing only one set of Spine, but it is not appropriate to open a folder containing more than two sets of Spine unless their animations have synchronised timelines.
- This is to load JSON:
- which contains atlas at
[5][0][2], and skeleton at[5][0][4]. - or that which contains atlas at
[5][0][2]and requires binary skeleton separately.
- which contains atlas at
Option on loading can be configured through menu File->Load option.
| Option name | Function |
|---|---|
| PMA on loading | Multiply alpha on loading texture. |
| Find webp | Find *.webp if a file specified by atlas is not found. |
| Ignore small image | Make image smaller than 255x255 transparent on loading. |
On loaded, the window will be fit to the whole bounding box of Spine at the timeline of 0 with empty animation and empty skin.
The window can be resized via menu item Allow dragged resizing, or can be adjusted to a specific size via menu item Show tool dialogue.
Fit window to a specific slot
Fit_window_to_a_specific_slot.mp4
Set fixed-size
Set_fixed_size.mp4
| Input | Action |
|---|---|
| Wheel scroll | Scale up/down. Combining with Ctrl to zoom in/out. |
| L-pressed + wheel scroll | Speed up/down the animation. |
| L-click | Switch the animation. |
| L-drag | Move view-point. |
| M-click | Reset scale, animation speed, and view-point to default. |
| R-pressed + wheel scroll | Switch the skin. |
| R-pressed + M-click | Hide/show the border of window. |
| R-pressed + L-click | Start moving borderless window. L-click again to end. |
| Input | Action |
|---|---|
| Esc | Close the application. |
| Up | Open the previous folder. |
| Down | Open the next folder. |
| A | Enable/disable premultiplied alpha. Default: enabled. |
| R | Toggle draw-order between filename asc/descending order. Default: ascending order. |
- Up and Down key are valid only when files are loaded via
Open folder. - Toggling
PMAis permitted only for Spine version3.8and older.- For Spine version
4.0and later, runtime applies pma property read from atlas file. - Mind that this is to specify what blend mode operation be used, and not to make the alpha of texture be multiplied to RGB.
- The latter can be done from menu
File->Extension setting.
- The latter can be done from menu
- For Spine version
| Menu item | Action |
|---|---|
| Snap as PNG | Save the current frame as PNG. |
| Snap as JPG | Save the current frame as JPG. |
| Export as GIF | Restart the current animation and export as GIF. |
| Export as H264 | Restart the current animation and export as MP4. |
| Export as PNGs | Restart the current animation and export as sequential PNGs. |
| Export as JPGs | Restart the current animation and export as sequential PNGs. |
- Context menu appears only when Spine is loaded.
- By unchecking
Export per anim.option fromTool->Export setting, when to start and end recording will be delegated to user.
Note on filename
- The files are saved in the subdirectory of the execution file.
- The folder is named after folder-name when loaded via
Open folder, and the first atlas filename when viaSelect files.
- The folder is named after folder-name when loaded via
PNGandJPGfile will be named likehome_4.475.pngwherehomeis animation name, and4.475is animation time.GIFfile will be named likewait.gifwherewaitis animation name.H264file will be named likefp.mp4wherefpis animation name.
Visual Studio is required.
- Open
DxLibSpineViewerdirectory with Visual Studio. - Wait for dependency libraries downloading to be done.
- The configuration downloads external libraries and modifies older Spine
extensions.- For spine-c
3.5, renames some of the functions which lackspprefix so as to be consistent with3.6and later. - For spine-c
2.1, supplies binary skeleton reader from here.
- For spine-c
- The configuration downloads external libraries and modifies older Spine
- Build All
DxLibSpineViewerproject.
The functionalities are as follows:
| File | Functionality | Dependency on STL |
|---|---|---|
| dxlib_spine_drawable.cpp/h | Hold instance data and render skeleton. | No |
| dxlib_spine_texture_loader.cpp/h | Load and unload texture. | No |
| spine_loader.cpp/h | Load atlas or skeleton file. | Yes (C++14) |
| spine_player.cpp/h | Manage Spine resources and manipulation. | Yes (C++14) |
| dxlib_spine_player.cpp/h | Adjust scale and translation using matrix. | Yes (C++14) |
-
The files under
runtime/DxLibSpineCppare to be used withspine-cpp. (3.8to4.2) -
The files under
runtime/DxLibSpineCare to be used withspine-c. (3.5to4.2) -
There is a drawable class for
2.1though, note that transformation method is totally different from later versions. -
For the time being, in order to use runtime in the environment where STL cannot be used, other functionalities than texture loader and skeleton rendering should be implemented outside of the latter three classes.
-
In order to build these files in a project using DxLib, it is required to define macro depending on versions of Spine generic runtime to be used with.
| Version | Macro to be defined |
|---|---|
2.1 |
SPINE_21 |
3.5 |
- |
3.6 |
- |
3.7 |
- |
3.8 |
SPINE_38 provided that C runtime is to be used. |
4.0 |
SPINE_40 |
4.1 |
SPINE_41 |
4.2 |
SPINE_42 |
- Independently,
spine_file_verifier.cpp/hcan be used to find Spine version string in skeleton file and check if it is binary or JSON format. dxlib_spine_dll.cpp/handspine_player_dll.cpp/hare for building dynamic library which depends on DxLib without linking it. So usually, these files will not be needed.