Skip to content
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

Flip Animation #23

Closed
Tembac opened this issue Sep 21, 2015 · 7 comments
Closed

Flip Animation #23

Tembac opened this issue Sep 21, 2015 · 7 comments
Labels

Comments

@Tembac
Copy link

Tembac commented Sep 21, 2015

Hello,

I'm trying to implement spriter with HaxeFlixel using SpriterHaxeEngine.
The problem I encountered is that I can't flip the spriter sprites.

I tried this:

if (flipX)
{
//spriterAnims.info.scaleX = -1;
spriterAnims.info.scaleY = -1;
}
else
{
//spriterAnims.info.scaleX = 1;
spriterAnims.info.scaleY = 1;
}

But id does crazy things. Is there any solution?

@loudoweb
Copy link
Owner

It seems that it's a missing feature.
I also need this feature so I will probably write it, but not before October because I don't have the time right now.

A temporary fix exists within Spriter by creating a clone of your animation:
-select your animation in the animation pannel
-click on the ... button
-create a clone with scaleX -1 or scaleY -1
then you just have to switch between the all set of animations in your engine.

@loudoweb
Copy link
Owner

Maybe it's a bug because I see that some other implementations have the same behavior. I guess there is an error in the scml reference. See http://brashmonkey.com/forum/index.php?/topic/3127-flipping-not-working/?hl=flip

loudoweb added a commit that referenced this issue Sep 21, 2015
@sruloart
Copy link
Contributor

Shouldn't you be doing the flipping part with Flixel? .info.scaleX is only relevant when you first create the FlxSprites (AFAIK). On dev there are a number of options, I'm not too sure what you should use on 3.3.11 but I think there's a related FlxAtlas demo for that (just don't mistake the dev version to be the 3.3.11 compatible version, that won't work).

@loudoweb
Copy link
Owner

Finally I made the change because I was able to find a fix in the Spriter forum :)
So 2 solutions for you right now : grab the dev branch of this repo (beware that I didn't test this branch with Flixel right now so please give me feedback), or just update the SpriterHaxeEngine with the updated file or line.

@loudoweb
Copy link
Owner

What do you mean @sruloart ? is the dev branch of SpriterHaxeEngine not working with Flixel?

Can somebody provide me a quick sample project using Flixel and SpriterHaxeEngine, I will be able to test myself on flixel that way :)

@sruloart
Copy link
Contributor

Master should work with master (spatialResult in the FlixelLibrary) dev with dev (info in the FlixelLibrary). I'm working with dev and a demo is a good idea, HaxeFlixel would benefit from that as well, so I would definitely look into it.

What I've meant to say is that you don't have to use the engine to tell you something is flipped, you can just flip it using Flixel directly (both on master and on dev).

Using the angle to flip the sprite? wouldn't it just spin it around?

@loudoweb
Copy link
Owner

Using the angle to flip the sprite? wouldn't it just spin it around?

I'm just following the fix I saw on Spriter forum. I'm not sure of how to do that otherwise right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants