Пример #1
0
 public void RemoveAll()
 {
     scene1.RemoveChild(sprite, true);
     scene1.RemoveChild(playSprite, true);
     scene1.RemoveChild(controlSprite, true);
 }
 /// <summary>
 /// Removes from scene.
 /// Scene からすべてのSpriteをremoveする。
 /// </summary>
 /// <param name='scene'>
 /// Scene.
 /// </param>
 public override void RemoveFromScene(Scene scene)
 {
     foreach (SpriteForTouch spriteForTouch in this.Sprites) {
         scene.RemoveChild(spriteForTouch.Sprite,true);
     }
 }
Пример #3
0
 /// <summary>
 /// Removes the yes no message.
 /// メッセージを削除するときに呼び出す。
 /// </summary>
 /// <param name='scene'>
 /// Scene.
 /// </param>
 public void RemoveYesNoMessage(Scene scene)
 {
     this.YesNoCursor.Sprite.Quad.T.X = 6.5f*gridSize*Const.FIX;
     this.YesNoCursor.Sprite.Quad.T.Y = (279.84f + Const.GRID_Y_REST)*Const.FIX;
     scene.RemoveChild(this.NoTouch.Sprite,true);
     scene.RemoveChild(this.YesTouch.Sprite,true);
     scene.RemoveChild(this.yesNoMessage.Sprite,true);
     scene.RemoveChild(this.choseBox.Sprite,true);
     scene.RemoveChild(this.YesNoCursor.Sprite,true);
     this.CursorPosition = 0;
     this.choseBox = null;
     this.yesNoMessage = null;
     this.YesNoCursor = null;
     this.YesTouch = null;
     this.NoTouch = null;
     this.firstDraw = true;
     GC.Collect();//強制的にすべてのジェネレーションのガベージ コレクションを行う
 }
Пример #4
0
        public static void Update()
        {
            if (screenManager.IsTransitioning())
            {
                screenManager.Update(gameScene);

                // Transition Finished, load relevant data
                if (!screenManager.IsTransitioning())
                {
                    if (screenManager.GetScreen() == Screens.Game)
                    {
                        SetupGame();
                        soundManager.PlayBGM();
                    }
                    else if (screenManager.GetScreen() == Screens.GameOver)
                    {
                        gameScene.Camera2D.SetViewY(new Vector2(0.0f, Director.Instance.GL.Context.GetViewport().Height *0.5f),
                                                    new Vector2((Director.Instance.GL.Context.GetViewport().Width *0.5f), Director.Instance.GL.Context.GetViewport().Height *0.5f));
                    }
                }
            }
            else
            {
                UpdateTouchData();

                switch (screenManager.GetScreen())
                {
                case Screens.Splash:
                    screenManager.ChangeScreenTo(Screens.Menu);
                    break;

                case Screens.Game:
                    if (!tutorialManager.HasPopUp())
                    {
                        GameUpdate();
                    }
                    else
                    {
                        UpdateTouchData();
                    }
                    break;

                case Screens.GameOver:
                    Vector2 touchPos = Input2.Touch00.Pos;

                    if (touchPos.X >= 0)
                    {
                        touchPos = new Vector2((touchPos.X * 450) + 450, (touchPos.Y * 272) + 272);
                    }
                    else
                    {
                        touchPos = new Vector2(((touchPos.X + 1) * 450), ((touchPos.Y + 1) * 272));
                    }
                    Bounds2 touchBox = new Bounds2(touchPos, touchPos);
                    if (touchBox.Overlaps(rSprite.GetlContentLocalBounds()))
                    {
                        screenManager.ChangeScreenTo(Screens.Menu);
                        gameScene.RemoveChild(rSprite, false);
                    }

                    break;
                }
            }
        }
 /// <summary>
 /// Removes from scene.
 /// Scene からすべてのSpriteをremoveする。
 /// </summary>
 /// <param name='scene'>
 /// Scene.
 /// </param>
 public override void RemoveFromScene(Scene scene)
 {
     foreach (string keyTemp in this.Sprites.Keys) {
         scene.RemoveChild(this.Sprites[keyTemp].Sprite,true);
     }
 }