MiniMap and Gamestates

I can draw a minimap from a gamestate (e.g. world) via in my Minimap Gamestates render function.





public void render(float tpf) {
        super.render(tpf);
        WorldGameState wgst = (WorldGameState) GameStateManager.getInstance().getChild("world");
        Node wRootNode = wgst.getRootNode();
        // very important since world scene should be drawn in minimap
        tRenderer.render(wRootNode, fakeTex);
    }



But how could I acomplish the drawing of a minimap from more than one gamestates rootNode?

maybe you could create a MiniMapGameState which has references to the other gamestates ?


I did it that way

Is this a good way or exists better ones? At least it works :slight_smile:



in construction of monitor / minimap gamestate


 // prepare scene for texture
        combineNode = new ArrayList<Spatial>();
        WorldGameState wgst = (WorldGameState) GameStateManager.getInstance().getChild("world");
        ObjectGameState ogst = (ObjectGameState) GameStateManager.getInstance().getChild("object");
        combineNode.add(wgst.getRootNode());
        combineNode.add(ogst.getRootNode());
       
        list = new ArrayList();
        list.add(fakeTex);



and in render I did


tRenderer.render(combineNode, list);