Possibilité de placer un sprite d'une couche sans nécessité qu'une

couche précédente existe
This commit is contained in:
galaxyoyo 2015-01-13 15:42:32 +01:00
parent 1c2d673bec
commit c47939957d
2 changed files with 14 additions and 17 deletions

View File

@ -42,32 +42,32 @@ public class MapPanel extends JPanel
for (Case c : getMap().getAllCases())
{
if (isEmpty(c.getCoucheOne().getImage()))
continue;
// BufferedImage image;
if (!isEmpty(c.getCoucheOne().getImage()))
{
g.drawImage(c.getCoucheOne().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
}
/* if (frame.getSelectedLayerIndex() != 0)
{
image = recalculateAplha(c.getCoucheOne().getImage(), 0);
g.drawImage(image, x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
}*/
if (isEmpty(c.getCoucheTwo().getImage()) || (frame.getSelectedLayerIndex() != 1 && frame.getSelectedLayerIndex() != 2))
continue;
if (!isEmpty(c.getCoucheTwo().getImage()) || (frame.getSelectedLayerIndex() != 1 && frame.getSelectedLayerIndex() != 2))
{
g.drawImage(c.getCoucheTwo().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
}
/* if (frame.getSelectedLayerIndex() != 1)
{
image = recalculateAplha(c.getCoucheTwo().getImage(), 1);
g.drawImage(image, x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
}*/
if (isEmpty(c.getCoucheThree().getImage()) || frame.getSelectedLayerIndex() != 2)
continue;
if (!isEmpty(c.getCoucheThree().getImage()) || frame.getSelectedLayerIndex() != 2)
{
g.drawImage(c.getCoucheThree().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
}
/* if (frame.getSelectedLayerIndex() != 2)
{
image = recalculateAplha(c.getCoucheThree().getImage(), 2);

View File

@ -39,9 +39,6 @@ public class MapMouseListener extends MouseAdapter
{
if (getFrame().getSelectedSprite() != null)
{
if (getFrame().getSelectedSprite().getCouche() - 1 > getFrame().getSelectedLayerIndex())
return;
Case n;
switch (getFrame().getSelectedSprite().getCouche())