Skip to content

Latest commit

 

History

History
114 lines (72 loc) · 3.47 KB

README.md

File metadata and controls

114 lines (72 loc) · 3.47 KB

Spriter-Player-for-Phaser

Installing from npm

npm install phaser-ce-spriter

The npm package contains the following outputs:

  • Basic UMD bundle that works in browsers in dist/spriter.js
  • Same, but minified & optimized in dist/spriter.min.js
  • CJS module, for use with require in dist/cjs
  • ESM module, for use with import in dist/esm
  • Source maps
  • TypeScript definitions

(Note from package maintainer: The setup follows roughly the guidelines from https://marcobotto.com/blog/compiling-and-bundling-typescript-libraries-with-webpack/)

Changelog

2022-09-30

  • Released to NPM as phaser-ce-spriter v1.0.1
  • Do not use v1.0.0, it's missing some files in the ESM variant.


2022-03-19

  • fixed for Phaser 2.19.2

2017-01-29

  • adjustments to allow proper work with BOX and POINT Spriter objects
  • changed Test example - character now holds book in his hand if "I" key was pressed. This book is attached to Spriter POINT object, which is part of animation. Book is separate Phaser.Sprite image.


2017-01-26

  • small bugfix. Objects of type BOX and POINT are processed now (their processing was accidentally commented out).
  • added two new signals into Spriter.SpriterGroup: onBoxUpdated, onPointUpdated to listen for updates of BOX and POINT Spriter objects.


2016-09-16

  • added optional parameter in Spriter.SpriterJSON and Spriter.SpriterXml of type IFileOptions. This parameter is object with some optional keys. Currently important is imageNameType of type Spriter.eImageNameType. It converts and returns name of image taken from Spriter animation file in this way (let's assume name in animation file is path/image_name.png):

NAME_ONLY (default): image_name
NAME_AND_EXTENSION: image_name.png
FULL_PATH_NO_EXTENSION: path/image_name
ORIGINAL: path/image_name.png

So you can strip path, extension or both or keep original name.



2016-07-08

  • added rest of easing functions - quartic, quintic, bezier,
  • corrected loading tag from JSON files.


2016-04-17

Code is split into Spriter Player and Test example of usage.
Newly, there are both Spriter Player and minimized version of player in Build directory.
In Build directory you can also find Typescript definitions in spriter.d.ts file.



2016-03-25

Fixed bug when creating multiple instances of SpriterGroup pointing to the same Spriter animation (instances shared some variables with each other).



2016-02-20

Added Pro features:

  • character maps
  • tags
  • variables (int and float variables are not interpolated)
  • events
  • sound events (instead of playing sound directly, the player fires event with name of sound to be played)

Most of the code is rewritten.

Currently only loading of .scml (.xml) and .scon (.json) produced by Spriter export works. Loading of minimized versions and loading of binary will be added later.



2015-10-30

Play animations made with Spriter in Phaser engine. Load .xml, .json or special compact binary format.

Supports only features in free version of Spriter.

Can load .xml/.scml and .json/.scon exported directly from Spriter or files minimized with [SpriterMinimizer] (https://github.com/SBCGames/SpriterMinimizer) as well as compact binary output created with SpriterMinimizer.

In [src/States/Test.ts] (https://github.com/SBCGames/Spriter-Player-for-Phaser/blob/master/Spriter/src/States/Test.ts) play with loading .xml, .json, .bin.