Class Renderer
Graphics rendering and batching
Inheritance
Implements
Inherited Members
Namespace: Inferno.Graphics
Assembly: Inferno.Desktop.dll
Syntax
public class Renderer : IDisposable
Constructors
| Improve this Doc View SourceRenderer(GraphicsDevice)
Create a new renderer
Declaration
public Renderer(GraphicsDevice graphicsDevice)
Parameters
Type | Name | Description |
---|---|---|
GraphicsDevice | graphicsDevice | The current graphics device |
Methods
| Improve this Doc View SourceBegin(RenderSortMode, Nullable<Matrix>)
Begin a drawing batch
Declaration
public void Begin(RenderSortMode sortMode = RenderSortMode.Immediate, Matrix? translationMatrix = default(Matrix? ))
Parameters
Type | Name | Description |
---|---|---|
RenderSortMode | sortMode | Batch sort mode |
System.Nullable<Matrix> | translationMatrix | Translation matrix for batch |
Dispose()
Clean the renderer
Declaration
public void Dispose()
Draw(RenderTarget, Rectangle, Color, Boolean)
Draw Render Target
Declaration
public void Draw(RenderTarget target, Rectangle destRectangle, Color color, bool disposeAfterDraw = false)
Parameters
Type | Name | Description |
---|---|---|
RenderTarget | target | Render target |
Rectangle | destRectangle | Destination rectangle |
Color | color | Color modifier |
System.Boolean | disposeAfterDraw | Dispose target after draw |
Draw(RenderTarget, Vector2, Color, Boolean)
Draw Render Target
Declaration
public void Draw(RenderTarget target, Vector2 position, Color color, bool disposeAfterDraw = false)
Parameters
Type | Name | Description |
---|---|---|
RenderTarget | target | Render target |
Vector2 | position | Position |
Color | color | Color modifier |
System.Boolean | disposeAfterDraw | Dispose target after draw |
Draw(Texture2D, Color, Single, Rectangle, Nullable<Rectangle>, Vector2, Double, Boolean)
Draw texture
Declaration
public void Draw(Texture2D texture, Color color, float depth, Rectangle destinationRectangle, Rectangle? sourceRectangle, Vector2 origin, double rotation = 0, bool disposeAfterDraw = false)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | Texture to draw |
Color | color | Color modifier |
System.Single | depth | Depth to draw at |
Rectangle | destinationRectangle | Position and size to draw at |
System.Nullable<Rectangle> | sourceRectangle | Source rectangle |
Vector2 | origin | Origin |
System.Double | rotation | Rotation |
System.Boolean | disposeAfterDraw | Dispose texture after draw |
Draw(Texture2D, Color, Single, Vector2, Nullable<Rectangle>, Vector2, Double, Boolean)
Draw texture
Declaration
public void Draw(Texture2D texture, Color color, float depth, Vector2 position, Rectangle? sourceRectangle, Vector2 origin, double rotation = 0, bool disposeAfterDraw = false)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | Texture to draw |
Color | color | Color modifier |
System.Single | depth | Depth to draw at |
Vector2 | position | Position |
System.Nullable<Rectangle> | sourceRectangle | Source rectangle |
Vector2 | origin | Origin |
System.Double | rotation | Rotation |
System.Boolean | disposeAfterDraw | Dispose texture after draw |
Draw(Texture2D, Vector2)
Draw a texture
Declaration
public void Draw(Texture2D texture, Vector2 position)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | Texture to draw |
Vector2 | position | Position |
Draw(Texture2D, Vector2, Color)
Draw texture
Declaration
public void Draw(Texture2D texture, Vector2 position, Color color)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | Texture to draw |
Vector2 | position | Position |
Color | color | Color modifier |
Draw(Texture2D, Vector2, Color, Single)
Draw texture
Declaration
public void Draw(Texture2D texture, Vector2 position, Color color, float depth)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | Textyre to draw |
Vector2 | position | Position |
Color | color | Color modifier |
System.Single | depth | Depth to draw at |
DrawCircle(Vector2, Int32, Color, Single, Boolean, Int32, Int32)
Draw circle
Declaration
public void DrawCircle(Vector2 position, int radius, Color color, float depth = 0F, bool filled = true, int lineWidth = 1, int circlePrecision = 24)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | Position to draw at |
System.Int32 | radius | Circle radius |
Color | color | Color to draw |
System.Single | depth | Depth to draw at |
System.Boolean | filled | Whether or not it is filled |
System.Int32 | lineWidth | Line width (only affects non filled) |
System.Int32 | circlePrecision | Lines/Points per circle |
DrawLine(Vector2, Vector2, Color, Int32, Single)
Draw a line
Declaration
public void DrawLine(Vector2 a, Vector2 b, Color color, int lineWidth = 1, float depth = 0F)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | a | Point a |
Vector2 | b | Point b |
Color | color | Color of line |
System.Int32 | lineWidth | Line width |
System.Single | depth | Line depth |
DrawLines(Vector2[], Color, Int32, Single)
Draw a line array
Declaration
public void DrawLines(Vector2[] points, Color color, int lineWidth = 1, float depth = 0F)
Parameters
Type | Name | Description |
---|---|---|
Vector2[] | points | Points on the line |
Color | color | Color of line |
System.Int32 | lineWidth | Line width |
System.Single | depth | Depth to draw at |
DrawRectangle(Rectangle, Color, Single, Boolean, Int32)
Draw Rectangle
Declaration
public void DrawRectangle(Rectangle rect, Color color, float depth = 0F, bool filled = true, int lineWidth = 1)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | rect | Rectangle to draw |
Color | color | Color to draw |
System.Single | depth | Depth to draw at |
System.Boolean | filled | Whether or not it is filled |
System.Int32 | lineWidth | Line width (only affects non-filled) |
DrawText(String, Vector2, Font)
Draw text
Declaration
public void DrawText(string text, Vector2 position, Font font)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Text to draw |
Vector2 | position | Position to draw |
Font | font | Font to draw in |
DrawText(String, Vector2, Font, Color, Single)
Draw text
Declaration
public void DrawText(string text, Vector2 position, Font font, Color color, float depth = 0F)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Text to draw |
Vector2 | position | Position to draw |
Font | font | Font to draw in |
Color | color | Text color |
System.Single | depth | Depth to draw at |
DrawText(String, Vector2, Font, Color, Single, Vector2, Double, Boolean)
Draw text
Declaration
public void DrawText(string text, Vector2 position, Font font, Color color, float depth, Vector2 origin, double rotation, bool disposeAfterDraw = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Text to draw |
Vector2 | position | Position to draw |
Font | font | Font to draw in |
Color | color | Text color |
System.Single | depth | Depth to draw at |
Vector2 | origin | Origin of text |
System.Double | rotation | Text Rotation |
System.Boolean | disposeAfterDraw | Dispose font after drawing |
End()
End a drawing batch
Declaration
public void End()