Closed xaguzman closed 9 years ago
The way I've used TweenManager
so far was as a global variable and a simple system like this:
class TweeningSystem extends VoidEntitySystem {
@override
void processSystem() {
tweenManager.update(world.delta);
}
}
But your idea isn't bad because with the way I'm doing it I'm polluting the global namespace which isn't that good (and I'm doing it with some other things like a GameState
too).
I'll consider your suggestion for the next version..
Properties can now be accessed like this:
class System extends EntityProcessingSystem{
process(e) {
// direct
world['tManager'].update(world.delta);
// or via properties (if you need to do use some other map methods)
world.properties['tManager'].update(world.delta);
}
}
great! thanks! :)
Xavier Guzman
http://blog.xavierguzman.com http:////plus.google.com/u/0/113140404022814604923? http://mx.linkedin.com/in/xavierguz/ https://twitter.com/arkalain
Blog http://blog.xavierguzman.com | G+ http:////plus.google.com/u/0/113140404022814604923? | LinkedIn http://mx.linkedin.com/in/xavierguz/ | Twitter https://twitter.com/arkalain
On Sat, Mar 28, 2015 at 2:42 AM, Dennis Kaselow notifications@github.com wrote:
Properties can now be accessed like this:
class System extends EntityProcessingSystem{ process(e) { // direct world['tManager'].update(world.delta);
// or via properties (if you need to do use some other map methods) world.properties['tManager'].update(world.delta);
} }
— Reply to this email directly or view it on GitHub https://github.com/denniskaselow/dartemis/issues/48#issuecomment-87191895 .
In the java version, it's very annoying when you want to put some aditional stuff right into your world so all the systems have access to it.
Let's say for example that I want to have tweens available in all of my systems, if we were using the universal tween engine (shameless self promotion), we would need to extend world to add a TweenManager property to it:
I think it would be nice to have some kind of built-in functionality so it could be called in the form of:
Just so that there's no absolute need to do this by hand. It will, surely, not be enough for all cases, but I see quite some cases where this might be useful.
It might not seem as a huge gain, and it might actually not be, but I think nice-to-have functionalities are always very welcome