#region CPL License /* Nuclex Framework Copyright (C) 2002-2009 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #endregion using System; using System.Collections.Generic; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; namespace Nuclex.Ninject.Xna { /// Interface for XNA's sprite batch class public interface ISpriteBatch { /// /// Prepares the graphics device for drawing sprites. Reference page contains /// links to related code samples. /// void Begin(); /// /// Begins a sprite batch operation using the specified sort and blend state /// object and default state objects (DepthStencilState.None, SamplerState.LinearClamp, /// RasterizerState.CullCounterClockwise). If you pass a null blend state, the /// default is BlendState.AlphaBlend. /// /// Sprite drawing order /// Blending options void Begin(SpriteSortMode sortMode, BlendState blendState); /// /// Begins a sprite batch operation using the specified sort, blend, sampler, /// depth stencil and rasterizer state objects. Passing null for any of the state /// objects selects the default default state objects (BlendState.AlphaBlend, /// SamplerState.LinearClamp, DepthStencilState.None, /// RasterizerState.CullCounterClockwise). /// /// Sprite drawing order /// Blending options /// Texture sampling options /// Depth and stencil options /// Rasterization options void Begin( SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState ); /// /// Begins a sprite batch operation using the specified sort, blend, sampler, /// depth stencil and rasterizer state objects, plus a custom effect. Passing /// null for any of the state objects selects the default default state objects /// (BlendState.AlphaBlend, DepthStencilState.None, /// RasterizerState.CullCounterClockwise, SamplerState.LinearClamp). Passing /// a null effect selects the default SpriteBatch Class shader. /// /// Sprite drawing order /// Blending options /// Texture sampling options /// Depth and stencil options /// Rasterization options /// Effect state options void Begin( SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect ); /// /// Begins a sprite batch operation using the specified sort, blend, sampler, /// depth stencil, rasterizer state objects, plus a custom effect and a 2D /// transformation matrix. Passing null for any of the state objects selects /// the default default state objects (BlendState.AlphaBlend, DepthStencilState.None, /// RasterizerState.CullCounterClockwise, SamplerState.LinearClamp). Passing /// a null effect selects the default SpriteBatch Class shader. /// /// Sprite drawing order /// Blending options /// Texture sampling options /// Depth and stencil options /// Rasterization options /// Effect state options /// /// Transformation matrix for scale, rotate, translate options /// void Begin( SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Matrix transformMatrix ); /// /// Adds a sprite to the batch of sprites to be rendered, specifying the texture, /// destination rectangle, and color tint. Reference page contains links to related /// code samples. /// /// The sprite texture /// /// A rectangle specifying, in screen coordinates, where the sprite will be drawn. /// If this rectangle is not the same size as sourcerectangle, the sprite is /// scaled to fit. /// /// /// The color channel modulation to use. Use Color.White for full color with /// no tinting /// void Draw(Texture2D texture, Rectangle destinationRectangle, Color color); /// /// Adds a sprite to the batch of sprites to be rendered, specifying the texture, /// screen position, and color tint. Reference page contains links to related /// code samples. /// /// The sprite texture /// /// The location, in screen coordinates, where the sprite will be drawn /// /// /// The color channel modulation to use. Use Color.White for full color with /// no tinting. /// void Draw(Texture2D texture, Vector2 position, Color color); /// /// Adds a sprite to the batch of sprites to be rendered, specifying the texture, /// destination and source rectangles, and color tint. Reference page contains /// links to related code samples. /// /// The sprite texture /// /// A rectangle specifying, in screen coordinates, where the sprite will be drawn. /// If this rectangle is not the same size as sourcerectangle the sprite will /// be scaled to fit. /// /// /// A rectangle specifying, in texels, which section of the rectangle to draw. /// Use null to draw the entire texture. /// /// /// The color channel modulation to use. Use Color.White for full color with /// no tinting. /// void Draw( Texture2D texture, Rectangle destinationRectangle, Rectangle? sourceRectangle, Color color ); /// /// Adds a sprite to the batch of sprites to be rendered, specifying the texture, /// screen position, source rectangle, and color tint. Reference page contains /// links to related code samples. /// /// The sprite texture /// /// The location, in screen coordinates, where the sprite will be drawn /// /// /// A rectangle specifying, in texels, which section of the rectangle to draw. /// Use null to draw the entire texture. /// /// /// The color channel modulation to use. Use Color.White for full color with /// no tinting. /// void Draw(Texture2D texture, Vector2 position, Rectangle? sourceRectangle, Color color); /// /// Adds a sprite to the batch of sprites to be rendered, specifying the texture, /// destination, and source rectangles, color tint, rotation, origin, effects, /// and sort depth. Reference page contains links to related code samples. /// /// The sprite texture /// /// A rectangle specifying, in screen coordinates, where the sprite will be drawn. /// If this rectangle is not the same size as sourceRectangle, the sprite is /// scaled to fit. /// /// /// A rectangle specifying, in texels, which section of the rectangle to draw. /// Use null to draw the entire texture. /// /// /// The color channel modulation to use. Use Color.White for full color with /// no tinting. /// /// /// The angle, in radians, to rotate the sprite around the origin /// /// /// The origin of the sprite. Specify (0,0) for the upper-left corner. /// /// Rotations to apply prior to rendering /// /// The sorting depth of the sprite, between 0 (front) and 1 (back). You must /// specify either SpriteSortMode.FrontToBack or SpriteSortMode.BackToFront for /// this parameter to affect sprite drawing. /// void Draw( Texture2D texture, Rectangle destinationRectangle, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth ); /// /// Adds a sprite to the batch of sprites to be rendered, specifying the texture, /// screen position, optional source rectangle, color tint, rotation, origin, /// scale, effects, and sort depth. Reference page contains links to related /// code samples. /// /// The sprite texture /// /// The location, in screen coordinates, where the sprite will be drawn /// /// /// A rectangle specifying, in texels, which section of the rectangle to draw. /// Use null to draw the entire texture. /// /// /// The color channel modulation to use. Use Color.White for full color with /// no tinting. /// /// /// The angle, in radians, to rotate the sprite around the origin /// /// /// The origin of the sprite. Specify (0,0) for the upper-left corner. /// /// /// Uniform multiple by which to scale the sprite width and height /// /// Rotations to apply prior to rendering /// /// The sorting depth of the sprite, between 0 (front) and 1 (back). You must /// specify either SpriteSortMode.FrontToBack or SpriteSortMode.BackToFront for /// this parameter to affect sprite drawing. /// void Draw( Texture2D texture, Vector2 position, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth ); /// /// Adds a sprite to the batch of sprites to be rendered, specifying the texture, /// screen position, source rectangle, color tint, rotation, origin, scale, effects, /// and sort depth. Reference page contains links to related code samples. /// /// The sprite texture /// /// The location, in screen coordinates, where the sprite will be drawn /// /// /// A rectangle specifying, in texels, which section of the rectangle to draw. /// Use null to draw the entire texture. /// /// /// The color channel modulation to use. Use Color.White for full color with /// no tinting. /// /// /// The angle, in radians, to rotate the sprite around the origin /// /// /// The origin of the sprite. Specify (0,0) for the upper-left corner. /// /// /// Vector containing separate scalar multiples for the x- and y-axes of /// the sprite. /// /// Rotations to apply before rendering /// /// The sorting depth of the sprite, between 0 (front) and 1 (back). You must /// specify either SpriteSortMode.FrontToBack or SpriteSortMode.BackToFront for /// this parameter to affect sprite drawing. /// void Draw( Texture2D texture, Vector2 position, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth ); /// /// Adds a sprite string to the batch of sprites to be rendered, specifying the /// font, output text, screen position, and color tint. Reference page contains /// links to related code samples. /// /// The sprite font /// The string to draw /// /// The location, in screen coordinates, where the text will be drawn /// /// The desired color of the text void DrawString(SpriteFont spriteFont, string text, Vector2 position, Color color); /// /// Adds a mutable sprite string to the batch of sprites to be rendered, specifying /// the font, output text, screen position, and color tint. Reference page contains /// links to related code samples /// /// The sprite font /// The mutable (read/write) string to draw /// /// The location, in screen coordinates, where the text will be drawn /// /// The desired color of the text void DrawString(SpriteFont spriteFont, StringBuilder text, Vector2 position, Color color); /// /// Adds a sprite string to the batch of sprites to be rendered, specifying the /// font, output text, screen position, color tint, rotation, origin, scale, /// and effects. Reference page contains links to related code samples. /// /// The sprite font /// The string to draw /// /// The location, in screen coordinates, where the text will be drawn /// /// The desired color of the text /// /// The angle, in radians, to rotate the text around the origin /// /// /// The origin of the string. Specify (0,0) for the upper-left corner. /// /// /// Uniform multiple by which to scale the sprite width and height /// /// Rotations to apply prior to rendering /// /// The sorting depth of the sprite, between 0 (front) and 1 (back) /// void DrawString( SpriteFont spriteFont, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth ); /// /// Adds a sprite string to the batch of sprites to be rendered, specifying the /// font, output text, screen position, color tint, rotation, origin, scale, /// effects, and depth. Reference page contains links to related code samples. /// /// The sprite font /// The string to draw /// /// The location, in screen coordinates, where the text will be drawn /// /// The desired color of the text /// /// The angle, in radians, to rotate the text around the origin /// /// /// The origin of the string. Specify (0,0) for the upper-left corner. /// /// /// Vector containing separate scalar multiples for the x- and y-axes of /// the sprite /// /// Rotations to apply prior to rendering /// /// The sorting depth of the sprite, between 0 (front) and 1 (back) /// void DrawString( SpriteFont spriteFont, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth ); /// /// Adds a mutable sprite string to the batch of sprites to be rendered, specifying /// the font, output text, screen position, color tint, rotation, origin, scale, /// and effects. Reference page contains links to related code samples. /// /// The sprite font /// The mutable (read/write) string to draw /// /// The location, in screen coordinates, where the text will be drawn /// /// The desired color of the text /// /// The angle, in radians, to rotate the text around the origin. /// /// /// The origin of the string. Specify (0,0) for the upper-left corner. /// /// /// Uniform multiple by which to scale the sprite width and height /// /// Rotations to apply prior to rendering /// /// The sorting depth of the sprite, between 0 (front) and 1 (back) /// void DrawString( SpriteFont spriteFont, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth ); /// /// Adds a mutable sprite string to the batch of sprites to be rendered, specifying /// the font, output text, screen position, color tint, rotation, origin, scale, /// effects, and depth. Reference page contains links to related code samples. /// /// The sprite font /// The mutable (read/write) string to draw /// /// The location, in screen coordinates, where the text will be drawn /// /// The desired color of the text /// /// The angle, in radians, to rotate the text around the origin /// /// /// The origin of the string. Specify (0,0) for the upper-left corner. /// /// /// Vector containing separate scalar multiples for the x- and y-axes of /// the sprite. /// /// Rotations to apply prior to rendering /// /// The sorting depth of the sprite, between 0 (front) and 1 (back) /// void DrawString( SpriteFont spriteFont, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth ); /// /// Flushes the sprite batch and restores the device state to how it was before /// Begin was called. Reference page contains links to related code samples. /// void End(); } } // namespace Nuclex.Ninject.Xna