コード例 #1
0
        public override void Initialize()
        {
            PNode blue = new PNode();

            blue.SetBounds(0, 0, 60, 80);
            blue.Brush = new SolidBrush(Color.Blue);
            Canvas.Layer.AddChild(blue);

            PNode red = new PEllipse();

            red.SetBounds(50, 30, 60, 45);
            red.Brush = new SolidBrush(Color.Red);
            Canvas.Layer.AddChild(red);

            Bitmap bm    = new Bitmap(GetType().Module.Assembly.GetManifestResourceStream("PocketPiccoloFeatures.hcil.bmp"));
            PImage image = new PImage(bm);

            image.SetBounds(80, 100, image.Width, image.Height);
            Canvas.Layer.AddChild(image);

            Canvas.ZoomEventHandler = null;
            Canvas.AddInputEventListener(new PPanEventHandler());

            base.Initialize();
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EllipseCollider"/> class.
        /// </summary>
        /// <param name="x">Center x point of ellipse.</param>
        /// <param name="y">Center y point of ellipse.</param>
        /// <param name="w">Width of ellipse.</param>
        /// <param name="h">Height of ellipse.</param>
        public EllipseCollider(double x, double y, double w, double h)
        {
            TrianglesInternal = new PEllipse(new Vector2((float)x, (float)y), (float)h, (float)w).Triangles.ToArray();

            VerticesInternal = new Vector2[TrianglesInternal.Length];
            for (int i = 0; i < VerticesInternal.Length; i++)
            {
                VerticesInternal[i] = TrianglesInternal[i].VertexTwo;
            }
        }
コード例 #3
0
        public override void Initialize()
        {
            PClip clip = new PClip();

            clip.Brush = new SolidBrush(Color.Yellow);
            clip.SetBounds(0, 0, 100, 100);

            PEllipse red = new PEllipse();

            red.Bounds = new RectangleF(20, 20, 110, 50);
            red.Brush  = new SolidBrush(Color.Red);
            clip.AddChild(red);

            Canvas.Layer.AddChild(clip);

            Canvas.ZoomEventHandler = null;
            Canvas.Camera.AddInputEventListener(new PDragEventHandler());

            base.Initialize();
        }
コード例 #4
0
        public override void Initialize()
        {
            PLayer   l = new PLayer();
            PEllipse n = new PEllipse();

            n.SetBounds(0, 0, 100, 80);
            n.Brush = new SolidBrush(Color.Red);
            PBoundsHandle.AddBoundsHandlesTo(n);
            l.AddChild(n);
            n.TranslateBy(100, 100);

            PCamera c = new PCamera();

            c.SetBounds(0, 0, 100, 80);
            c.ScaleViewBy(0.1f);
            c.AddLayer(l);
            PBoundsHandle.AddBoundsHandlesTo(c);
            c.Brush = new SolidBrush(Color.Yellow);

            Canvas.Layer.AddChild(l);
            Canvas.Layer.AddChild(c);

            base.Initialize();
        }