Comments (5)
Hey,
Thanks for creating a new issue for it!
So, looking over your code, and then over Phaser's Group prototype for.top
(https://github.com/photonstorm/phaser/blob/master/src/core/Group.js#L2771) seems like it might be actually related to Phaser setter of .top
. Check it out, there's a call to .getBounds()
after which the group's .y
is being set.
IMO it's randomly happening, maybe, because whenever the transition didn't finished yet, and the slide it's still animating, the .top
setter makes the call to .getBounds()
which in turn might catch the overlapping of the slide.
To confirm this, can you use this instead of getRandomStateTransitionIn()
{
ease: Phaser.Easing.Exponential.InOut,
duration: 2e3, // 2s
intro: true,
props: {
y: function(game) {
return game.height;
}
}
}
This increases the transition duration and you could notice the scrambled sprites more often.
Cheers!
from phaser-state-transition.
Ah ok i thought it might be something like this. That seems probable to me. I'll check it out after work. Thanks man! Good find!
from phaser-state-transition.
Yeah that change makes it much more likely. I upped it to 3s and it seems to happen every time. commit Can you clarify what you mean by
.top
setter makes the call to.getBounds()
which in turn might catch the overlapping of the slide.
Any idea on how we can remedy this? I'm looking over the plugin now for potential solutions. I've updated my repo with the new transitions. Something suspicious that I've noticed is that on the initial rendering game.world has the properties
//on my monitor
centerX:586
centerY:409
x:-0
y:-0
but on all subsequent state transitions when it breaks (remains the same when it does not break):
centerX:586
centerY:-2551
x:-0
y:-0
Since I'm only transitioning on Y, I'd assume game.world would probably break on its X value when you transition horizontally as well.
Also, I noticed some other potential issues.
- When my random 'out' transition is null and the 'in' transition is In.SlideTop, no transitions occur. When 'in' is null and 'out' is Out.SlideTop, transitions work.
- When the 'out' transition is Out.SlideTop and the 'in' transition is the custom one defined above, it transitions in a disjointed way.
- store transitions out via SlideTop. It appears that the next state begins simultaneous to the transition, which means by the time it finishes the state has been running game logic for a little while.
- There is a brief pause as you can see the next state running.
- The 'In' transition begins & ends, overlapping game state, and you can view the state again.
from phaser-state-transition.
K I've fixed some issues but still have not figured out why world/Groups are getting messed up. It seems to somehow be caused by the renderXY call that is drawing world to the ContentSnapshot Image
from phaser-state-transition.
OK SO I found a work around. Instead of using ...renderXY(game.world...
iterate over all of game.world's children and call renderXY on those instead. I guess game.world is treated different than a generic Phaser.Group or displayObject. But this seems to work well for me! I'll submit a PR.
from phaser-state-transition.
Related Issues (20)
- [Question] Need help to use this plugin HOT 10
- state "create" method being called twice when using "In" transition HOT 14
- Want to use default state parameter HOT 2
- State slide left transition in draws twice HOT 10
- Transition does not care about camera position HOT 2
- Starting a transition while a transition is running creates a ghost snapshot HOT 4
- `game.state.start` can take other parameters, which this hijacks HOT 5
- Add list of transitions HOT 3
- (chore) Benchmark tests should be included
- Codepen examples HOT 1
- Persistent Sprites Hidden behind background in Snapshot HOT 6
- Typescript definition updates ? HOT 3
- How to disable anti-aliasing during transition? HOT 7
- Blank screen before transition HOT 1
- Feedback needed HOT 7
- Screen blinking upon transition HOT 4
- Support for v3
- v2.10.0 breaks the position of the slide HOT 2
- Unable to use .js HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phaser-state-transition.