public void Display() { if (r == null) { return; } // Update text at most every 0.5 seconds if (lastLoadScreen.ElapsedTime() < 0.5) { return; } if (r.Fonts == null) { return; } lastLoadScreen.Reset(); var text = Comments.Random(Game.CosmeticRandom); var textSize = r.Fonts["Bold"].Measure(text); r.BeginFrame(float2.Zero, 1f); WidgetUtils.FillRectWithSprite(StripeRect, Stripe); r.RgbaSpriteRenderer.DrawSprite(Logo, LogoPos); r.Fonts["Bold"].DrawText(text, new float2(Renderer.Resolution.Width - textSize.X - 20, Renderer.Resolution.Height - textSize.Y - 20), Color.White); r.EndFrame(new NullInputHandler()); }
public override void Display() { if (r == null) { return; } // Update text at most every 0.5 seconds if (lastUpdate.Elapsed.TotalSeconds < 0.5) { return; } if (r.Fonts == null) { return; } lastUpdate.Restart(); var text = messages.Random(Game.CosmeticRandom); var textSize = r.Fonts["Bold"].Measure(text); r.BeginFrame(int2.Zero, 1f); WidgetUtils.FillRectWithSprite(stripeRect, stripe); r.RgbaSpriteRenderer.DrawSprite(logo, logoPos); r.Fonts["Bold"].DrawText(text, new float2(r.Resolution.Width - textSize.X - 20, r.Resolution.Height - textSize.Y - 20), Color.White); r.EndFrame(new NullInputHandler()); }
public override void DisplayInner(Renderer r, Sheet s, int density) { if (s != lastSheet || density != lastDensity) { lastSheet = s; lastDensity = density; logo = CreateSprite(s, density, new Rectangle(0, 0, 256, 256)); stripe = CreateSprite(s, density, new Rectangle(258, 0, 253, 256)); } if (r.Resolution != lastResolution) { lastResolution = r.Resolution; stripeRect = new Rectangle(0, lastResolution.Height / 2 - 128, lastResolution.Width, 256); logoPos = new float2(lastResolution.Width / 2 - 128, lastResolution.Height / 2 - 128); } if (stripe != null) { WidgetUtils.FillRectWithSprite(stripeRect, stripe); } if (logo != null) { r.RgbaSpriteRenderer.DrawSprite(logo, logoPos); } if (r.Fonts != null) { var text = messages.Random(Game.CosmeticRandom); var textSize = r.Fonts["Bold"].Measure(text); r.Fonts["Bold"].DrawText(text, new float2(r.Resolution.Width - textSize.X - 20, r.Resolution.Height - textSize.Y - 20), Color.White); } }
public override void Draw() { //Game.Renderer.SetPalette(hardwarePalette); int offsetY = 0; int offsetX = 0; Rectangle temprect = new Rectangle(); foreach (uiCom u in luiComs) { temprect = u.rect; if (u.ResetOffsetX) { offsetX = 0; } if (u.MoveX) { temprect.X += offsetX; } if (u.MoveY) { temprect.Y += offsetY; } u.spr.SpriteType = 3; WidgetUtils.FillRectWithSprite(temprect, u.spr, pr); if (u.MoveY) { offsetY = offsetY + u.rect.Height + u.rect.Y; } if (u.MoveX) { offsetX = offsetX + u.rect.Width + u.rect.X; } } }
public void Display() { var r = Game.Renderer; if (r == null) { return; } r.BeginFrame(int2.Zero, 1f); WidgetUtils.FillRectWithSprite(bounds, sprite); r.EndFrame(new NullInputHandler()); }
public override void DisplayInner(Renderer r, Sheet s, int density) { if (s != lastSheet || density != lastDensity) { lastSheet = s; lastDensity = density; sprite = CreateSprite(s, density, new Rectangle(0, 0, 1024, 480)); } if (r.Resolution != lastResolution) { lastResolution = r.Resolution; bounds = new Rectangle(0, 0, lastResolution.Width, lastResolution.Height); } WidgetUtils.FillRectWithSprite(bounds, sprite); }