예제 #1
0
파일: Button.cs 프로젝트: TodesBrot/Mekanik
        public Button(string _content, Action _onclick)
        {
            this.Interfacial = true;

            this.OnClick = _onclick;

            this.Graphics.Add(this.Text = new Text(FontBase.Consolas)
            {
                Z = 1, Content = _content                                                                    /*, Origin = 0.5*/
            });
            //this.Text.Position = this.Text.Size / 2;
            this.Graphics.Add(this.Background = new RectangleRounded(0, this.Text.Size, 2)
            {
                Color = Color.White * 0.9                                                                                         /*, Position = this.Text.Size / 2, Origin = 0.5*/
            });
        }
예제 #2
0
        public TextBox(string _value)
            : base(_value)
        {
            this.Graphics.Add(this.Background = new RectangleRounded(0, this.Size, 5)
            {
                Z = -1, Color = Color.White * 0.9, Quality = 2
            });
            this.Graphics.Add(this.Selection = new VertexArray(VertexArrayType.Quads)
            {
                Color = Color.Black ^ 85
            });

            this.Graphics.Add(this.Cursor = new VertexArray(VertexArrayType.Lines)
            {
                Vertices = new Bunch <Vertex>(new Vector(0), new Vector(0, this._Text.Font.CharSize)), Color = Color.Black ^ 170
            });
        }