コード例 #1
0
ファイル: GamePlay1.cs プロジェクト: liangyee/Wizard
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        public void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            screenSize = new Point(graphics.GraphicsDevice.DisplayMode.Width, graphics.GraphicsDevice.DisplayMode.Height);
            DebugGUI.init(graphics.GraphicsDevice);
            ScaleManager.setDefaultValues(screenSize);
            Card.setDefaultScale(ScaleManager.CardScale);

            button = this.Content.Load <Texture2D>("button.9.png");

            Card.setTexture(this.Content.Load <Texture2D>("cards.png"));
            DebugCards.init();

            font11pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender11");
            font22pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender22");
            font33pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender33");
            font44pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender44");
            font55pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender55");

            frameController = new FrameController();

            frameHand = new FrameHand(Vector2.Zero);
            frameController.addFrame(frameHand, VectorDirection.Down, true);

            CardContainer container = frameHand.addContainer();

            for (int i = 0; i < 20; i++)
            {
                container.addCard(DebugCards.draw());
            }
            CardSnap snap = new CardSnap(new Vector2(0, screenSize.Y), (float)screenSize.X, false);

            frameHand.addSnap(container, snap);
        }
コード例 #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);
        }