Blackthorn

sb-d6.snippet

Nov 4th, 2014
468
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.38 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <CodeSnippets
  3.    xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  4.   <CodeSnippet Format="1.0.0">
  5.     <Header>
  6.       <Title>Sprite Batch</Title>
  7.       <Author>John Steel</Author>
  8.       <Description>Inserts the default draw override stuff using the 6th draw overload.</Description>
  9.       <Shortcut>sb-d6</Shortcut>
  10.     </Header>
  11.     <Snippet>
  12.       <Declarations>
  13.         <Literal>
  14.           <ID>sb</ID>
  15.           <ToolTip>The spritebatch variable name.</ToolTip>
  16.           <Default>spritebatch</Default>
  17.         </Literal>
  18.         <Object>
  19.           <ID>texture</ID>
  20.           <Type>Microsoft.Xna.Framework.Graphics.Texture2D</Type>
  21.           <ToolTip>texture: The texture.</ToolTip>
  22.           <Default>texture</Default>
  23.         </Object>
  24.         <Object>
  25.           <ID>position</ID>
  26.           <Type>Microsoft.Xna.Framework.Vector2</Type>
  27.           <ToolTip>position: The location (in screen coordinates) to draw the sprite.</ToolTip>
  28.           <Default>Vector2.Zero</Default>
  29.         </Object>
  30.         <Object>
  31.           <ID>srcRect</ID>
  32.           <Type>Microsoft.Xna.Framework.Rectangle</Type>
  33.           <ToolTip>sourceRectangle: A rectangle that specifies (in texels) the source texels from a texture.
  34.           Use null to draw the entire texture.</ToolTip>
  35.           <Default>null /* Draw whole texture */</Default>
  36.         </Object>
  37.         <Object>
  38.           <ID>colour</ID>
  39.           <Type>Microsoft.Xna.Framework.Color</Type>
  40.           <ToolTip>color: The color to tint a sprite. Use Color.White for full color with no tinting.</ToolTip>
  41.           <Default>Color.White</Default>
  42.         </Object>
  43.         <Object>
  44.           <ID>rotation</ID>
  45.           <Type>System.Single</Type>
  46.           <ToolTip>rotation: Specifies the angle (in radians) to rotate the sprite about its center.</ToolTip>
  47.           <Default>0 /* No rotation */</Default>
  48.         </Object>
  49.         <Object>
  50.           <ID>origin</ID>
  51.           <Type>Microsoft.Xna.Framework.Vector2</Type>
  52.           <ToolTip>origin: The sprite origin; the default is (0,0) which represents the upper-left corner.</ToolTip>
  53.           <Default>Vector2.Zero</Default>
  54.         </Object>
  55.         <Object>
  56.           <ID>scale</ID>
  57.           <Type>System.Single</Type>
  58.           <ToolTip>scale: Scale factor.</ToolTip>
  59.           <Default>1 /* 1 : 1 Scale */</Default>
  60.         </Object>
  61.         <Object>
  62.           <ID>effect</ID>
  63.           <Type>Microsoft.Xna.Framework.Graphics.SpriteEffects</Type>
  64.           <ToolTip>effects: Effects to apply.</ToolTip>
  65.           <Default>SpriteEffects.None</Default>
  66.         </Object>
  67.         <Object>
  68.           <ID>layer</ID>
  69.           <Type>System.Single</Type>
  70.           <ToolTip>layerDepth: The depth of a layer. By default, 0 represents the front layer and 1 represents
  71.           a back layer. Use SpriteSortMode if you want sprites to be sorted during
  72.           drawing.</ToolTip>
  73.           <Default>0</Default>
  74.         </Object>
  75.       </Declarations>
  76.       <Code Language="csharp">
  77.         <![CDATA[public override void Draw(GameTime gameTime)
  78.        {
  79.            $sb$.Begin();
  80.            $sb$.Draw($texture$, $position$, $srcRect$, $colour$, $rotation$, $origin$, $scale$, $effect$, $layer$);
  81.            $sb$.End();
  82.            
  83.            base.Draw(gameTime);
  84.        }]]>
  85.       </Code>
  86.     </Snippet>
  87.   </CodeSnippet>
  88. </CodeSnippets>
Advertisement
Add Comment
Please, Sign In to add comment