![]() |
Paradox Game Engine
v1.0.0 beta06
|
Renders a group of sprites. More...
Classes | |
struct | SpriteDrawInfo |
Public Member Functions | |
SpriteBatch (GraphicsDevice graphicsDevice, int bufferElementCount=1024, int batchCapacity=64) | |
Initializes a new instance of the SpriteBatch class. More... | |
void | Begin (SpriteSortMode sortMode, Effect effect) |
Begins a sprite batch operation using deferred sort and default state objects (BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise). More... | |
void | Begin (SpriteSortMode sortMode=SpriteSortMode.Deferred, BlendState blendState=null, SamplerState samplerState=null, DepthStencilState depthStencilState=null, RasterizerState rasterizerState=null, Effect effect=null, int stencilValue=0) |
Begins a sprite batch rendering using the specified sorting mode and blend state, 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. More... | |
void | Begin (Matrix viewMatrix, SpriteSortMode sortMode=SpriteSortMode.Deferred, BlendState blendState=null, SamplerState samplerState=null, DepthStencilState depthStencilState=null, RasterizerState rasterizerState=null, Effect effect=null, int stencilValue=0) |
Begins a sprite batch rendering using the specified sorting mode and blend state, 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. More... | |
void | Begin (Matrix viewMatrix, Matrix projectionMatrix, SpriteSortMode sortMode=SpriteSortMode.Deferred, BlendState blendState=null, SamplerState samplerState=null, DepthStencilState depthStencilState=null, RasterizerState rasterizerState=null, Effect effect=null, int stencilValue=0) |
Begins a sprite batch rendering using the specified sorting mode and blend state, 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. More... | |
void | Draw (Texture texture, RectangleF destinationRectangle, Color color) |
Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, and color. More... | |
void | Draw (Texture texture, Vector2 position) |
Adds a sprite to a batch of sprites for rendering using the specified texture, position and color. More... | |
void | Draw (Texture texture, Vector2 position, Color color) |
Adds a sprite to a batch of sprites for rendering using the specified texture, position and color. More... | |
void | Draw (Texture texture, RectangleF destinationRectangle, RectangleF?sourceRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects=SpriteEffects.None, ImageOrientation orientation=ImageOrientation.AsIs, float layerDepth=0f) |
Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, source rectangle, color, rotation, origin, effects and layer. More... | |
void | Draw (Texture texture, Vector2 position, Color color, float rotation, Vector2 origin, float scale=1.0f, SpriteEffects effects=SpriteEffects.None, ImageOrientation orientation=ImageOrientation.AsIs, float layerDepth=0) |
Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer. More... | |
void | Draw (Texture texture, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects=SpriteEffects.None, ImageOrientation orientation=ImageOrientation.AsIs, float layerDepth=0) |
Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer. More... | |
void | Draw (Texture texture, Vector2 position, RectangleF?sourceRectangle, Color color) |
Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, and color. More... | |
void | Draw (Texture texture, Vector2 position, RectangleF?sourceRectangle, Color color, float rotation, Vector2 origin, float scale=1f, SpriteEffects effects=SpriteEffects.None, ImageOrientation orientation=ImageOrientation.AsIs, float layerDepth=0) |
Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer. More... | |
void | Draw (Texture texture, Vector2 position, RectangleF?sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects=SpriteEffects.None, ImageOrientation orientation=ImageOrientation.AsIs, float layerDepth=0) |
Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer. More... | |
Vector2 | MeasureString (SpriteFont spriteFont, string text, Vector2 targetSize) |
Returns the size of the given text in virtual pixels. More... | |
Vector2 | MeasureString (SpriteFont spriteFont, string text, float fontSize, Vector2 targetSize) |
Returns the size of the given text in virtual pixels. More... | |
void | DrawString (SpriteFont spriteFont, string text, Vector2 position, Color color, TextAlignment alignment=TextAlignment.Left) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, and color. More... | |
void | DrawString (SpriteFont spriteFont, StringBuilder text, Vector2 position, Color color, TextAlignment alignment=TextAlignment.Left) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, and color. More... | |
void | DrawString (SpriteFont spriteFont, string text, float fontSize, Vector2 position, Color color, TextAlignment alignment=TextAlignment.Left) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, and color. More... | |
void | DrawString (SpriteFont spriteFont, StringBuilder text, float fontSize, Vector2 position, Color color, TextAlignment alignment=TextAlignment.Left) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, and color. More... | |
void | DrawString (SpriteFont spriteFont, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth, TextAlignment alignment) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer. More... | |
void | DrawString (SpriteFont spriteFont, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth, TextAlignment alignment) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer. More... | |
void | DrawString (SpriteFont spriteFont, string text, float fontSize, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth, TextAlignment alignment) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer. More... | |
void | DrawString (SpriteFont spriteFont, StringBuilder text, float fontSize, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth, TextAlignment alignment) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer. More... | |
![]() | |
void | End () |
Flushes the sprite batch and restores the device state to how it was before Begin was called. More... | |
![]() | |
void | Dispose () |
override string | ToString () |
Static Public Member Functions | |
static Matrix | CalculateDefaultProjection (Vector3 virtualResolution) |
Calculate the default projection matrix for the provided virtual resolution. More... | |
static void | CalculateDefaultProjection (ref Vector3 virtualResolution, out Matrix projection) |
Calculate the default projection matrix for the provided virtual resolution. More... | |
Protected Member Functions | |
override unsafe void | UpdateBufferValuesFromElementInfo (ref ElementInfo elementInfo, IntPtr vertexPtr, IntPtr indexPtr, int vertexOffset) |
Update the mapped vertex and index buffer values using the provided element info. More... | |
override void | PrepareForRendering () |
![]() | |
BatchBase (GraphicsDevice device, Shaders.EffectBytecode defaultEffectByteCode, ResourceBufferInfo resourceBufferInfo, VertexDeclaration vertexDeclaration, int indexSize=sizeof(short)) | |
void | Begin (Effect effect, SpriteSortMode sessionSortMode, BlendState sessionBlendState, SamplerState sessionSamplerState, DepthStencilState sessionDepthStencilState, RasterizerState sessionRasterizerState, int stencilValue) |
Begins a sprite batch rendering using the specified sorting mode and blend state, sampler, depth stencil, rasterizer state objects and 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 effect shader. More... | |
void | CheckBeginHasBeenCalled (string functionName) |
void | CheckEndHasBeenCalled (string functionName) |
void | Draw (Texture texture, Texture texture1, ref ElementInfo elementInfo) |
![]() | |
ComponentBase () | |
Initializes a new instance of the ComponentBase class. More... | |
ComponentBase (string name) | |
Initializes a new instance of the ComponentBase class. More... | |
virtual void | OnNameChanged () |
Called when Name property was changed. More... | |
virtual void | Destroy () |
Disposes of object resources. More... | |
Properties | |
float | DefaultDepth [get, set] |
Gets or sets the default depth value used by the SpriteBatch when the VirtualResolution is not set. More... | |
Vector3 | VirtualResolution [get, set] |
Gets or sets the virtual resolution used for this SpriteBatch More... | |
![]() | |
Effect | Effect [get, set] |
The effect used for the current Begin/End session. More... | |
TextureIdComparer | TextureComparer [get, set] |
QueueComparer< ElementInfo > | BackToFrontComparer [get, set] |
QueueComparer< ElementInfo > | FrontToBackComparer [get, set] |
![]() | |
long | Id [get, set] |
string | Name [get, set] |
Gets or sets the name of this component. More... | |
bool | IsDisposed [get, set] |
Has the component been disposed or not yet. More... | |
![]() | |
long | Id [get] |
Gets the id of this component. More... | |
string | Name [get] |
Gets the name of this component. More... | |
![]() | |
int | ReferenceCount [get] |
Gets the reference count of this instance. More... | |
![]() | |
ObjectCollector | Collector [get] |
Gets the collector. More... | |
Additional Inherited Members | |
![]() | |
PropertyContainer | Tags |
Gets the attached properties to this component. More... | |
![]() | |
readonly DeviceResourceContext | ResourceContext |
GraphicsDevice | GraphicsDevice |
BlendState | BlendState |
RasterizerState | RasterizerState |
SamplerState | SamplerState |
DepthStencilState | DepthStencilState |
int | StencilReferenceValue |
SpriteSortMode | SortMode |
readonly Effect | DefaultEffect |
Renders a group of sprites.
Definition at line 8 of file SpriteBatch.Extensions.cs.
SiliconStudio.Paradox.Graphics.SpriteBatch.SpriteBatch | ( | GraphicsDevice | graphicsDevice, |
int | bufferElementCount = 1024 , |
||
int | batchCapacity = 64 |
||
) |
Initializes a new instance of the SpriteBatch class.
graphicsDevice | The graphics device. |
bufferElementCount | The maximum number element that can be batched in one time. |
batchCapacity | The batch capacity default to 64. |
Definition at line 44 of file SpriteBatch.cs.
void SiliconStudio.Paradox.Graphics.SpriteBatch.Begin | ( | SpriteSortMode | sortMode, |
Effect | effect | ||
) |
Begins a sprite batch operation using deferred sort and default state objects (BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise).
sortMode | The sprite drawing order to use for the batch session |
effect | The effect to use for the batch session |
Definition at line 93 of file SpriteBatch.cs.
void SiliconStudio.Paradox.Graphics.SpriteBatch.Begin | ( | SpriteSortMode | sortMode = SpriteSortMode.Deferred , |
BlendState | blendState = null , |
||
SamplerState | samplerState = null , |
||
DepthStencilState | depthStencilState = null , |
||
RasterizerState | rasterizerState = null , |
||
Effect | effect = null , |
||
int | stencilValue = 0 |
||
) |
Begins a sprite batch rendering using the specified sorting mode and blend state, 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.
sortMode | The sprite drawing order to use for the batch session |
effect | The effect to use for the batch session |
blendState | The blending state to use for the batch session |
samplerState | The sampling state to use for the batch session |
depthStencilState | The depth stencil state to use for the batch session |
rasterizerState | The rasterizer state to use for the batch session |
stencilValue | The value of the stencil buffer to take as reference for the batch session |
Definition at line 109 of file SpriteBatch.cs.
void SiliconStudio.Paradox.Graphics.SpriteBatch.Begin | ( | Matrix | viewMatrix, |
SpriteSortMode | sortMode = SpriteSortMode.Deferred , |
||
BlendState | blendState = null , |
||
SamplerState | samplerState = null , |
||
DepthStencilState | depthStencilState = null , |
||
RasterizerState | rasterizerState = null , |
||
Effect | effect = null , |
||
int | stencilValue = 0 |
||
) |
Begins a sprite batch rendering using the specified sorting mode and blend state, 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.
sortMode | The sprite drawing order to use for the batch session |
effect | The effect to use for the batch session |
blendState | The blending state to use for the batch session |
samplerState | The sampling state to use for the batch session |
depthStencilState | The depth stencil state to use for the batch session |
rasterizerState | The rasterizer state to use for the batch session |
stencilValue | The value of the stencil buffer to take as reference for the batch session |
viewMatrix | The view matrix to use for the batch session |
Definition at line 126 of file SpriteBatch.cs.
void SiliconStudio.Paradox.Graphics.SpriteBatch.Begin | ( | Matrix | viewMatrix, |
Matrix | projectionMatrix, | ||
SpriteSortMode | sortMode = SpriteSortMode.Deferred , |
||
BlendState | blendState = null , |
||
SamplerState | samplerState = null , |
||
DepthStencilState | depthStencilState = null , |
||
RasterizerState | rasterizerState = null , |
||
Effect | effect = null , |
||
int | stencilValue = 0 |
||
) |
Begins a sprite batch rendering using the specified sorting mode and blend state, 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.
sortMode | The sprite drawing order to use for the batch session |
effect | The effect to use for the batch session |
blendState | The blending state to use for the batch session |
samplerState | The sampling state to use for the batch session |
depthStencilState | The depth stencil state to use for the batch session |
rasterizerState | The rasterizer state to use for the batch session |
stencilValue | The value of the stencil buffer to take as reference for the batch session |
viewMatrix | The view matrix to use for the batch session |
projectionMatrix | The projection matrix to use for the batch session |
Definition at line 144 of file SpriteBatch.cs.
|
static |
Calculate the default projection matrix for the provided virtual resolution.
The sprite batch default projection is an orthogonal matrix such as (0,0) is the Top/Left corner of the screen and (VirtualResolution.X, VirtualResolution.Y) is the Bottom/Right corner of the screen.
Definition at line 56 of file SpriteBatch.cs.
|
static |
Calculate the default projection matrix for the provided virtual resolution.
Definition at line 68 of file SpriteBatch.cs.
void SiliconStudio.Paradox.Graphics.SpriteBatch.Draw | ( | Texture | texture, |
RectangleF | destinationRectangle, | ||
Color | color | ||
) |
Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, and color.
texture | A texture. |
destinationRectangle | A rectangle that specifies (in screen coordinates) the destination for drawing the sprite. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
Before making any calls to Draw, you must call Begin. Once all calls to Draw are complete, call End.
Definition at line 163 of file SpriteBatch.cs.
Adds a sprite to a batch of sprites for rendering using the specified texture, position and color.
texture | A texture. |
position | The location (in screen coordinates) to draw the sprite. |
Definition at line 173 of file SpriteBatch.cs.
References SiliconStudio.Core.Mathematics.Color.White.
void SiliconStudio.Paradox.Graphics.SpriteBatch.Draw | ( | Texture | texture, |
Vector2 | position, | ||
Color | color | ||
) |
Adds a sprite to a batch of sprites for rendering using the specified texture, position and color.
texture | A texture. |
position | The location (in screen coordinates) to draw the sprite. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
Definition at line 184 of file SpriteBatch.cs.
References SiliconStudio.Core.Mathematics.Vector2.X, and SiliconStudio.Core.Mathematics.Vector2.Y.
void SiliconStudio.Paradox.Graphics.SpriteBatch.Draw | ( | Texture | texture, |
RectangleF | destinationRectangle, | ||
RectangleF? | sourceRectangle, | ||
Color | color, | ||
float | rotation, | ||
Vector2 | origin, | ||
SpriteEffects | effects = SpriteEffects.None , |
||
ImageOrientation | orientation = ImageOrientation.AsIs , |
||
float | layerDepth = 0f |
||
) |
Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, source rectangle, color, rotation, origin, effects and layer.
texture | A texture. |
orientation | The source image orientation |
destinationRectangle | A rectangle that specifies (in screen coordinates) the destination for drawing the sprite. If this rectangle is not the same size as the source rectangle, the sprite will be scaled to fit. |
sourceRectangle | A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
rotation | Specifies the angle (in radians) to rotate the sprite about its center. |
origin | The sprite origin in the texture in pixels (dependent of image orientation). Default value is (0,0) which represents the upper-left corner. |
effects | Effects to apply. |
layerDepth | The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. |
Definition at line 202 of file SpriteBatch.cs.
void SiliconStudio.Paradox.Graphics.SpriteBatch.Draw | ( | Texture | texture, |
Vector2 | position, | ||
Color | color, | ||
float | rotation, | ||
Vector2 | origin, | ||
float | scale = 1.0f , |
||
SpriteEffects | effects = SpriteEffects.None , |
||
ImageOrientation | orientation = ImageOrientation.AsIs , |
||
float | layerDepth = 0 |
||
) |
Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer.
texture | A texture. |
position | The location (in screen coordinates) to draw the sprite. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
rotation | Specifies the angle (in radians) to rotate the sprite about its center. |
origin | The sprite origin in the texture in pixels (dependent of image orientation). Default value is (0,0) which represents the upper-left corner. |
scale | Scale factor. |
effects | Effects to apply. |
orientation | The source image orientation |
layerDepth | The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. |
Definition at line 221 of file SpriteBatch.cs.
void SiliconStudio.Paradox.Graphics.SpriteBatch.Draw | ( | Texture | texture, |
Vector2 | position, | ||
Color | color, | ||
float | rotation, | ||
Vector2 | origin, | ||
Vector2 | scale, | ||
SpriteEffects | effects = SpriteEffects.None , |
||
ImageOrientation | orientation = ImageOrientation.AsIs , |
||
float | layerDepth = 0 |
||
) |
Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer.
texture | A texture. |
position | The location (in screen coordinates) to draw the sprite. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
rotation | Specifies the angle (in radians) to rotate the sprite about its center. |
origin | The sprite origin in the texture in pixels (dependent of image orientation). Default value is (0,0) which represents the upper-left corner. |
scale | Scale factor. |
effects | Effects to apply. |
orientation | The source image orientation |
layerDepth | The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. |
Definition at line 239 of file SpriteBatch.cs.
void SiliconStudio.Paradox.Graphics.SpriteBatch.Draw | ( | Texture | texture, |
Vector2 | position, | ||
RectangleF? | sourceRectangle, | ||
Color | color | ||
) |
Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, and color.
texture | A texture. |
position | The location (in screen coordinates) to draw the sprite. |
sourceRectangle | A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
Definition at line 252 of file SpriteBatch.cs.
References SiliconStudio.Core.Mathematics.Vector2.X, and SiliconStudio.Core.Mathematics.Vector2.Y.
void SiliconStudio.Paradox.Graphics.SpriteBatch.Draw | ( | Texture | texture, |
Vector2 | position, | ||
RectangleF? | sourceRectangle, | ||
Color | color, | ||
float | rotation, | ||
Vector2 | origin, | ||
float | scale = 1f , |
||
SpriteEffects | effects = SpriteEffects.None , |
||
ImageOrientation | orientation = ImageOrientation.AsIs , |
||
float | layerDepth = 0 |
||
) |
Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer.
texture | A texture. |
position | The location (in screen coordinates) to draw the sprite. |
sourceRectangle | A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
rotation | Specifies the angle (in radians) to rotate the sprite about its center. |
origin | The sprite origin in the texture in pixels (dependent of image orientation). Default value is (0,0) which represents the upper-left corner. |
scale | Scale factor. |
effects | Effects to apply. |
orientation | The source image orientation |
layerDepth | The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. |
Definition at line 271 of file SpriteBatch.cs.
References SiliconStudio.Core.Mathematics.Vector2.X, and SiliconStudio.Core.Mathematics.Vector2.Y.
void SiliconStudio.Paradox.Graphics.SpriteBatch.Draw | ( | Texture | texture, |
Vector2 | position, | ||
RectangleF? | sourceRectangle, | ||
Color | color, | ||
float | rotation, | ||
Vector2 | origin, | ||
Vector2 | scale, | ||
SpriteEffects | effects = SpriteEffects.None , |
||
ImageOrientation | orientation = ImageOrientation.AsIs , |
||
float | layerDepth = 0 |
||
) |
Adds a sprite to a batch of sprites for rendering using the specified texture, position, source rectangle, color, rotation, origin, scale, effects, and layer.
texture | A texture. |
position | The location (in screen coordinates) to draw the sprite. |
sourceRectangle | A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
rotation | Specifies the angle (in radians) to rotate the sprite about its center. |
origin | The sprite origin in the texture in pixels (dependent of image orientation). Default value is (0,0) which represents the upper-left corner. |
scale | Scale factor. |
effects | Effects to apply. |
orientation | The source image orientation |
layerDepth | The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. |
Definition at line 291 of file SpriteBatch.cs.
References SiliconStudio.Core.Mathematics.Vector2.X, and SiliconStudio.Core.Mathematics.Vector2.Y.
void SiliconStudio.Paradox.Graphics.SpriteBatch.DrawString | ( | SpriteFont | spriteFont, |
string | text, | ||
Vector2 | position, | ||
Color | color, | ||
TextAlignment | alignment = TextAlignment.Left |
||
) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, and color.
spriteFont | A font for displaying text. |
text | A text string. |
position | The location (in screen coordinates) to draw the sprite. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
alignment | Describes how to align the text to draw |
Definition at line 349 of file SpriteBatch.cs.
References SiliconStudio.Core.Mathematics.Vector2.One, and SiliconStudio.Core.Mathematics.Vector2.Zero.
void SiliconStudio.Paradox.Graphics.SpriteBatch.DrawString | ( | SpriteFont | spriteFont, |
StringBuilder | text, | ||
Vector2 | position, | ||
Color | color, | ||
TextAlignment | alignment = TextAlignment.Left |
||
) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, and color.
spriteFont | A font for displaying text. |
text | Text string. |
position | The location (in screen coordinates) to draw the sprite. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
alignment | Describes how to align the text to draw |
Definition at line 361 of file SpriteBatch.cs.
References SiliconStudio.Core.Mathematics.Vector2.One, and SiliconStudio.Core.Mathematics.Vector2.Zero.
void SiliconStudio.Paradox.Graphics.SpriteBatch.DrawString | ( | SpriteFont | spriteFont, |
string | text, | ||
float | fontSize, | ||
Vector2 | position, | ||
Color | color, | ||
TextAlignment | alignment = TextAlignment.Left |
||
) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, and color.
spriteFont | A font for displaying text. |
text | A text string. |
fontSize | The font size in pixels (ignored in the case of static fonts) |
position | The location (in screen coordinates) to draw the sprite. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
alignment | Describes how to align the text to draw |
Definition at line 374 of file SpriteBatch.cs.
References SiliconStudio.Core.Mathematics.Vector2.One, and SiliconStudio.Core.Mathematics.Vector2.Zero.
void SiliconStudio.Paradox.Graphics.SpriteBatch.DrawString | ( | SpriteFont | spriteFont, |
StringBuilder | text, | ||
float | fontSize, | ||
Vector2 | position, | ||
Color | color, | ||
TextAlignment | alignment = TextAlignment.Left |
||
) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, and color.
spriteFont | A font for displaying text. |
text | Text string. |
fontSize | The font size in pixels (ignored in the case of static fonts) |
position | The location (in screen coordinates) to draw the sprite. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
alignment | Describes how to align the text to draw |
Definition at line 387 of file SpriteBatch.cs.
References SiliconStudio.Core.Mathematics.Vector2.One, and SiliconStudio.Core.Mathematics.Vector2.Zero.
void SiliconStudio.Paradox.Graphics.SpriteBatch.DrawString | ( | SpriteFont | spriteFont, |
string | text, | ||
Vector2 | position, | ||
Color | color, | ||
float | rotation, | ||
Vector2 | origin, | ||
Vector2 | scale, | ||
SpriteEffects | effects, | ||
float | layerDepth, | ||
TextAlignment | alignment | ||
) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer.
spriteFont | A font for displaying text. |
text | A text string. |
position | The location (in screen coordinates) to draw the sprite. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
rotation | Specifies the angle (in radians) to rotate the sprite about its center. |
origin | The sprite origin in virtual pixels; the default is (0,0) which represents the upper-left corner. |
scale | Scale factor. |
effects | Effects to apply. |
layerDepth | The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. |
alignment | Describes how to align the text to draw |
Definition at line 404 of file SpriteBatch.cs.
void SiliconStudio.Paradox.Graphics.SpriteBatch.DrawString | ( | SpriteFont | spriteFont, |
StringBuilder | text, | ||
Vector2 | position, | ||
Color | color, | ||
float | rotation, | ||
Vector2 | origin, | ||
Vector2 | scale, | ||
SpriteEffects | effects, | ||
float | layerDepth, | ||
TextAlignment | alignment | ||
) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer.
spriteFont | A font for displaying text. |
text | Text string. |
position | The location (in screen coordinates) to draw the sprite. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
rotation | Specifies the angle (in radians) to rotate the sprite about its center. |
origin | The sprite origin in virtual pixels; the default is (0,0) which represents the upper-left corner. |
scale | Scale factor. |
effects | Effects to apply. |
layerDepth | The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. |
alignment | Describes how to align the text to draw |
Definition at line 421 of file SpriteBatch.cs.
void SiliconStudio.Paradox.Graphics.SpriteBatch.DrawString | ( | SpriteFont | spriteFont, |
string | text, | ||
float | fontSize, | ||
Vector2 | position, | ||
Color | color, | ||
float | rotation, | ||
Vector2 | origin, | ||
Vector2 | scale, | ||
SpriteEffects | effects, | ||
float | layerDepth, | ||
TextAlignment | alignment | ||
) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer.
spriteFont | A font for displaying text. |
text | A text string. |
fontSize | The font size in pixels (ignored in the case of static fonts) |
position | The location (in screen coordinates) to draw the sprite. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
rotation | Specifies the angle (in radians) to rotate the sprite about its center. |
origin | The sprite origin in virtual pixels; the default is (0,0) which represents the upper-left corner. |
scale | Scale factor. |
effects | Effects to apply. |
layerDepth | The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. |
alignment | Describes how to align the text to draw |
Definition at line 439 of file SpriteBatch.cs.
void SiliconStudio.Paradox.Graphics.SpriteBatch.DrawString | ( | SpriteFont | spriteFont, |
StringBuilder | text, | ||
float | fontSize, | ||
Vector2 | position, | ||
Color | color, | ||
float | rotation, | ||
Vector2 | origin, | ||
Vector2 | scale, | ||
SpriteEffects | effects, | ||
float | layerDepth, | ||
TextAlignment | alignment | ||
) |
Adds a string to a batch of sprites for rendering using the specified font, text, position, color, rotation, origin, scale, effects and layer.
spriteFont | A font for displaying text. |
text | Text string. |
fontSize | The font size in pixels (ignored in the case of static fonts) |
position | The location (in screen coordinates) to draw the sprite. |
color | The color to tint a sprite. Use Color.White for full color with no tinting. |
rotation | Specifies the angle (in radians) to rotate the sprite about its center. |
origin | The sprite origin in virtual pixels; the default is (0,0) which represents the upper-left corner. |
scale | Scale factor. |
effects | Effects to apply. |
layerDepth | The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing. |
alignment | Describes how to align the text to draw |
Definition at line 457 of file SpriteBatch.cs.
Vector2 SiliconStudio.Paradox.Graphics.SpriteBatch.MeasureString | ( | SpriteFont | spriteFont, |
string | text, | ||
Vector2 | targetSize | ||
) |
Returns the size of the given text in virtual pixels.
spriteFont | The font used to draw the text. |
text | The text to measure. |
targetSize | The size of the target to render in |
ArgumentNullException | The provided sprite font is null. |
Definition at line 306 of file SpriteBatch.cs.
References SiliconStudio.Paradox.Graphics.SpriteFont.Size.
Vector2 SiliconStudio.Paradox.Graphics.SpriteBatch.MeasureString | ( | SpriteFont | spriteFont, |
string | text, | ||
float | fontSize, | ||
Vector2 | targetSize | ||
) |
Returns the size of the given text in virtual pixels.
spriteFont | The font used to draw the text. |
text | The text to measure. |
targetSize | The size of the target to render in |
fontSize | The font size (in pixels) used to draw the text. |
ArgumentNullException | The provided sprite font is null. |
Definition at line 322 of file SpriteBatch.cs.
References SiliconStudio.Core.Mathematics.Vector2.X, and SiliconStudio.Core.Mathematics.Vector2.Y.
|
protectedvirtual |
Reimplemented from SiliconStudio.Paradox.Graphics.BatchBase< TDrawInfo >.
Definition at line 616 of file SpriteBatch.cs.
|
protectedvirtual |
Update the mapped vertex and index buffer values using the provided element info.
elementInfo | The structure containing the information about the element to draw. |
vertexPointer | The pointer to the vertex array buffer to update. |
indexPointer | The pointer to the index array buffer to update. This value is null if the index buffer used is static. |
vexterStartOffset | The offset in the vertex buffer where the vertex of the element starts |
Implements SiliconStudio.Paradox.Graphics.BatchBase< TDrawInfo >.
Definition at line 576 of file SpriteBatch.cs.
References SiliconStudio.Core.Mathematics.MathUtil.ZeroTolerance.
|
getset |
Gets or sets the default depth value used by the SpriteBatch when the VirtualResolution is not set.
More precisely, this value represents the length "farPlane-nearPlane" used by the default projection matrix.
Definition at line 31 of file SpriteBatch.cs.
|
getset |
Gets or sets the virtual resolution used for this SpriteBatch
Definition at line 36 of file SpriteBatch.cs.