mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-18 22:56:15 +01:00
ImageButton for new Button design
This commit is contained in:
parent
646d301554
commit
a78261594d
@ -0,0 +1,39 @@
|
|||||||
|
package pp.monopoly.client.gui;
|
||||||
|
|
||||||
|
import com.jme3.texture.Texture;
|
||||||
|
import com.simsilica.lemur.Button;
|
||||||
|
import com.simsilica.lemur.component.QuadBackgroundComponent;
|
||||||
|
import com.simsilica.lemur.style.ElementId;
|
||||||
|
|
||||||
|
import pp.monopoly.client.MonopolyApp;
|
||||||
|
|
||||||
|
public class ImageButton extends Button {
|
||||||
|
|
||||||
|
private final String file;
|
||||||
|
private static MonopolyApp app;
|
||||||
|
|
||||||
|
public ImageButton( String s, String file, MonopolyApp app ) {
|
||||||
|
this(s, true, new ElementId(ELEMENT_ID), null, file, app);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ImageButton( String s, String style, String file, MonopolyApp app ) {
|
||||||
|
this(s, true, new ElementId(ELEMENT_ID), style, file, app);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ImageButton( String s, ElementId elementId, String file, MonopolyApp app ) {
|
||||||
|
this(s, true, elementId, null, file, app);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ImageButton( String s, ElementId elementId, String style, String file, MonopolyApp app ) {
|
||||||
|
this(s, true, elementId, style, file, app);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ImageButton( String s, boolean applyStyles, ElementId elementId, String style, String file, MonopolyApp app ) {
|
||||||
|
super(s, false, elementId, style);
|
||||||
|
this.file = file;
|
||||||
|
ImageButton.app = app;
|
||||||
|
Texture backgroundImage = app.getAssetManager().loadTexture("Pictures/Buttons/"+file+".png");
|
||||||
|
setBackground(new QuadBackgroundComponent(backgroundImage));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user