You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Problems with LibGdxGraphics.drawStage(Stage stage). #85
It renders mirror reflection of stage (comparing to stage.draw()) . I believe it is because Stage has a coordinate system where (0,0) is at the bottom-left while LibGdxGraphics have usual coordinate system (where (0,0) is in the Top Left Corner).
I have tried this:
Camera camera= new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
camera.setToOrtho(true, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
stage = gc.createStage(new ScreenViewport(camera));
But it didn't work out. I guess it is because LibGdxGraphics.drawStage(Stage stage) uses its own camera:
Unfortunately this is due to how we interact with LibGDX and how LibGDX handles the orthographic view and texture U/V values. I'm hoping to fix this in the 2.0 release in the future when I restructure a lot of the internal code.
The easiest workaround I can suggest is to create a org.mini2Dx.core.graphics.TextureRegion (which extends the LibGDX TextureRegion) and pass that to your stage actors.
Looks like this is a lot messier than I thought. LibGDX scene 2D always assumes the bottom left of the screen is 0,0 but mini2Dx assumes it is top-left of the screen (to match Slick2D).
I can change the code so that mini2Dx doesn't manipulate the scene camera but this means the 0,0 graphics coordinates in the scene will be at the bottom left.
Another workaround is to flip your image in an image editor.
Just an FYI that 2.0 will de-couple from LibGDX to allow for consoles support. This means that from 2.0 onwards it'll be recommended to not use LibGDX APIs directly (though it will still be allowed). I'm planning to simplify mini2Dx's UI library to work with a Scene2D-like API. I'm hoping to have a beta of 2.0 by August. More info can be found here
Activity
tomcashman commentedon Apr 19, 2019
What version are you using?
jacynkaa commentedon Apr 20, 2019
mini2DxVersion = '1.8.2'
gdxVersion = '1.9.6'
I also tried switching mini2DxVersion to 1.7 but it didn't help.
tomcashman commentedon Apr 20, 2019
Unfortunately this is due to how we interact with LibGDX and how LibGDX handles the orthographic view and texture U/V values. I'm hoping to fix this in the 2.0 release in the future when I restructure a lot of the internal code.
The easiest workaround I can suggest is to create a org.mini2Dx.core.graphics.TextureRegion (which extends the LibGDX TextureRegion) and pass that to your stage actors.
jacynkaa commentedon Apr 20, 2019
How should I do that if I use skin?
TextButton button= new TextButton("text",skin,"default");
tomcashman commentedon Apr 20, 2019
Looks like this is a lot messier than I thought. LibGDX scene 2D always assumes the bottom left of the screen is 0,0 but mini2Dx assumes it is top-left of the screen (to match Slick2D).
I can change the code so that mini2Dx doesn't manipulate the scene camera but this means the 0,0 graphics coordinates in the scene will be at the bottom left.
Another workaround is to flip your image in an image editor.
Just an FYI that 2.0 will de-couple from LibGDX to allow for consoles support. This means that from 2.0 onwards it'll be recommended to not use LibGDX APIs directly (though it will still be allowed). I'm planning to simplify mini2Dx's UI library to work with a Scene2D-like API. I'm hoping to have a beta of 2.0 by August. More info can be found here
jacynkaa commentedon Apr 20, 2019
OK I have just commented out these three lines in LibGdxGraphics.drawStage and it seems to work:
Thanks for help!
tomcashman commentedon Apr 20, 2019
I'll remove them in next update then XD