UMD.HCIL.Piccolo.PNode.TranslateBy C# (CSharp) Method

TranslateBy() public method

Translate this node's matrix by the given amount, using the standard matrix Translate method.
This translation affects this node and all of its descendents.
public TranslateBy ( float dx, float dy ) : void
dx float The amount to translate in the x direction.
dy float The amount to translate in the y direction.
return void
		public virtual void TranslateBy(float dx, float dy) {
			matrix.TranslateBy(dx, dy);
			InvalidatePaint();
			InvalidateFullBounds();
			FirePropertyChangedEvent(PROPERTY_KEY_TRANSFORM, PROPERTY_CODE_TRANSFORM, null, matrix);
		}

Usage Example

		public override void Initialize() {
			Canvas.PanEventHandler = null;
			Canvas.AddInputEventListener(new PDragEventHandler());
		
			node1 = PPath.CreateEllipse(0, 0, 100, 100);
			node2 = PPath.CreateEllipse(0, 0, 100, 100);
			link = PPath.CreateLine(50, 50, 50, 50);
			link.Pickable = false;
			Canvas.Layer.AddChild(node1);
			Canvas.Layer.AddChild(node2);
			Canvas.Layer.AddChild(link);
		
			node2.TranslateBy(200, 200);

			node1.FullBoundsChanged += new PPropertyEventHandler(node1_FullBoundsChanged);
			node2.FullBoundsChanged += new PPropertyEventHandler(node2_FullBoundsChanged);
		}
All Usage Examples Of UMD.HCIL.Piccolo.PNode::TranslateBy