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


C# IntRect.Bottom方法代码示例

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


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

示例1: 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

示例2: 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

示例3: GetVisibility

        private float GetVisibility(IntRect visibleRegion)
        {
            // Outside bounds
            if (visibleRegion.Top > _glyphArea.Bottom())
                return 0;
            if (visibleRegion.Bottom() < _glyphArea.Top)
                return 0;

            // Completely within bounds
            if (visibleRegion.Top < _glyphArea.Top
                && visibleRegion.Bottom() > _glyphArea.Bottom())
                return 1;;

            // Partially within bounds - fading out
            if (visibleRegion.Top > _glyphArea.Top)
                return (_glyphArea.Bottom() - visibleRegion.Top) / (float)(_glyphArea.Bottom() - _glyphArea.Top);

            // Partially within bounds - fading in
            return (float)(visibleRegion.Bottom() - _glyphArea.Top) / _glyphArea.Height;
        }
开发者ID:nathanchere,项目名称:MatrixSaver,代码行数:20,代码来源:Glyph.cs


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