public override void Draw(SpriteBatch batch, GameTime gameTime) { Primitives2D.FillRectangle(batch, new Rectangle(this.Position.ToPoint(), this.Size.ToPoint()), Color.FromNonPremultiplied(230, 230, 230, 255)); Primitives2D.FillRectangle(batch, new Rectangle(this.Position.ToPoint(), new Point((int)this.Size.X, (int)textBoxHeight)), Color.FromNonPremultiplied(255, 255, 255, 255)); Primitives2D.DrawRectangle(batch, new Rectangle(this.Position.ToPoint(), this.Size.ToPoint()), Color.FromNonPremultiplied(60, 60, 60, 255), 2.0f); Primitives2D.DrawRectangle(batch, new Rectangle(this.Position.ToPoint(), new Point((int)this.Size.X, (int)textBoxHeight)), Color.FromNonPremultiplied(60, 60, 60, 255), 2.0f); if (selected) { Primitives2D.FillRectangle(batch, new Rectangle(new Point((int)(this.Position.X), (int)(this.Position.Y + textBoxHeight)), new Point((int)this.Size.X, 2)), Color.FromNonPremultiplied(255, 173, 123, 255)); } DrawTextbox(batch); DrawSelectedEmployeeData(batch); confirmButton.Draw(batch, gameTime); }
public override void Draw(SpriteBatch batch, GameTime gameTime) { if (!Visible) { return; } var rec = TruckerX.TargetRetangle; this.Position = new Vector2(rec.X, rec.Y); this.Size = new Vector2(rec.Width, rec.Height); popupSize = new Vector2(533, 300) * ContentLoader.GetRDMultiplier(); int x = (int)(this.Position.X + (this.Size.X / 2) - (popupSize.X / 2)); int y = (int)(this.Position.Y + (this.Size.Y / 2) - (popupSize.Y / 2)); int w = (int)popupSize.X; int h = (int)popupSize.Y; float pad = (20 * ContentLoader.GetRDMultiplier()); batch.Draw(bg, new Rectangle(x, y, w, h), Color.White); float textY = y + pad; foreach (var text in textLines) { var font = ContentLoader.GetRDFont("main_font_21"); var size = font.MeasureString(text); float angle = (float)Math.PI * 0.0f / 180.0f; float offsetx = x + pad; float offsety = textY; batch.DrawString(font, text, new Vector2(offsetx, offsety), Color.White, angle, new Vector2(0, 0), 1.0f, SpriteEffects.None, 1.0f); textY += size.Y; } buttonAccept.Position = new Vector2(x + (3 * ContentLoader.GetRDMultiplier()), y + h - ((buttonAccept.Size.Y + (pad / 1.5f)) * 2)); buttonAccept.Draw(batch, gameTime); buttonCancel.Position = new Vector2(x + (3 * ContentLoader.GetRDMultiplier()), y + h - buttonAccept.Size.Y - pad); buttonCancel.Draw(batch, gameTime); }