This class creates a graphical text console for running code while executing a game.
Inheritance: Microsoft.Xna.Framework.DrawableGameComponent
Example #1
0
 /// <summary>
 /// Creates a new MpqConsole
 /// </summary>
 public MpqConsole(Game game, SpriteFont font)
     : base(game)
 {
     Console = new XnaConsoleComponent(game, font);
     game.Components.Add(Console);
     Console.Prompt(Prompt, Execute);
 }
Example #2
0
 /// <summary>
 /// Creates a new CssInterpreter
 /// </summary>
 public CssInterpreter(Game game, SpriteFont font) : base((Game)game)
 {            
     multi = "";
     console = new XnaConsoleComponent(game, font);
     game.Components.Add(console);
     console.Prompt(Prompt, Execute);
 }
Example #3
0
 /// <summary>
 /// Creates a new CssInterpreter
 /// </summary>
 public CssInterpreter(GameClient parentGame, SpriteFont font) : base((GameClient)parentGame)
 {            
     multi = "";
     game = parentGame;
     console = new XnaConsoleComponent(game, font);
     game.Components.Add(console);
     Prompt();
 }
        /// <summary>
        /// Creates a new PythonInterpreter
        /// </summary>
        public PythonInterpreter(Game1 game, SpriteFont font) : base((Game)game)
        {
            this.PythonEngine = new PythonEngine();
            this.PythonOutput = new MemoryStream();
            this.PythonEngine.SetStandardOutput(PythonOutput);
            this.ASCIIEncoder = new ASCIIEncoding();

            ClrModule clr = this.PythonEngine.Import("clr") as ClrModule;
            clr.AddReference("Microsoft.Xna.Framework");
            clr.AddReference("Microsoft.Xna.Framework.Game");

            this.PythonEngine.Execute("from Microsoft.Xna.Framework import *");
            this.PythonEngine.Execute("from Microsoft.Xna.Framework.Graphics import *");
            this.PythonEngine.Execute("from Microsoft.Xna.Framework.Content import *");
            multi = "";

            Console = new XnaConsoleComponent(game, font);
            game.Components.Add(Console);
            Console.Prompt(Prompt, Execute);
            AddGlobal("Console", Console);
        }