Comments (5)
Normally when the game is set up in pause, all animated game objects are stopped via a Signal dispatched and then resume when the game continue.
Deactivate event should never be used for a in game action. It's only used for when you leave the application/ or change the tab in your browser.
Also Starling isn't rendered in the update loop, I mean Starling doesn't need to have an action made/call in the enter frame (from the Citrus Engine side).
If you make a menu with Starling, you will use mostly Starling objects, not Citrus Sprite. It will be quicker to add event listener, create sprites with images inside, buttons etc. So actually I don't see a real problem if the State loop isn't made anymore.
from citrus-engine.
"Normally when the game is set up in pause, all animated game objects are stopped via a Signal dispatched and then resume when the game continue."
I understand, but CitrusEngine actually stops Starling altogether. so everything running with the starling juggler stops.
if your ui is using jugglers to animate etc, then the ui is stopped as well when you use _ce.playing = false.
the updates are stopped as well... so if you want your ui to move in that case, you have to add a new enter frame event listener , and that's too bad.
"Deactivate event should never be used for a in game action. It's only used for when you leave the application/ or change the tab in your browser."
I'm sorry here I didn't meant to use those event for in game things, I was just talking about how CE listens to activate/deactivate to play/pause a game by default.
"If you make a menu with Starling, you will use mostly Starling objects, not Citrus Sprite. It will be quicker to add event listener, create sprites with images inside, buttons etc. So actually I don't see a real problem if the State loop isn't made anymore."
You are correct here. but by default, doing _ce.playing = false; stops the starling instance as well, therefore if you are going to use IAnimatable sprites in your starling menu, these won't play at all because the starling instance is stopped.
What I suggested here was to run a custom juggler with CE, a juggler that we can pause/play, instead of stopping all of starling ... maybe there's a good reason to stop all starling which I'd understand.
So _ce.playing = false;
would stop the "CE main juggler" (not starling)... all AnimationSequences would stop... but if you had another custom juggler running for your menus for example, then it would still be running as starling would not be stopped.
Here's maybe the only important point I was trying to make:
deactivating/activating should stop/start starling, you are right about that, as most often this means we are not looking at the game anyway and it would run for no good reason.
but _ce.playing = false; should only "pause the game" and not stop starling.
that way we can have an easy way of pausing a game.
and also if we want to keep animating stuff when a game is paused, then we can use a custom juggler (so starling needs to keep running) or start a new enter frame event listener if we need to update other stuff I guess
from citrus-engine.
Don't worry about this issue though, to me its far less important than any other
I just wanted to write this down somewhere and share it, I didn't expect a reply that soon but thanks for it anyway.
there are more important issues. important doesn't mean urgent either
from citrus-engine.
Where Starling is stopped when playing = false; ? I can't find it.
from citrus-engine.
I think we've got that covered now.
from citrus-engine.
Related Issues (20)
- MediatorScene._poolObjects after scene cycle, has null. HOT 2
- Implement a 'remove()' method to PhysicsCollisionCategories.as HOT 1
- ObjectMakerStarling is using old QuadBatch HOT 4
- Feathers swc version problem
- rename _realState to _realScene in display list Scene
- Jump bug CE 3.1.12 + Nape HOT 2
- MathUtils
- ViewportMode.FULLSCREEN -> ViewportMode.SHOW_ALL
- GameInput : update CE's input package
- easy way to activate/deactivate objects
- Accessing undefined properties starling.contentScaleFactor HOT 7
- CitrusSoundGroup could be created like any other CE object, not only creating a custom class HOT 3
- FluidBox.as needs to be removed HOT 1
- SpriteArt/StarlingArt dragonBones code HOT 2
- CitrusStarlingJuggler (pausable juggler) per StarlingScene
- Get rid of linked list in the pooling system
- The classes should implement the functions of interface 'ISpriteView' HOT 1
- Camera onPostUpdate / enabled
- Create NapePhysicsCompound/Box2DPhysicsCompound
- Yay
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 citrus-engine.