Brief description: I will show you how to make a loading screen for change scene,
because if your game have huge/many resource to load in that scene,
the scene will black screen several seconds before material appear because of loading resource
Requirements: -
like this, and you will see code like this
2.scroll down to line 107 or prepareLoadingScreen
3. add this code to line 118
at the line 120
"Graphics/Pictures/other/loading_screen" loading_screen is a picture that you want it to be a loading screen for me use this picture
at the line 122
@loadingBackgroundSprite.srcRect = new gs.Rect(0, 0, 1920, 1080)
1920 and 1080 recommend to be a picture resolution but you can try another width and height
4.go to line 129 or clearLoadingScreen
5. insert this code between line 132 and 133
NOTE: for this step is unnecessary because if not have this code it still work, But I add this for avoid memory leak
6. hit save button and go test ( it's work! )
because if your game have huge/many resource to load in that scene,
the scene will black screen several seconds before material appear because of loading resource
Requirements: -
Step by step
1. go to Component_SceneBehaviorlike this, and you will see code like this
2.scroll down to line 107 or prepareLoadingScreen
3. add this code to line 118
Code:
else
# Static Picture
bitmap = new gs.Bitmap("Graphics/Pictures/other/loading_screen")
@loadingBackgroundSprite.bitmap = bitmap
@loadingBackgroundSprite.srcRect = new gs.Rect(0, 0, 1920, 1080) # Picture Resolution
at the line 120
"Graphics/Pictures/other/loading_screen" loading_screen is a picture that you want it to be a loading screen for me use this picture
at the line 122
@loadingBackgroundSprite.srcRect = new gs.Rect(0, 0, 1920, 1080)
1920 and 1080 recommend to be a picture resolution but you can try another width and height
4.go to line 129 or clearLoadingScreen
5. insert this code between line 132 and 133
Code:
else
@loadingBackgroundSprite.bitmap.dispose()
NOTE: for this step is unnecessary because if not have this code it still work, But I add this for avoid memory leak
6. hit save button and go test ( it's work! )