Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scene width and height change in DynamicCompositeEntity #220

Open
Kevin-Vink opened this issue Oct 18, 2021 · 10 comments
Open

Scene width and height change in DynamicCompositeEntity #220

Kevin-Vink opened this issue Oct 18, 2021 · 10 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Kevin-Vink
Copy link

Kevin-Vink commented Oct 18, 2021

When parsing the scene to a DynamicCompositeEntity the width and height change to a value multiplied by 1.25.

The initial size of the game:
image

the size im getting in the DynamicCompositeEntity
image

@meronbrouwer meronbrouwer added the bug Something isn't working label Nov 30, 2021
@meronbrouwer
Copy link
Collaborator

This cannot be reproduces on my Mac. Is it possibly related to #208, which makes it a Windows-only bug. Lets test this again after an update to JavaFX 17.

@meronbrouwer meronbrouwer added the help wanted Extra attention is needed label Dec 10, 2021
@meronbrouwer
Copy link
Collaborator

Anyone running Windows that wants to test this one, would be much appreciated.

@RyanAelen
Copy link
Contributor

Found the place the multiplication happens.
Inside one of the javaFX class GlassViewEventHandler.class program gets the system scale. Running your windows system on 125% scale cause the 1.25 multiplication.
Changing the scale to 100% in side windows. will 'fix' this.

It looks like you need to work with the Pane object and not with the Scene object of the abstract StaticScene.

@meronbrouwer
Copy link
Collaborator

Thanks @RyanAelen ! If you have the time, you're welcome to implement a fix. :-)

@meronbrouwer meronbrouwer moved this to Todo in 2022.2023 Jul 5, 2022
@meronbrouwer meronbrouwer removed the status in 2022.2023 Dec 16, 2022
@meronbrouwer meronbrouwer removed this from 2022.2023 Dec 16, 2022
@Jaapapa
Copy link
Contributor

Jaapapa commented Mar 30, 2023

Using environment variable / java property glass.win.uiScale=100% works for me! It should tell glass/javafx to use 100% scaling no matter what the option in windows is configured to.

@Jaapapa
Copy link
Contributor

Jaapapa commented Mar 30, 2023

I tried setting the property in code (using System.setProperty()) in the YaegerGame class but this had no effect. I also tried prism.allowhidpi=false without effect. Maybe add the environment variable hint to the docs somewhere?

@meronbrouwer
Copy link
Collaborator

Interesting, I didn't know about this setting. I'll try to figure out how to set this property from code. It should be possible... I guess.

@meronbrouwer
Copy link
Collaborator

The post in the link seems to state an example that solves the problem. Main thing seems to set the property before calling the run-method. Could you (@Jaapapa ) perhaps test this on windows?

https://stackoverflow.com/questions/67264613/system-setpropertyprism-allowhidpi-false-does-not-work

@meronbrouwer meronbrouwer moved this to In Progress in 2023 - 2024 Mar 31, 2023
@Jaapapa
Copy link
Contributor

Jaapapa commented Apr 1, 2023

I couldnt get it to work. Tried all the props and also creating a seperate launcher class like so:

    public static void main(String[] args) {
        System.setProperty("glass.win.uiScale","100%"); // :(
//        System.setProperty("prism.lcdtext", "false"); // :(
//        System.setProperty("prism.subpixeltext", "false"); // :(
//        System.setProperty("prism.allowhidpi", "false"); // :(
        JGame.launch(args);
    }
}

@meronbrouwer
Copy link
Collaborator

meronbrouwer commented Apr 3, 2023

I'll leave this issue as is for now. Maybe someone will find a solution for this in the future.

@meronbrouwer meronbrouwer moved this from In Progress to Todo in 2023 - 2024 Sep 29, 2023
@meronbrouwer meronbrouwer removed the status in 2023 - 2024 Sep 29, 2023
@meronbrouwer meronbrouwer moved this to Todo in 2024 - 2025 Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants