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

Find a way to get rid of transition functions in FlxState #1676

Closed
Gama11 opened this issue Dec 20, 2015 · 4 comments
Closed

Find a way to get rid of transition functions in FlxState #1676

Gama11 opened this issue Dec 20, 2015 · 4 comments
Milestone

Comments

@Gama11
Copy link
Member

Gama11 commented Dec 20, 2015

Really not a fan of having isTransitionNeeded() and transitionToState() in FlxState. They're only needed by the transitions classes in flixel-addons. which makes them a hack in my opinion. The system should be flexible enough that you can create addon classes like this without modifying the base FlxState class.

I'd also like to avoid them becoming part of the public API we have to keep compatibility with in a 4.0.0 release.

@Gama11 Gama11 added this to the 4.0.0 milestone Dec 20, 2015
@Tiago-Ling
Copy link
Contributor

+1

Tiago Ling Alexandre
Tel: +55 41 8819-3191

2015-12-20 8:18 GMT-02:00 Gama11 [email protected]:

Really not a fan of having isTransitionNeeded() and transitionToState()
in FlxState

flixel/flixel/FlxState.hx

Lines 132 to 149 in 637e4a5

/**
* Checked by FlxG.switchState to see if a transition is required before switching states
* @return
*/
public function isTransitionNeeded():Bool
{
//override in your subclass to enable this functionality
return false;
}
/**
* Perform a visual transition, and when it's complete, call FlxG.switchState
* @param State
*/
public function transitionToState(State:FlxState):Void
{
//override in your subclass to enable this functionality
}
.
They're only needed by the transitions classes in flixel-addons. which
makes them a hack in my opinion. The system should be flexible enough that
you can create addon classes like this without modifying the base FlxState
class.

I'd also like to avoid them becoming part of the public API we have to
keep compatibility with in a 4.0.0 release.


Reply to this email directly or view it on GitHub
#1676.

@Gama11
Copy link
Member Author

Gama11 commented Dec 20, 2015

I think I've found a more flexible solution...

@larsiusprime
Copy link
Member

Cool

@Gama11 Gama11 closed this as completed in be11c5f Dec 20, 2015
@Gama11
Copy link
Member Author

Gama11 commented Dec 20, 2015

The new FlxState#switchTo() should be a bit more flexible.. Even if not, it doesn't have "transition" in the name and the implementation is simpler. :)

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

No branches or pull requests

3 participants