当前位置: 首页>>代码示例>>C#>>正文


C# Manager.Initialize方法代码示例

本文整理汇总了C#中TomShane.Neoforce.Controls.Manager.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# Manager.Initialize方法的具体用法?C# Manager.Initialize怎么用?C# Manager.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TomShane.Neoforce.Controls.Manager的用法示例。


在下文中一共展示了Manager.Initialize方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadContent

        public override void LoadContent(ContentManager contentloader)
        {
            _guiman = new Manager(_gamemanager.Game, _gamemanager.Graphics, "Default");
            _guiman.Initialize();

            _settingsmenu = new Window(_guiman);
            _settingsmenu.Init();
            _settingsmenu.Resizable = false;
            _settingsmenu.Movable = false;
            _settingsmenu.CloseButtonVisible = false;
            _settingsmenu.Text = "Settings Menu";
            _settingsmenu.Width = 300;
            _settingsmenu.Height = 400;
            _settingsmenu.Center();
            _settingsmenu.Visible = true;
            _settingsmenu.BorderVisible = true;
            _settingsmenu.Cursor = _guiman.Skin.Cursors["Default"].Resource;

            _back = new Button(_guiman);
            _back.Init();
            _back.Text = "Go Back";
            _back.Width = 200;
            _back.Height = 50;
            _back.Left = 50;
            _back.Top = 300;
            _back.Anchor = Anchors.Bottom;
            _back.Parent = _settingsmenu;

            _playername = new TextBox(_guiman);
            _playername.Init();
            _playername.Text = _gamemanager.Pbag.Player.Name;
            _playername.Width = 200;
            _playername.Height = 50;
            _playername.Left = 50;
            _playername.Top = 0;
            _playername.Anchor = Anchors.Bottom;
            _playername.Parent = _settingsmenu;

            _volume = new ScrollBar(_guiman, Orientation.Horizontal);
            _volume.Init();
            //Todo check why volume.value is reseting it to 50 :S
            _volume.Value = _gamemanager.Audiomanager.GetVolume();
            _volume.Range = 100;
            _volume.PageSize = 10;
            _volume.StepSize = 1;
            _volume.Width = 200;
            _volume.Height = 50;
            _volume.Left = 50;
            _volume.Top = 50;
            _volume.Anchor = Anchors.Bottom;
            _volume.Parent = _settingsmenu;

            _guiman.Add(_settingsmenu);

            _gamemanager.Game.IsMouseVisible = true;
        }
开发者ID:dkfdevil,项目名称:Mine-World,代码行数:56,代码来源:SettingsState.cs

示例2: LoadContent

        public override void LoadContent(ContentManager contentloader)
        {
            _guiman = new Manager(_gamemanager.Game, _gamemanager.Graphics, "Default");
            _guiman.Initialize();

            _mainmenu = new Window(_guiman);
            _mainmenu.Init();
            _mainmenu.Resizable = false;
            _mainmenu.Movable = false;
            _mainmenu.CloseButtonVisible = false;
            _mainmenu.Text = "Main Menu";
            _mainmenu.Width = 300;
            _mainmenu.Height = 400;
            _mainmenu.Center();
            _mainmenu.Visible = true;
            _mainmenu.BorderVisible = true;
            //mainmenu.Cursor = guiman.Skin.Cursors["Default"].Resource;

            _play = new Button(_guiman);
            _play.Init();
            _play.Text = "Play";
            _play.Width = 200;
            _play.Height = 50;
            _play.Left = 50;
            _play.Top = 0;
            _play.Anchor = Anchors.Bottom;
            _play.Parent = _mainmenu;

            _settings = new Button(_guiman);
            _settings.Init();
            _settings.Text = "Settings";
            _settings.Width = 200;
            _settings.Height = 50;
            _settings.Left = 50;
            _settings.Top = 50;
            _settings.Anchor = Anchors.Bottom;
            _settings.Parent = _mainmenu;

            _exit = new Button(_guiman);
            _exit.Init();
            _exit.Text = "Exit";
            _exit.Width = 200;
            _exit.Height = 50;
            _exit.Left = 50;
            _exit.Top = 100;
            _exit.Anchor = Anchors.Bottom;
            _exit.Parent = _mainmenu;

            _guiman.Cursor = _guiman.Skin.Cursors["Default"].Resource;
            _guiman.Add(_mainmenu);

            _gamemanager.Game.IsMouseVisible = true;
        }
开发者ID:dkfdevil,项目名称:Mine-World,代码行数:53,代码来源:MainMenuState.cs

