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
0
 public ArrowTranslateSceneWidget(TranslateSceneWidget translateWidget, TranslateArrowDirection direction)
 {
     OnInitialize += OnInitializeHandler;
     _direction = direction;
     _translateWidget = translateWidget;
     OnStartDrag += OnStartDragHandler;
     OnDrag += OnDragHandler;
     OnStopDrag += OnStopDragHandler;
 }