Exemplo n.º 1
0
        public TextInputWidget( Game game, Font font )
            : base(game)
        {
            HorizontalAnchor = Anchor.LeftOrTop;
            VerticalAnchor = Anchor.BottomOrRight;
            typingLogPos = game.Chat.InputLog.Count; // Index of newest entry + 1.
            buffer = new WrappableStringBuffer( 64 * lines );

            DrawTextArgs args = new DrawTextArgs( "_", font, true );
            caretTex = game.Drawer2D.MakeChatTextTexture( ref args, 0, 0 );
            caretTex.Width = (caretTex.Width * 3) / 4;
            defaultCaretWidth = caretTex.Width;

            args = new DrawTextArgs( "> ", font, true );
            Size defSize = game.Drawer2D.MeasureChatSize( ref args );
            defaultWidth = Width = defSize.Width;
            defaultHeight = Height = defSize.Height;

            this.font = font;
            altText = new AltTextInputWidget( game, font, this );
            altText.Init();
        }
        public TextInputWidget(Game game, Font font) : base(game)
        {
            HorizontalAnchor = Anchor.LeftOrTop;
            VerticalAnchor   = Anchor.BottomOrRight;
            typingLogPos     = game.Chat.InputLog.Count;         // Index of newest entry + 1.
            buffer           = new WrappableStringBuffer(64 * lines);

            DrawTextArgs args = new DrawTextArgs("_", font, true);

            caretTex          = game.Drawer2D.MakeChatTextTexture(ref args, 0, 0);
            caretTex.Width    = (caretTex.Width * 3) / 4;
            defaultCaretWidth = caretTex.Width;

            args = new DrawTextArgs("> ", font, true);
            Size defSize = game.Drawer2D.MeasureChatSize(ref args);

            defaultWidth  = Width = defSize.Width;
            defaultHeight = Height = defSize.Height;

            this.font = font;
            altText   = new AltTextInputWidget(game, font, this);
            altText.Init();
        }