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));

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.

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

I already solved my problem using this:


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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.