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


C# IAssetManager.LoadBrush方法代码示例

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


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

示例1: LoadContent

        public override void LoadContent(IAssetManager assetManager)
        {
            base.LoadContent(assetManager);
            _assetManager = assetManager;

            switch (TextSize) {
                case TextSize.Large:
                    Font = assetManager.LoadFont(FontName, ControlManager.Config.WindowLargeFontSize, FontWeight.Normal, FontStyle.Normal, FontStretch.Normal);
                    break;

                case TextSize.Normal:
                    goto default;

                default:
                    Font = assetManager.LoadFont(FontName, ControlManager.Config.WindowStandardFontSize, FontWeight.Normal, FontStyle.Normal, FontStretch.Normal);
                    break;
            }

            if (!String.IsNullOrEmpty(ActiveTexturePath)) {
                _activeTexture = assetManager.LoadTexture(ActiveTexturePath);

                if (String.IsNullOrEmpty(InactiveTexturePath))
                    _inactiveTexture = _activeTexture;
                else
                    _inactiveTexture = assetManager.LoadTexture(InactiveTexturePath);

                if (String.IsNullOrEmpty(PressedTexturePath))
                    _pressedTexture = _activeTexture;
                else
                    _pressedTexture = assetManager.LoadTexture(PressedTexturePath);
            }

            if (_activeTexture == null) {
                _activeBackgroundBrush = assetManager.LoadBrush(this.ActiveBackgroundColor);
            } else {
                _activeBackgroundBrush = assetManager.LoadBrush(_activeTexture.Resource, new BitmapBrushProperties() {
                    ExtendModeX = ExtendMode.Wrap,
                    ExtendModeY = ExtendMode.Wrap,
                    InterpolationMode = BitmapInterpolationMode.Linear
                }, null);
            }
            _activeBorderBrush = assetManager.LoadBrush(this.ActiveBorderColor);

            if (_inactiveTexture == null) {
                _inactiveBackgroundBrush = assetManager.LoadBrush(this.InactiveBackgroundColor);
            } else {
                _inactiveBackgroundBrush = assetManager.LoadBrush(_inactiveTexture.Resource, new BitmapBrushProperties() {
                    ExtendModeX = ExtendMode.Wrap,
                    ExtendModeY = ExtendMode.Wrap,
                    InterpolationMode = BitmapInterpolationMode.Linear
                }, null);
            }
            _inactiveBorderBrush = assetManager.LoadBrush(this.InactiveBorderColor);
            _pressedBackgroundBrush = assetManager.LoadBrush(this.PressedBackgroundColor);
            _pressedBorderBrush = assetManager.LoadBrush(this.PressedBorderColor);
            _activeFontBrush = assetManager.LoadBrush(this.ActiveFontColor);
            _inactiveFontBrush = assetManager.LoadBrush(this.InactiveFontColor);
        }
开发者ID:sleepless1,项目名称:GameSharp,代码行数:58,代码来源:DrawableControlBase.cs

示例2: LoadContent

 public void LoadContent(IAssetManager assets)
 {
     _buffer.Clear();
     _assetManager = assets;
     _font = ToDispose<FontAsset>(assets.LoadFont(FONT_NAME, FONT_SIZE, FontWeight.Normal, FontStyle.Normal, FontStretch.Normal));
     _backgroundColor = ToDispose<BrushAsset>(assets.LoadBrush(BACKGROUND));
     _standardColor = ToDispose<BrushAsset>(assets.LoadBrush(NORMALTEXT));
     _errorColor = ToDispose<BrushAsset>(assets.LoadBrush(ERRORTEXT));
 }
开发者ID:sleepless1,项目名称:GameSharp,代码行数:9,代码来源:CommandConsole.OutputView.cs

示例3: LoadContent

 public void LoadContent(IAssetManager assets)
 {
     _assetManager = assets;
     _font = ToDispose<FontAsset>(assets.LoadFont(FONT_NAME, FONT_SIZE, FontWeight.Normal, FontStyle.Normal, FontStretch.Normal));
     _currentLayout = ToDispose<TextLayout>(assets.MakeTextLayout(_font.Resource, "", float.MaxValue, float.MaxValue));
     _cursor = ToDispose<TextLayout>(assets.MakeTextLayout(_font.Resource, CURSOR, float.MaxValue, float.MaxValue));
     _lineSpacing = _cursor.Metrics.Height;
     _backgroundColor = ToDispose<BrushAsset>(assets.LoadBrush(BACKGROUND));
     _textColor = ToDispose<BrushAsset>(assets.LoadBrush(TEXT));
     Reset();
 }
开发者ID:sleepless1,项目名称:GameSharp,代码行数:11,代码来源:CommandConsole.InputView.cs


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