Hi I am making a football stratedgy game and I have it the game working. I was playing prison architect and minecraft in fullscreen and noticed there was no windows it was covering the whole screen. So I looked up how to do this and I got
frame.setSize(Toolkit.getDefaultToolkit().getScreenSize());
frame.setUndecorated(true);
frame.setVisible(true);
and this works its just that all the images are (I don't know how to put this) the same size as when the game was in 600 * 500 window and I was wondering if there was a way to have them in the right place according to the size of the screen, so for example if the computer screen is 1000 * 1000 pixels the image whould be 100 pixels from the left of the screen but if someone played it on a 500 * 500 pixel screen it would be 50 pixels form the left of the screen. Keep in mind that they way I draw my images are
ImageIcon i2 = new ImageIcon("res/BackGrounds/titlescreen.png");
img = i2.getImage();
g.drawImage(img, 10, 10, null);
I tried doing it this way:
ImageIcon i2 = new ImageIcon("res/BackGrounds/titlescreen.png");
img = i2.getImage();
g.drawImage(img, 100, 10,Toolkit.getDefaultToolkit().getScreenSize().width / 5 -100,Toolkit.getDefaultToolkit().getScreenSize().height / 5 - 100, null);
but I when I tested it on a different computer whith a different sized screen the images where more squashed together because the screen is smaller and I had set the toolkit to be
Toolkit.getDefaultToolkit().getScreenSize().width / 5 -100
Pleas if u can help me, help me cause I really need help. THX in advance