public override void Project(GameTime gameTime, int x, int y, IRender render) { render.Begin(); render.DrawBody(new Rectangle(x, y, Width, Height), Color.White, TopBorder, TopRightCorner, RightBorder, BottomRightCorner, BottomBorder, BottomLeftCorner, LeftBorder, TopLeftCorner, Inside); string textToDraw = Text; if (HasFocus) { textToDraw = Text.Insert(CursorPosition, "|"); } Font.DrawString(textToDraw, new Point(x + LeftBorder.Width + textMargin, y + base.Height / 2 - Font.CharHeight / 2), FontColor, render); render.End(); }
public override void Project(GameTime gameTime, int x, int y, IRender render) { render.Begin(); render.DrawBody(new Rectangle(x, y, Width, Height), Color.White, topInUse, topRightInUse, rightInUse, bottomRightInUse, bottomInUse, bottomLeftInUse, leftInUse, topLeftInUse, insideInUse); Font.DrawString(Title, new Point(x + (Width / 2), y + (Height / 2)), new Vector2(0.5F, 0.5F), Color.White, render); render.End(); }
public override void Project(GameTime gameTime, int x, int y, IRender render) { render.Begin(); render.DrawBody(new Rectangle(x, y, Width, Height), Color.White, topInUse, topRightCornerInUse, RightBorder, BottomRightCorner, BottomBorder, BottomLeftCorner, LeftBorder, topLeftCornerInUse, Inside); if (Header) { Font.DrawString(titleToPrint, new Point(x + topLeftCornerInUse.Width, y + topLeftCornerInUse.Height / 2), new Vector2(0F, 0.5F), FontColor, render); DrawButtons(render, x, y); } render.End(); }
public override void Project(GameTime gameTime, int x, int y, IRender render) { render.Begin(); render.DrawBody(new Rectangle(x, y, TextFieldWidth, TextFieldHeight), Color.White, TopBorder, TopRightCorner, RightBorder, BottomRightCorner, BottomBorder, BottomLeftCorner, LeftBorder, TopLeftCorner, Inside); Font.DrawString(CurrentLine, new Point(x + LeftBorder.Width + textMargin, y + TextFieldHeight / 2 - Font.CharHeight / 2), FontColor, render); render.End(); if (Open) { Parent.AddDrawDelegate(DrawOpen); } }