Ejemplo n.º 1
0
        public TestCircle()
        {
            m_pntVel    = new EPointF(0, 0);
            m_pntThrust = new EPoint(0, 0);

            aKeysPressedX = new ArrayList();
            aKeysPressedY = new ArrayList();

            Bitmap   bmp = new Bitmap(40, 40, PixelFormat.Format24bppRgb);
            Graphics g   = Graphics.FromImage(bmp);

            g.FillEllipse(new SolidBrush(Color.Red), 0, 0, 40, 40);
            g.Dispose();
            MemberSpriteBitmap mb = new MemberSpriteBitmap(bmp);

            mb.CenterRegPoint();
            Member = mb;

            m_aLines = new ArrayList();
            for (int i = 0; i < 1; i++)
            {
                TestLine line = new TestLine(m_endogine);
                line.SetLine(new EPointF((i) * 150, 0), new EPointF((i + 1) * 150, 150));
                m_aLines.Add(line);
            }

            LocZ = 10;
            Loc  = new EPointF(171, 171);
            m_endogine.KeyEvent += new KeyEventHandler(m_endogine_KeyEvent);
        }
Ejemplo n.º 2
0
        public void Init()
        {
            this.UIParentSprite = new Sprite();
            this.UIParentSprite.Parent = this.m_sp.Parent;
            this.UIParentSprite.Name = "Transformer";

            this.moveSprite = new Sprite();
            this.moveSprite.Parent = this.UIParentSprite;
            this.moveSprite.LocZ = 999;
            this.moveSprite.Name = "Move";
            this.moveSprite.MouseActive = true;
            this.moveSprite.MouseEvent+=new Endogine.Sprite.MouseEventDelegate(moveSprite_MouseEvent);
            this.moveSprite.Cursor = System.Windows.Forms.Cursors.SizeAll;
            this.m_aSprites.Add(this.moveSprite);

            this.rotateSprite = new Sprite();
            this.rotateSprite.Parent = this.UIParentSprite;
            this.rotateSprite.LocZ = 998;
            this.rotateSprite.Name = "Rotate";
            this.rotateSprite.MouseActive = true;
            this.rotateSprite.MouseEvent+=new Endogine.Sprite.MouseEventDelegate(rotateSprite_MouseEvent);
            this.rotateSprite.Cursor = System.Windows.Forms.Cursors.Hand;
            this.m_aSprites.Add(this.rotateSprite);

            Bitmap bmpCross = new Bitmap(8,8,PixelFormat.Format24bppRgb);
            Graphics g = Graphics.FromImage(bmpCross);
            Pen pen = new Pen(System.Drawing.Color.Gray);
            g.DrawRectangle(pen, 0,0,bmpCross.Width, bmpCross.Height);
            g.DrawLine(pen, bmpCross.Width/2,0,bmpCross.Width/2,bmpCross.Height);
            g.DrawLine(pen, 0,bmpCross.Height/2,bmpCross.Width,bmpCross.Height/2);
            MemberSpriteBitmap mb = new MemberSpriteBitmap(bmpCross);
            mb.CenterRegPoint();

            this.pivotSprite = new Sprite();
            this.pivotSprite.Parent = this.UIParentSprite;
            this.pivotSprite.Name = "Pivot";
            this.pivotSprite.Member = mb;
            this.pivotSprite.LocZ = 1002;
            this.pivotSprite.MouseActive = true;
            this.pivotSprite.MouseEvent+=new Endogine.Sprite.MouseEventDelegate(pivotSprite_MouseEvent);
            this.pivotSprite.Cursor = System.Windows.Forms.Cursors.NoMove2D;
            this.m_aSprites.Add(this.pivotSprite);

            //8 squares for resizing:
            Bitmap bmpSquare = new Bitmap(8,8,PixelFormat.Format24bppRgb);
            g = Graphics.FromImage(bmpSquare);
            //g.DrawRectangle(new Pen(Color.Gray), 0,0,bmpSquare.Width, bmpSquare.Height);
            g.FillRectangle(new SolidBrush(System.Drawing.Color.Gray), 0, 0, bmpSquare.Width, bmpSquare.Height);
            mb = new MemberSpriteBitmap(bmpSquare);
            mb.CenterRegPoint();

            resizeSquares = new ArrayList();

            for (int y = 0; y < 3; y++)
            {
                for (int x = 0; x < 3; x++)
                {
                    if (x == 1 && y == 1)
                        continue;
                    Sprite spSquare = new Sprite();
                    //spSquare.Parent = this.m_sp;
                    spSquare.Parent = this.UIParentSprite;
                    spSquare.Name = "Size";
                    spSquare.Member = mb;
                    resizeSquares.Add(spSquare);
                    spSquare.Tag = new EPoint(x,y);
                    spSquare.LocZ = 1000;
                    spSquare.Ink = RasterOps.ROPs.BgTransparent;
                    spSquare.MouseActive = true;
                    spSquare.MouseEvent+=new Endogine.Sprite.MouseEventDelegate(spSquare_MouseEvent);
                    this.m_aSprites.Add(spSquare);
                }
            }
            ((Sprite)resizeSquares[0]).Cursor = System.Windows.Forms.Cursors.SizeNWSE;
            ((Sprite)resizeSquares[7]).Cursor = System.Windows.Forms.Cursors.SizeNWSE;
            ((Sprite)resizeSquares[2]).Cursor = System.Windows.Forms.Cursors.SizeNESW;
            ((Sprite)resizeSquares[5]).Cursor = System.Windows.Forms.Cursors.SizeNESW;
            ((Sprite)resizeSquares[1]).Cursor = System.Windows.Forms.Cursors.SizeNS;
            ((Sprite)resizeSquares[6]).Cursor = System.Windows.Forms.Cursors.SizeNS;
            ((Sprite)resizeSquares[3]).Cursor = System.Windows.Forms.Cursors.SizeWE;
            ((Sprite)resizeSquares[4]).Cursor = System.Windows.Forms.Cursors.SizeWE;

            this.Update();
        }
