Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        public override void draw(SpriteBatch sprite_batch, GraphicsDevice device, RenderTarget2D[] render_targets)
        {
            device.SetRenderTarget(render_targets[0]);
            device.Clear(Color.Transparent);

            if (Title_Back == null)
            {
                draw_animation_scene(sprite_batch, device, render_targets[0], render_targets[2], render_targets[3]);
            }
            else
            {
                draw_banner_scene(sprite_batch);
            }
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
            White_Screen.draw(sprite_batch);
            sprite_batch.End();

            base.draw(sprite_batch, device, render_targets);
        }
Ejemplo n.º 3
0
        private void draw_battle(SpriteBatch sprite_batch, GraphicsDevice device,
                                 RenderTarget2D finalRender, RenderTarget2D tempRender, RenderTarget2D effectRender, Effect battle_shader)
        {
            device.SetRenderTarget(finalRender);

            if (Weather_Visible == BattleWeathers.Visible)
            {
                draw_lower_weather(sprite_batch, Weather_Opacity);
            }

            draw_battler_bg_effects(sprite_batch);

            // Platform
            device.SetRenderTarget(tempRender);
            device.Clear(Color.Transparent);
            draw_platform(sprite_batch);
            device.SetRenderTarget(finalRender);
            if (battle_shader != null)
            {
                battle_shader.CurrentTechnique = battle_shader.Techniques["Tone"];
                battle_shader.Parameters["tone"].SetValue(
                    Global.game_state.screen_tone.to_vector_4(
                        Global.BattleSceneConfig.ActionPlatformToneWeight / 255f));
            }
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, battle_shader);
            sprite_batch.Draw(tempRender, Vector2.Zero, Color.White); // on promotion (and level up?) darken this tint //Yeti
            sprite_batch.End();

            // Platform effect
            device.SetRenderTarget(tempRender);
            device.Clear(Color.Transparent);

            platform_effect_setup();
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, Platform_Matrix_1);
            if (Platform_Effect_1 != null)
            {
                Platform_Effect_1.draw(sprite_batch, Vector2.Zero);
            }
            //Platform_Effect_1.draw(sprite_batch, (Layer_2_Shake + Pan_Vector) + Platform_1_Shake);
            sprite_batch.End();
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, Platform_Matrix_2);
            if (Platform_Effect_2 != null)
            {
                Platform_Effect_2.draw(sprite_batch, Vector2.Zero);
            }
            //Platform_Effect_2.draw(sprite_batch, (Layer_2_Shake + Pan_Vector) + Platform_2_Shake);
            sprite_batch.End();

            device.SetRenderTarget(finalRender);
            sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
            sprite_batch.Draw(tempRender, Vector2.Zero, new Color(160, 160, 160, 160));
            sprite_batch.End();

            // Battlers
            draw_battler_lower_effects(sprite_batch);

            BattleSpriteRenderer battler_renderer = new BattleSpriteRenderer(
                Reverse, Layer_3_Shake + Pan_Vector, Platform_1_Shake, Platform_2_Shake);

            battler_renderer.draw(sprite_batch, device,
                                  active_battler_sprite, inactive_battler_sprites,
                                  finalRender, tempRender, effectRender);

            device.SetRenderTarget(finalRender);

            if (Weather_Visible == BattleWeathers.Visible)
            {
                draw_upper_weather(sprite_batch, Weather_Opacity);
            }

            draw_battler_upper_effects(sprite_batch);

            draw_hud(sprite_batch);

            if (White_Screen != null)
            {
                sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
                White_Screen.draw(sprite_batch);
                sprite_batch.End();
            }

            // If level up, darken parts of the screen
            // Always switch to render target 2 for this, it needs to act as a temporary final target for a bit
            device.SetRenderTarget(effectRender);
            device.Clear(Color.Transparent);

            draw_masked_screen_darken(sprite_batch, battle_shader, finalRender);
        }