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


C# IGraphicsContext.LoadTexture2D方法代码示例

本文整理汇总了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);
 }
开发者ID:TiagoJSM,项目名称:Storytime,代码行数:14,代码来源:TranslateWidgetRenderableAsset.cs

示例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;
 }
开发者ID:TiagoJSM,项目名称:Storytime,代码行数:7,代码来源:FreeMovementRenderableAsset.cs

示例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;
 }
开发者ID:TiagoJSM,项目名称:Storytime,代码行数:7,代码来源:RotateWidgetRenderableAsset.cs

示例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);
        }
开发者ID:TiagoJSM,项目名称:Storytime,代码行数:18,代码来源:MoveWidgetRenderableAsset.cs

示例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);
 }
开发者ID:TiagoJSM,项目名称:Storytime,代码行数:6,代码来源:BoneRenderableAsset.cs


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