-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #292 from tzachshabtay/SplashDoc
Splash screen- add doc and use background in demo
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Splash Screen | ||
|
||
MonoAGS comes with a built-in simple splash screen that you can choose to use if needed. | ||
The splash screen can be seen at the beginning of the demo game. It is a simple loading screen, showing a "Loading..." text (which can be changed to any custom text with any custom font/text color/etc) which gets smaller and then bigger in a loop while resources are loading. | ||
When you load the splash screen you get a reference to the room so you can change its background or add any other desired graphics/sound assets, though notes that the text changes its size in a way designed to be independent of the framerate, as loading all of the resources might affect the framerate deeply, so adding your own custom animations to the splash screen might not show smoothly as in the rest of the game. | ||
|
||
Here's an example in which we change the loading text, change the text color to blue and add a background: | ||
|
||
```cs | ||
|
||
var mySplashScreen = new AGSSplashScreen(); | ||
mySplashScreen.LoadingText = "Loading, Please Wait..."; | ||
mySplashScreen.TextConfig = new AGSTextConfig(brush: game.Factory.Graphics.Brushes.LoadSolidBrush(Colors.Blue)); | ||
var room = mySplashScreen.Load(game); | ||
|
||
var splashBackground = game.Factory.Object.GetObject("Splash Background"); | ||
splashBackground.Image = await game.Factory.Graphics.LoadImageAsync("Rooms/Splash/bg.png"); | ||
room.Background = splashBackground; | ||
|
||
await game.State.ChangeRoomAsync(room); | ||
|
||
//... | ||
//Load stuff here | ||
//... | ||
await game.State.ChangeRoomAsync(firstGameRoom); | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters