-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscene_loading.go
37 lines (27 loc) · 891 Bytes
/
scene_loading.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"rapidengine/ui"
)
var ProgressBar *ui.ProgressBar
var ProgressText *ui.TextBox
func InitializeLoadingScene() {
LoadingScene = Engine.SceneControl.NewScene("loading")
ProgressBar = Engine.UIControl.NewProgressBar()
ProgressBar.SetDimensions(500, 25)
ProgressBar.SetPosition(0, 500)
Engine.UIControl.AlignCenter(ProgressBar)
ProgressText = Engine.TextControl.NewTextBox("Generating world...", "pixel", (1920 / 2), 600, 1, [3]float32{255, 255, 255})
ProgressText.X -= float32(ProgressText.GetLength() / 2)
LoadingScene.InstanceText(ProgressText)
Engine.UIControl.InstanceElement(ProgressBar, LoadingScene)
}
func updateLoadingScreen() {
ProgressBar.Update(nil)
Engine.Renderer.ForceUpdate()
}
func create() {
Engine.SceneControl.SetCurrentScene(LoadingScene)
Engine.Logger.Info("Generating world...")
updateLoadingScreen()
generateWorldTree()
}