當前位置: 首頁>>代碼示例>>C#>>正文


C# PNode.SetBounds方法代碼示例

本文整理匯總了C#中UMD.HCIL.Piccolo.PNode.SetBounds方法的典型用法代碼示例。如果您正苦於以下問題:C# PNode.SetBounds方法的具體用法?C# PNode.SetBounds怎麽用?C# PNode.SetBounds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UMD.HCIL.Piccolo.PNode的用法示例。


在下文中一共展示了PNode.SetBounds方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Initialize

		public override void Initialize() {
			PRoot root = Canvas.Root;
			PCamera camera = Canvas.Camera;
			//PLayer gridLayer = new GridLayer();

			// replace standard layer with grid layer.
			root.RemoveChild(camera.GetLayer(0));
			camera.RemoveLayer(0);
			root.AddChild(gridLayer);
			camera.AddLayer(gridLayer);

			// add constraints so that grid layers bounds always match cameras view bounds. This makes 
			// it look like an infinite grid.
			camera.BoundsChanged += new PPropertyEventHandler(camera_BoundsChanged);
			camera.ViewTransformChanged += new PPropertyEventHandler(camera_ViewTransformChanged);

			gridLayer.Bounds = camera.ViewBounds;

			PNode n = new PNode();
			n.Brush = Brushes.Blue;
			n.SetBounds(0, 0, 100, 80);
		
			Canvas.Layer.AddChild(n);
			Canvas.RemoveInputEventListener(Canvas.PanEventHandler);

			Canvas.AddInputEventListener(new GridDragHandler(Canvas));
		}
開發者ID:malacandrian,項目名稱:Piccolo.NET,代碼行數:27,代碼來源:GridExample.cs

示例2: Initialize

		public override void Initialize() {
			PLayer layer = Canvas.Layer;
			PNode aNode = new PNode();

			aNode.MouseDown += new PInputEventHandler(aNode_MouseDown);
			aNode.MouseDrag += new PInputEventHandler(aNode_MouseDrag);
			aNode.MouseUp += new PInputEventHandler(aNode_MouseUp);

			aNode.SetBounds(0, 0, 200, 200);
			aNode.Brush = new SolidBrush(Color.Green);

			// add another node to the canvas that does not handle events as a reference
			// point, so that we can make sure that our green node is getting dragged.				
			layer.AddChild(PPath.CreateRectangle(0, 0, 100, 80));
			layer.AddChild(aNode);		
		}
開發者ID:ArsenShnurkov,項目名稱:piccolo2d.net,代碼行數:16,代碼來源:NodeEventExample.cs

示例3: InterpData

 public InterpData()
     : base()
 {
     InterpGroups = new List<InterpGroup>();
     TimelineView = new PNode();
     AddChild(TimelineView);
     TimelineView.MoveToBack();
     TimelineView.Pickable = false;
     //TimelineView.Brush = new SolidBrush(Color.FromArgb(60, 60, 60));
     TimelineView.SetBounds(0, 0, 3600, Height);
     TimelineView.TranslateBy(Timeline.ListWidth, 0);
     TimeScale = PPath.CreateRectangle(0, 0, 3600, Timeline.InfoHeight);
     TimeScale.TranslateBy(Timeline.ListWidth, 0);
     TimeScale.Pickable = false;
     TimeScale.Brush = new SolidBrush(Color.FromArgb(80, 80, 80));
     AddChild(TimeScale);
     TimeScale.MoveToFront();
     //seperationLine = PPath.CreateLine(Timeline.ListWidth, 0, Timeline.ListWidth, 10);
     //seperationLine.Pickable = false;
     //AddChild(seperationLine);
 }
開發者ID:Dybuk,項目名稱:ME3Explorer,代碼行數:21,代碼來源:Timeline.cs

示例4: Initialize

		public override void Initialize() {
			// Add a standard pnode to the scene graph.
			PNode aNode = new PNode();
			aNode.SetBounds(0, 70, 15, 15);
			aNode.Brush = Brushes.Blue;
			Canvas.Layer.AddChild(aNode);

			// Create a button.
			Button button = new Button();
			button.Text = "Hello";
			button.Bounds = new Rectangle(10, 10, 10, 10);
			button.BackColor = SystemColors.Control;

			// Wrap the button in a PControl and
			// add it to the scene graph.
			PControl cn = new PControl(button);
			Canvas.Layer.AddChild(cn);
			cn.SetBounds(20, 20, 70, 70);

			// Create another button.
			Button otherButton = new Button();
			otherButton.Text = "123";
			otherButton.Bounds = new Rectangle(0, 0, 15, 45);
			otherButton.BackColor = SystemColors.Control;

			// Wrap the second button in another PControl and
			// add it to the scene graph.
			PControl cn2 = new PControl(otherButton, PCanvas.CURRENT_PCANVAS);
			cn2.ScaleBy(1.1f);
			Canvas.Layer.AddChild(cn2);

			// Create a tabcontrol
			TabControl tabControl = new TabControl();
			tabControl.Size = new Size(60, 60);
			tabControl.TabPages.Add(new TabPage("P1"));
			tabControl.TabPages.Add(new TabPage("P2"));

			// Wrap the tabcontrol in a PControl and
			// add it the scene graph.
			PControl cn3 = new PControl(tabControl);
			cn3.ScaleBy(1.2f);
			cn3.TranslateBy(0, 100);
			Canvas.Layer.AddChild(cn3);

			// Create an internal camera that looks at the main layer.
			PCamera internalCamera = new PCamera();
			internalCamera.TranslateViewBy(145, 145);
			internalCamera.ScaleViewBy(.5f);
			internalCamera.SetBounds(130, 130, 200, 200);
			internalCamera.Brush = Brushes.Yellow;
			internalCamera.AddLayer(Canvas.Layer);
			Canvas.Camera.AddChild(internalCamera);

			Canvas.Layer.ScaleBy(1.3f);

			// Create another canvas.
			PCamera otherCamera = new PCamera();
			otherCamera.AddLayer(Canvas.Layer);
			Canvas.Root.AddChild(otherCamera); 	
		
			PCanvas other = new PCanvas();
			other.Camera = otherCamera;
			PForm result = new PForm(false, other);
			result.StartPosition = FormStartPosition.Manual;
			result.Location = new Point(this.Location.X + this.Width, this.Location.Y);
			result.Size = this.Size;
			result.Show();

			// Add the control event handler to both canvas' cameras.
			Canvas.Camera.AddInputEventListener(new PControlEventHandler());
			other.Camera.AddInputEventListener(new PControlEventHandler());
		}
開發者ID:ArsenShnurkov,項目名稱:piccolo2d.net,代碼行數:72,代碼來源:ControlExample.cs

示例5: BirdsEyeView

			public BirdsEyeView() {
				// create the coverage node
				areaVisiblePNode = new P3DRectangle();
				areaVisiblePNode.Brush = new SolidBrush(Color.FromArgb(204, 128, 128, 255));
				areaVisiblePNode.SetBounds(0, 0, 100, 100);
				Camera.AddChild(areaVisiblePNode);

				Camera.AddInputEventListener(new BEVDragEventHandler(this));

				// remove Pan and Zoom
				this.PanEventHandler = null;
				this.ZoomEventHandler = null;

				this.DefaultRenderQuality = RenderQuality.LowQuality;
			}
開發者ID:ArsenShnurkov,項目名稱:piccolo2d.net,代碼行數:15,代碼來源:BirdsEyeViewExample.cs


注:本文中的UMD.HCIL.Piccolo.PNode.SetBounds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。