示例3: FileBrowserScreen

        private Window window; // Main window

        #endregion Fields

        #region Constructors

        public FileBrowserScreen(Game game)
        {
            this.game = game;
            graphics = GameServices.GetService<GraphicsDeviceManager>();
            // Setting up the shared skins directory

            manager = new Manager(game, graphics, "Green");

            manager.SkinDirectory = @"..\..\Skins\";
            manager.Initialize();

            gpList = new List<GroupPanel>();
            Initialize();
        }
开发者ID:SundeepK,项目名称:Geom,代码行数:20,代码来源:FileBrowserScreen.cs

示例4: Initialize

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // Create an instance of manager using Default skin. We set the fourth parameter to false,
            // so the instance of manager is not registered as an XNA game component and methods
            // like Initialize(), Update() and Draw() are called manually in the game loop.
            manager = new Manager(this, graphics, "Default");

            // Setting up the shared skins directory
            manager.SkinDirectory = "Content/Skins/";
            manager.RenderTarget = new RenderTarget2D(GraphicsDevice, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight, false, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);
            manager.TargetFrames = 120;
            manager.Initialize();
            #if(!DEBUG)
            manager.LogUnhandledExceptions = false;
            #endif
            world = new EntityWorld();

            if (useMaxRes && GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height > 960)
            {
                graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
                graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height-22;
                canvasRender = new RenderTarget2D(GraphicsDevice,
                    GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width,
                    GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height - 22);
            }
            else
            {
                graphics.PreferredBackBufferWidth = 1280;
                graphics.PreferredBackBufferHeight = 720;
                canvasRender = new RenderTarget2D(GraphicsDevice, 1280, 720);
            }
            IsMouseVisible = true;

            graphics.SynchronizeWithVerticalRetrace = true;
            graphics.ApplyChanges();

            Window.AllowUserResizing = false; //DONT CHANGE!
            Window.ClientSizeChanged += new EventHandler<System.EventArgs>(Window_ClientSizeChanged);

            System.Windows.Forms.Form xnaWindow = System.Windows.Forms.Form.FromHandle(Window.Handle) as System.Windows.Forms.Form;
            if (xnaWindow != null)
            {
                xnaWindow.FormClosing += f_FormClosing;
                xnaWindow.Text = "The Little Cheese Boy Editor - Beta";

                if (useMaxRes && GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height > 960)
                {
                    xnaWindow.WindowState = System.Windows.Forms.FormWindowState.Maximized;
                }
            }

            base.Initialize();

            Debug.Print("Finished Initializing");
        }
开发者ID:Hoodad,项目名称:Editor_TLCB,代码行数:61,代码来源:Editor.cs

