Пример #1
0
 public void submitPress(string input)
 {
     Debug.Log("input:" + input);
     CmdInputText.text  = "";
     CmdOutputText.text = "> " + TextInputHandler.GetResponse(input);
     thisText.text      = "";
 }
Пример #2
0
    public void TypeClick()
    {
        string input = CmdInputText.text;

        CmdOutputText.text = "> " + TextInputHandler.GetResponse(input);
        CmdInputText.text  = "";
    }
 private void KeyPressed(KeyCode keyCode)
 {
     if (isInteracting)
     {
         if (Input.anyKeyDown)
         {
             GetComponent <Text>().text = TextInputHandler.EditString(GetComponent <Text>().text, keyCode);
         }
     }
 }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:MB2D.MBGame"/> class and
        /// defines essential graphics settings.
        /// </summary>
        public MBGame(Type initSceneType)
        {
            _graphics    = new GraphicsDeviceManager(this);
            _scenes      = new SceneStack();        // main scene stack
            _gameObjects = new EntityMap();
            _fps         = new FramesPerSecondCounter();
            _textHandler = new TextInputHandler();
            _lastInput   = string.Empty;
            _initScene   = initSceneType;

            ForceQuit             = false;
            Content.RootDirectory = "Content";

            // 720p
            _graphics.PreferredBackBufferWidth  = 1280;
            _graphics.PreferredBackBufferHeight = 720;
            _graphics.ApplyChanges();
        }
Пример #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:MidnightBlue.MBConsole"/> class.
        /// </summary>
        /// <param name="bgColor">Background color for rendering the console</param>
        /// <param name="txtColor">Text color</param>
        public MBConsole(Color bgColor, Color txtColor, SpriteFont font)
        {
            _bgColor     = bgColor;
            _txtColor    = txtColor;
            _font        = font;
            _textHandler = new TextInputHandler();
            _parser      = new MBConsoleParser();

            _animating = false;

            _maxTextWidth = (int)_surface.Width / 2;

            _currentLine = string.Empty;
            _cmdHistory  = new List <string>();
            _ioHistory   = new List <string>();
            _cmdPtr      = 0;
            _funcs       = new Dictionary <string, Action <string[]> >();
            _gameVars    = new Dictionary <string, object>();
        }