本文整理汇总了C#中IGraphicsContext.LoadTexture2D方法的典型用法代码示例。如果您正苦于以下问题:C# IGraphicsContext.LoadTexture2D方法的具体用法?C# IGraphicsContext.LoadTexture2D怎么用?C# IGraphicsContext.LoadTexture2D使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGraphicsContext
的用法示例。
在下文中一共展示了IGraphicsContext.LoadTexture2D方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TranslateWidgetRenderableAsset
public TranslateWidgetRenderableAsset(IGraphicsContext context, TranslateArrowDirection direction)
{
if (direction == TranslateArrowDirection.Horizontal)
{
_texture = context.LoadTexture2D("ArrowHorizontal");
RenderingOffset = - new Vector2(0, _texture.Height / 2);
}
else
{
_texture = context.LoadTexture2D("ArrowVertical");
RenderingOffset = - new Vector2(_texture.Width / 2, 0);
}
_boundingBox = new AxisAlignedBoundingBox2D(0, 0, _texture.Height, _texture.Width);
}
示例2: FreeMovementRenderableAsset
public FreeMovementRenderableAsset(IGraphicsContext context)
{
_texture = context.LoadTexture2D("freeMovementWidget");
_boundingBox = new AxisAlignedBoundingBox2D(0, 0, _texture.Height, _texture.Width);
RenderingOffset = -AABoundingBox.Center;
Origin = AABoundingBox.Center;
}
示例3: RotateWidgetRenderableAsset
public RotateWidgetRenderableAsset(IGraphicsContext context)
{
_texture = context.LoadTexture2D("RotationWidget");
_boundingBox = new AxisAlignedBoundingBox2D(0, 0, _texture.Height, _texture.Width);
RenderingOffset = - _boundingBox.Center;
Origin = _boundingBox.Center;
}
示例4: MoveWidgetRenderableAsset
public MoveWidgetRenderableAsset(IGraphicsContext context)
{
_verticalArrow = context.LoadTexture2D("ArrowVertical");
_horizontalArrow = context.LoadTexture2D("ArrowHorizontal");
_verticalArrowBox =
new AxisAlignedBoundingBox2D(
-_verticalArrow.Width / 2,
0,
_verticalArrow.Height,
_verticalArrow.Width);
_horizontalArrowBox =
new AxisAlignedBoundingBox2D(
0,
-_horizontalArrow.Height / 2,
_horizontalArrow.Height,
_horizontalArrow.Width);
}
示例5: BoneRenderableAsset
public BoneRenderableAsset(IGraphicsContext graphicsContext)
{
Texture2D = graphicsContext.LoadTexture2D("Bone");
Origin = new Vector2(Texture2D.Width / 2, 0.0f);
RenderingOffset = -new Vector2(Texture2D.Width / 2, 0.0f);
}