Beispiel #1
0
    private void BuildEnemies()
    {
        string localClrStr = PlayerManager.Instance().local.MeepleColor.ToString();

        texture = TextureResources.Get("NamePlateBackgroundLong" + localClrStr);
        foes.SetColor((localClrStr.Equals("Red") || localClrStr.Equals("Black")) ? ColorResources.White : ColorResources.Black);

        foesNames.Clear();
        int totalHeight = foes.Position.Height;

        foreach (GhostPlayer enemy in PlayerManager.Instance().ghostPlayers)
        {
            if (enemy.Equals(PlayerManager.Instance().local))
            {
                continue;
            }
            Rectangle nextRect = new Rectangle(contentRect.Location.X, contentRect.Location.Y + totalHeight, contentRect.Width, contentRect.Height / 4);

            string colorStr  = enemy.MeepleColor.ToString();
            Color  textColor = ColorResources.ForName(colorStr);
            foesNames.Add(new TextBoardElement(nextRect, enemy.name, fontBig, "namePlateFoesNamesText" + enemy.name, textColor, zPosition + 2, TextBoardElement.Alignment.LeftMiddle));

            totalHeight += nextRect.Height;
        }
    }
        public SettingsViewController()
        {
            AutomaticallyAdjustsScrollViewInsets = false;

            // Only purpose of this is to show the navigation bar, otherwise this is just a normal paged view model host
            MyNavigationController.NavigationBarHidden = false;

            ColorResources.ConfigureNavBar(MyNavigationController.NavigationBar);
        }
        public TasksViewController()
        {
            MyNavigationController.View.TranslatesAutoresizingMaskIntoConstraints = false;
            MyNavigationController.View.StretchWidth(base.View);

            var statusBar = UIStatusBarView.CreateAndAddTo(View);

            NavBar = new UINavigationBar()
            {
                TranslatesAutoresizingMaskIntoConstraints = false
            };
            ColorResources.ConfigureNavBar(NavBar);
            base.View.Add(NavBar);
            NavBar.StretchWidth(base.View);

            NavItem      = new UINavigationItem();
            NavBar.Items = new UINavigationItem[] { NavItem };

            _viewSelectedItemAndArrow = new UIControl();
            _labelSelectedItem        = new UILabel()
            {
                TextColor = UIColor.White
            };
            _viewSelectedItemAndArrow.Add(_labelSelectedItem);
            _imageSelectedItemDownArrow = new UIImageView(UIImage.FromBundle("ToolbarDown").ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate))
            {
                TintColor   = UIColor.White,
                ContentMode = UIViewContentMode.ScaleAspectFit
            };
            _viewSelectedItemAndArrow.Add(_imageSelectedItemDownArrow);
            _viewSelectedItemAndArrow.TouchUpInside += new WeakEventHandler(ButtonSwitchView_Clicked).Handler;

            NavItem.Title             = "";
            NavItem.LeftBarButtonItem = new UIBarButtonItem(_viewSelectedItemAndArrow);

            NavItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Add)
            {
                Title = "Add item"
            };
            NavItem.RightBarButtonItem.Clicked += new WeakEventHandler <EventArgs>(ButtonAddItem_Clicked).Handler;

            View.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|[statusBar][navBar][mainView]|", NSLayoutFormatOptions.DirectionLeadingToTrailing,
                                                                    "statusBar", statusBar,
                                                                    "navBar", NavBar,
                                                                    "mainView", MyNavigationController.View));
        }
Beispiel #4
0
        public PopupViewController()
        {
            AutomaticallyAdjustsScrollViewInsets = false;

            _contentView = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false
            };
            base.View.Add(_contentView);
            _contentView.StretchWidth(base.View);

            var statusBarView = UIStatusBarView.CreateAndAddTo(View);

            NavBar = new UINavigationBar()
            {
                TranslatesAutoresizingMaskIntoConstraints = false
            };
            ColorResources.ConfigureNavBar(NavBar);
            base.View.Add(NavBar);
            NavBar.StretchWidth(base.View);

            _backButton = new UIBarButtonItem()
            {
                Title = "Back"
            };
            _backButton.Clicked += new WeakEventHandler <EventArgs>(_backButton_Clicked).Handler;

            NavItem = new UINavigationItem();
            NavItem.LeftBarButtonItem = _backButton;
            NavBar.Items = new UINavigationItem[] { NavItem };

            View.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|[statusBar][navBar][contentView]|", NSLayoutFormatOptions.DirectionLeadingToTrailing,
                                                                    "statusBar", statusBarView,
                                                                    "navBar", NavBar,
                                                                    "contentView", _contentView));
        }