コード例 #1
0
 /// <summary>
 /// Adds a new drawing callback to the log window widget drawer.
 /// </summary>
 /// <param name="drawerDelegate">The delegate called each OnGUI to draw the widget.</param>
 /// <param name="align">The side of the WidgetRow this widget should be drawn into.</param>
 public static void AddLogWindowWidget(WidgetDrawer drawerDelegate, WidgetAlignMode align = WidgetAlignMode.Left)
 {
     if (drawerDelegate == null)
     {
         throw new NullReferenceException("Drawer delegate required");
     }
     widgets.Add(new LogWindowWidget(drawerDelegate, align));
 }
コード例 #2
0
        public EquestriEngine(string title)
        {
            EngineGlobals.GameReference = this;
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;

            graphics.PreparingDeviceSettings += OnPreparingDeviceSettings;

#if RUN_FAST
            graphics.SynchronizeWithVerticalRetrace = false;
            this.IsFixedTimeStep = false;
#endif
            _settings = GameSettings.LoadData();
            _settings.InitGraphicsDevice(graphics, GraphicsDevice);

            _assetManager  = new AssetManager(this);
            _dataManager   = new DataManager(this);
            _inputManager  = new InputManager(this);
            _stateManager  = new StateManager(this);
            _widgetDisplay = new WidgetDrawer(this);

            this.Components.Add(_assetManager);
            this.Components.Add(_dataManager);
            this.Components.Add(_inputManager);
            this.Components.Add(_stateManager);
            this.Components.Add(_widgetDisplay);
#if PROFILER
            profiler = new Indiefreaks.Xna.Profiler.ProfilerGameComponent(this, @"Fonts\celestia_redux");
            Indiefreaks.AOP.Profiler.ProfilingManager.Run = true;
            this.Components.Add(profiler);
#endif
#if DEBUG
            _debugConsole = new ConsoleWindow(this);
            this.Components.Add(_debugConsole);
#endif
            Content.RootDirectory = "Content";



            //this.Window.Title = string.Format("{0} - ver {1}",title,VERSION_NUMBER);
        }
コード例 #3
0
 public LogWindowWidget(WidgetDrawer drawer, WidgetAlignMode alignment)
 {
     Drawer    = drawer;
     Alignment = alignment;
 }