public override void Initialize() { PCanvas c = Canvas; PLayer l = c.Layer; PCamera cam = c.Camera; cam.ScaleViewBy(2.0f); PPath path = PPath.CreateRectangle(0, 0, 100, 100); l.AddChild(path); path.TranslateBy(100, 10); path.ScaleBy(0.2f); cam.AnimateViewToCenterBounds(path.GlobalFullBounds, true, 1000); }
public override void Initialize() { PLayer layer = Canvas.Layer; Random r = new Random(); for (int i = 0; i < 20; i++) { PPath each = PPath.CreateRectangle(0, 0, 100, 80); each.ScaleBy((float)r.NextDouble() * 2); each.OffsetBy((float)r.NextDouble() * 1000, (float)r.NextDouble() * 1000); each.Brush = new SolidBrush(Color.FromArgb((int)(255 * r.NextDouble()), (int)(255 * r.NextDouble()), (int)(255 * r.NextDouble()))); each.Pen = new Pen(Color.FromArgb((int)(255 * r.NextDouble()), (int)(255 * r.NextDouble()), (int)(255 * r.NextDouble()))); layer.AddChild(each); } Canvas.AddInputEventListener(new PNavigationEventHandler()); base.Initialize(); }
public override void Initialize() { PLayer layer = Canvas.Layer; Random r = new Random(); for (int i = 0; i < 1000; i++) { PPath each = PPath.CreateRectangle(0, 0, 100, 80); each.ScaleBy((float)r.NextDouble() * 2); each.OffsetBy((float)r.NextDouble() * 10000, (float)r.NextDouble() * 10000); each.Brush = Color.FromNonPremultiplied((int)(255 * r.NextDouble()), (int)(255 * r.NextDouble()), (int)(255 * r.NextDouble()), 255); each.Pen = new System.Drawing.Pen(System.Drawing.Color.FromArgb((int)(255 * r.NextDouble()), (int)(255 * r.NextDouble()), (int)(255 * r.NextDouble())), (float)(1 + (10 * (float)r.NextDouble()))); layer.AddChild(each); } Canvas.RemoveInputEventListener(Canvas.PanEventHandler); Canvas.AddInputEventListener(new PNavigationEventHandler()); }
public override void Initialize() { PPath eacha = PPath.CreateRectangle(50, 50, 300, 300); eacha.Brush = Color.Red; Canvas.Layer.AddChild(eacha); eacha = PPath.CreateRectangle(-50, -50, 100, 100); eacha.Brush = Color.Green; Canvas.Layer.AddChild(eacha); eacha = PPath.CreateRectangle(350, 350, 100, 100); eacha.Brush = Color.Green; Canvas.Layer.AddChild(eacha); Canvas.Camera.MouseDown += new PInputEventHandler(Camera_MouseDown); PLayer layer = Canvas.Layer; Random random = new Random(); for (int i = 0; i < 1000; i++) { PPath each = PPath.CreateRectangle(0, 0, 100, 80); each.ScaleBy((float)random.NextDouble() * 2); each.OffsetBy((float)random.NextDouble() * 10000, (float)random.NextDouble() * 10000); each.Brush = Color.FromNonPremultiplied((int)(255 * random.NextDouble()), (int)(255 * random.NextDouble()), (int)(255 * random.NextDouble()), (int)(255 * random.NextDouble())); System.Drawing.Color penBrush = System.Drawing.Color.FromArgb((int)(255 * random.NextDouble()), (int)(255 * random.NextDouble()), (int)(255 * random.NextDouble())); each.Pen = new System.Drawing.Pen(penBrush, 1 + (10 * (float)random.NextDouble())); layer.AddChild(each); } Canvas.RemoveInputEventListener(Canvas.ZoomEventHandler); }