Hi,
im playing with Lemur to see how it works.
I have a Button and added a command. That command is changing the background of the button. When the background of the button has changed I can not access the command. Without the change of the background all commands are working.
Can anyone give me a hint why?
And if it is possible to change the button background from command ?
PS: I found this post
https://hub.jmonkeyengine.org/t/dynamic-background-images-on-lemur-buttons/40314
but it is more about background pictures and lemur styles.
Here are the few lines of code I am using
QuadBackgroundComponent q1 = new QuadBackgroundComponent(txtele);
QuadBackgroundComponent q2 = new QuadBackgroundComponent(txtele2);
...
b2.setName("Status01");
b2.setBackground(q1);
Command Order_01 = new Command() {
@Override
public void execute(Object source) {
if (b2.getName().equals("Status01")) {
// b2.setBackground(q2);
b2.setName("Status02");
System.out.println("Order 01 - A");
} else {
// b2.setBackground(q1);
b2.setName("Status01");
System.out.println("Order 01 - B");
}
}
};
b2.addCommands(Button.ButtonAction.Up, Order_01);