public TextInputWidget( Game game, Font font, Font boldFont )
            : base(game)
        {
            HorizontalAnchor = Anchor.LeftOrTop;
            VerticalAnchor = Anchor.BottomOrRight;
            typingLogPos = game.Chat.InputLog.Count; // Index of newest entry + 1.

            this.font = font;
            this.boldFont = boldFont;
            chatInputText = new WrappableStringBuffer( len );
        }
Beispiel #2
0
        public TextInputWidget(Game game, Font font, Font boldFont) : base(game)
        {
            HorizontalAnchor = Anchor.LeftOrTop;
            VerticalAnchor   = Anchor.BottomOrRight;
            typingLogPos     = game.Chat.InputLog.Count;         // Index of newest entry + 1.

            chatInputText = new WrappableStringBuffer(len);
            DrawTextArgs args    = new DrawTextArgs("A", boldFont, true);
            Size         defSize = game.Drawer2D.MeasureChatSize(ref args);

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

            args     = new DrawTextArgs("_", boldFont, true);
            caretTex = game.Drawer2D.MakeChatTextTexture(ref args, 0, 0);

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

            chatInputText = new WrappableStringBuffer( len );
            DrawTextArgs args = new DrawTextArgs( "A", boldFont, true );
            Size defSize = game.Drawer2D.MeasureChatSize( ref args );
            defaultWidth = defSize.Width; defaultHeight = defSize.Height;
            Width = defaultWidth; Height = defaultHeight;

            args = new DrawTextArgs( "_", boldFont, true );
            caretTex = game.Drawer2D.MakeChatTextTexture( ref args, 0, 0 );

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