Wednesday, 15 June 2011

android java array of paint -



android java array of paint -

i making game , trying create bitmaps dissapear or appear anyway reason when utilize paint 1 object works when add together array paint(fro each bitmap) crashes here lines used it:

//in mainactivity class paint[] paintanswer; //in oncreate paintanswer=new paint[answerlength]; //in draw func for(int i=0;i<answerlength;i++){ paintanswer[i].setalpha(answeralpha[i]); canvas.drawbitmap(answerbitmapscaled[i],(float) (((cwidth/2)-((answerlength*answersize)/4)-answersize/4)+i*(answersize/2)),(float) (cwidth/2), paintanswer[i]);

the reply length length other activity accordingly set array

an array in java container amount of slots elements of type. in case container can store illustration 20 paint elements, however, empty. have fill array elements if want utilize them later on:

paintanswer = new paint[answerlength]; (int = 0; < answerlength; i++) paintanswer[i] = new paint();

java android arrays bitmap

No comments:

Post a Comment