示例5: WindowsDesigner

        /// <summary>
        /// Код дизайнера всех базовых окон
        /// </summary>
        private void WindowsDesigner()
        {
            Manager = new Manager(this, graphics, "Default");
            Manager.Initialize();

            #region mainmenu

            mainmenu = new Window(Manager) {BackColor = Color.Black};
            mainmenu.Init();
            mainmenu.Text = "";
            mainmenu.SetPosition(resx/3, resy/4);
            mainmenu.Width = resx/3;
            mainmenu.Height = resy/2;
            mainmenu.Visible = true;
            mainmenu.BorderVisible = false;
            mainmenu.Movable = false;
            mainmenu.Resizable = false;

            mainmenucloseB = new Button(Manager);
            mainmenucloseB.Init();
            mainmenucloseB.Text = "Quit";
            mainmenucloseB.Width = resx/5;
            mainmenucloseB.Height = 25;
            mainmenucloseB.Left = (resx/3 - resx/5)/2;
            mainmenucloseB.Top = mainmenu.ClientHeight - mainmenucloseB.Height - 8;
            mainmenucloseB.Anchor = Anchors.Bottom;
            mainmenucloseB.Parent = mainmenu;
            mainmenucloseB.Click += button_Click;

            mainmenugeneratenewB = new Button(Manager);
            mainmenugeneratenewB.Init();
            mainmenugeneratenewB.Text = "Создать новый мир и начать игру";
            mainmenugeneratenewB.Width = resx/5;
            mainmenugeneratenewB.Height = 25;
            mainmenugeneratenewB.Left = (resx/3 - resx/5)/2;
            mainmenugeneratenewB.Top = 50;
            mainmenugeneratenewB.Anchor = Anchors.Bottom;
            mainmenugeneratenewB.Parent = mainmenu;
            mainmenugeneratenewB.Click += mainmenugeneratenewB_Click;

            mainmenuloadmapB = new Button(Manager) {Text = "Начать игру в созданном мире", Width = resx/5};
            mainmenuloadmapB.Init();
            mainmenuloadmapB.Height = 25;
            mainmenuloadmapB.Left = (resx/3 - resx/5)/2;
            mainmenuloadmapB.Top = 100;
            mainmenuloadmapB.Anchor = Anchors.Bottom;
            mainmenuloadmapB.Parent = mainmenu;
            mainmenuloadmapB.Click += mainmenuloadmapB_Click;

            mainmenuloadgameB = new Button(Manager);
            mainmenuloadgameB.Init();
            mainmenuloadgameB.Text = "Загрузить игру";
            mainmenuloadgameB.Width = resx/5;
            mainmenuloadgameB.Height = 25;
            mainmenuloadgameB.Left = (resx/3 - resx/5)/2;
            mainmenuloadgameB.Top = 150;
            mainmenuloadgameB.Anchor = Anchors.Bottom;
            mainmenuloadgameB.Parent = mainmenu;
            mainmenuloadgameB.Click += mainmenuloadgameB_Click;

            mainmenuoptionsB = new Button(Manager);
            mainmenuoptionsB.Init();
            mainmenuoptionsB.Text = "Опции";
            mainmenuoptionsB.Width = resx/5;
            mainmenuoptionsB.Height = 25;
            mainmenuoptionsB.Left = (resx/3 - resx/5)/2;
            mainmenuoptionsB.Top = 200;
            mainmenuoptionsB.Anchor = Anchors.Bottom;
            mainmenuoptionsB.Parent = mainmenu;
            mainmenuoptionsB.Click += mainmenuoptionsB_Click;

            Manager.Add(mainmenu);

            #endregion

            #region generateoptionsmenu

            generateoptionsmenu = new Window(Manager) {BackColor = Color.Black};
            generateoptionsmenu.Init();
            generateoptionsmenu.Text = "";
            generateoptionsmenu.SetPosition(resx/3, resy/4);
            generateoptionsmenu.Width = resx/3;
            generateoptionsmenu.Height = resy/2;
            generateoptionsmenu.Visible = false;
            generateoptionsmenu.BorderVisible = false;
            generateoptionsmenu.Movable = false;
            generateoptionsmenu.Resizable = false;

            generateoptionnextB = new Button(Manager);
            generateoptionnextB.Init();
            generateoptionnextB.Text = "Продолжить";
            generateoptionnextB.Width = resx/5;
            generateoptionnextB.Height = 25;
            generateoptionnextB.Left = (resx/3 - resx/5)/2;
            generateoptionnextB.Top = 50;
            generateoptionnextB.Anchor = Anchors.Bottom;
            generateoptionnextB.Parent = generateoptionsmenu;
//.........这里部分代码省略.........
开发者ID:ishellstrike,项目名称:Mork,代码行数:101,代码来源:Main.cs

示例6: Initialize

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            Manager = new Manager(this, graphics, "Default");
            Manager.AutoCreateRenderTarget = true;
            Manager.Initialize();

            ModelDrawer = new BruteModelDrawer(this);
            ConstraintDrawer = new LineDrawer(this);
            LightDrawer = new LightDrawer(this);
            space = new Space();
            space.ForceUpdater.Gravity = new Vector3(0.0f, -10.0f, 0.0f);
            Actors = new ActorContainer(space, ModelDrawer, ConstraintDrawer, LightDrawer);

            base.Initialize();
        }
开发者ID:slicedpan,项目名称:demo,代码行数:22,代码来源:Game1.cs

