Jump to content

Spriter-scon-js


deangiberson

Recommended Posts

I'd like to share a javascript implementation of the Spriter format player, https://github.com/deangiberson/spriter-scon-js.

It's designed to be generic but has a dependency on CraftyJS PreloadJS currently, but that's easily removed.

The currently know problem is that it doesn't play well with negative scales. So for example the Ladder animations out of the PlatformPack don't work, everything else works great.

For an example of how it's used look at examples/crafty/hero.js, for now that's all there is, but I'm adding more.

lucid, maybe you could look and let me know if you see why negative scales aren't working?

Link to comment
Share on other sites

  • 3 weeks later...

hi deangiberson,

Can you show me a screenshot, of the incorrectly working negative scale? I may be able to figure out what's wrong, as I've seen issues with negative scale before.

It's most likely this. If you're unmapping a child bone from local coordinates, you have to flip the angle to get mirrors to look right:


if(parentBone.scaleX*parentBone.scaleY {
unmappedChild.angle=(360-child.angle)+parentBone.angle;
}
else
{
unmappedChild.angle=child.angle+parentBone.angle;
}

Link to comment
Share on other sites

  • 2 weeks later...
HTML and Javascript? Im confused. What is Javascript used for? I know that you can write using javascript but what is the difference between javascript and HTML, how are they different, how do their uses differ? Thanks a lot.

The simple answer is that html by itself makes static pages. (It's short for HyperText Markup Language.) With javascript (or another scripting language), you can make the pages change.

Link to comment
Share on other sites

  • 1 year later...

Thank you for this implementation, it really is helpful.

 

Only problem I'm having is that my sprite animations don't show correct alphas, actually every object is visible all the time, even though they should not be. Is there some way in Spriter to make my problem go away? I make objects appears as the animations proceed, so this is very important to get working. 

 

EDIT: Got it working, it was a problem with updating the globalAlpha on my context. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...