当前位置: 首页>>代码示例>>C#>>正文


C# IntRect.Right方法代码示例

本文整理汇总了C#中IntRect.Right方法的典型用法代码示例。如果您正苦于以下问题:C# IntRect.Right方法的具体用法?C# IntRect.Right怎么用?C# IntRect.Right使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IntRect的用法示例。


在下文中一共展示了IntRect.Right方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

        public override void Update(float frameTime)
        {
            if (disposing || !IsVisible()) return;
            ClientArea = new IntRect(Position, new Vector2i((int)clippingRI.Width, (int)clippingRI.Height));

            if (inner_focus != null && !components.Contains((GuiComponent) inner_focus)) ClearFocus();

            scrollbarH.Position = new Vector2i(ClientArea.Left, ClientArea.Bottom() - scrollbarH.ClientArea.Height);
            scrollbarV.Position = new Vector2i(ClientArea.Right() - scrollbarV.ClientArea.Width, ClientArea.Top);

            if (scrollbarV.IsVisible()) scrollbarH.size = Size.X - scrollbarV.ClientArea.Width;
            else scrollbarH.size = Size.X;

            if (scrollbarH.IsVisible()) scrollbarV.size = Size.Y - scrollbarH.ClientArea.Height;
            else scrollbarV.size = Size.Y;

            max_x = 0;
            max_y = 0;

            foreach (GuiComponent component in components)
            {
                if (component.Position.X + component.ClientArea.Width > max_x)
                    max_x = component.Position.X + component.ClientArea.Width;
                if (component.Position.Y + component.ClientArea.Height > max_y)
                    max_y = component.Position.Y + component.ClientArea.Height;
            }

            scrollbarH.max = (int) max_x - ClientArea.Width +
                             (max_y > clippingRI.Height ? scrollbarV.ClientArea.Width : 0);
            if (max_x > clippingRI.Height) scrollbarH.SetVisible(true);
            else scrollbarH.SetVisible(false);

            scrollbarV.max = (int) max_y - ClientArea.Height +
                             (max_x > clippingRI.Height ? scrollbarH.ClientArea.Height : 0);
            if (max_y > clippingRI.Height) scrollbarV.SetVisible(true);
            else scrollbarV.SetVisible(false);

            scrollbarH.Update(frameTime);
            scrollbarV.Update(frameTime);
        }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:40,代码来源:ScrollableContainer.cs

示例2: Update

 public override sealed void Update(float frameTime)
 {
     var boundsLeft = _buttonLeft.GetLocalBounds();
     var boundsMain = _buttonMain.GetLocalBounds();
     var boundsRight = _buttonRight.GetLocalBounds();
     _clientAreaLeft = new IntRect(Position, new Vector2i((int)boundsLeft.Width, (int)boundsLeft.Height));
     _clientAreaMain = new IntRect(_clientAreaLeft.Right(), Position.Y,
                                     (int) Label.Width, (int)boundsMain.Height);
     _clientAreaRight = new IntRect(_clientAreaMain.Right(), Position.Y,
                                      (int)boundsRight.Width, (int)boundsRight.Height);
     ClientArea = new IntRect(Position,
                                new Vector2i(_clientAreaLeft.Width + _clientAreaMain.Width + _clientAreaRight.Width,
                                         Math.Max(Math.Max(_clientAreaLeft.Height, _clientAreaRight.Height), _clientAreaMain.Height)));
     Label.Position = new Vector2i(_clientAreaLeft.Right(),
                                Position.Y + (int) (ClientArea.Height/2f) - (int) (Label.Height/2f));
 }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:16,代码来源:Button.cs

示例3: Update

 public override sealed void Update(float frameTime)
 {
     var bounds = _buttonSprite.GetLocalBounds();
     _buttonArea = new IntRect(Position.X, Position.Y,
                                 (int)bounds.Width, (int)bounds.Height);
     ClientArea = new IntRect(Position.X, Position.Y,
                                (int)bounds.Width + (int) _descriptionTextSprite.Width + 2,
                                         (int)bounds.Height);
     _descriptionTextSprite.Position = new Vector2i(_buttonArea.Right() + 2, _buttonArea.Top);
 }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:10,代码来源:JobSelectButton.cs

