Esempio n. 1
0
 /// <summary>
 /// Initialize a label with position and text
 /// </summary>
 /// <param name="engine">Engine pointer</param>
 /// <param name="x">X Position</param>
 /// <param name="y">Y Position</param>
 /// <param name="text">Label text</param>
 public Label(FlatUIEngine engine, Int32 x, Int32 y, String text)
     : base(engine)
 {
     this.Text = text;
     this.SetPosition(x, y);
     this.Color = Color.Black;
 }
Esempio n. 2
0
 /// <summary>
 /// Initialize a basic label
 /// </summary>
 /// <param name="engine">Engine pointer</param>
 public Label(FlatUIEngine engine)
     : base(engine)
 {
     this.Text = "";
     this.SetPosition(0, 0);
     this.Color = Color.Black;
 }
Esempio n. 3
0
 /// <summary>
 /// Initialize a new button with his position and size
 /// </summary>
 /// <param name="engine">UI Engine pointer</param>
 /// <param name="x">X</param>
 /// <param name="y">Y</param>
 /// <param name="width">Button width</param>
 /// <param name="height">Button height</param>
 public Button(FlatUIEngine engine, Int32 x, Int32 y, Int32 width, Int32 height)
     : base(engine)
 {
     this.SetPosition(x, y);
     this.SetSize(width, height);
     this.NormalColor = ColorType.Turquoise;
     this.InitializeColors();
 }
Esempio n. 4
0
 /// <summary>
 /// Initialize a container with his size, position and color
 /// </summary>
 /// <param name="engine">Engine Pointer</param>
 /// <param name="x">X Position</param>
 /// <param name="y">Y Position</param>
 /// <param name="width">Container width</param>
 /// <param name="height">Container height</param>
 /// <param name="color">Container color</param>
 public Container(FlatUIEngine engine, Int32 x, Int32 y, Int32 width, Int32 height, Color color)
     : base(engine)
 {
     this.Controls = new List<Control>();
     this.Color = color;
     this.SetPosition(x, y);
     this.SetSize(width, height);
 }
Esempio n. 5
0
 /// <summary>
 /// Initialize a container with his size and position
 /// </summary>
 /// <param name="engine">Engine Pointer</param>
 /// <param name="x">X Position</param>
 /// <param name="y">Y Position</param>
 /// <param name="width">Container width</param>
 /// <param name="height">Container height</param>
 public Container(FlatUIEngine engine, Int32 x, Int32 y, Int32 width, Int32 height)
     : base(engine)
 {
     this.Controls = new List<Control>();
     this.Color = ColorType.GrayPanel;
     this.SetPosition(x, y);
     this.SetSize(width, height);
 }
Esempio n. 6
0
 /// <summary>
 /// Initialize a basic container (x: 0, y: 0, width: 100, height: 50)
 /// </summary>
 /// <param name="engine">Engine Pointer</param>
 public Container(FlatUIEngine engine)
     : base(engine)
 {
     this.Controls = new List<Control>();
     this.Color = ColorType.GrayPanel;
     this.SetPosition(0, 0);
     this.SetSize(100, 50);
 }
Esempio n. 7
0
 /// <summary>
 /// Initialize a control
 /// </summary>
 /// <param name="engine">Engine Pointer</param>
 public Control(FlatUIEngine engine) 
 {
     this.State = ControlState.Normal;
     this.Enabled = true;
     this.Visible = true;
     this.Focus = false;
     this.EnginePointer = engine;
 }
Esempio n. 8
0
        protected override void Initialize()
        {
            this.Engine = new FlatUIEngine(this.Content, this.GraphicsDevice);

            this.Button1 = new Button(this.Engine, 10, 80, 290, 50, "Click me!");
            this.Button1.OnClick += Button1_OnClick;
            this.Button2 = new Button(this.Engine, 10, 10, 250, 50, "Not in container", ColorType.PeterRiver);
            this.Button3 = new Button(this.Engine, 10, 70, 250, 50, "Yeah Flat Button", ColorType.Alizarin);

            this.Label1 = new Label(this.Engine, 25, 10, "Welcome to MonoGame FlatUI");

            this.Container1 = new Container(this.Engine);
            this.Container1.SetPosition(350, 50);
            this.Container1.SetSize(310, 150);
            this.Container1.AddControl(this.Button1);
            this.Container1.AddControl(this.Label1);

            this.Engine.AddControl(this.Container1);
            this.Engine.AddControl(this.Button2);
            this.Engine.AddControl(this.Button3);
            
            base.Initialize();
        }
Esempio n. 9
0
 /// <summary>
 /// Initialize a new button with position, size and text
 /// </summary>
 /// <param name="engine">UI Engine pointer</param>
 /// <param name="x">X</param>
 /// <param name="y">Y</param>
 /// <param name="width">Button width</param>
 /// <param name="height">Button height</param>
 /// <param name="text">Button text</param>
 /// <param name="color">Button color</param>
 public Button(FlatUIEngine engine, Int32 x, Int32 y, Int32 width, Int32 height, String text, Color color)
     : base(engine)
 {
     this.SetPosition(x, y);
     this.SetSize(width, height);
     this.Text = text;
     this.NormalColor = color;
     this.InitializeColors();
 }
Esempio n. 10
0
 /// <summary>
 /// Initialize a new button
 /// </summary>
 /// <param name="engine">UI Engine pointer</param>
 public Button(FlatUIEngine engine)
     : base(engine) 
 {
     this.NormalColor = ColorType.Turquoise;
     this.InitializeColors();
 }