Ejemplo n.º 3
0
        public void Init()
        {
            this.UIParentSprite        = new Sprite();
            this.UIParentSprite.Parent = this.m_sp.Parent;
            this.UIParentSprite.Name   = "Transformer";

            this.moveSprite             = new Sprite();
            this.moveSprite.Parent      = this.UIParentSprite;
            this.moveSprite.LocZ        = 999;
            this.moveSprite.Name        = "Move";
            this.moveSprite.MouseActive = true;
            this.moveSprite.MouseEvent += new Endogine.Sprite.MouseEventDelegate(moveSprite_MouseEvent);
            this.moveSprite.Cursor      = System.Windows.Forms.Cursors.SizeAll;
            this.m_aSprites.Add(this.moveSprite);

            this.rotateSprite             = new Sprite();
            this.rotateSprite.Parent      = this.UIParentSprite;
            this.rotateSprite.LocZ        = 998;
            this.rotateSprite.Name        = "Rotate";
            this.rotateSprite.MouseActive = true;
            this.rotateSprite.MouseEvent += new Endogine.Sprite.MouseEventDelegate(rotateSprite_MouseEvent);
            this.rotateSprite.Cursor      = System.Windows.Forms.Cursors.Hand;
            this.m_aSprites.Add(this.rotateSprite);


            Bitmap   bmpCross = new Bitmap(8, 8, PixelFormat.Format24bppRgb);
            Graphics g        = Graphics.FromImage(bmpCross);
            Pen      pen      = new Pen(System.Drawing.Color.Gray);

            g.DrawRectangle(pen, 0, 0, bmpCross.Width, bmpCross.Height);
            g.DrawLine(pen, bmpCross.Width / 2, 0, bmpCross.Width / 2, bmpCross.Height);
            g.DrawLine(pen, 0, bmpCross.Height / 2, bmpCross.Width, bmpCross.Height / 2);
            MemberSpriteBitmap mb = new MemberSpriteBitmap(bmpCross);

            mb.CenterRegPoint();

            this.pivotSprite             = new Sprite();
            this.pivotSprite.Parent      = this.UIParentSprite;
            this.pivotSprite.Name        = "Pivot";
            this.pivotSprite.Member      = mb;
            this.pivotSprite.LocZ        = 1002;
            this.pivotSprite.MouseActive = true;
            this.pivotSprite.MouseEvent += new Endogine.Sprite.MouseEventDelegate(pivotSprite_MouseEvent);
            this.pivotSprite.Cursor      = System.Windows.Forms.Cursors.NoMove2D;
            this.m_aSprites.Add(this.pivotSprite);


            //8 squares for resizing:
            Bitmap bmpSquare = new Bitmap(8, 8, PixelFormat.Format24bppRgb);

            g = Graphics.FromImage(bmpSquare);
            //g.DrawRectangle(new Pen(Color.Gray), 0,0,bmpSquare.Width, bmpSquare.Height);
            g.FillRectangle(new SolidBrush(System.Drawing.Color.Gray), 0, 0, bmpSquare.Width, bmpSquare.Height);
            mb = new MemberSpriteBitmap(bmpSquare);
            mb.CenterRegPoint();

            resizeSquares = new ArrayList();

            for (int y = 0; y < 3; y++)
            {
                for (int x = 0; x < 3; x++)
                {
                    if (x == 1 && y == 1)
                    {
                        continue;
                    }
                    Sprite spSquare = new Sprite();
                    //spSquare.Parent = this.m_sp;
                    spSquare.Parent = this.UIParentSprite;
                    spSquare.Name   = "Size";
                    spSquare.Member = mb;
                    resizeSquares.Add(spSquare);
                    spSquare.Tag         = new EPoint(x, y);
                    spSquare.LocZ        = 1000;
                    spSquare.Ink         = RasterOps.ROPs.BgTransparent;
                    spSquare.MouseActive = true;
                    spSquare.MouseEvent += new Endogine.Sprite.MouseEventDelegate(spSquare_MouseEvent);
                    this.m_aSprites.Add(spSquare);
                }
            }
            ((Sprite)resizeSquares[0]).Cursor = System.Windows.Forms.Cursors.SizeNWSE;
            ((Sprite)resizeSquares[7]).Cursor = System.Windows.Forms.Cursors.SizeNWSE;
            ((Sprite)resizeSquares[2]).Cursor = System.Windows.Forms.Cursors.SizeNESW;
            ((Sprite)resizeSquares[5]).Cursor = System.Windows.Forms.Cursors.SizeNESW;
            ((Sprite)resizeSquares[1]).Cursor = System.Windows.Forms.Cursors.SizeNS;
            ((Sprite)resizeSquares[6]).Cursor = System.Windows.Forms.Cursors.SizeNS;
            ((Sprite)resizeSquares[3]).Cursor = System.Windows.Forms.Cursors.SizeWE;
            ((Sprite)resizeSquares[4]).Cursor = System.Windows.Forms.Cursors.SizeWE;

            this.Update();
        }