internal static void Draw(this Sprite sprite, Rage.Graphics graphics) { Texture texture = sprite.Texture; var origRes = Game.Resolution; float aspectRaidou = origRes.Width / (float)origRes.Height; PointF pos = new PointF(sprite.Position.X / (1080 * aspectRaidou), sprite.Position.Y / 1080f); SizeF siz = new SizeF(sprite.Size.Width / (1080 * aspectRaidou), sprite.Size.Height / 1080f); if (texture != null) { graphics.DrawTexture(texture, pos.X * Game.Resolution.Width, pos.Y * Game.Resolution.Height, siz.Width * Game.Resolution.Width, siz.Height * Game.Resolution.Height); } }
public override void Draw(object sender, GraphicsEventArgs args) { if (!WidgetManager.Drawn["Progress"]) { return; } base.Draw(sender, args); Rage.Graphics graphics = args.Graphics; #if DEFAULT if (Context.CurrentTrack != null) { graphics.DrawRectangle(new RectangleF(this.GetMappedPoint("Base"), this.GetMappedSize("Progress")), Color.FromArgb(27, 216, 94)); } #endif }
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); }
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)); }
public override void Draw(object sender, GraphicsEventArgs args) { if (!WidgetManager.Drawn["Update"]) { return; } if (this.LastCheck == 0) { this.LastCheck = Utils.GetCurrentTimestamp() + 120; } if (this.LastCheck < Utils.GetCurrentTimestamp()) { return; } base.Draw(sender, args); Rage.Graphics expr_44 = args.Graphics; expr_44.DrawRectangle(new RectangleF(this.GetMappedPoint("Base"), this.GetMappedSize("Base")), Color.FromArgb(200, 41, 128, 185)); expr_44.DrawText("An update is available! V" + this.GetMappedString("Version"), "Arial", 17f, this.GetMappedPoint("Text"), Color.FromArgb(255, 255, 255)); }
private Notification(string title, string subtitle, double seconds) { EasingStartValue = Game.Resolution.Width - Width; EasingChangeInValue = Width; Title = title; Subtitle = subtitle; DisplaySeconds = seconds; TitleWrapped = AdvancedUI.Util.WrapText(title, Font, TitleFontSize, Width - 10); SubtitleWrapped = AdvancedUI.Util.WrapText(subtitle, Font, SubtitleFontSize, Width - 10); TitleColor = Color.FromArgb(200, 0, 0); SubtitleColor = Color.FromArgb(230, 230, 230); SubtitleYCoordinate = Graphics.MeasureText(TitleWrapped, Font, TitleFontSize).Height; NotificationHeight = SubtitleYCoordinate + Graphics.MeasureText(SubtitleWrapped, Font, SubtitleFontSize).Height + 35; easing = true; easingInverse = false; easingCurrentTime = EaseDuration; location.X = Game.Resolution.Width; }