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