jMonkeyEngine-Contributions / Lemur

Lemur is a jMonkeyEngine-based UI toolkit.
http://jmonkeyengine-contributions.github.io/Lemur/
BSD 3-Clause "New" or "Revised" License
116 stars 32 forks source link

Allow the effect control to run effect instances directly. #51

Closed NemesisMate closed 5 years ago

NemesisMate commented 7 years ago

Currently, to run an effect on an EffectControl the only way is to add it and then run it by its name. I'm trying to make a Tween that runs another effect that isn't added individually.

For example:

Effect press = ...;
Effect release = ...;

Effect clickEffect = ... new TweenAnimation(Tweens.runEffect(target, press), Tweens.runEffect(target, release)) ...

Currently I did a tween that run the effects by name:

Effect clickEffect = .... new TweenAnimation(Tweens.runEffect(target, "name), Tweens.runEffect(target, "name2")) ....

The problem with this is that when the press/release effects are added they can be added with other names. With the runEffect(Effect) support added this could be done with two advantages:

pspeed42 commented 5 years ago

For effects, the "name" indirection is like 90% of what they are designed for. The idea that you can call runEffect(Button.EFFECT_PRESSED) and not worry about what effect instance is registered at that particular instant in time. The other 10% is the channel support.

So what part of Effect are you using in this case where you are not invoking it by name and not using the channel support? Isn't it just an animation at that point?

pspeed42 commented 5 years ago

I'm going to close this issue pending further discussion. It would be good to know what it is your are actually trying to do which may factor back into this (and we can reopen) or lead to a different path.