Esempio n. 1
0
        public override void Draw(Graphics graphics)
        {
            if (Visible)
            {
                if (LevelGridVisible)
                {
                    //画格子
                    if (transformIsChanged)
                    {
                        UpdateLayerGridTransform();
                    }
                    layer_Grid.Visible            = true;
                    layer_Grid.GridLine.LineColor = Color.FromArgb(Alpha + (255 - Alpha) / 6, gridColor);
                    layer_Grid.GridLine.LineWidth = GridLineWidth;
                    layer_Grid.Draw(graphics);
                }

                if (LevelPartVisible)
                {
                    Brush brush = new SolidBrush(Color.FromArgb(alpha, partColor));
                    //画有效分块
                    for (int i = 0; i < level.GetUnitNumInHeight(); i++)
                    {
                        for (int j = 0; j < level.GetUnitNumInWidth(); j++)
                        {
                            if (level.GetPartRefByPartIndex(j, i) != null)
                            {
                                graphics.FillRectangle(brush, GetPartScreenRectangleInSpecificLevel(level, j, i));
                            }
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        public override void Draw(Graphics graphics)
        {
            if (Visible)
            {
                Color tempColor = GridColor;

                for (int i = m2mStructure.GetLevelNum() - 1; i > 0; i--)
                {
                    layer_Grid = new Layer_Grid(m2mStructure.GetLevel(i));

                    layer_Grid.ScreenScaleX       = this.ScreenScaleX;
                    layer_Grid.ScreenScaleY       = this.ScreenScaleY;
                    layer_Grid.ScreenTranslationX = this.ScreenTranslationX;
                    layer_Grid.ScreenTranslationY = this.ScreenTranslationY;

                    layer_Grid.Visible            = true;
                    tempColor                     = GenerateColor.GetSimilarColor(tempColor);
                    layer_Grid.GridLine.LineColor = Color.FromArgb(alpha, tempColor);
                    layer_Grid.GridLine.LineWidth = (float)((m2mStructure.GetLevelNum() - i));
                    layer_Grid.Draw(graphics);
                }
            }
        }