Ejemplo n.º 1
0
 public Views.Popup AddPopup(Texture2D popupBackgroundTexture, Constants.ViewContainerLayout childPosition)
 {
     Views.Popup newPopup = new Sunfish.Views.Popup (popupBackgroundTexture, childPosition);
     ChildViews.Add (newPopup);
     return newPopup;
 }
Ejemplo n.º 2
0
        private void PopulateParadoxTestScreenViews()
        {
            int rows = 8;
            int cols = 18;

            PanScaleContainer panScaleContainer = new PanScaleContainer (cols * 50, rows * 50, Constants.ViewLayer.Layer1, Constants.ViewContainerLayout.FloatLeft);
            ViewPositioner.ScreenCenter (panScaleContainer);
            ChildViews.Add (panScaleContainer);

            for (int grids = 0; grids < rows * cols; grids++) {
                Sprite grid = new Sprite (LoadTexture ("Grid"));
                grid.EnableDoubleTapGesture (HandleChildTap);
                panScaleContainer.AddChild (grid);
            }

            Sprite stats = new Sprite (LoadTexture ("Stats"), Constants.ViewLayer.Layer3);
            stats.Data = "";
            stats.Scale = 0.5f;
            ViewPositioner.ScreenTopLeft (stats);
            ChildViews.Add (stats);

            Sprite timeTravelButton = new Sprite (LoadTexture ("TimeTravelButton"), Constants.ViewLayer.Layer3);
            ViewPositioner.ScreenTopCenter (timeTravelButton);
            ChildViews.Add (timeTravelButton);

            TestPopup = AddPopup (LoadTexture ("PopupBackground"), Constants.ViewContainerLayout.Absolute);

            Sprite pauseButton = new Sprite (LoadTexture ("PauseButton"), Constants.ViewLayer.Layer3);
            //pauseButton.Scale = 2.0f;
            ViewPositioner.ScreenTopRight (pauseButton, PixelsWithDensity(20), PixelsWithDensity(20));
            //pauseButton.EnableTapGesture (HandlePauseTap);
            //pauseButton.OverlayColor = Color.Yellow;
            ChildViews.Add (pauseButton);

            Sprite directionalPad = new Sprite (LoadTexture ("DirectionalPad"), Constants.ViewLayer.Layer3);
            ViewPositioner.ScreenBottomRight (directionalPad, PixelsWithDensity(20), PixelsWithDensity(20));
            ChildViews.Add (directionalPad);

            Sprite dialog = new Sprite (LoadTexture ("Dialog"), Constants.ViewLayer.Layer3);
            ViewPositioner.ScreenBottomCenter (dialog);
            ChildViews.Add (dialog);
        }