コード例 #1
0
        /// <summary>
        /// Draw rectangle
        /// </summary>
        /// <param name="g"></param>
        public override void Draw(SpriteBatch g)
        {
            try
            {
                Rectangle r = GetNormalizedRectangle(Rectangle);
                if (Fill.ToColor() != Color.Transparent)
                {
                    //Brush brush = new SolidBrush(Fill);
                    XnaDrawing.DrawFilledRectangle(r, Fill.ToColor());
                }
                //Pen pen = new Pen(Stroke, StrokeWidth);
                //TODO change Draw Rectangle to include strokewidth
                XnaDrawing.DrawRectangle(r, Stroke);

                //pen.Dispose();
            }
            catch (Exception ex)
            {
                ErrH.Log("DrawRectangle", "Draw", ex.ToString(), ErrH._LogPriority.Info);
            }
        }
コード例 #2
0
        /// <summary>
        /// Draw tracker for selected object
        /// </summary>
        /// <param name="g"></param>
        public virtual void DrawTracker(SpriteBatch g)
        {
            if (!Selected)
            {
                return;
            }

            //var brush = new SolidBrush(Color.Black);

            for (int i = 1; i <= HandleCount; i++)
            {
                try
                {
                    XnaDrawing.DrawFilledRectangle(GetHandleRectangle(i), Color.Black);
                }
                catch
                {}
            }

            //brush.Dispose();
        }