Skip to content

[Embeded mode]How to set the default task for loading scene? #1087

Answered by AlmasB
chengenzhao asked this question in Q&A
Discussion options

You must be logged in to vote

There is no need to explicitly call loading() since initGame() already runs on a background thread. While initGame() runs, FXGL will display the loading scene, which can be customized. So:

  1. Using scene factory, provide your own implementation of LoadingScene.
  2. Something like this:
public void initGame() {
                updateProgress(0,100);
                FXGL.image("player" + separator + "upper.png", 1400 /2, 350 /2);
                updateProgress(20,100);
                FXGL.image("player" + separator + "run.png", 2880/2, 220/2);
                updateProgress(40,100);
                FXGL.image("player" + separator + "jump.png", 2400/2, 220/2);
                updateProgress(60,1…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@chengenzhao
Comment options

Comment options

You must be logged in to vote
2 replies
@chengenzhao
Comment options

@chengenzhao
Comment options

Comment options

You must be logged in to vote
4 replies
@chengenzhao
Comment options

@AlmasB
Comment options

@AlmasB
Comment options

@chengenzhao
Comment options

Answer selected by chengenzhao
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants