コード例 #1
0
        public void draw(SpriteBatch sprite_batch)
        {
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
            Black_Fill.draw(sprite_batch);
            Burst.draw(sprite_batch);
            sprite_batch.End();

            Rectangle scissor_rect = new Rectangle(Banner_Scissor_Rect.X +
                                                   (int)Stereoscopic_Graphic_Object.graphic_draw_offset(Config.RANKING_BANNER_DEPTH).X,
                                                   Banner_Scissor_Rect.Y, Banner_Scissor_Rect.Width, Banner_Scissor_Rect.Height);

            sprite_batch.GraphicsDevice.ScissorRectangle = Scene_Map.fix_rect_to_screen(scissor_rect);
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp,
                               null, new RasterizerState {
                ScissorTestEnable = true
            });
            Banner.draw(sprite_batch);
            sprite_batch.End();

            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
            Window_Img.draw(sprite_batch);
            if (Window_Img.visible)
            {
                foreach (TextSprite text in Text)
                {
                    text.draw(sprite_batch, -Window_Img.loc);
                }
            }
            Rank.draw(sprite_batch);
            White_Screen.draw(sprite_batch);
            sprite_batch.End();
        }
コード例 #2
0
 protected override Vector2 stereo_offset()
 {
     if (Stereo_Offset.IsNothing)
     {
         return(Vector2.Zero);
     }
     return(Stereoscopic_Graphic_Object.graphic_draw_offset(
                Stereo_Offset + (Off_Frame ? Config.MAP_WEATHER_OFF_FRAME_DEPTH_OFFSET : 0)));
 }
コード例 #3
0
 protected void platform_effect_setup()
 {
     if (Platform_Effect_1 != null)
     {
         // If at range, the battler 1 platform will be attached to battle 1
         if (Distance > 1)
         {
             Platform_Effect_1.loc = Battler_1_Sprite.loc;
         }
         // Otherwise it is shared between the two battlers and thus needs to be averaged between them
         else
         {
             Platform_Effect_1.loc = (Battler_1_Sprite.loc + Platform_Loc_2) / 2;
         }
         Platform_Effect_1.loc -= new Vector2(0, 8);
         Platform_Effect_1.loc -= Pan_Vector;
         Platform_Effect_1.loc += Stereoscopic_Graphic_Object.graphic_draw_offset(Battler_1_Sprite.battler_stereo_offset());
         Platform_Matrix_1      = Matrix.Identity *
                                  Matrix.CreateTranslation(new Vector3(-Platform_Effect_1.loc.X, -Platform_Effect_1.loc.Y, 0)) *
                                  platform_effect_matrix(Distance > 1, true ^ !Reverse, Platform_Effect_Ratio) *
                                  Matrix.CreateRotationZ((1 - Platform_Effect_Ratio) * Platform_Effect_Angle) *
                                  Matrix.CreateTranslation(new Vector3(
                                                               Platform_Effect_1.loc.X,
                                                               Platform_Effect_1.loc.Y,
                                                               0) +
                                                           new Vector3((Battler_2 == null || Distance == 1) ? 0 : Platform_Effect_Ratio * 4, Platform_Effect_Ratio * 2, -0.5f)) *
                                  Matrix.CreateScale(new Vector3(1, 1, 0.001f));
         if (Platform_Effect_2 != null)
         {
             Platform_Effect_2.loc  = Battler_2_Sprite.loc - new Vector2(0, 8);
             Platform_Effect_2.loc -= Pan_Vector;
             Platform_Effect_2.loc += Stereoscopic_Graphic_Object.graphic_draw_offset(Battler_1_Sprite.battler_stereo_offset());
             Platform_Matrix_2      = Matrix.Identity *
                                      Matrix.CreateTranslation(new Vector3(-Platform_Effect_2.loc.X, -Platform_Effect_2.loc.Y, 0)) *
                                      platform_effect_matrix(Distance > 1, false ^ !Reverse, Platform_Effect_Ratio) *
                                      Matrix.CreateRotationZ((1 - Platform_Effect_Ratio) * Platform_Effect_Angle) *
                                      Matrix.CreateTranslation(new Vector3(
                                                                   Platform_Effect_2.loc.X,
                                                                   Platform_Effect_2.loc.Y,
                                                                   0) +
                                                               new Vector3(Platform_Effect_Ratio * -4, Platform_Effect_Ratio * 2, -0.5f)) *
                                      Matrix.CreateScale(new Vector3(1, 1, 0.001f));
         }
     }
 }
