Esempio n. 1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            Vector2 position = new Vector2(d.X, d.Y);

            if (mainMenu.SelectItemNumber == 0)
            {
                mainMenu.Draw(gameTime, d, position);
            }
            else if (mainMenu.SelectItemNumber == 1)
            {
                if (kanjiMenu.SelectItemNumber == 0)
                {
                    kanjiMenu.Draw(gameTime, d, position);
                }
                else if (kanjiMenu.SelectItemNumber == 1)
                {
                    if (kanjiGame == null)
                    {
                        this.kanjiGame = new KanjiGame(this);
                        Components.Add(this.kanjiGame);
                    }

                    kanjiGame.Draw(gameTime, d, position);
                    kanjiGame.Update(gameTime);
                }
                else if (kanjiMenu.SelectItemNumber == 2)
                {
                    if (compositionGame == null)
                    {
                        this.compositionGame = new CompositionGame(this);
                        Components.Add(this.compositionGame);
                    }

                    compositionGame.Draw(gameTime, d, position);
                    compositionGame.Update(gameTime);
                }
                else if (kanjiMenu.SelectItemNumber == 3)
                {
                    if (kanjiList == null)
                    {
                        this.kanjiList = new KanjiList(this);
                        Components.Add(this.kanjiList);
                    }

                    kanjiList.Draw(gameTime, d, position);
                    kanjiList.Update(gameTime);
                }
                else
                {
                }

                back(position);
            }
            else if (mainMenu.SelectItemNumber == 2)
            {
                if (vocabularyMenu.SelectItemNumber == 0)
                {
                    vocabularyMenu.Draw(gameTime, d, position);
                }
                else if (vocabularyMenu.SelectItemNumber == 1)
                {
                    if (vocabularyGame == null)
                    {
                        this.vocabularyGame = new VocabularyGame(this);
                        Components.Add(this.vocabularyGame);
                    }

                    vocabularyGame.Draw(gameTime, d, position);
                }
                else if (vocabularyMenu.SelectItemNumber == 2)
                {
                    if (vocabularyGame2 == null)
                    {
                        this.vocabularyGame2 = new VocabularyGame2(this);
                        Components.Add(this.vocabularyGame2);
                    }

                    vocabularyGame2.Draw(gameTime, d, position);
                }
                else if (vocabularyMenu.SelectItemNumber == 3)
                {
                    if (vocabularyList == null)
                    {
                        this.vocabularyList = new VocabularyList(this);
                        Components.Add(this.vocabularyList);
                    }

                    vocabularyList.Draw(gameTime, d, position);
                    vocabularyList.Update(gameTime);
                }
                else
                {
                }

                back(position);
            }
            else
            {
                back(position);
            }

            spriteBatch.Begin();

            if (d.X > 0 && d.X < GraphicsDevice.Viewport.Width && d.Y > 0 && d.Y < GraphicsDevice.Viewport.Height)
            {
                spriteBatch.Draw(cursor, position, null, Color.White, 0.0f, textureCenter, 1.0f, SpriteEffects.None, 0.0f);
            }

            spriteBatch.End();

            base.Draw(gameTime);
        }