1

When rendering a texture region in android as opposed to getting the image (which i get in desktop), i get just black boxes instead of the image. I have a feeling it would be to do with the unusual 4495*260px size of the image. Here is the code for the texture region:

        walkSheet = new Texture(Gdx.files.internal("data/spritesheet5.png"));

        upFarmer1 = new Sprite (walkSheet, 0, 0, 145, 130);  

        upFarmer2 = new Sprite (walkSheet, 170, 0, 170, 170);
        upFarmer3 = new Sprite (walkSheet, 340, 0, 170, 170);
        upFarmer4 = new Sprite (walkSheet, 680, 0, 170, 170);
        upFarmer5 = new Sprite (walkSheet, 0, 170, 170, 170);
        upFarmer6 = new Sprite (walkSheet, 170, 170, 170, 170);
        upFarmer7= new Sprite (walkSheet, 340, 170, 170, 170);
        upFarmer8= new Sprite (walkSheet, 680, 170, 170, 170);

        TextureRegion[][] tmp = TextureRegion.split(walkSheet, walkSheet.getWidth()/FRAME_COLS, walkSheet.getHeight()/FRAME_ROWS);              // #10
        walkFrames = new TextureRegion[FRAME_COLS * FRAME_ROWS];

        int index = 0;
        for (int i = 0; i < FRAME_ROWS; i++) {
            for (int j = 0; j < FRAME_COLS; j++) {
                walkFrames[index++] = tmp[i][j];
            }
        }
//        walkAnimation = new Animation(0.225f, walkFrames);      // #11
        walkAnimation = new Animation(1/90f, walkFrames);      // #11
        spriteBatch = new SpriteBatch();                // #12
        stateTime = 0f;
        }

I have been using libgdx, which i believe uses the GL20 or GL10, however i have had little experience with these, and if they are the problem please direct me to the location where I am to solve the problem within the application.

genpfault
  • 51,148
  • 11
  • 85
  • 139
  • 1
    Not all Android devices support sizes greater than 2048. – Tenfour04 Feb 01 '15 at 02:40
  • note what it says @Tenfour04, but maybe you can try in API Level 11+ can have android:largeHeap="true", I never used to for libgdx but perhaps help , look this question http://stackoverflow.com/questions/11275650/how-to-increase-heap-size-of-an-android-application – Angel Angel Feb 01 '15 at 08:27
  • 1
    See http://stackoverflow.com/questions/24101711/is-there-a-max-libgdx-texture-size-for-desktop (despite the name, it also applies to Android, not just desktop) – P.T. Feb 01 '15 at 18:45

0 Answers0