예제 #1
0
        public void debugDraw(SpriteBatch spriteBatch, TouchCollection touchCollection)
        {
            foreach (LineSeg line in lines)
            {
                DebugGUI.line(spriteBatch, line.A, line.B, Color.Gray);
            }

            foreach (Vector2 point in getSafeBounds())
            {
                DebugGUI.point(spriteBatch, point, Color.Blue);
            }

            foreach (TouchLocation touch in touchCollection)
            {
                foreach (Vector2 point in getSafeBounds())
                {
                    Color col = Color.Red;
                    if (raytrace(point, touch.Position))
                    {
                        col = Color.Green;
                    }

                    DebugGUI.line(spriteBatch, point, touch.Position, col);
                }
            }
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
파일: CardSnap.cs 프로젝트: liangyee/Wizard
 public void debugDraw(SpriteBatch spriteBatch)
 {
     DebugGUI.line(spriteBatch, new Vector2(position.X, position.Y), new Vector2(length, position.Y), Color.Black);
     DebugGUI.line(spriteBatch, new Vector2(leftLimit, position.Y), new Vector2(leftLimit + bufferedLength, position.Y), Color.Red);
     foreach (Vector2 node in nodes)
     {
         DebugGUI.point(spriteBatch, node, Color.Lime);
     }
 }
예제 #4
0
파일: Arranger.cs 프로젝트: liangyee/Wizard
 public void debugDraw(SpriteBatch spriteBatch)
 {
     if (vertical)
     {
         foreach (ArrangerGuide guide in guideArray)
         {
             DebugGUI.line(spriteBatch, new Vector2(guide.Guide, 0), new Vector2(guide.Guide, screenSizeVector.Y), Color.Black);
         }
     }
     else
     {
         foreach (ArrangerGuide guide in guideArray)
         {
             DebugGUI.line(spriteBatch, new Vector2(0, guide.Guide), new Vector2(screenSizeVector.X, guide.Guide), Color.Black);
         }
     }
 }
예제 #5
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);
        }
예제 #6
0
 /// <summary>
 /// This is called when the game should draw itself.
 /// </summary>
 /// <param name="gameTime">Provides a snapshot of timing values.</param>
 public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
 {
     //Draw code goes here. Don't change this spriteBatch!
     frameHand.draw(spriteBatch);
     DebugGUI.info(spriteBatch, font22pt, gameTime);
 }