Esempio n. 1
0
 public void draw(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime)
 {
     g.DrawRectangle(new Rect(player, new Vector2(10, 10), true), Color.Green);
     if (lazorTime >= 0 && lazorTime <= 80)
     {
         float   m  = (float)Misc.map(0, 80, 0, minigamePanel.Height, lazorTime);
         Vector2 mp = new Vector2(lazor, m);
         g.DrawLine(mp, new Vector2(lazor, 0), Color.DarkGray, 2);
         g.DrawLine(new Vector2(lazor, minigamePanel.Height), mp, Color.Red, 2);
     }
     for (int i = 0; i < platforms.Count; i++)
     {
         g.DrawRectangle(new Rect(platforms[i], new Vector2(100, 10), true), Color.White);
     }
 }
Esempio n. 2
0
 public void draw(GraphicsWrapper g, Panel minigamePanel, Timer minigameTimer, uint minigameTime)
 {
     for (int y = 0; y < 23; ++y)
     {
         for (int x = 0; x < 10; x++)
         {
             if (grid[y, x] == 1 | droppedtetrominoeLocationGrid[y, x] == 1)
             {
                 g.DrawRectangle(new RectangleF(x * 10, y * 10, 10, 10), Color.White, false, false);
             }
         }
         g.DrawLine(new Point(0, (y + 1) * 10), new Point(10 * 10, (y + 1) * 10), Color.DarkGray, 1, false);
     }
     for (int x = 0; x < 10; x++)
     {
         g.DrawLine(new Point((x + 1) * 10, 0), new Point((x + 1) * 10, 23 * 10), Color.DarkGray, 1, false);
     }
     g.DrawSizedString("Level " + level, 10, new PointF(150, 10), Brushes.White, false);
     g.DrawSizedString("Score " + score, 10, new PointF(150, 30), Brushes.White, false);
     g.DrawSizedString("LinesCleared " + linesCleared, 10, new PointF(150, 50), Brushes.White, false);
 }
Esempio n. 3
0
 private void tutorialPanel_Paint(object sender, PaintEventArgs e)
 {
     using (GraphicsWrapper g = new GraphicsWrapper(e.Graphics, Color.Red, new Rectangle(Point.Empty, tutorialPanel.Size), true))
     {
         for (int i = 0; i < 40; i++)
         {
             for (int j = 0; j < 40; j++)
             {
                 g.DrawLine(new PointF(tutorialPanel.Width / 2, tutorialPanel.Height / 2), new PointF(i * 10 + 5, j * 10 + 5), Color.DarkGray, 1, false);
             }
         }
         g.DrawSizedString("This is " + ((timertime < 17) ? "bad" : (timertime <= 33) ? "neutral" : "you"), 10, new PointF(tutorialPanel.Width / 2, tutorialPanel.Height / 2), new SolidBrush((timertime < 17) ? Color.Red : (timertime <= 33) ? Color.White : Color.Green), true, true);
     }
 }
Esempio n. 4
0
        public override void Draw(ChartPane managingPane, GraphicsWrapper g, int unitsUnification, RectangleF clippingRectangle, float itemWidth, float itemMargin)
        {
            if (this.Visible == false || Indicator == null)
            {
                return;
            }

            lock (Indicator.Results)
            {
                foreach (string name in Indicator.Results.SetsNamesUnsafe)
                {
                    LinesChartSeries.ChartTypeEnum?chartType = Indicator.Results.GetResultSetChartType(name);
                    if (chartType.HasValue == false)
                    {// No specific value assigned means go for default.
                        chartType = DefaultChartType;
                    }

                    base.DrawItemSet(chartType.Value, g, _outputResultSetsPens[name], _defaultBrush,
                                     unitsUnification, clippingRectangle, itemWidth, itemMargin, name);
                }
            }

            foreach (string name in Indicator.Parameters.DynamicNames)
            {// Render fixed lines.
                if (name.Contains(FixedLinePrefix))
                {
                    object value = Indicator.Parameters.GetDynamic(name);
                    if (value == null)
                    {
                        continue;
                    }

                    float floatValue = Convert.ToSingle(value);
                    int   dashMove   = 0;// ((int)x % DashSize);
                    g.DrawLine(_defaultDashedPen, clippingRectangle.X + dashMove, floatValue, clippingRectangle.X + clippingRectangle.Width, floatValue);
                }
            }
        }