示例7: InitializeControls

        private void InitializeControls()
        {
            manager = new Manager(CurrGame, CurrGame.Graphics, "Green") { SkinDirectory = CurrGame.ApplicationDirectory + @"\Content\GUI\Skin\" };
            try
            {
                manager.Initialize();
            }
            catch (Exception)
            {
                throw;
            }

            manager.AutoCreateRenderTarget = true;

            Console = new Console(manager);
            Console.Init();
            LoadConsoleCommands();
            manager.Add(Console);
            Console.ChannelsVisible = false;
            Console.MessageSent += Console_MessageSent;
            Console.MessageFormat = ConsoleMessageFormats.None;
            Console.Width = manager.ScreenWidth;
            Console.Channels.Add(new ConsoleChannel(0, "[System]", Color.Orange));
            Console.Channels.Add(new ConsoleChannel(1, "[User]", Color.White));
            Console.Channels.Add(new ConsoleChannel(2, "[Error]", Color.DarkRed));
            Console.SelectedChannel = 1;
            Console.Hide();

            tabControl = new TabControl(manager);
            tabControl.Init();
            tabControl.Left = CurrGame.CreepFieldWidth;
            tabControl.Top = 0;
            tabControl.Width = CurrGame.Width - CurrGame.CreepFieldWidth;
            tabControl.Height = CurrGame.Height;

            #region Gameplaypage

            GameplayPage = tabControl.AddPage();
            GameplayPage.Init();
            GameplayPage.Text = "Spiel";

            #region Turmauswahl

            var thumbnailBox = new GroupBox(manager);
            thumbnailBox.Init();
            thumbnailBox.Parent = GameplayPage;
            thumbnailBox.Left = 2;
            thumbnailBox.Top = 2;
            thumbnailBox.Width = thumbnailBox.Parent.Width - 4;
            thumbnailBox.Height = 100;

            int counter = 0;
            foreach (TowerClass towerClass in GamePlayScreen.TowerManager.TowerClassList)
            {
                var towerButton = new ImageButton(manager)
                                      {
                                          Image = GamePlayScreen.TowerManager.GetThumbnail(towerClass.TowerKey),
                                          SizeMode = SizeMode.Stretched,
                                          Top = 14,
                                          Tag = towerClass
                                      };
                towerButton.Width = towerButton.Height = 60;
                towerButton.Left = 6 + counter * (towerButton.Width + 5);
                towerButton.Click += towerButton_Click;
                towerButton.MouseOver += towerButton_MouseOver;
                towerButton.MouseOut += towerButton_MouseOut;
                towerButton.Init();
                thumbnailBox.Add(towerButton);
                BuyTowerButtons.Add(towerButton);
                counter++;
            }

            thumbnailBox.AutoScroll = true;

            var scrollBar = new ScrollBar(manager, Orientation.Horizontal);
            scrollBar.Init();
            thumbnailBox.Add(scrollBar);
            scrollBar.Visible = false;

            #endregion

            #region Informationen

            var infoBox = new GroupBox(manager);
            infoBox.Init();
            infoBox.Parent = GameplayPage;
            infoBox.Text = "Informationen";
            infoBox.Width = infoBox.Parent.Width - 4;
            infoBox.Height = 110;
            infoBox.Left = 2;
            infoBox.Top = thumbnailBox.Top + thumbnailBox.Height + 2;

            CreepNumber = new Label(manager);
            CreepNumber.Init();
            CreepNumber.Parent = infoBox;
            CreepNumber.Top = 14;
            CreepNumber.Left = 4;
            CreepNumber.Width = CreepNumber.Parent.Width - 4;
            CreepNumber.ToolTip = new ToolTip(manager) { Text = "So viele Creeps sind momentan\nauf dem Spielfeld" };
            CreepNumber.Passive = false;
//.........这里部分代码省略.........
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:101,代码来源:GuiManager.cs

示例8: LoadContent

        public override void LoadContent(ContentManager contentloader)
        {
            _guiman = new Manager(_gamemanager.Game, _gamemanager.Graphics, "Default");
            _guiman.Initialize();

            _serverbrowsingmenu = new Window(_guiman);
            _serverbrowsingmenu.Init();
            _serverbrowsingmenu.Resizable = false;
            _serverbrowsingmenu.Movable = false;
            _serverbrowsingmenu.CloseButtonVisible = false;
            _serverbrowsingmenu.Text = "Server Browser";
            _serverbrowsingmenu.Width = 300;
            _serverbrowsingmenu.Height = 400;
            _serverbrowsingmenu.Center();
            _serverbrowsingmenu.Visible = true;
            _serverbrowsingmenu.BorderVisible = true;

            _serversbox = new ListBox(_guiman);
            _serversbox.Init();
            //servers.SetPosition(50, 50);
            _serversbox.Left = 50;
            _serversbox.Top = 150;
            _serversbox.Width = 200;
            _serversbox.Height = 200;
            _serversbox.Anchor = Anchors.Bottom;
            _serversbox.Parent = _serverbrowsingmenu;

            _join = new Button(_guiman);
            _join.Init();
            _join.Text = "Join";
            _join.Width = 200;
            _join.Height = 50;
            _join.Left = 50;
            _join.Top = 0;
            _join.Anchor = Anchors.Bottom;
            _join.Parent = _serverbrowsingmenu;

            _refresh = new Button(_guiman);
            _refresh.Init();
            _refresh.Text = "Refresh";
            _refresh.Width = 200;
            _refresh.Height = 50;
            _refresh.Left = 50;
            _refresh.Top = 50;
            _refresh.Anchor = Anchors.Bottom;
            _refresh.Parent = _serverbrowsingmenu;

            _back = new Button(_guiman);
            _back.Init();
            _back.Text = "Back";
            _back.Width = 200;
            _back.Height = 50;
            _back.Left = 50;
            _back.Top = 100;
            _back.Anchor = Anchors.Bottom;
            _back.Parent = _serverbrowsingmenu;

            _guiman.Cursor = _guiman.Skin.Cursors["Default"].Resource;
            _guiman.Add(_serverbrowsingmenu);

            _gamemanager.Game.IsMouseVisible = true;
        }
开发者ID:dkfdevil,项目名称:Mine-World,代码行数:62,代码来源:ServerBrowsingState.cs


注:本文中的TomShane.Neoforce.Controls.Manager.Initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。