Affine.Translate C# (CSharp) Method

Translate() public method

public Translate ( float dx, float dy ) : bool
dx float
dy float
return bool
	public bool Translate(float dx, float dy)
	{
		fMatrix.eDx += dx;
		fMatrix.eDy += dy;

		return true;
	}

Usage Example

コード例 #1
0
        public Window(double x, double y, double width, double height, string lable)
        {
            m_X      = x;
            m_Y      = y;
            m_width  = width;
            m_height = height;
            Affine transform = GetTransform();

            transform.Translate(x, y);
            SetTransform(transform);
            caption                  = new TextWidget(lable, 0, height - 15, 7);
            caption.TextColor        = new RGBA_Bytes(255, 255, 255);
            closeButton              = new ButtonWidget(width - 15, height - 15, "X", 7, 1, 1, 5);
            closeButton.ButtonClick += CloseEvent;
            AddChild(caption);
            AddChild(closeButton);

            TextPadding  = 1;
            BorderWidth  = 2;
            BorderRadius = 5;

            double totalExtra = BorderWidth + TextPadding;

            m_Bounds.Left   = x - totalExtra;
            m_Bounds.Bottom = y - totalExtra;
            m_Bounds.Right  = x + width + totalExtra;
            m_Bounds.Top    = y + height + totalExtra;
        }
All Usage Examples Of Affine::Translate