FXGL.getSettings().setGlobalMusicVolume may throw out "not on JavaFX Application Thread" exception #1118
Unanswered
chengenzhao
asked this question in
Q&A
Replies: 1 comment 1 reply
-
If it says not on app thread, then probably being called from a callback.
In fxgl only a few functions are not an app thread - initGame() is one of
them
…On Sat, 13 Nov 2021, 12:25 am Chengen Zhao, ***@***.***> wrote:
Hi:
Occasionally this method will throw out "Not on FX application thread"
error
and I tried to catch that exception but the FXGL application will still
exit
should fix this by Platform.runLater(() ->
FXGL.getSettings().setGlobalMusicVolume(...));
but don't know why...
Thx
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1118>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA3NT5TNU5HP4ZREKKXRXLDULWWA5ANCNFSM5H56QIYQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi:
Occasionally this method FXGL.getSettings().setGlobalMusicVolume will throw out "Not on FX application thread" exception
and I tried to catch that exception but the FXGL application will still exit
should fix this by Platform.runLater(() -> FXGL.getSettings().setGlobalMusicVolume(...));
but don't know why...
What is the recommended way to set the volume?
It happened in the embedded mode
not sure this is related
just for information
Thx
Beta Was this translation helpful? Give feedback.
All reactions