本文整理汇总了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);
}
示例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));
}
示例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();
}