Hi
It’s me again,
Can I use Layouts (like BorderLayout) to centeralize a JME Spatial inside a gui element (for example inside a button) ?
When I tried to do that I got
java.lang.IllegalArgumentException: Child is not GUI element.
this is my test code
I am doing this test inside my cell renderer.
cell is a lemur button and I added a BorderLayout to it.
Box b = new Box(10, 10, 10); // create cube shape
spatial = new Geometry("Box", b); // create cube geometry from the shape
Material mat = new Material(app.getAssetManager(),
"Common/MatDefs/Misc/Unshaded.j3md"); // create a simple material
mat.setColor("Color", ColorRGBA.Blue); // set color of material to blue
spatial.setMaterial(mat);
((Node)spatialNode).attachChild(spatial);
BorderLayout layout = cell.getControl(GuiControl.class).getLayout();
layout.addChild(BorderLayout.Position.Center, (Node)spatialNode);