2
\$\begingroup\$

I am making a quiz game using LibGDX. I want it to redirect to a website. I am using classes like Text and Label that extends Actor to write text using a bitmap Font. I have no idea on how to provide a link (like anchors in html) in a native app. However, I am not very good at Android but know java well. In android , I saw on stackexchange, we can do so using Intent or string.xml configuration.

Can anyone suggest me a way to do so using Actor in libGDX?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$
        TextButton button = new TextButton("click me", skin);
        button.addListener(new ClickListener(){
            @Override
            public void clicked(InputEvent event, float x, float y) {
                super.clicked(event, x, y);
                Gdx.net.openURI("https://www.example.com");
                event.handle();
            }
        });
\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .