Exemple #1
0
 public void CreateTopBar()
 {
     if (TopBar == null) {
         Texture2D topBarBackground = LoadTexture ("TopBarBackground");
         TopBar = new Views.Container (topBarBackground, Constants.ViewContainerLayout.FloatLeft);
         ChildViews.Add (TopBar);
     }
 }
Exemple #2
0
        private void CreateLockIndicatorAndDial()
        {
            LockIndicator = CreateLockIndicator (LockModel.IsUnlocked ());
            Dial = CreateDial (LockModel.CurrentPosition);

            Sunfish.Views.Container dialContainer = new Sunfish.Views.Container (Width, 0, Sunfish.Constants.ViewLayer.Layer4, Sunfish.Constants.ViewContainerLayout.StackCentered);
            dialContainer.ShouldExpandHeight = true;
            dialContainer.AddChild (LockIndicator, 0, PixelsWithDensity (4));
            dialContainer.AddChild (Dial, 0, PixelsWithDensity (5) - PixelsWithDensity(63));
            AddChild (dialContainer);
        }
Exemple #3
0
        private void CreateLocks(int yOffset)
        {
            Sunfish.Views.Container lockContainer = CreateLevelGridContainer ();
            int rowCount = Model.LockGrid.RowCount;
            int colCount = Model.LockGrid.ColCount;
            for (int row = 0; row < rowCount; row++) {
                for (int col = 0; col < colCount; col++) {
                    Models.Lock lockModel = Model.LockGrid.Locks [row, col];
                    Views.Lock lockView = new Views.Lock (lockModel, WorldNumber, row == 0, row == (rowCount - 1), col == 0, col == (colCount - 1));
                    lockView.OnLockButtonPush = HandleLockButtonPush;
                    lockContainer.AddChild (lockView, (col == 0) ? 0 : PixelsWithDensity (18), PixelsWithDensity (18));
                    LockViewsDictionary.Add (lockModel.GetRowColString (), lockView);
                }
            }

            // Center the locks in a play area
            if (Model.LockGrid.RowCount == 1) {
                yOffset += PixelsWithDensity (120);
            }
            else if (Model.LockGrid.RowCount == 2) {
                yOffset += PixelsWithDensity (80);
            }
            Sunfish.Views.Container locksPlayArea = new Sunfish.Views.Container (LocksGame.ScreenHeight, LocksGame.ScreenWidth, new Vector2 (PixelsWithDensity (9), yOffset), Sunfish.Constants.ViewContainerLayout.StackCentered);
            locksPlayArea.AddChild (lockContainer);

            AddChildView (locksPlayArea);
        }