public Scene(Camera2D camera, EventListener listener = null) { this.root = new Actor(); this.root.SetScene(this); this.camera = camera; this.listener = listener; }
public void EventCalled(Events e, Actor actor) { if (e == Events.TouchUp) { if (actor.name == "start") { SetScreen(new IntroScreen()); //SetScreen(new GameScreen()); } if (actor.name == "highscores") { SetScreen(new HighscoreScreen()); } } }
public void SetParent(Actor parent) { this.parent = parent; }
public void Add(string name, Actor actor) { actor.SetScene(GetScene()); actor.name = name; actor.SetParent(this); actor.Init(); actors.Add(name, actor); }
public void CallEvent(Events e, Actor actor) { if (listener != null) listener.EventCalled(e, actor); }
public void Remove(Actor actor) { root.Remove(actor.name); }
public void Add(string name, Actor actor) { root.Add(name, actor); }