IRendererService
Namespace: MonineEngine.Core
The interface for the RendererService.
public interface IRendererService : IService, System.IDisposable
Implements IService, IDisposable
Attributes NullableContextAttribute
Methods
SetSpriteBatch(SpriteBatch)
Sets the assigned to the renderer.
void SetSpriteBatch(SpriteBatch spriteBatch)
Parameters
spriteBatch SpriteBatch
The SpriteBatch to assign to the renderer.
GetSpriteBatch()
Gets the currently assigned to the renderer.
SpriteBatch GetSpriteBatch()
Returns
SpriteBatch
The SpriteBatch currently assigned to the renderer.
Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, Nullable<Matrix>)
Begins the rendering process of the current batch.
void Begin(SpriteSortMode sortMode, BlendState blendState, SamplerState samplerState, DepthStencilState depthStencilState, RasterizerState rasterizerState, Effect effect, Nullable<Matrix> transformMatrix)
Parameters
sortMode SpriteSortMode
Specifies the order method for rendering sprites. Defaults to if unspecified.
blendState BlendState
The to use for rendering.
samplerState SamplerState
The to use for rendering.
depthStencilState DepthStencilState
The to use for rendering.
rasterizerState RasterizerState
The to use for rendering.
effect Effect
If not null, overrides the default sprite when rendering.
transformMatrix Nullable<Matrix>
A to transform render geometry.
Draw(Texture2D, Vector2, Color)
Draws a texture to the screen, with the given properties.
void Draw(Texture2D texture, Vector2 position, Color color)
Parameters
texture Texture2D
The texture to draw.
position Vector2
The position to place the texture, relative to the upper-left corner of the screen.
color Color
The colour mask to apply. Acts as a tint. White is the default, and applies no extra tint.
Draw(Texture2D, Vector2, Color, Single, Vector2, Single)
Draws a texture to the screen, with the given properties.
void Draw(Texture2D texture, Vector2 position, Color color, float rotation, Vector2 scale, float layerDepth)
Parameters
texture Texture2D
The texture to draw.
position Vector2
The position to place the texture, relative to the upper-left corner of the screen.
color Color
The colour mask to apply. Acts as a tint. White is the default, and applies no extra tint.
rotation Single
The rotation of the sprite in degrees (0-360).
scale Vector2
Scaling of the sprite.
layerDepth Single
Depth of the layer for the sprite.
Draw(Texture2D, Vector2, Color, Single, Single, Single)
Draws a texture to the screen, with the given properties.
void Draw(Texture2D texture, Vector2 position, Color color, float rotation, float scale, float layerDepth)
Parameters
texture Texture2D
The texture to draw.
position Vector2
The position to place the texture, relative to the upper-left corner of the screen.
color Color
The colour mask to apply. Acts as a tint. White is the default, and applies no extra tint.
rotation Single
The rotation of the sprite in degrees (0-360).
scale Single
Scaling of the sprite.
layerDepth Single
Depth of the layer for the sprite.
Draw(Texture2D, Vector2, Nullable<Rectangle>, Color, Single, Vector2, Single, SpriteEffects, Single)
Draws a texture to the screen, with the given properties.
void Draw(Texture2D texture, Vector2 position, Nullable<Rectangle> sourceRectangle, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth)
Parameters
texture Texture2D
The texture to draw.
position Vector2
The position to place the texture, relative to the upper-left corner of the screen.
sourceRectangle Nullable<Rectangle>
An optional region on the texture to render. If null, draws the full texture.
color Color
The colour mask to apply. Acts as a tint. White is the default, and applies no extra tint.
rotation Single
The rotation of the sprite in degrees (0-360).
origin Vector2
The center of the sprite. This affects offset and rotation.
scale Single
Scaling of the sprite.
effects SpriteEffects
Modifiers for drawing. Can be combined.
layerDepth Single
Depth of the layer for the sprite.
Remarks:
This method is much more advanced compared to . You won't need to call this method yourself in most cases, and other drawing-related classes will handle it for you.
Draw(Texture2D, Vector2, Nullable<Rectangle>, Color, Single, Vector2, Vector2, SpriteEffects, Single)
Draws a texture to the screen, with the given properties.
void Draw(Texture2D texture, Vector2 position, Nullable<Rectangle> sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth)
Parameters
texture Texture2D
The texture to draw.
position Vector2
The position to place the texture, relative to the upper-left corner of the screen.
sourceRectangle Nullable<Rectangle>
An optional region on the texture to render. If null, draws the full texture.
color Color
The colour mask to apply. Acts as a tint. White is the default, and applies no extra tint.
rotation Single
The rotation of the sprite in degrees (0-360).
origin Vector2
The center of the sprite. This affects offset and rotation.
scale Vector2
Scaling of the sprite.
effects SpriteEffects
Modifiers for drawing. Can be combined.
layerDepth Single
Depth of the layer for the sprite.
Remarks:
This method is much more advanced compared to . You won't need to call this method yourself in most cases, and other drawing-related classes will handle it for you.
DrawString(SpriteFont, String, Vector2, Color)
Draws a string of text to the screen, with the given properties.
void DrawString(SpriteFont spriteFont, string text, Vector2 position, Color color)
Parameters
spriteFont SpriteFont
The font to draw the text in.
text String
The text to draw.
position Vector2
The position to place the text, relative to the upper-left corner of the screen.
color Color
The colour mask to apply. Acts as a tint. White is the default, and applies no extra tint.
DrawString(SpriteFont, String, Vector2, Color, Single, Vector2, Single)
Draws a string of text to the screen, with the given properties.
void DrawString(SpriteFont spriteFont, string text, Vector2 position, Color color, float rotation, Vector2 scale, float layerDepth)
Parameters
spriteFont SpriteFont
The font to draw the text in.
text String
The text to draw.
position Vector2
The position to place the text, relative to the upper-left corner of the screen.
color Color
The colour mask to apply. Acts as a tint. White is the default, and applies no extra tint.
rotation Single
The rotation of the string in degrees.
scale Vector2
Scaling of the text.
layerDepth Single
Depth of the layer for the text.
DrawString(SpriteFont, String, Vector2, Color, Single, Single, Single)
Draws a string of text to the screen, with the given properties.
void DrawString(SpriteFont spriteFont, string text, Vector2 position, Color color, float rotation, float scale, float layerDepth)
Parameters
spriteFont SpriteFont
The font to draw the text in.
text String
The text to draw.
position Vector2
The position to place the text, relative to the upper-left corner of the screen.
color Color
The colour mask to apply. Acts as a tint. White is the default, and applies no extra tint.
rotation Single
The rotation of the string in degrees.
scale Single
Scaling of the text.
layerDepth Single
Depth of the layer for the text.
DrawString(SpriteFont, String, Vector2, Color, Single, Vector2, Single, SpriteEffects, Single, Boolean)
Draws a string of text to the screen, with the given properties.
void DrawString(SpriteFont spriteFont, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth, bool rtl)
Parameters
spriteFont SpriteFont
The font to draw the text in.
text String
The text to draw.
position Vector2
The position to place the text, relative to the upper-left corner of the screen.
color Color
The colour mask to apply. Acts as a tint. White is the default, and applies no extra tint.
rotation Single
The rotation of the string in degrees (0-360).
origin Vector2
The center of the text. This affects offset and rotation.
scale Single
Scaling of the text.
effects SpriteEffects
Modifiers for drawing. Can be combined.
layerDepth Single
Depth of the layer for the text.
rtl Boolean
If true, text draws right-to-left, rather than left-to-right.
Remarks:
This method is much more advanced compared to IRendererService.DrawString(SpriteFont, String, Vector2, Color). You won't need to call this method yourself in most cases, and other drawing-related classes will handle it for you.
DrawString(SpriteFont, String, Vector2, Color, Single, Vector2, Vector2, SpriteEffects, Single, Boolean)
Draws a string of text to the screen, with the given properties.
void DrawString(SpriteFont spriteFont, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth, bool rtl)
Parameters
spriteFont SpriteFont
The font to draw the text in.
text String
The text to draw.
position Vector2
The position to place the text, relative to the upper-left corner of the screen.
color Color
The colour mask to apply. Acts as a tint. White is the default, and applies no extra tint.
rotation Single
The rotation of the string in degrees (0-360).
origin Vector2
The center of the text. This affects offset and rotation.
scale Vector2
Scaling of the text.
effects SpriteEffects
Modifiers for drawing. Can be combined.
layerDepth Single
Depth of the layer for the text.
rtl Boolean
If true, text draws right-to-left, rather than left-to-right.
Remarks:
This method is much more advanced compared to IRendererService.DrawString(SpriteFont, String, Vector2, Color). You won't need to call this method yourself in most cases, and other drawing-related classes will handle it for you.
End()
Ends the rendering process of the current , and submits the batch for drawing to the window.
void End()