Permalink
Browse files

Sets default new sprites and backgrounds to transparent

This is the same as GM8.1 and GMS
  • Loading branch information...
RobertBColton committed Feb 4, 2016
1 parent d044551 commit 00600686ce195a8dc6391ab0c679ffb96f541251
Showing with 4 additions and 14 deletions.
  1. +2 −8 org/lateralgm/subframes/BackgroundFrame.java
  2. +2 −6 org/lateralgm/subframes/SpriteFrame.java
@@ -14,11 +14,9 @@
import static javax.swing.GroupLayout.PREFERRED_SIZE;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Point;
import java.awt.event.ActionEvent;
@@ -587,11 +585,10 @@ private BufferedImage createNewImage(boolean askforsize)
hField.setValue(new Integer(height));
JPanel myPanel = new JPanel();
GridLayout layout = new GridLayout(0,2);
GridLayout layout = new GridLayout(0,2,0,3);
myPanel.setLayout(layout);
myPanel.add(new JLabel(Messages.getString("BackgroundFrame.NEW_WIDTH")));
myPanel.add(wField);
//myPanel.add(Box.createHorizontalStrut(15)); // a spacer
myPanel.add(new JLabel(Messages.getString("BackgroundFrame.NEW_HEIGHT")));
myPanel.add(hField);
@@ -605,10 +602,7 @@ private BufferedImage createNewImage(boolean askforsize)
width = (Integer) wField.getValue();
height = (Integer) hField.getValue();
}
BufferedImage bi = new BufferedImage(width,height,BufferedImage.TYPE_3BYTE_BGR);
Graphics g = bi.getGraphics();
g.setColor(Color.WHITE);
g.fillRect(0,0,width,height);
BufferedImage bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_ARGB);
res.setBackgroundImage(bi);
imageChanged = true;
return bi;
@@ -1174,11 +1174,10 @@ private BufferedImage createNewImage(boolean askforsize)
hField.setValue(new Integer(height));
JPanel myPanel = new JPanel();
GridLayout layout = new GridLayout(0,2);
GridLayout layout = new GridLayout(0,2,0,3);
myPanel.setLayout(layout);
myPanel.add(new JLabel(Messages.getString("SpriteFrame.NEW_WIDTH")));
myPanel.add(wField);
//myPanel.add(Box.createHorizontalStrut(15)); // a spacer
myPanel.add(new JLabel(Messages.getString("SpriteFrame.NEW_HEIGHT")));
myPanel.add(hField);
@@ -1192,10 +1191,7 @@ private BufferedImage createNewImage(boolean askforsize)
width = (Integer) wField.getValue();
height = (Integer) hField.getValue();
}
BufferedImage bi = new BufferedImage(width,height,BufferedImage.TYPE_3BYTE_BGR);
Graphics g = bi.getGraphics();
g.setColor(Color.WHITE);
g.fillRect(0,0,width,height);
BufferedImage bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_ARGB);
imageChanged = true;
return bi;

0 comments on commit 0060068

Please sign in to comment.