|
|
|
@ -64,6 +64,7 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
|
public static long scaleTime; |
|
|
|
|
public static Panel p; |
|
|
|
|
public static JFrame f; |
|
|
|
|
Sprite backgroundImg; |
|
|
|
|
|
|
|
|
|
List<Sound> currentlyPlayingSounds = new ArrayList<Sound>(); |
|
|
|
|
|
|
|
|
@ -280,15 +281,24 @@ public class Panel extends JPanel implements Runnable,KeyListener { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void SetBorderColor(Color col){ |
|
|
|
|
backgroundImg=null; |
|
|
|
|
borderCol=new java.awt.Color(col.r,col.g,col.b); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void SetBorderImage(Sprite spr){ |
|
|
|
|
backgroundImg=spr; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void paintComponent(Graphics g) { |
|
|
|
|
// perform draws on pixels
|
|
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
|
g.setColor(borderCol); |
|
|
|
|
if (backgroundImg==null) { |
|
|
|
|
g.fillRect(0,0,getWidth(),getHeight()); |
|
|
|
|
} else { |
|
|
|
|
g.drawImage(backgroundImg.getImg(),0,0,getWidth(),getHeight(),0,0,backgroundImg.width,backgroundImg.height,this); |
|
|
|
|
} |
|
|
|
|
g.drawImage(imageBuffer,vViewPos.x,vViewPos.y,vViewSize.x+vViewPos.x,vViewSize.y+vViewPos.y,0,0,ACTUAL_WINDOW_WIDTH,ACTUAL_WINDOW_HEIGHT,this); |
|
|
|
|
scaleTime=System.currentTimeMillis()-startTime; |
|
|
|
|
} |
|
|
|
|