Пример #1
0
        protected override void LoadContent()
        {
            Content.RootDirectory = "Content";
            ContentStore.load(Content);
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Point screenSize = new Point(GraphicsDevice.DisplayMode.Width, GraphicsDevice.DisplayMode.Height);

            ScaleManager.setDefaultValues(screenSize, ContentStore.getAllFonts());
            DebugGUI.init(GraphicsDevice);
            QRRenderer.init(GraphicsDevice);
            Arranger.init(screenSize);

            Card.setTexture(ContentStore.cardAtlas);
            Card.setDefaultScale(ScaleManager.CardScale);

            game = GameClient.Instance;

            menuController = new MenuController();
            mainMenu       = new PageMainMenu(this);
            joinMenu       = new PageJoinGame(this);
            hostMenu       = new PageHostGame(this);
            settingsMenu   = new PageSettings(this);
            tutorialPage   = new PageTutorial(this);
            preHostGame    = new PagePreHostGame(this);
            pages          = new List <Page>()
            {
                mainMenu, joinMenu, hostMenu, settingsMenu, tutorialPage, preHostGame
            };
            menuController.addPage(mainMenu, new Point(0, 0));
            menuController.addPage(joinMenu, new Point(1, 0));
            menuController.addPage(preHostGame, new Point(-1, 0));
            menuController.addPage(hostMenu, new Point(-2, 0));
            menuController.addPage(settingsMenu, new Point(0, 1));
            menuController.addPage(tutorialPage, new Point(0, -1));
            menuController.changeActivePage(mainMenu);
        }