How to create minimap in scene2d? I think this need make on two stages, but I don’t know how. Please write me an example. Thanks in advance.
Could you explain your problem a little bit more?
I do not understand how to make the minimap a different scene over the main stage in scene2d, another scene I just do not see
I have never used scene2d. What does it do? Does it allow you to draw sprites in 2d space?
You could just draw a minimal version of what you’re actually drawing on the corner somewhere, that would make a minimap i guess.
https://github.com/libgdx/libgdx/wiki/Scene2d.ui Is a good place to start.
I just started looking into this to make a HUD, though it is tricky and I havent gotten far.
I’d say you have to look into making your own Drawable, which is not too difficult. Then you can for example show the minimap Drawable in an Image actor.
Also, I’m not going to write your code for you, oh thou lazy one
Scene2d is ‘scene2d is a 2D scene graph for building applications and UIs using a hierarchy of actors.’ Which is pretty cool, and very useful for building an user interface when using LibGDX.
I don’t think that there is need for a second stage. You should really explain what you are trying to accomplish (More then one sentence)
I create table, and add to him another table and set background, but I have 3 answers:
- How I can attach root table to screen? Because my player move, and his coordinates change
- How I can dynamical draw elements minimap in this table?
- How in the future to make the player move by clicking on the minimap? Because then I have to use a another stage in the table?
[spoiler]
[/spoiler]
For such an overlay I think that using a
Some suggestions:
- Draw your GUI elements using a different camera than the one used for drawing game elements. E.g. make another OrtographicCamera guiCamera, keep this one in a fixed position, and set it active before rendering the Stage
- See my earlier post, make a Drawable
- Handle input events on the minimap Actor, no need for another stage