示例4: Update

        public override void Update(float frameTime)
        {
            ClientArea = new IntRect(Position, Size);

            _buttonLeft.Position = new Vector2i(ClientArea.Left,
                                             ClientArea.Top +
                                             (int) (ClientArea.Height/2f - _buttonLeft.ClientArea.Height/2f));
            _buttonLeft.Update(frameTime);

            _buttonRight.Position = new Vector2i(ClientArea.Right() - _buttonRight.ClientArea.Width,
                                              ClientArea.Top +
                                              (int) (ClientArea.Height/2f - _buttonRight.ClientArea.Height/2f));
            _buttonRight.Update(frameTime);

            foreach (var curr in _items)
            {
                curr.Key.Update(frameTime);
            }

            _selectionGlow.Update(frameTime);
        }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:21,代码来源:Showcase.cs

示例5: Update

 public override sealed void Update(float frameTime)
 {
     var listboxLeftBounds = _listboxLeft.GetLocalBounds();
     var listboxMainBounds = _listboxMain.GetLocalBounds();
     var listboxRightBounds = _listboxRight.GetLocalBounds();
     _clientAreaLeft = new IntRect(Position, new Vector2i((int)listboxLeftBounds.Width, (int)listboxLeftBounds.Height));
     _clientAreaMain = new IntRect(_clientAreaLeft.Right(), Position.Y,
                                   _width, (int)listboxMainBounds.Height);
     _clientAreaRight = new IntRect(new Vector2i(_clientAreaMain.Right(), Position.Y),
                                      new Vector2i((int)listboxRightBounds.Width, (int)listboxRightBounds.Height));
     ClientArea = new IntRect(Position,
                                new Vector2i(_clientAreaLeft.Width + _clientAreaMain.Width + _clientAreaRight.Width,
                                         Math.Max(Math.Max(_clientAreaLeft.Height, _clientAreaRight.Height),
                                                  _clientAreaMain.Height)));
     _selectedLabel.Position = new Vector2i(_clientAreaLeft.Right(),
                                         Position.Y + (int) (ClientArea.Height/2f) -
                                         (int) (_selectedLabel.Height/2f));
     _dropDown.Position = new Vector2i(ClientArea.Left + (int) ((ClientArea.Width - _dropDown.ClientArea.Width)/2f),
                                    ClientArea.Bottom());
     _dropDown.Update(frameTime);
 }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:21,代码来源:Listbox.cs

示例6: Update

        public override void Update(float frameTime)
        {
            var boundsLeft = _textboxLeft.GetLocalBounds();
            var boundsMain = _textboxMain.GetLocalBounds();
            var boundsRight = _textboxRight.GetLocalBounds();
            _clientAreaLeft = new IntRect(Position, new Vector2i((int)boundsLeft.Width, (int)boundsLeft.Height));

            _clientAreaMain = new IntRect(_clientAreaLeft.Right(), Position.Y,
                                            Width, (int)boundsMain.Height);
            _clientAreaRight = new IntRect(_clientAreaMain.Right(), Position.Y,
                                             (int)boundsRight.Width, (int)boundsRight.Height);
            ClientArea = new IntRect(Position,
                                       new Vector2i(_clientAreaLeft.Width + _clientAreaMain.Width + _clientAreaRight.Width,
                                                Math.Max(Math.Max(_clientAreaLeft.Height, _clientAreaRight.Height),
                                                         _clientAreaMain.Height)));
            Label.Position = new Vector2i(_clientAreaLeft.Right(),
                                       Position.Y + (int) (ClientArea.Height/2f) - (int) (Label.Height/2f));

            _caretPos = Label.Text.Length;

            if (Focus)
            {
                blinkCount += 1*frameTime;
                if (blinkCount > 0.50f) blinkCount = 0;
            }
        }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:26,代码来源:Textbox.cs

示例7: Update

 public override void Update(float frameTime)
 {
     if (disposing || !IsVisible()) return;
     base.Update(frameTime);
     if (title == null || gradient == null) return;
     int y_pos = ClientArea.Top - (2*titleBuffer) - title.ClientArea.Height + 1;
     title.Position = new Vector2i(ClientArea.Left + 3, y_pos + titleBuffer);
     titleArea = new IntRect(ClientArea.Left, y_pos, ClientArea.Width, title.ClientArea.Height + (2*titleBuffer));
     title.Update(frameTime);
     closeButton.Position = new Vector2i(titleArea.Right() - 5 - closeButton.ClientArea.Width,
                                      titleArea.Top + (int) (titleArea.Height/2f) -
                                      (int) (closeButton.ClientArea.Height/2f));
     gradient.ClientArea = titleArea;
     gradient.Color1 = TitleColor1;
     gradient.Color2 = TitleColor2;
     gradient.Update(frameTime);
     closeButton.Update(frameTime);
 }
开发者ID:MSylvia,项目名称:space-station-14,代码行数:18,代码来源:Window.cs


注:本文中的IntRect.Right方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。