newbie image loading problem
im trying to load in some images half way through my game....but i dont want the applet to suddenly stop whilst this happens........here's my code at the mo, it doesnt seem to work....am i going along the right tracks, any advice would be great
i call the loadPic functions from the mousePressed function, and the main game thread should continue whilst this loads......but it doesnt
public Image loadPic(String path){
try{
temp_pic=getImage(getCodeBase(),path);
tracker.addImage(temp_pic, 0);
do{
repaint();
}while (tracker.checkID(0));
tracker.waitForID(0);
}catch (Exception e){ System.out.print("ERROR: " + path);}
loadscreen = createImage(temp_pic.getWidth(this),temp_pic.getHeight(this));
loadGraphics = loadscreen.getGraphics();
loadGraphics.drawImage(temp_pic,0,0,this);
repaint();
return loadscreen;
}
Message was edited by:
00

