I want my objects to change for that small position, for which screen size is changed, whether is an image or graphic shape..
So I don't want:
g.drawImage(someImg, 10, 10);
So how should I do this? I have an idea of doing with percentages, is it a good way ? For example, I can give value of 5% to both x and y coordinates, from a total width and total height size.
UPDATE:
public static float getValueOfPercentage(float percentage, float value) {
return (percentage / 100.0f) * value;
}
float logoX = panelCenterX - logoCenterX;
float logoY = getValueOfPercentage(5, panelMaxY);
g.drawImage(logoImage, logoX, logoY);