예제 #1
0
파일: Home.cs 프로젝트: fordream/Locks
        private void CreateCreditsPopup()
        {
            Sunfish.Views.Sprite closeButton = new Sunfish.Views.Sprite (LocksGame.ActiveScreen.LoadTexture ("CloseButton"), Sunfish.Constants.ViewLayer.Modal);
            closeButton.EnableTapGesture (HandleCreditsPopupCloseButtonTap);

            CreditsPopup = AddPopup (LoadTexture ("PopupBackground"), Sunfish.Constants.ViewContainerLayout.StackCentered);
            CreditsPopup.AddChild (closeButton, 0, PixelsWithDensity (100));
        }
예제 #2
0
파일: Home.cs 프로젝트: fordream/Locks
        private void CreateStartButtonAndPopup()
        {
            Sunfish.Views.Sprite startButtonGlow = new Sunfish.Views.Sprite (LoadTexture ("StartButtonGlow"), Sunfish.Constants.ViewLayer.Layer2);
            startButtonGlow.CenterInScreen ();
            startButtonGlow.OverlayColor = Color.TransparentBlack;
            startButtonGlow.StartEffect(new Sunfish.Views.Effects.InAndOut(10000d, 100, Color.White));
            AddChildView (startButtonGlow);

            Sunfish.Views.Sprite startButton = new Sunfish.Views.Sprite (LoadTexture ("StartButton"), Sunfish.Constants.ViewLayer.Layer3);
            startButton.CenterInScreen ();
            startButton.EnableTapGesture (HandleStartButtonTap);
            AddChildView (startButton);

            PlayPopup = AddPopup (LoadTexture ("PopupBackground"), Sunfish.Constants.ViewContainerLayout.StackCentered);
            PlayPopup.TransitionAudioFilename = "PopupTransition";
            PlayPopup.TransitionAudioVolume = 0.8f;

            Models.GameProgress[] gameProgress = Rules.GameProgress.LoadGameProgress ();
            for (int slot=0; slot < Core.Constants.SlotsCount; slot++) {
                Models.GameProgress savedGame = gameProgress [slot];
                Views.PlaySlotButton playButton = null;
                if (savedGame == null) {
                    playButton = Views.PlaySlotButton.CreateNewGame (slot);
                } else {
                    playButton = Views.PlaySlotButton.CreateContinueGame (slot);
                }
                playButton.EnableTapGesture (HandleGameButtonTap);
                PlayPopup.AddChild (playButton, 0, (slot == 0) ? PixelsWithDensity (80) : PixelsWithDensity (30));
            }
        }