简体   繁体   中英

Is height along the x-axis and width along the y-axis in libgdx?

Shouldn't this convention be in reverse?

Desktop app config

cfg.width = 454;
cfg.height = 756;

//Logcat also shows what's expected

Gdx.app.log("height",Integer.toString(Gdx.graphics.getHeight()));.//756
Gdx.app.log("width",Integer.toString(Gdx.graphics.getWidth()));//454

but then this:

shapeRenderer.line(40, 400, 700, 400);

produces this line:

在此处输入图片说明

By default no. LIBGDX uses OpenGL's default origin in the bottom left corner, with Y going up and X going right.

Your camera could be messed up.

Looks like you're running this on Mac. You using RoboVM or Mono? RoboVM support is very new. Its possible there's some bug.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM