7
\$\begingroup\$

This one is probably really simple but I didn't find a solution.

I'm trying to create a widget (speedometer) with libgdx. For the arrows I'm using the setRotation() function. But when the image is rotated, the quality drops.

The result looks like this:

Speedometer

How can I improve the quality of the arrows?

\$\endgroup\$
4
  • \$\begingroup\$ not sure if libgdx has this but in java I use g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); and that helps improve the rotated image quality a lot \$\endgroup\$
    – Savlon
    Commented Apr 23, 2013 at 10:21
  • 3
    \$\begingroup\$ You can also look at your texture filtering and anti-aliasing settings. \$\endgroup\$
    – Roy T.
    Commented Apr 23, 2013 at 10:29
  • 1
    \$\begingroup\$ Yay! Thank you Roy! .setFilter(TextureFilter.Linear, TextureFilter.Linear); fixed this! :) \$\endgroup\$
    – dzonatan
    Commented Apr 23, 2013 at 10:38
  • \$\begingroup\$ @RoyT. add it as an answer, please :) \$\endgroup\$ Commented Dec 23, 2013 at 2:24

1 Answer 1

7
\$\begingroup\$

Roy T. suggested to fix this changing the texture filtering settings, On LibGDX this can be found on Texture.setFilter or changing the Texture Params if you are using the AssetLoader. Set the filter params to TextureFilter.Linear and the problem should be fixed.

For more on the matter, take a look at http://www.learnopengles.com/android-lesson-six-an-introduction-to-texture-filtering/

\$\endgroup\$

You must log in to answer this question.

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