So I started using libgdx for a while and I really really like it!
But what im missing in all of this, is the way of scaling things right!
My problem is:
-When i do a game, i do it to a default screen size, imagine 570x360, when i try to apply it, what im looking to do is resize whatever it takes so that way i would still work with the default screen size coordinates being 360 the max width and 570 max height, but i want to be able to resize whatever is on the screen to the current screen size, like drawing everything first into the 570x360 screen, but then rezise the screen.
I dont know if you are understanding what i want to do but heres an example what i used to do:
//render image in the canvas, resizing acording to scale
private void render() {
BufferStrategy bufferStrategy = getBufferStrategy();
if (bufferStrategy == null) {
createBufferStrategy(3);
return;
}
Graphics g = bufferStrategy.getDrawGraphics();
draw((Graphics2D) image.getGraphics());
g.drawImage(image, 0, 0, WIDTH * SCALE, HEIGHT * SCALE, null);
g.dispose();
bufferStrategy.show();
}
//drawing stuff in the 570x360 BufferedImage
public void draw(Graphics2D g) {
g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
g.setColor(getBackground());
g.fillRect(0, 0, WIDTH, HEIGHT);
stateManager.draw(g);
}
Please I really need some help on this one!