Skip to content

Spine runtime for DxLib, and a viewer with multiple rendering, runtime manipulation, and recording feature

License

Notifications You must be signed in to change notification settings

BithreenGirlen/DxLibSpineViewer

Repository files navigation

DxLibSpineViewer

Spine viewer for Windows based on Runtime for DxLib plus official generic runtime 2.1, 3.5, 3.6, 3.7, 3.8, 4.0, 4.1 and 4.2.

Feature

  • Multiple skeletons rendering
  • Runtime manipulation
    • Exclude slot
    • Mix skins
      • This is available for Spine 3.8 and later.
    • Mix animations
    • Replace attachment
      • This is available only for slots associated with multiple attachments.
  • Media file export
    • As PNG, GIF, JPG, and H264.
  • Transparent/borderless window style

Demonstration

Multiple rendering
Multiple.rendering.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

How to load

Load via Open folder

  1. From File->Setting, specify atlas and skeleton extensions.
  2. From File->Open folder, select a folder containing atlas/skel(s) with specified extensions.

Load via Select files

  1. From File->Select files, first select atlas file(s) to load.
  2. Then select skel file(s) which is/are pair(s) of atlas.

How to export

Export as single image

  1. Right click on the window.
  2. Select Snap as PNG or Snap as JPG.

Export as animation

  1. Right click on the window.
  2. Select Export as GIF or Export as H264.

More flexible recording is available by unchecking Export per anim. option from Image->Export setting.

Note on flexible recording
State Behaviour
Export per anim. checked Restarts the animation once recording has started, and ends recording as soon as animation has ended.
Export per anim. unchecked Recording start and end timing can be choosen by user hand.

Export as multiple images

  1. Right click on the window.
  2. Select Start image recording.
  3. Right click again and select Save as GIF or Save as PNGs.

Export as video

  1. Right click on the window.
  2. Select Start video recording.
  3. Right click again and select End recording.
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 via Select files.
  • PNG and JPG file will be named like home_4.475018.png where home is animation name, and 4.475018 is animation frame when saved.
  • GIF file will be named like wait.gif where wait is animation name.
  • H264 file will be named like fp.mp4 where fp is animation name.

Mouse functions

Input Action
Wheel scroll Scale up/down. Combinating with Ctrl to retain window size.
Left pressed + wheel scroll Speed up/down the animation.
Left click Switch the animation.
Left drag Move view-point.
Middle click Reset scale, animation speed, and view-point to default.
Right pressed + wheel scroll Switch the skin.
Tip on transparent window
  1. Check menu item Window->Through-seen to make window transparent.
  2. Right pressed + middle click to make window borderless.
  3. Right pressed + left click to move borderless window.

Keyboard functions

Input Action
Esc Close the application.
Up Open the previpus folder.
Down Open the next folder.
A Enable/disable premultiplied alpha. Default: enabled.
B Prefer/ignore blned-mode specified by slots. Default: preferred.
R Toggle draw-order between filename asc/descending order. Default: ascending order.
  • Up and Down key are valid only when the current spine(s) is/are loaded via Open folder.
  • Manual toggling of PMA is available for Spine version 3.8 and older.
    • For Spine version 4.0 and later, runtime applies pma property read from atlas file.
Tip on PMA and blend mode
  • Disable PMA with A if it is too bright, and enable if darkish.
  • Force normal blend mode with B if multiply is not well represented.

External libraries

Build

  1. Run shared-src/deps/CMakeLists.txt.
  2. Open DxLibSpineViewer.sln with Visual Studio.
  3. Select Build Solution on menu item.

The CMakeLists.txt modifies some of the external sources as well as obtains them.

  • For spine-c 3.5, renames some of the functions which lack sp prefix in extension.c and extension.h so as to be consistent with those of 3.6 and later.
  • For spine-c 2.1, supplies binary skeleton reader which is lacking in official 2.1.25 runtime, and overwrites some of the files with those from here.
deps directory will be as follows:
...
├ DxLibSpineC
│  └ ...
├ DxLibSpineCpp
│  └ ...
├ projects
│  └ ...
├ shared-src
│  ├ deps
│  │  ├ dxlib // static libraries and headers of DxLib for VC
│  │  │  └ ...
│  │  ├ spine-c-x.x // Spine C generic runtime for version x.x
│  │  │  ├ include
│  │  │  │  └ ...
│  │  │  └ src
│  │  │     └ ...
│  │  ├ ...
│  │  ├ spine-cpp-x.x // Spine C++ generic runtime for version x.x
│  │  │  ├ include
│  │  │  │  └ ...
│  │  │  └ src
│  │  │     └ ...
│  │  └ ...
│  └ ...
├ DxLibSpineViewer.sln
└ ...

Spine runtime for DxLib

  • Spine runtime for DxLib provides functionality to (1) load texture and (2) render skeleton.
  • There are two kind of runtimes depending on the official generic runtimes to be used with.
    • dxlib_spine.cpp is to be used with spine-cpp. (3.8 to 4.2)
    • dxlib_spine_c.cpp is to be used with spine-c. (3.5 to 4.2)
      • Class is used because DxLib is C++ library, but STL is avoided.

Besides, there is a runtime for spine 2.1.27 under projects/DxLibSpineViewerC-2.1. But note that transformation method is totally different from later versions.

About

Spine runtime for DxLib, and a viewer with multiple rendering, runtime manipulation, and recording feature

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published