that is showing a background layer I cant see the effect.
I have searched the lemur library (like button.java, glass-style etc.) and found things like that runEffect(EFFECT_CLICK); etc. but still I am not able to figure out where the buttonw down effect of glass style is located.
My questions are:
How can I apply or use the same effect as in button glass style ? (is it an animation/tween?)
Why/where is the button effect lost during the setting of my own style ?
I also made my own style (with the same name) for label and container! Does this have an influence on button (due to inheritance) ?
Here is the solution that worked for me. I implement the desired behaviour as a style and not as commands to new buttons.
Attributes attrs = style.getSelector("button", "mystyle");
// the "moving" of the button
Command<Button> pressedCommand = new Command<Button>() {
public void execute( Button source ) {
if( source.isPressed() ) {
source.move(1, -1, 0);
} else {
source.move(-1, 1, 0);
}
}
};
// list of commands + we add the example command
List<Command<Button>> commandlist = new ArrayList<>();
commandlist.add(pressedCommand);
// Map of Buttonactions and commands, we add it for "button clicked/unclicked"
Map<Button.ButtonAction,List<Command<Button>>> commandMap = new HashMap<>();
commandMap.put(Button.ButtonAction.Down,commandlist);
commandMap.put(Button.ButtonAction.Up,commandlist);
// finally we add it to the style
attrs.set("buttonCommands",commandMap);