66 lines
2.4 KiB
C#
66 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
|
|
namespace MrAG
|
|
{
|
|
public partial class Gui
|
|
{
|
|
public class Frame : Base
|
|
{
|
|
public string Text = "";
|
|
|
|
public SpriteFont Font = MrAG.Draw.Font;
|
|
|
|
public Color TopBarBackColor = Color.DimGray;
|
|
public Color TopBarBorderColor = Color.SlateGray;
|
|
public Color TopBarTextColor = Color.White;
|
|
|
|
public Color ContentBackColor = Color.DimGray;
|
|
public Color ContentBorderColor = Color.SlateGray;
|
|
|
|
public MrAG.Draw.TextAlignmentX AlignmentX = MrAG.Draw.TextAlignmentX.Left;
|
|
public MrAG.Draw.TextAlignmentY AlignmentY = MrAG.Draw.TextAlignmentY.Top;
|
|
|
|
public float Rotation = 0;
|
|
public bool AutoResize = true;
|
|
|
|
public bool HasCloseButton = true;
|
|
public bool CanMove = true;
|
|
public bool CanResize = false;
|
|
|
|
public int Padding = 6;
|
|
|
|
public override void Update()
|
|
{
|
|
base.Update();
|
|
}
|
|
|
|
public override bool Hovering() {
|
|
if (this.Removed) return false;
|
|
|
|
int x = MrAG.Gui.CurMouseState.X;
|
|
int y = MrAG.Gui.CurMouseState.Y;
|
|
return x >= this.X && x <= this.X + this.Width && y >= this.Y - 22 - Padding && y <= this.Y + this.Height;
|
|
}
|
|
|
|
public override void Draw()
|
|
{
|
|
MrAG.Draw.Box(this.X - Padding, this.Y - 22 - Padding, this.Width + Padding * 2, 22, this.TopBarBackColor);
|
|
MrAG.Draw.Box(this.X - Padding, this.Y - Padding, this.Width + Padding * 2, this.Height + Padding * 2, this.ContentBackColor);
|
|
|
|
MrAG.Draw.OutlinedBox(this.X - Padding, this.Y - 22 - Padding, this.Width + Padding * 2, 22, 2, this.TopBarBorderColor);
|
|
MrAG.Draw.OutlinedBox(this.X - Padding, this.Y - Padding, this.Width + Padding * 2, this.Height + Padding * 2, 2, this.ContentBorderColor);
|
|
|
|
MrAG.Draw.SetFont(this.Font);
|
|
MrAG.Draw.Text(this.Text, this.X, this.Y - 22, this.TopBarTextColor, this.AlignmentX, this.AlignmentY, this.Rotation);
|
|
|
|
base.Draw();
|
|
}
|
|
}
|
|
}
|
|
}
|