Reputation: 73
i am actually writing a "simple" version of the game "Diablo" with JavaFX.
At the moment the screen size is absolute 800x600, everything is working fine. Now our team wants to use fullscreen on every desktop.
My Problem is: We are using images for walls, floor etc with an absolute size of 25x25. If we want to work in fullscreen mode, we would neet to scale them.
But as far as i know, you only can scale ImageView or BufferedImage. Of course we are reusing the images. e.g. a wall texture appears more than 20 times on the Pane. That's easy with an image, since you can use it again and again, but you would need 20 ImageViews for the same thing.
The screen is update about every 0.2 seconds, so we can't always scale all the ImageViews.
My ideas were:
I am sure, there is a better solution and a intelligent standard workaround, but i didn't find it yet.
Thank you for every help, TailorDurden
Upvotes: 1
Views: 1340
Reputation: 73
Okay, i found the answer myself. Simple as usual:
Image myImage = new Image("img.png", 15, 20, false false);
scales the image in the loading process to 15x20..
Upvotes: 2