Beispiel #1
0
 public override void update(GameTime gameTime)
 {
     base.update(gameTime);
     if (MainGame.Instance == null)
     {
         return;
     }
     if (UltraServer.Instance.network.DeviceIP == null)
     {
         return;
     }
     if (ipField.Text == "Starting...")
     {
         ipField.Text = IPHelper.decToSimple(UltraServer.Instance.network.DeviceIP + ":" + UltraServer.Instance.network.DevicePort);
         QRCode       = QRRenderer.QRFromString(ipField.Text);
         Console.WriteLine(QRCode.Bounds);
     }
 }
Beispiel #2
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);
        }