LibGDX quest log display?

I’m writing a top down RPG using LibGDX and I’m trying to figure out how to create a screen to display the data of a given quest. For example, let’s say you have a quest called “Goblin slayer” and you click on that quest in the quest tracker. A screen should come up saying the title of the quest, completed objectives and current objectives. How would you guys suggest setting this up?

Thanks :slight_smile:

 public NpcWindow(String title) {
        TextureAtlas atlas = AssetAccessor.getInstance().getAtlas();
        TextureAtlas.AtlasRegion background = atlas.findRegion("ui/window/background");

        SpriteDrawable spriteDrawable = new SpriteDrawable(new Sprite(background));

        DirectoriesLevel_Extend dle = new DirectoriesLevel_Extend();
        BitmapFont simpleWhiteFont = dle.getSimpleWhiteFont();

        WindowStyle ws = new Window.WindowStyle(simpleWhiteFont, Color.BLUE, spriteDrawable);
        window = new Window(title, ws);
    }

Use Window

:smiley:

^ That’s not really a great answer, code is too specialized to your game. I would recommend having a stage and table specifically for the hud and things like quest targets.

I know, its just a small code example.I dont know if he ever saw a Window implementation so i thought that would give him an idea…

But yes, you need a stage, table;;; But i think he knows that?

I mean a separate stage from the one you use for your game actors.

Ah.
Why would you have two stages?

TWL is what you need.
http://l33tlabs.org/

I havent tried it myself, but it seems totaly awesome. Though i heard it was a harder then the other GUIlibrary, Box2D i think it was called?
Check both of those.

I think this question that i have will help the OP, im not hijacking !
But the answer might help him as will help me.

Is there a Window Maker ( eclipse ) or a Swing View maker ( netbeans/mantissa?) for libgdx? Perhaps he could make some of the windows in that and just load them?

If you are using libgdx why not use scene2d? https://github.com/libgdx/libgdx/wiki/Scene2d then look at https://github.com/libgdx/libgdx/wiki/Scene2d.ui specifically the window and dialog section on that screen. browse the libgdx source for a scene2d example on these two things if you have not used them before.

Thanks for all the suggestions. I’ve been using scene2D in my game but don’t fully understand it. I think I’ve used it completely wrong. If I was to post up the source for my game, do you think someone could take a brief look at it to see if I’ve been doing it correctly? It feels really uncomfortable to use and the documentation seems lacking.

Thanks for all the suggestions :slight_smile:

This is the source if anyone has a chance.

I suggest paste bin to post the code :smiley:

Well, for example, if you use box2d one stage will have a scaled viewport. It’s a pain to have to also scale the gui components to the same box2d scale so we just use a different stage with an unscaled viewport.

I understand!
Thanks!

Note taken on the pastebin suggestions. Would it be possible to glance at my overall project though? I don’t mean to be a burden, but I have a lot of classes that render(I’ve realized this has been a bad decision) and want to refactor my code to a much cleaner point before I continue. If it will make things easier, I’ve located all the classes that render. They are:

jesse.rscl.map.MapManager
jesse.rscl.player.PlayerEquipment
jesse.rscl.player.PlayerInventory
jesse.rscl.player.PlayerSkills
jesse.rscl.player.screens.GameScreen
jesse.rscl.UI.QuestTrackerUI
jesse.rscl.UI.TabBar
jesse.rscl.UIManager

While we’re addressing the issue of rendering and graphics, can anyone suggest me a decent way of providing multi-resolution support? I can only run this game properly on my desktop and not my laptop because the resolution is too large for my laptop.

Thanks again for any help, I know it’s a mess :confused:

I will look into your code tommorow, i promisse!
Also, re-arranging your question, is there a way to check available resolutions with libgdx?

Btw you use netbeans or eclipse?

Appreciate that, I’m sure a set of fresh eyes will do wonders. Plus, the criticism will really help me understand what I’m doing correctly and incorrectly.

As for your question, I use Eclipse.

Np i will check how the get a list of avaialable resolutions using libgdx and get you back.

Multi-resolution support is a term that’s kinda thrown around. Do you always want to keep the width/height ratio?

Also, current resolution with libgdx is

Gdx.graphics.getWidth();

and

Gdx.graphics.getHeight();

Yes, I’d like to keep the same ratio if possible.

Just in case someone needs it :


            for (int i = 0; i < LwjglApplicationConfiguration.getDisplayModes().length; i++) {
                System.out.println("\n");
                System.out.println("Resolution : Width " + LwjglApplicationConfiguration.getDisplayModes()[i].width);
                System.out.println("Resolution : Height " + LwjglApplicationConfiguration.getDisplayModes()[i].height);
            }