Libgdx Software Design

Viewed 66

I am building a libgdx game, and I am not sure what tools are available right now.I have a folder with actors and I do all the logic inside those actors, but I have to add them manually to the stage, is there any way I can load all those actors at once.

public class ConfigureUI extends Stage {
    private RuvikEngine ruvikEngine;
    private OrthographicCamera camera;

    public ConfigureUI(ScreenViewport viewport, RuvikEngine engine, OrthographicCamera camera) {
        super(viewport);
        this.ruvikEngine = engine;
        this.camera = camera;
        configure();
    }

    private void configure() {
        //TODO make a scalable UI class system,so we can load each UI component independently
        TextureActor actor = new TextureActor("move.png");
        TextureActor reset = new TextureActor("reset.jpg");
        Image image = new Image(actor.texture);
        Image resetimg = new Image(reset.texture);
        image.setPosition(225, 0);
        this.addActor(image);
        this.addActor(resetimg);
        image.addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                GameUIState.getInstance().setPAN_MODE(!GameUIState.getInstance().isPAN_MODE());
                super.clicked(event, x, y);
            }
        });
        resetimg.addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                ruvikEngine.clearBodyArray();
                ruvikEngine.addBody(new Body(new Vector2(1920 / 2, 1080 / 2), new Vector2(0, 0), 1000));
                camera.position.set(GameUIState.getInstance().width / 2, GameUIState.getInstance().height / 2, 0);
                camera.zoom = 0.1f;
                camera.update();
                super.clicked(event, x, y);
            }
        });

    }

}```
1 Answers

If you are looking for a Visual Editor like unity. Sorry but libgGdx doesn't have one. But if you want some framework to make your game more easily.

You can take a look to Autumn Mvc a spring like framework you will permit you to make your game menu rapidly. And who will add Ioc to your stack. Who can simplify your code greatly

I never use it myself because i don't need it but this can be a good solution.

Related