I'm developing a game for Android using libGDX. I implemented "spotlight effect" for highlighting some scene elements in tutorial levels. I did use Pixmap class for implementing this. So I did something like this:
public class ComplexSpotlight implements MoveObserver{
// somewhere in class
public void update(){
black.setColor(0, 0, 0, 0.7f);
black.fill();
black.setColor(0, 0, 0, 0);
for(Map.Entry<MoveObservable, Vector2> entry : currentObservablePositions.entrySet()){
Vector2 position = entry.getValue();
int x = (int)(Gdx.graphics.getWidth()/2+position.x);
int y = (int)(Gdx.graphics.getHeight()*1.5f-position.y);
int radius = 50;
black.fillCircle(x, y, radius);
System.out.println("at "+x+" "+y);
}
overlay.dispose();
overlay = new Texture(black);
}
public Texture getOverlayTexture(){
return overlay;
}
Fast explanation - I'm creating a Pixmap filling it with color(0,0,0,0.7f). After this I'm drawing transparent circle using Pixmap.fillCircle() method. And then I'm creating new Texture using this Pixmap. I've tested this code using following devices: HTC One V(480*800), Sony XPeria Neo 15i(480*854), HTC Desire S(480*800) and it works good;
But today I'm found that there are problems on HTC One X(1280*720) and Gamsung Nexus(1280*720) - I'm seeing black screen only.
So it would be nice if someone give me some explanation about this issue. Links, thoughts - anything may be helpful. Thanks in advance!