5
\$\begingroup\$

I'm not sure if I'm missing it somewhere or if this just doesn't exist, but I'd like to support "retina" graphics on desktop displays that support them (like the newer MacBook Pro), but I can't find a way to change the density of the LWJGL canvas in Libgdx.

Is this possible? How can I do it?

\$\endgroup\$

5 Answers 5

3
\$\begingroup\$

I know this post is old, but I found it when having the same issue. I luckily found this option after:

LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.useHDPI = true;

Maybe this was not available at the time, but it did solve my problem! Now my textures look super sharp.

\$\endgroup\$
2
\$\begingroup\$

Retina Graphics is just a fancy word for high pixel density. What makes your game support high density displays is the resolution of your assets, not the engine.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I understand the meaning, but I am unable to get the engine to display the game's canvas in a non-pixel-doubled format. \$\endgroup\$
    – Evan Walsh
    Commented Dec 21, 2013 at 21:20
2
\$\begingroup\$

I may be way off the mark here but this comes from my experience with PlayN (which seems very similar to libGDX).

Though Retina means double resolution you treat it as if the resolution were the same as a non-retina device. Apples core libraries will even tell you that the screen if half the size as it actually is!

When you load an image asset, say "Sprites.png", iOS will actually first look for a file called "[email protected]" and use that file instead.

When coding for iOS you're are no longer working in pixels - but in points - and its up to iOS how big a point is depending on the context.

So all you need to do is provide versions of all of your image assets at twice the resolution with a slightly different file name e.g. "Sprites.png" and "[email protected]". The iOS will do the rest :D

I hope that makes sense... I didn't get much sleep last night :)

\$\endgroup\$
2
0
\$\begingroup\$

If you use an OrthographicCamera to display the scene, it has a zoom option, have you tried looking into it?

\$\endgroup\$
1
  • \$\begingroup\$ I have tried this, but it does not change the pixel density, from what I can tell. \$\endgroup\$
    – Evan Walsh
    Commented Dec 19, 2013 at 20:42
0
\$\begingroup\$

It's a problem with JAVA apps being scaled twice by retina displays. I presume your talking about the desktop version right? I currently have the same issue, it's super blurry. The solution is to turn off retina scaling for java apps, currently trying to figure this out.

\$\endgroup\$

You must log in to answer this question.

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