Friday, 15 August 2014

Put image on progressbar in android -



Put image on progressbar in android -

i want superimpose image of different color on progress bar depending on progress percentage.

i putted image on right position , set invisible , setting visible depending on condition.

problem image not visible on progress bar visible below progress bar.

here code progress bar:

progressbar = ccprogresstimer.progress("timebar23.png"); progressbar.settype(5); progressbar.setanchorpoint(0, 0); // progressbar.setposition(47, 356); progressbar.setposition(47, 310);

and here images:

progressbarimage1.setposition(68,500); progressbarimage2.setposition(68,456); progressbarimage3.setposition(68, 424); progressbarimage1.setvisible(false); progressbarimage2.setvisible(false); progressbarimage3.setvisible(false);

and here status on making images visible:

if(gamebarlayer.progressbar.getpercentage() > 33.33) { gamebarlayer.progressbarimage1.setvisible(true); gamebarlayer.progressbarimage1.setvertexz(100); } else if(gamebarlayer.progressbar.getpercentage() > 66.66) { gamebarlayer.progressbarimage2.setvisible(true); } else if(gamebarlayer.progressbar.getpercentage() > 100) { gamebarlayer.progressbarimage3.setvisible(true); }

please help me in this.

the image used in progressbar : seek addchild(progressbar, 1);

here "1" gave priority pogressbar on layer.

android android-progressbar cocos2d-android

No comments:

Post a Comment