Esempio n. 1
0
        public DialogYN(Screen display)
            : base(display)
        {
            BackgroundImage = Content.Graphics.Instance.Images.background.bg_dialog;

            size = new Vector2(300, 150);
            pos = new Vector2(Game1.Instance.Window.ClientBounds.Width / 2 - size.X / 2, 100);

            lbl_txt = new Label("");
            lbl_txt.LabelFun = ColorTheme.LabelColorTheme.LabelFunction.NORM;
            lbl_txt.Position = new Vector2(pos.X + 50, pos.Y + 10);
            add(lbl_txt);

            lnk_yes = new Link("Yes");
            lnk_yes.Position = new Vector2(pos.X + 50, pos.Y + 120);
            lnk_yes.selected = com;
            add(lnk_yes);

            lnk_no = new Link("No");
            lnk_no.Position = new Vector2(pos.X + 200, pos.Y + 120);
            lnk_no.selected = com;
            add(lnk_no);

            FocusSideArrowEnabled = true;
        }
Esempio n. 2
0
        public DialogTxt(Screen display)
            : base(display)
        {
            BackgroundImage = Content.Graphics.Instance.Images.background.bg_dialog;

            size = new Vector2(300, 150);
            pos = new Vector2(Game1.Instance.Window.ClientBounds.Width / 2 - size.X / 2, 100);

            lbl_text = new Label("");
            lbl_text.LabelFun = ColorTheme.LabelColorTheme.LabelFunction.NORM;
            lbl_text.Position = new Vector2(pos.X + 50, pos.Y + 10);
            add(lbl_text);

            txt = new TextBox(15);
            txt.Position = new Vector2(pos.X + 50, pos.Y + 50);
            txt.HasFocus = true;
            add(txt);

            lnk_enter = new Link("Enter");
            lnk_enter.Position = new Vector2(pos.X + 50, pos.Y + 100);
            lnk_enter.selected = sel;
            add(lnk_enter);
        }
Esempio n. 3
0
        public void goForward(Screen sc)
        {
            if (cstate.Count > 0)
                cstate.Peek().pause();

            InputHandler.flush();

            Game1.Instance.Components.Add(sc);

            cstate.Push(sc);
            sc.start();
        }
Esempio n. 4
0
 public void changeCur(Screen sc)
 {
     goBack();
     goForward(sc);
 }
Esempio n. 5
0
 public StateManager(Screen sc)
 {
     cstate = new Stack<Screen>();
     goForward(sc);
 }
Esempio n. 6
0
 public void reset(Screen sc)
 {
     clear();
     goForward(sc);
 }
Esempio n. 7
0
 public Window(Screen display)
     : base(Game1.Instance)
 {
     init(display, false);
 }
Esempio n. 8
0
 public Window(Screen display, bool mainWindow)
     : base(Game1.Instance)
 {
     init(display, mainWindow);
 }
Esempio n. 9
0
        private void init(Screen display, bool fismain)
        {
            parent = display;
            ismain = fismain;

            if (ismain)
            {
                pos = new Vector2(0, 0);
                size = new Vector2(Game1.Instance.Window.ClientBounds.Width, Game1.Instance.Window.ClientBounds.Height);
            }
            else
            {
                pos = new Vector2(10, 10);
                size = new Vector2(100, 100);
            }

            bg = Content.Graphics.Instance.Images.background.black;

            fm = new FocusManager();
            hasFocus = false;
        }