I need to draw a ring on the fly. However, in practice, I use ShapeRenderer
to draw such a small ring whose radius is 32px and border width is 1px, its result is ugly. Compared with browser render result, I give screenshots.
css:
libgdx:
- How to draw ring on the fly like using CSS. (Prepare ring textures with vary sizes, but it is against my original intend).
- How to draw ring with a specific line width like using HTML5 canvas.
.numberCircle {
border-radius: 50%;
/* behavior: url(PIE.htc); remove if you don't care about IE8 */
width: 16px;
height: 16px;
/*padding: 8px;*/
line-height: 16px;
background: #fff;
border: 1px solid #666;
color: #666;
text-align: center;
font: 8px Arial, sans-serif;
}
<div class="numberCircle">0</div>
<div class="numberCircle">1</div>