I'm trying to implement a basic SceneManager using OpenFL and Haxe. I don't have a lot of experience using OpenFL and Haxe so I have a few problems.
Here is how I designed the SceneManager class:
package;
import openfl.display.Sprite;
import openfl.Lib;
class SceneManager extends Sprite
{
private var currentScene: ...;
public function new(rootScene: ...)
{
super();
currentScene = rootScene;
Lib.current.addChild(currentScene);
}
public function changeScene(newScene: ...): Void
{
Lib.current.removeChild(currentScene);
currentScene = newScene;
Lib.current.addChild(SceneTwo);
}
}
The "..." should be replaced with a general "class" type that can hold any of my scenes.
If anyone can help me solve this I would be really grateful.