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

FXGLDefaultMenu layout is not responsive #1021

Open
AlmasB opened this issue Apr 21, 2021 · 1 comment
Open

FXGLDefaultMenu layout is not responsive #1021

AlmasB opened this issue Apr 21, 2021 · 1 comment
Assignees
Labels
codefest23-24 difficulty:medium API design elements, need time to think through good-first-issue First-time contributor-friendly help wanted Contributions welcome / high PR acceptance rate lang:kotlin-only Solution should be in Kotlin

Comments

@AlmasB
Copy link
Owner

AlmasB commented Apr 21, 2021

module: fxgl
package: com.almasb.fxgl.app.scene
file: FXGLDefaultMenu.kt

val menuX = 50.0
val menuY = appHeight / 2.0 - menu.layoutHeight / 2

These are hardcoded, instead we should listen for (bind to) settings.prefWidth/Height properties.

You can check the result of this working (or not working) in fxgl-samples module by running a MenuSample and adding settings.setManualResizeEnabled(true);, then resizing the game at runtime.

Currently on resize, the hardcoded values will not result in a responsive layout.

@AlmasB AlmasB added help wanted Contributions welcome / high PR acceptance rate difficulty:medium API design elements, need time to think through lang:kotlin-only Solution should be in Kotlin labels Apr 21, 2021
@AlmasB AlmasB added the good-first-issue First-time contributor-friendly label May 21, 2021
@DaleHuntGB
Copy link

Discussed & Fixed.

@artemijsem
@BeckFW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codefest23-24 difficulty:medium API design elements, need time to think through good-first-issue First-time contributor-friendly help wanted Contributions welcome / high PR acceptance rate lang:kotlin-only Solution should be in Kotlin
Projects
None yet
Development

No branches or pull requests

2 participants