Quantcast
Channel: Android Mode - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 941

preferences in android

$
0
0

i m using image pixels to save the preferences of player in game. m saving the image in data folder with pref.save("data/preferences.png"); but when i deploy this to android device it show me error of not finding the data folder. when i save the image directly to the sketch folder it is not deployed with the code to the device. i write the code to create the image when nt available in skecth folder it creates the image in android but can't be able to change the pixel values of the image the code is given below

  if (loadImage("preferences.png")==null)
    {
      pref = createImage(6, 6, RGB);
      pref.loadPixels();
      for (int i = 0; i<36; i++)
      {
        pref.pixels[i] = color(1, 0, 0);
      }
      pref.updatePixels();
      pref.save("preferences.png");
      println("null");
    }
    else
    {
      pref=loadImage("preferences.png");
  //    println("preferences");
    }

Viewing all articles
Browse latest Browse all 941

Trending Articles