Ejemplo n.º 1
0
        public void draw(SpanPanel spanPanel, Graphics g)
        {
            float width  = SpanPanel.spriteWidth - 15;
            float startX = 10;
            float startY = spanPanel.getSpriteY(curHeight);

            PointF[] points = new PointF[] {
                new PointF(startX, startY),
                new PointF(startX + width, startY),
                new PointF(startX + width, startY + SpanPanel.spriteHeight),
                new PointF(startX, startY + SpanPanel.spriteHeight),
            };
            g.FillPolygon(new SolidBrush(Color.White), points);
            g.DrawPolygon(new Pen(Color.Black), points);

            StringFormat format = new StringFormat();

            format.Alignment   = StringAlignment.Far;
            format.FormatFlags = StringFormatFlags.DirectionRightToLeft
                                 | StringFormatFlags.NoClip | StringFormatFlags.NoWrap;
            RectangleF layoutRectangle = new RectangleF();

            layoutRectangle.Location = new PointF(startX, startY + 4);
            layoutRectangle.Width    = width;
            layoutRectangle.Height   = SpanPanel.spriteHeight;
            g.DrawString(aeSprite.name, new Font("宋体", 11), new SolidBrush(Color.Black), layoutRectangle, format);

            foreach (ActionsBox actionsBox in actionBoxs.Values)
            {
                actionsBox.draw(spanPanel, g);
            }
        }
Ejemplo n.º 2
0
        public TimeSpanForm()
        {
            InitializeComponent();

            this.Size = new System.Drawing.Size(1024, 800);

            spanPanel = new SpanPanel(this.Size.Width - spanPanelOffsetX * 2, this.Size.Height - spanPanelOffsetY1 - spanPanelOffsetY2);
            this.Controls.Add(spanPanel);
            spanPanel.Location = new Point(spanPanelOffsetX, spanPanelOffsetY1);

            this.ResizeEnd          += TimeSpanForm_ResizeEnd;
            this.MaximumSizeChanged += TimeSpanForm_MaximumSizeChanged;
            this.MouseWheel         += TimeSpanForm_MouseWheel;

            this.FormClosed += TimeSpanForm_FormClosed;

            instance = this;

            spanPanel.updateActionBox(MainFrame.instance.curEditAEData);
        }
Ejemplo n.º 3
0
 public void isInside(PointF xy, SpanPanel spanPanel, Graphics g)
 {
 }
Ejemplo n.º 4
0
        internal void draw(SpanPanel spanPanel, Graphics g)
        {
            float width = spanPanel.secondInPixel * index.duration;

            if (index.duration == 0)
            {
                if (index.passed < spanPanel.curBeginSecond)
                {
                    return;
                }

                float    startX = spanPanel.getPixelOfSecond(index.passed);
                float    startY = spanPanel.getSpriteY(index.spanHeight);
                PointF[] points = new PointF[] {
                    new PointF(startX - 4, startY - 6),
                    new PointF(startX + 4, startY - 6),
                    new PointF(startX, startY),
                };
                g.FillPolygon(new SolidBrush(Color.Red), points);
                g.DrawPolygon(new Pen(Color.Black), points);
                g.DrawLine(new Pen(Color.Black), new PointF(startX, startY), new PointF(startX, startY + SpanPanel.spriteHeight / 2));
            }
            else
            {
                if (index.passed + index.duration < spanPanel.curBeginSecond)
                {
                    return;
                }

                float startX = spanPanel.getPixelOfSecond(index.passed > spanPanel.curBeginSecond ? index.passed : spanPanel.curBeginSecond);
                width = width + (spanPanel.getPixelOfSecond(index.passed) - startX);
                if (actions[0].name == "CCDelayTime")
                { // 延迟只画线
                    float    startY = spanPanel.getSpriteY(index.spanHeight) + SpanPanel.spriteHeight / 2;
                    PointF[] points = new PointF[] {
                        new PointF(startX, startY - 2),
                        new PointF(startX + width, startY - 2),
                        new PointF(startX + width, startY + 2),
                        new PointF(startX, startY + 2),
                    };
                    g.FillPolygon(new SolidBrush(Color.BurlyWood), points);
                    g.DrawPolygon(new Pen(Color.Black), points);
                }
                else
                {
                    // 画盒子
                    float    startY = spanPanel.getSpriteY(index.spanHeight);
                    PointF[] points = new PointF[] {
                        new PointF(startX, startY + 2),
                        new PointF(startX + width, startY + 2),
                        new PointF(startX + width, startY + SpanPanel.spriteHeight - 2),
                        new PointF(startX, startY + SpanPanel.spriteHeight - 2),
                    };
                    g.FillPolygon(new SolidBrush(Color.White), points);
                    g.DrawPolygon(new Pen(Color.Black), points);

                    // 画文字
                    StringFormat format = new StringFormat();
                    format.Alignment   = StringAlignment.Far;
                    format.FormatFlags = StringFormatFlags.DirectionRightToLeft | StringFormatFlags.NoWrap | StringFormatFlags.DisplayFormatControl;
                    RectangleF layoutRectangle = new RectangleF();
                    layoutRectangle.Location = new PointF(startX, startY + 2 + 4);
                    layoutRectangle.Width    = width;
                    layoutRectangle.Height   = SpanPanel.spriteHeight;
                    g.DrawString(actions[0].note.Substring(actions[0].note.IndexOf("]") + 1) + "\u200E", new Font("宋体", 10), new SolidBrush(Color.Black), layoutRectangle, format);
                }
            }
        }