示例#1
0
        public UIDropDownList(Vector2f size, Color backgroundColor, Font font, uint fontSize,
                              Color fontColor)
        {
            m_SelectedBox = new RectangleShape(size)
            {
                FillColor = backgroundColor
            };
            m_ExtendedBox = new RectangleShape
            {
                FillColor = backgroundColor
            };

            m_SelectedCaption = new UICaption("", font, fontSize, fontColor);
            m_ExtendedCaption = new UICaption("", font, fontSize, fontColor);
        }
示例#2
0
        public UITextField(Window window, Vector2f size, Color backgroundColor, Font font, uint fontSize,
                           Color fontColor)
        {
            m_Box = new RectangleShape(size)
            {
                FillColor = backgroundColor
            };
            m_CaptionRenderTexture = new RenderTexture((uint)size.X, (uint)size.Y);
            m_CaptionSprite        = new Sprite();

            m_Caption = new UICaption("", font, fontSize, fontColor);

            //TODO: Remove the need to pass a window object around
            //Ideally a user would pass the desired text/keyPress events to the UI
            window.TextEntered += HandleTextEntered;
            window.KeyPressed  += HandleKeyPressed;
        }
示例#3
0
 protected UICaptionedButton(Texture texture, IntRect normalRect, UICaption caption)
     : base(texture, normalRect)
 {
     Caption = caption;
     Caption.CenterOn(this);
 }