Scrolling works, had boundaries, only draws an object when image is drawn, woo

This commit is contained in:
Yorick
2015-03-12 23:00:44 +00:00
parent fa726f062e
commit 7e51fe541a
3 changed files with 24 additions and 6 deletions
+12 -2
View File
@@ -81,6 +81,17 @@ public class Panel extends JPanel {
}
public int getPanelInfoLength()
{
int panelInfoLength = 0;
for(BufferedImage image : panelInfo)
{
panelInfoLength += image.getWidth();
}
return panelInfoLength;
}
public DrawObject createNewDrawObject(int index)
{
switch(index)
@@ -112,12 +123,11 @@ public class Panel extends JPanel {
// g2.drawImage(podiumImage, 0, 0, null);
for(BufferedImage image : panelInfo)
{
g2.drawImage(image, panelInfox - scrollfactor, panelInfoy, null);
g2.drawImage(image, panelInfox + scrollfactor, panelInfoy, null);
panelInfox += image.getWidth();
}
panelInfox = 0;
g2.setClip(new Rectangle2D.Double(0,150, getWidth(), getHeight()));
AffineTransform oldTransform = g2.getTransform();
g2.setTransform(getCamera());