Skip to content

BithreenGirlen/DxLibSpineViewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DxLibSpineViewer

Spine viewer for Windows based on Runtime for DxLib (2.1, 3.5 to 4.2).

Feature

  • Multiple rendering
  • Runtime manipulation
    • Exclude slot
    • Mix skins
    • Mix animations
    • Replace attachment
  • Media export
  • Transparent/borderless window style

Demonstration

Multiple rendering-1 (via selecting multiple files)
Multiple-rendering-1.mp4
Multiple rendering-2 (via opening 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 (including both atlas and skeleton)
Import.Cocos-1.mp4
Import Cocos-2 (including only atlas and requiring separate skeleton)
Import.Cocos-2.mp4

How to load

Load via Open files

  1. First select atlas file(s) to load.
  2. Then select skel file(s) which is/are pair(s) of atlas.

Load via Open folder

  1. From File->Extension setting, specify atlas and skeleton extensions.
  2. From File->Open folder, select a folder containing atlas/skel(s) with specified extensions.
  • Open folder is to load all the Spine files in a folder and render them synchronically.
    • Of cource it is permitted to open folder containing only one set of Spine files.
    • But do not try to open folder containing Spine files of which animations do not have synchronised timelines.

Load via Import Cocos

  • 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.

Mouse functions

Input Action
Wheel scroll Scale up/down. Combinating with Ctrl to retain window size.
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 Make window borderless.
R-pressed + L-click Start moving borderless window. L-click again to end.

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 files are loaded via Open folder.
  • Toggling PMA is permitted only for Spine version 3.8 and older.
    • For Spine version 4.0 and later, runtime applies pma property read from atlas file.
    • Disable PMA if it seems too bright, and enable if darkish.
  • Force normal blend mode if multiply is not well represented.

Context menu functions

Menu item Action
Snap as PNG Save the current screen as PNG.
Snap as JPG Save the current screen 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 separate PNGs.
  • Context menu appears only when Spine is loaded.
  • By unchecking Export per anim. option from Tool->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 via Select files.
  • PNG and JPG file will be named like home_4.475.png where home is animation name, and 4.475 is animation time.
  • 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.

External libraries

Build Spine viewer

Visual Studio is required.

  1. Open shared-src/deps folder with Visual Studio.
  2. Wait for the CMake configuration to be done.
    • The configuration downloads external libraries and modifies older Spine extensions.
      • For spine-c 3.5, renames some of the functions which lack sp prefix so as to be consistent with 3.6 and later.
      • For spine-c 2.1, supplies binary skeleton reader from here.
  3. Install Spine generic runtimes both for x64-debug and x64-release.
  4. Open DxLibSpineViewer.sln and build.

Spine runtime for DxLib

  • For minimal integration, only dxlib_spine.cpp/h or dxlib_spine_c.cpp are suffice.
  • For more functionalities, use all the files under DxLibSpineCpp or DxLibSpineC.
    • The functionalities are as follows:
File Functionality
dxlib_spine.cpp/h Load texture and render skeleton based on API of DxLib.
dxlib_spine_player.cpp/h Adjust scale and translation using matrix of DxLib.
spine_loader.cpp/h Load atlas or skeleton file.
spine_player.cpp/h Manage Spine resources and manipulation.

About

Spine runtime for DxLib, and a viewer on Windows

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published