Hello,
i’m using lemur to generate a popup message when i touch some specialy object. This popup is executed in Android’s devices and it worked perfectly on android. The popup message is generated using the next code:
[java]
package mygame;
import com.jme3.app.FlyCamAppState;
import com.jme3.app.SimpleApplication;
import com.jme3.material.RenderState.BlendMode;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
import com.simsilica.lemur.Container;
import com.simsilica.lemur.GuiGlobals;
import com.simsilica.lemur.Label;
import com.simsilica.lemur.LayerComparator;
import com.simsilica.lemur.Panel;
import com.simsilica.lemur.component.QuadBackgroundComponent;
import com.simsilica.lemur.core.VersionedReference;
import com.simsilica.lemur.style.ElementId;
public class Main extends SimpleApplication {
// Define some model references we will use in
// update.
private VersionedReference<Double> redRef;
private VersionedReference<Double> greenRef;
private VersionedReference<Double> blueRef;
private VersionedReference<Double> alphaRef;
private VersionedReference<Boolean> showStatsRef;
private VersionedReference<Boolean> showFpsRef;
private ColorRGBA boxColor = ColorRGBA.Blue.clone();
public static void main(String[] args) {
Main app = new Main();
app.start();
}
@Override
public void simpleInitApp() {
// Initialize the globals access so that the defualt
// components can find what they need.
GuiGlobals.initialize(this);
// Remove the flycam because we don't want it in this
// demo
stateManager.detach( stateManager.getState(FlyCamAppState.class) );
Container ventana = new Container("glass");
ventana.setLocalTranslation(50,250,0);
guiNode.attachChild(ventana);
Container panelVentana = new Container("glass");
ventana.addChild(panelVentana);
panelVentana.setBackground(new QuadBackgroundComponent(new ColorRGBA(0,0.5f,0.5f,0.5f),15,5,0.02f,false));
panelVentana.addChild(new Label("Ventana Emergente", new ElementId("Titulo"),"glass"));
panelVentana.addChild(new Panel(2, 2, ColorRGBA.Cyan, "glass")).setUserData( LayerComparator.LAYER, 2 );
Container mensaje = new Container("glass");
ventana.addChild(mensaje);
mensaje.setBackground(new QuadBackgroundComponent(new ColorRGBA(0,0.5f,0.5f,0.5f),15,5,0.02f,false));
mensaje.addChild(new Label("********-----------------------"
+ "\n----------------*******"));
Box box = new Box( Vector3f.ZERO, 1, 1, 1 );
Geometry geom = new Geometry( "Box", box );
Material mat = new Material( assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor( "Color", boxColor );
mat.getAdditionalRenderState().setBlendMode( BlendMode.Alpha );
geom.setMaterial(mat);
rootNode.attachChild( geom );
}[/java]
So, this popup message must have an icon in left side of title and i don’t know how can i add image in this panel?