Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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;

enter image description here

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!

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.