Exemplo n.º 1
0
 /// <summary>
 /// Loads defaut values for SceneBackground, SceneBars and SpriteFont
 /// </summary>
 /// <param name="defBCKG"></param>
 /// <param name="defBARS"></param>
 /// <param name="defFONT"></param>
 public void LoadContent(SceneBackground defBCKG, SceneBars defBARS, SpriteFont defFONT)
 {
     DefaultBCKG = defBCKG;
     DefaultBARS = defBARS;
     DefaultFONT = defFONT;
     Loaded      = true;
     Scenes.SetSceneDefaults(defBCKG, defBARS, defFONT);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Adds new Scene
 /// </summary>
 /// <param name="id">Scene ID</param>
 /// <param name="text">Text shown in text-box</param>
 /// <param name="name">Text shown as a Name</param>
 /// <param name="behav">Scene Behaviour</param>
 /// <param name="bckg">Scene Background image</param>
 /// <param name="bars">Scene Bar image and Name/Text-Box positions</param>
 /// <param name="font">Text font</param>
 public void NewScene(
     string id, string text         = "", string name = "",
     GameScene.SceneBehaviour behav = null, SceneBackground bckg = null, SceneBars bars = null,
     SpriteFont font = null, Action <GameScene> generationFunc   = null
     )
 {
     Scenes.Add(GenerateScene(
                    id: id, text: text, name: name,
                    t: behav ?? new GameScene.SceneBehaviour(Scenes),
                    bg: bckg, br: bars, f: font,
                    flag: SceneHandler.Flag.MIDDLE, genfunc: generationFunc
                    ));
 }
Exemplo n.º 3
0
 public GameScene(string id, string text, string name,
                  SceneBehaviour t, SceneBackground bg, SceneBars br, SpriteFont f,
                  SceneHandler.Flag flag)
 {
     Locked = false;
     ID     = id;
     VALUES = new SceneValues(new InputStates( ), name, text);
     TYPE   = t;
     BCKG   = bg ?? t.Parent.DefaultBCKG;
     BARS   = br ?? t.Parent.DefaultBARS;
     FONT   = f ?? t.Parent.DefaultFONT;
     FLAG   = flag;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Generates new GameScene from only given parameters
        /// </summary>
        /// <param name="id">ID of a Scene</param>
        /// <param name="text">Text shown in text-box</param>
        /// <param name="name">Text shown as a Name</param>
        /// <param name="t">Scene Behaviour</param>
        /// <param name="bg">Scene Background image</param>
        /// <param name="br">Scene Bar image and Name/Text-Box positions</param>
        /// <param name="f">Text font</param>
        /// <param name="flag">Scene flag (only works via .FirstScene/.EndScene/.ErrorScene)</param>
        /// <param name="genfunc">Function that gets invoked on object after creating it.</param>
        /// <returns>Newly created GameScene</returns>
        public GameScene GenerateScene(
            string id, string text, string name,
            GameScene.SceneBehaviour t, SceneBackground bg, SceneBars br, SpriteFont f,
            SceneHandler.Flag flag = SceneHandler.Flag.MIDDLE, Action <GameScene> genfunc = null
            )
        {
            var ngs = new GameScene(id, text, name, t,
                                    bg ?? t.Parent.DefaultBCKG,
                                    br ?? t.Parent.DefaultBARS,
                                    f ?? t.Parent.DefaultFONT,
                                    AUTH ? flag : SceneHandler.Flag.MIDDLE
                                    );

            genfunc?.Invoke(ngs);
            return(ngs);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Adds new Scene as a FIRST.
 /// </summary>
 /// <param name="text">Text shown in text-box</param>
 /// <param name="name">Text shown as a Name</param>
 /// <param name="behav">Scene Behaviour</param>
 /// <param name="bckg">Scene Background image</param>
 /// <param name="bars">Scene Bar image and Name/Text-Box positions</param>
 /// <param name="font">Text font</param>
 public void FirstScene(string text = "", string name = "",
                        GameScene.SceneBehaviour behav = null, SceneBackground bckg = null, SceneBars bars = null,
                        SpriteFont font = null
                        )
 {
     AUTH = true;
     Scenes.Add(GenerateScene(
                    id: "0", text: text, name: name,
                    t: behav ?? new GameScene.SceneBehaviour(Scenes),
                    bg: bckg, br: bars, f: font,
                    flag: SceneHandler.Flag.FIRST
                    ));
     AUTH = false;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Adds new Scene as a END (which has locked .Next as Terminate)
 /// </summary>
 /// <param name="text">Text shown in text-box</param>
 /// <param name="name">Text shown as a Name</param>
 /// <param name="behav">Scene Behaviour</param>
 /// <param name="bckg">Scene Background image</param>
 /// <param name="bars">Scene Bar image and Name/Text-Box positions</param>
 /// <param name="font">Text font</param>
 public void EndScene(string text = "", string name = "",
                      GameScene.SceneBehaviour behav = null, SceneBackground bckg = null, SceneBars bars = null,
                      SpriteFont font = null
                      )
 {
     if (Scenes.Last != null)
     {
         return;
     }
     AUTH = true;
     Scenes.Add(GenerateScene(
                    id: "end", text: text, name: name,
                    t: behav ?? new GameScene.SceneBehaviour(Scenes),
                    bg: bckg, br: bars, f: font,
                    flag: SceneHandler.Flag.END
                    ));
     AUTH = false;
     Scenes.Last.Next(null);
     Scenes.Last.Lock( );
 }