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);
 }
 public FreeMovementRenderableAsset(IGraphicsContext context)
 {
     _texture = context.LoadTexture2D("freeMovementWidget");
     _boundingBox = new AxisAlignedBoundingBox2D(0, 0, _texture.Height, _texture.Width);
     RenderingOffset = -AABoundingBox.Center;
     Origin = AABoundingBox.Center;
 }
 public RotateWidgetRenderableAsset(IGraphicsContext context)
 {
     _texture = context.LoadTexture2D("RotationWidget");
     _boundingBox = new AxisAlignedBoundingBox2D(0, 0, _texture.Height, _texture.Width);
     RenderingOffset = - _boundingBox.Center;
     Origin = _boundingBox.Center;
 }
        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);
        }
Exemplo n.º 5
0
 public BoneRenderableAsset(IGraphicsContext graphicsContext)
 {
     Texture2D = graphicsContext.LoadTexture2D("Bone");
     Origin = new Vector2(Texture2D.Width / 2, 0.0f);
     RenderingOffset = -new Vector2(Texture2D.Width / 2, 0.0f);
 }