コード例 #4
0
 /// <summary>
 /// Copies the stereoscopy of this object onto another object
 /// </summary>
 /// <param name="other"></param>
 protected void copy_stereo(Stereoscopic_Graphic_Object other)
 {
     other.Stereo_Offset = Stereo_Offset;
 }
コード例 #5
0
ファイル: GameLoop.cs プロジェクト: Nagraal/Tactile-Engine
        public IEnumerable <GameTime> Update(GameTime gameTime)
        {
            KeyboardState keyState        = Keyboard.GetState();
            GamePadState  controllerState = GamePad.GetState(PlayerIndex.One);

#if !MONOGAME
            OpenALInterface.update();
#endif

#if DEBUG
            // Stereoscopy debugging
            if (Tactile.Global.Input.pressed(Inputs.Select))
            {
                if (Global.Input.triggered(Inputs.Right))
                {
                    Global.gameSettings.Graphics.ConfirmSetting(
                        Tactile.Options.GraphicsSetting.Stereoscopic, 0,
                        Global.gameSettings.Graphics.StereoscopicLevel + 5);
                }
                if (Global.Input.triggered(Inputs.Left))
                {
                    Global.gameSettings.Graphics.ConfirmSetting(
                        Tactile.Options.GraphicsSetting.Stereoscopic, 0,
                        Global.gameSettings.Graphics.StereoscopicLevel - 5);
                }
            }
#endif
            // If changing zoom or fullscreen, return
            if (UpdateZoom())
            {
                PreviousKeyState = keyState;
                yield break;
            }
            int updateLoops = UpdateFramerate(gameTime, keyState, controllerState);
            UpdateInitialLoad();

            int i;
            for (i = 0; ; i++)
            {
                if (!Paused)
                {
                    Global.update_input(Game, gameTime, Game.IsActive, keyState, controllerState);
                    Global.Rumble.Update(gameTime);
                    Renderer.UpdateTouch();
                }

                UpdatePause(keyState, controllerState);
                bool processNextFrame = (!Paused || FrameAdvanced);

                if (i > 0)
                {
#if !MONOGAME
                    OpenALInterface.update();
#endif
                }
                // Don't update audio handling when the game is paused,
                // to better debug fades etc
                if (processNextFrame)
                {
                    Global.Audio.update(GameInactive);
                }
                Stereoscopic_Graphic_Object.update_stereoscopy();

                UpdateIO();
                UpdateSceneChange();
                if (Global.scene != null)
                {
                    // Suspend
                    IOHandler.UpdateSuspend();
                    // Update Scene
                    if (processNextFrame)
                    {
                        UpdateScene(gameTime, keyState, controllerState);
                    }
                }

                yield return(gameTime);

                if (updateLoops > 1)
                {
                    float updateLoopTime = (float)(HyperspeedStopWatch.ElapsedTicks / ((double)Stopwatch.Frequency));
                    // If a normal frame worth of time has passed, or if the fixed number of hyperspeed loops have occurred
                    if (updateLoopTime > 1f / FRAME_RATE || i >= updateLoops - 1)
                    {
                        break;
                    }
#if DEBUG || GET_FPS
                    else
                    {
                        FramerateFrames++;
                    }
#endif
                }
                else
                {
                    break;
                }
            }

            UpdateOpenGameSite();

            Global.Audio.post_update();
            Renderer.UpdateScreenScale();
            UpdateTextGlow(i + 1);
            HyperspeedStopWatch.Stop(); //@Debug

            PreviousKeyState = keyState;
        }