Possibilité de placer un sprite d'une couche sans nécessité qu'une
couche précédente existe
This commit is contained in:
parent
1c2d673bec
commit
c47939957d
|
@ -41,33 +41,33 @@ public class MapPanel extends JPanel
|
||||||
g.drawImage(getMap().getFont(), x, y, width, height, null);
|
g.drawImage(getMap().getFont(), x, y, width, height, null);
|
||||||
|
|
||||||
for (Case c : getMap().getAllCases())
|
for (Case c : getMap().getAllCases())
|
||||||
{
|
{
|
||||||
if (isEmpty(c.getCoucheOne().getImage()))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// BufferedImage image;
|
// BufferedImage image;
|
||||||
|
|
||||||
g.drawImage(c.getCoucheOne().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
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)
|
/* if (frame.getSelectedLayerIndex() != 0)
|
||||||
{
|
{
|
||||||
image = recalculateAplha(c.getCoucheOne().getImage(), 0);
|
image = recalculateAplha(c.getCoucheOne().getImage(), 0);
|
||||||
g.drawImage(image, x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
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))
|
if (!isEmpty(c.getCoucheTwo().getImage()) || (frame.getSelectedLayerIndex() != 1 && frame.getSelectedLayerIndex() != 2))
|
||||||
continue;
|
{
|
||||||
|
g.drawImage(c.getCoucheTwo().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
||||||
g.drawImage(c.getCoucheTwo().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
}
|
||||||
/* if (frame.getSelectedLayerIndex() != 1)
|
/* if (frame.getSelectedLayerIndex() != 1)
|
||||||
{
|
{
|
||||||
image = recalculateAplha(c.getCoucheTwo().getImage(), 1);
|
image = recalculateAplha(c.getCoucheTwo().getImage(), 1);
|
||||||
g.drawImage(image, x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
g.drawImage(image, x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if (isEmpty(c.getCoucheThree().getImage()) || frame.getSelectedLayerIndex() != 2)
|
if (!isEmpty(c.getCoucheThree().getImage()) || frame.getSelectedLayerIndex() != 2)
|
||||||
continue;
|
{
|
||||||
|
g.drawImage(c.getCoucheThree().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
||||||
g.drawImage(c.getCoucheThree().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null);
|
}
|
||||||
/* if (frame.getSelectedLayerIndex() != 2)
|
/* if (frame.getSelectedLayerIndex() != 2)
|
||||||
{
|
{
|
||||||
image = recalculateAplha(c.getCoucheThree().getImage(), 2);
|
image = recalculateAplha(c.getCoucheThree().getImage(), 2);
|
||||||
|
|
|
@ -38,10 +38,7 @@ public class MapMouseListener extends MouseAdapter
|
||||||
if ((c = map.getCase((event.getX() - x + 2) / 34, (event.getY() - y + 2) / 34)) != null && event.getX() - x >= 2 && event.getY() - y >= 2)
|
if ((c = map.getCase((event.getX() - x + 2) / 34, (event.getY() - y + 2) / 34)) != null && event.getX() - x >= 2 && event.getY() - y >= 2)
|
||||||
{
|
{
|
||||||
if (getFrame().getSelectedSprite() != null)
|
if (getFrame().getSelectedSprite() != null)
|
||||||
{
|
{
|
||||||
if (getFrame().getSelectedSprite().getCouche() - 1 > getFrame().getSelectedLayerIndex())
|
|
||||||
return;
|
|
||||||
|
|
||||||
Case n;
|
Case n;
|
||||||
|
|
||||||
switch (getFrame().getSelectedSprite().getCouche())
|
switch (getFrame().getSelectedSprite().getCouche())
|
||||||
|
|
Loading…
Reference in New Issue