Пример #1
0
        public OutOfLifePopup() : base(SkiaRoot.ScreenWidth * 0.7f, SkiaRoot.ScreenHeight * 0.3f, false)
        {
            Popup.Title      = $"Oups...";
            Popup.ActionName = "Refill";

            var container = new Container();

            container.AddContent(new TextBlock(0, 0, "Seems like you are out of life", SkiaRoot.ScreenHeight * 0.03f, CreateColor(255, 255, 255)));

            Popup.AddContent(container);
        }
Пример #2
0
        public LevelDialogPopup(LevelData levelData) : base(SkiaRoot.ScreenWidth * 0.7f, SkiaRoot.ScreenHeight * 0.3f, false)
        {
            Popup.Title      = $"Mission {levelData.Id}";
            Popup.ActionName = "Let's Go !";


            var container = new Container();


            Popup.AddContent(container);
        }
Пример #3
0
        public WinDialogPopup(int movesLeft) : base(SkiaRoot.ScreenWidth * 0.7f, SkiaRoot.ScreenHeight * 0.4f, false)
        {
            Popup.Title      = $"Congratulation !";
            Popup.ActionName = "Next level";

            _starEffects = new List <StarEffect>();
            var container = new Container();

            for (int i = 0; i < 3; i++)
            {
                var starEffect = new StarEffect((i - 1) * Width * 0.2f, SkiaRoot.ScreenHeight * 0.1f);
                container.AddContent(starEffect);
                _starEffects.Add(starEffect);
            }

            Popup.AddContent(container);

            var scoreDetails = new ScoreDetails(container.X, container.Y, Width, ContentHeight * 0.5f);

            Popup.AddContent(scoreDetails);


            Task.Run(async() =>
            {
                var scoreMovesLeft    = movesLeft * 100;
                var scoreLevelCleared = 50;
                await Task.Delay(1000);
                await scoreDetails.Push($"Level Cleared : {scoreLevelCleared}");

                await Task.Delay(500);
                await scoreDetails.Push($"Moves left : {scoreMovesLeft}");


                await Task.Delay(500);

                var scoreText = new IncrementalText(0, scoreMovesLeft + scoreLevelCleared, 0, 0, SkiaRoot.ScreenHeight * 0.05f, CreateColor(255, 255, 255));
                Popup.AddContent(scoreText);
                await scoreText.Start();

                await Task.Delay(200);
                for (int i = 0; i < 3; i++)
                {
                    _starEffects[i].Start();
                    await Task.Delay(300);
                }
            });
        }