Example #1
0
 public PauseMenu(Background bg) : base(bg, "dialog_small")
 {
     var ui = new GridLayout(new Rectangle(Point.Zero, Size.ToPoint()), 4)
     {
         Scale = SkidiBirdGame.Scale,
         Rows =
         {
             new Row(32)
             {
                 new HColumn(1f)
                 {
                     VerticalAlign = VerticalAlign.Top,
                     Items = { Label.FromResource("Pause")}
                 }
             },
             new Row(-1)
             {
                 new HColumn(1f)
                 {
                     Spacing = 12,
                     Items =
                     {
                         new Buttons.SmallButton("ic_play", ReturnClick),
                         new Buttons.SmallButton("ic_restart", RestartClick),
                         new Buttons.SmallButton("ic_exit", ExitClick)
                     }
                 }
             }
         }
     };
     Add(ui);
 }
Example #2
0
        protected Dialog(Background bg, string frameName)
            : base(SkidiGame.ResourceManager.GetFrame(frameName))
        {
            _bg = bg;
            InternalCascade = true;
            //Size *= SkidiBirdGame.Scale;
            Visible = false;

            Position = (SkidiGame.ScreenBounds.Size.ToVector2() - Size) * .5f;
        }
Example #3
0
        public GameOverMenu(Background bg) : base(bg, "dialog")
        {
            var ui = new GridLayout(new Rectangle(Point.Zero, Size.ToPoint()), 12)
            {
                Scale = SkidiBirdGame.Scale,
                Rows =
                {
                    new Row(40)
                    {
                        new HColumn(1f)
                        {
                            VerticalAlign = VerticalAlign.Top,
                            Items = {Label.FromResource("GameOver")}
                        }
                    },
                    new Row(50)
                    {
                        new HColumn(.5f)
                        {
                            HorizontalAlign = HorizontalAlign.Right,
                            Items = {Label.FromResource("Score")}
                        },
                        new HColumn(-1f)
                        {
                            (_scoresLb = new Label("0"))
                        }
                    },
                    new Row(50)
                    {
                        new HColumn(.5f)
                        {
                            HorizontalAlign = HorizontalAlign.Right,
                            Items = {Label.FromResource("HighScore")}
                        },
                        new HColumn(-1f)
                        {
                            (_highScoresLb = new Label("0"))
                        }
                    },
                    new Row(-1)
                    {
                        new HColumn(1f)
                        {
                            Spacing = 24,
                            Items = {
                                new Buttons.SmallButton("ic_restart", RestartClick),
                                new Buttons.SmallButton("ic_exit", ExitClick)
                            }
                        }
                    }
                }
            };

            Add(ui);
        }
Example #4
0
        public PlayScene(MainStage stage) : base(stage)
        {
            using (var settings = SkidiGame.SettingsStorage.Read())
            {
                _highScore = settings.ReadInt("HighScore");
            }

            UpdateEvent.Subscribe(this, Update);
            AddInput();

            Position = new Vector2(0, SkidiGame.ScreenBounds.Height);
            Visible = false;

            Add(CreateGround());

            Add((_player = new Skidi()));
            Add((_eagle = new Eagle()));

            Add((_emmiter = new ParticleEmmiter()));

            var ui = new Grid(36)
            {
                new Row(.2f)
                {
                    new VColumn(.5f)
                    {
                        HorizontalAlign = HorizontalAlign.Left,
                        Items = { (_scoreLb = new Label("0")) }
                    },
                    new VColumn(.5f)
                    {
                        HorizontalAlign = HorizontalAlign.Right,
                        Items = { new Buttons.PauseButton(OnPauseClick) }
                    }
                },
                new Row(.2f),
                new Row(-1)
                {
                    new VColumn(1f)
                    {
#if WINDOWS_APP
                        (_hintLb = Label.FromResource(SkidiBirdGame.IsMouseEnabled ? "StartHintKb" : "StartHint"))
#else
                        (_hintLb = Label.FromResource("StartHint"))
#endif
                    }
                }
            };
            Add(ui);
            _hintLb.RunAction(HintAnimation);

            var bg = new Background(SkidiGame.ScreenBounds, SkidiGame.ResourceManager.GetFrame("$px"))
            {
                Color = Color.Black,
                Visible = false,
                Alpha = .7f
            };

            stage.UiLayer.Add(bg);
            stage.UiLayer.Add((_pauseMenu = new PauseMenu(bg)));
            stage.UiLayer.Add((_gameOverMenu = new GameOverMenu(bg)));
        }