MCPcopy
hub / github.com/EngoEngine/engo / SetSceneByName

Function SetSceneByName

scene.go:133–144  ·  view source on GitHub ↗

SetSceneByName does a lookup for the `Scene` where its `Type()` equals `name`, and then sets it as current `Scene`

(name string, forceNewWorld bool)

Source from the content-addressed store, hash-verified

131
132// SetSceneByName does a lookup for the `Scene` where its `Type()` equals `name`, and then sets it as current `Scene`
133func SetSceneByName(name string, forceNewWorld bool) error {
134 sceneMutex.RLock()
135 scene, ok := scenes[name]
136 sceneMutex.RUnlock()
137 if !ok {
138 return fmt.Errorf("scene not registered: %s", name)
139 }
140
141 SetScene(scene.scene, forceNewWorld)
142
143 return nil
144}

Callers 2

UpdateMethod · 0.92
TestSceneSwitchingFunction · 0.85

Calls 1

SetSceneFunction · 0.85

Tested by 1

TestSceneSwitchingFunction · 0.68