Exemplo n.º 1
0
 /// <summary>
 /// Called by the <see cref="DeferredRenderSystem"/> when this <see cref="SpriteBase"/> component needs to draw its options map.
 /// Override this method with component-specific drawing code.
 /// </summary>
 /// <param name="gameTime">Time passed since the last call to DrawOptionsMap.</param>
 /// <param name="renderSystem"><see cref="DeferredRenderSystem"/> to render with.</param>
 /// <param name="drawBoundingBox">The bounding box of the sprite within the texture.</param>
 protected void DrawOptionsMap(GameTime gameTime, DeferredRenderSystem renderSystem, Rectangle drawBoundingBox)
 {
     renderSystem.BeginRender(this.optionMapFlagsShader);
     this.optionMapFlagsShader.ConfigureShaderAndApplyPass(renderSystem, this);
     renderSystem.DrawSprite(this.spriteTexture, this.Position, drawBoundingBox, Color.White, this.Rotation, Vector2.Zero, this.RenderScale, SpriteEffects.None);
     renderSystem.EndRender();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Called by the <see cref="DeferredRenderSystem"/> when this <see cref="SpriteBase"/> component needs to be drawn.
        /// Override this method with component-specific drawing code.
        /// </summary>
        /// <param name="gameTime">Time passed since the last call to DrawColorMap.</param>
        /// <param name="renderSystem"><see cref="DeferredRenderSystem"/> to render with.</param>
        public override void DrawColorMap(GameTime gameTime, DeferredRenderSystem renderSystem)
        {
            renderSystem.BeginRender();

            this.ForEachTile((pos, rect) => renderSystem.DrawSprite(this.SpriteTexture, pos, rect, this.RenderColor, this.Rotation, Vector2.Zero, this.RenderScale, SpriteEffects.None));

            renderSystem.EndRender();
        }
 /// <summary>
 /// Called by the <see cref="DeferredRenderSystem"/> when this <see cref="SpriteBase"/> component needs to be drawn.
 /// Override this method with component-specific drawing code.
 /// </summary>
 /// <param name="gameTime">Time passed since the last call to DrawColorMap.</param>
 /// <param name="renderSystem"><see cref="DeferredRenderSystem"/> to render with.</param>
 public override void DrawColorMap(GameTime gameTime, DeferredRenderSystem renderSystem)
 {
     renderSystem.BeginRender(this.shaderAsset);
     this.shaderAsset.ConfigureShader(renderSystem);
     this.shaderAsset.ApplyPass(0);
     renderSystem.DrawSprite(this.SpriteTexture, this.Position, null, this.RenderColor, this.Rotation, Vector2.Zero, this.RenderScale, SpriteEffects.None);
     renderSystem.EndRender();
 }
Exemplo n.º 4
0
        /// <summary>
        /// Called by the <see cref="DeferredRenderSystem"/> when this <see cref="SpriteBase"/> component needs to draw its options map.
        /// Override this method with component-specific drawing code.
        /// </summary>
        /// <param name="gameTime">Time passed since the last call to DrawOptionsMap.</param>
        /// <param name="renderSystem"><see cref="DeferredRenderSystem"/> to render with.</param>
        public override void DrawOptionsMap(GameTime gameTime, DeferredRenderSystem renderSystem)
        {
            renderSystem.BeginRender(this.OptionMapFlagsShader);
            this.OptionMapFlagsShader.ConfigureShaderAndApplyPass(renderSystem, this);

            this.ForEachTile((pos, rect) => renderSystem.DrawSprite(this.SpriteTexture, pos, rect, Color.White, this.Rotation, Vector2.Zero, this.RenderScale, SpriteEffects.None));

            renderSystem.EndRender();
        }
Exemplo n.º 5
0
 /// <summary>
 /// Called by the <see cref="DeferredRenderSystem"/> when this <see cref="SpriteBase"/> component needs to draw its normal map.
 /// Override this method with component-specific drawing code.
 /// </summary>
 /// <param name="gameTime">Time passed since the last call to DrawColorMap.</param>
 /// <param name="renderSystem"><see cref="DeferredRenderSystem"/> to render with.</param>
 /// <param name="drawBoundingBox">The bounding box of the sprite within the texture.</param>
 protected void DrawNormalMap(GameTime gameTime, DeferredRenderSystem renderSystem, Rectangle drawBoundingBox)
 {
     renderSystem.BeginRender();
     renderSystem.DrawSprite(this.spriteNormalTexture, this.Position, drawBoundingBox, Color.White, this.Rotation, Vector2.Zero, this.RenderScale, SpriteEffects.None);
     renderSystem.EndRender();
 }