0
\$\begingroup\$

I'm making a level select screen and I need use ExtendViewPort (I can't use Fit for other reasons), but this viewport moves my actors to the left, I need center them. I put X and Y position corresponding with my virtual screen size. This is my problem:

enter image description here

I do this things:

setViewport(new ExtendViewport(720, 1280));

@Override
public void resize(int width, int height) {
    levelsStage.getViewport().update(width, height, true);
}

actor.setPosition(10,100); (Examples..)

Sry for my bad english, I speak spanish.

\$\endgroup\$
1
  • \$\begingroup\$ can you provide more code?, do setViewport() is being called from a Stage object? \$\endgroup\$ Apr 7, 2016 at 16:07

1 Answer 1

0
\$\begingroup\$

I already solved my problem using this:

viewport.getWorldWidth() 

I can't explain more because my english is so bad

\$\endgroup\$

You must log in to answer this question.

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