コード例 #1
0
 public override void Draw(object sender, GraphicsEventArgs args)
 {
     if (!WidgetManager.Drawn["Track"])
     {
         return;
     }
     base.Draw(sender, args);
     Rage.Graphics expr_20 = args.Graphics;
     expr_20.DrawRectangle(new RectangleF(this.GetMappedPoint("Base"), this.GetMappedSize("Base")), Color.FromArgb(200, 40, 40, 40));
     expr_20.DrawText(this.Name, "Arial", 17f, this.GetMappedPoint("Name"), Color.FromArgb(255, 255, 255));
     expr_20.DrawText(this.Artist, "Arial", 12f, this.GetMappedPoint("Artist"), Color.FromArgb(255, 255, 255));
 }
コード例 #2
0
        public void OnDraw(Graphics g)
        {
            if (Image != null)
            {
                float marginTotalWidth = (2 * 2.5f);
                g.DrawRectangle(new RectangleF(location.X - marginTotalWidth, location.Y, ImageWidth + marginTotalWidth, NotificationHeight), Color.FromArgb(190, 3, 3, 3));
                g.DrawTexture(Image, new RectangleF(location.X + 2.5f - marginTotalWidth, location.Y + ImageY, ImageWidth, ImageWidth));
            }

            float x_ = location.X + (Image != null ? ImageWidth : 0.0f);

            g.DrawRectangle(new RectangleF(x_, location.Y, Width + 5.0f, NotificationHeight), Color.FromArgb(190, 3, 3, 3));
            g.DrawText(TitleWrapped, Font, TitleFontSize, new PointF(x_ + 5, location.Y + 2.0f), TitleColor);
            g.DrawText(SubtitleWrapped, Font, SubtitleFontSize, new PointF(x_ + 5, location.Y + SubtitleYCoordinate + 20.0f), SubtitleColor);
        }
コード例 #3
0
ファイル: MenuItem.cs プロジェクト: pnwparksfan/EmergencyV
        public void OnDraw(Graphics g, float x, int position) // position == 0 -> middle of screen, selected item  ;;  position < 0 -> above middle  ;;  position > 0 -> below middle
        {
            float middleY = Game.Resolution.Height / 2 - ItemHeight / 2;
            float offsetY = (ItemHeight + 3.0f) * position;

            float y = middleY + offsetY;

            if (y < -ItemHeight || y > Game.Resolution.Height) // if item isn't on screen don't draw it
            {
                return;
            }

            RectangleF rect = new RectangleF(x, y, ItemWidth, ItemHeight);

            g.DrawRectangle(rect, position == 0 ? Color.FromArgb(200, 200, 200) : Color.FromArgb(100, 5, 5, 5));

            string text = DisplayText;

            SizeF textSize = Graphics.MeasureText(text, ItenFontName, ItemFontSize);

            float textX = rect.X + rect.Width * 0.5f - textSize.Width * 0.5f;
            float textY = rect.Y + rect.Height * 0.5f - textSize.Height * 0.8f;

            g.DrawText(text, ItenFontName, ItemFontSize, new PointF(textX, textY), position == 0 ? Color.FromArgb(0, 0, 0) : Color.FromArgb(100, 240, 240, 240), rect);
        }
コード例 #4
0
        public override void Draw(object sender, GraphicsEventArgs args)
        {
            if (!WidgetManager.Drawn["Update"])
            {
                return;
            }

            if (LastCheck == 0)
            {
                LastCheck = Utils.GetCurrentTimestamp() + 2 * 60;
            }

            if (LastCheck < Utils.GetCurrentTimestamp())
            {
                return;
            }

            base.Draw(sender, args);

            Rage.Graphics Device = args.Graphics;

            Device.DrawRectangle(new RectangleF(GetMappedPoint("Base"), GetMappedSize("Base")), Color.FromArgb(200, 41, 128, 185));

            Device.DrawText("An update is available! V" + GetMappedString("Version"), "Arial", 17.0F, GetMappedPoint("Text"), Color.FromArgb(255, 255, 255));
        }
コード例 #5
0
        public override void Draw(object sender, GraphicsEventArgs args)
        {
            if (!WidgetManager.Drawn["Track"])
            {
                return;
            }

            base.Draw(sender, args);

            Rage.Graphics Device = args.Graphics;

            Device.DrawRectangle(new RectangleF(GetMappedPoint("Base"), GetMappedSize("Base")), Color.FromArgb(200, 40, 40, 40));

            Device.DrawText(Name, "Arial", 17.0F, GetMappedPoint("Name"), Color.FromArgb(255, 255, 255));
            Device.DrawText(Artist, "Arial", 12.0F, GetMappedPoint("Artist"), Color.FromArgb(255, 255, 255));
        }