# Libgdx drawing semi-transparent circle on pixmap

I am currently working on an android game using libgdx and would like to add a joystick to its interface. For this I use the built-in touchpad class. Untill now I have used external images for rendering the background and joystick. Now, I would like to dynamically draw the background of the joystick. This would make it possible to make the background of the joystick semi-transparent and to change the color of the background dynamically.

To do this, I implemented the following:

public class Joystick{

public Joystick(GameWorld world, GuiComponent gui) {

Pixmap background = new Pixmap(200, 200, Format.RGBA8888);
background.setColor(1, 1, 1, .6f);
background.fillCircle(100, 100, 100);
touchpadStyle.background = new TextureRegionDrawable(new TextureRegion(new Texture(background)));

}
}


As you can see, this code provides a joystick with a semi-transparent background: Joystick with semi-transparent background

However, this background has some inexplicable lines that are not transparent. Does anybody know what causes this? I thought it could have something to do with the format of the pixmap, but after trying with some other formats, there was not much improvement.

• I also noticed that when I just draw a rectangle instead of a circle, everything is fine. – Consec Jan 3 '15 at 19:54

To get rid of the lines, you need to set Pixmap.setBlending(Blending.NONE); before you draw the circle.