-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spine-ts #121
Comments
Thank you, that will help me to integrate spine-ts. !@#$ im stupid! Check if its PIXI.TransformStatic either PIXI.Transform, not just latter Also, I'm going to create branch, change the build system, and I'll add you to contributors, lets try this in separate branch. |
I made a little progress - the TransformStatic helped |
The most difficult part will be loader, it is async. OK, gonna add your stuff today in separate branch, as planned. Then we make it to master |
I dont undrestand some typescript stuff regarding modules, I need help with that. Currently spine-ts compiles all files from folder somehow and I dont understand how to do it the same way as PIXI does. For example, we have module "spine" inside of directory "core", it contains all files in this directory. How can I include this as a module from "index.ts" which will be entry for browserify? Also I want all core to be found inside "PIXI.spine.SpineRuntime" namespace. How do I do that? |
@englercj said that Its better to convert module to imports first, so I'll do that. |
It may be best to keep the spine-ts core files untouched so the runtime can be easily updated. What about having the runtimes as a package dependency and importing just the spine-ts/build/spine-core.js? |
I dont think we can leave them in pure form, there are too many hacks in original pixi-spine for that. I can ask Mario (spine-ts author) to change the way it builds, but for now we have to change everything on ES6 modules manually. |
Having it as package dep is bad too because I also want to generate TS header automagically. |
Good point, but it may still be possible to keep the hacks and the original spine-ts in separate files, leaving data in the the core then the display implementation in the new pixi part. For example I moved the sprites array from the Slot(core) to the SlotContainer(pixi) so that the Slot remains unchanged. |
If we could keep the original lib as a dependency and apply our hacks to it that would be awesome. You should be able to generate the dts file that includes spine even with it as a dep. |
At the moment the runtimes are missing a package.json (I opened an issue) |
OK, that's my branch: https://github.com/pixijs/pixi-spine/tree/spine-ts it can be built with "npm run build", and this thing will create definitions: "tsc -p tsconfig-2.json" Definitions are wrong, but I'm going to just integrate pixi changes first, then fix their generation. If we specify "outFile" and not "outDir", they will be in one file, but format is bad anyway. |
IT WORKS! https://github.com/pixijs/pixi-spine/tree/spine-ts There are a few changes, I'm going to change API a bit, add deprecated stuff :) Path Constraints are working! |
Super work! |
Current problems:
Atlas to TextureAtlas setAnimation to setAnimationWith addAnimation to addAnimationWith So you'll have problem with "byName" suffix, just remove it from your code.
gonna merge JSON parser with older one
animation.state.addListener({
/** Invoked when the current animation triggers an event. */
event : function(trackIndex, event) { alert('event fired '+event.data) }
/** Invoked when the current animation has completed.
* @param loopCount The number of times the animation reached the end. */
complete : function(trackIndex, loopCount) {}
/** Invoked just after the current animation is set. */
start: function (trackIndex) {}
/** Invoked just before the current animation is replaced. */
end: function (trackIndex) {}
}) |
It works great! Check out Stretchyman and Spineboy now in pixi-spine. Only thing not working for me is the Stretchman head rotation - setting the bone rotation is not updating the sprite rotation? |
Yeah, we have to add this feature to pixi-spine. |
So, I think we can close that :) lets work on one rotation in the pther issue |
That thing: #115 |
What is the plan with spine-ts? I had a quick look here at adding some Pixi to it, but have got stuck already.
Here is the example but it is not applying the local transform on update. Not sure of the workings of the new PIXI v4 transforms.
The text was updated successfully, but these errors were encountered: