本文整理汇总了C#中IAssetManager.LoadTexture方法的典型用法代码示例。如果您正苦于以下问题:C# IAssetManager.LoadTexture方法的具体用法?C# IAssetManager.LoadTexture怎么用?C# IAssetManager.LoadTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAssetManager
的用法示例。
在下文中一共展示了IAssetManager.LoadTexture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 override void LoadContent(IAssetManager assetManager)
{
_texture = assetManager.LoadTexture(_imageFilepath);
if (ResizeToImage)
this.Size = new Vector2(_texture.Resource.Size.Width, _texture.Resource.Size.Height);
}