コード例 #1
0
ファイル: ConsoleRenderer.cs プロジェクト: jpgdev/JPEngine
        internal ConsoleRenderer(ConsoleInputProcessor consoleInputProcessor, ConsoleOptions options)
        {
            _consoleInputProcessor = consoleInputProcessor;
            _options = options;

            _pixel = new Texture2D(Engine.Window.GraphicsDevice, 1, 1);
            _pixel.SetData(new[] { Color.White });

            _position = new Vector2(_options.Margin, 0);

            _oneCharacterWidth = _options.Font.MeasureString("X").X;
            _maxCharactersPerLine = (int)((Bounds.Width - _options.Padding * 2) / _oneCharacterWidth);
        }
コード例 #2
0
ファイル: ScriptConsole.cs プロジェクト: jpgdev/JPEngine
        public ScriptConsole(ConsoleOptions options)
        {
            if (options == null)
                throw new ArgumentNullException("options");

            Options = options;

            _consoleInputProcessor = new ConsoleInputProcessor(options);
            _consoleInputProcessor.Open += (sender, args) =>
            {
                if (Open != null)
                    Open(this, args);
            };
            _consoleInputProcessor.Close += (sender, args) =>
            {
                if (Close != null)
                    Close(this, args);
            };

            _consoleRenderer = new ConsoleRenderer(_consoleInputProcessor, options);
        }