Velaptor.Graphics.Renderers.IShapeRenderer
Velaptor
Velaptor.Graphics.Renderers
IShapeRenderer Interface
Renders rectangles to the screen.
public interface IShapeRenderer : System.IDisposable
Implements System.IDisposable
Methods
Render(CircleShape, int)
Renders the given circle.
void Render(Velaptor.Graphics.CircleShape circle, int layer=0);
Parameters
circle CircleShape
The circle to render.
layer System.Int32
The layer to render the circle.
Exceptions
System.Exception
Thrown if the IBatcher.Begin method has not been called.
Remarks
Lower layer values will render before higher layer values. If two separate textures have the same layer value, they will render in the order that the method was invoked.
Example below:<b>Render Method Invoked Order:</b>
- Texture 1 (Layer -10)
- Texture 2 (Layer -20)
- Texture 3 (Layer 0)
- Texture 4 (Layer 0)
- Texture 5 (Layer 4)
- Texture 6 (Layer 3) <b>Texture Render Order:</b>
- Texture 2
- Texture 1
- Texture 3
- Texture 4
- Texture 6
- Texture 5
Render(Line, int)
Renders the given line.
void Render(Velaptor.Graphics.Line line, int layer=0);
Parameters
line Line
The line to render.
layer System.Int32
The layer to render the line.
Exceptions
System.Exception
Thrown if the IBatcher.Begin method has not been called.
Remarks
Lower layer values will render before higher layer values. If two separate textures have the same layer value, they will render in the order that the method was invoked.
Example below:<b>Render Method Invoked Order:</b>
- Texture 1 (Layer -10)
- Texture 2 (Layer -20)
- Texture 3 (Layer 0)
- Texture 4 (Layer 0)
- Texture 5 (Layer 4)
- Texture 6 (Layer 3) <b>Texture Render Order:</b>
- Texture 2
- Texture 1
- Texture 3
- Texture 4
- Texture 6
- Texture 5
Render(RectShape, int)
Renders the given rect.
void Render(Velaptor.Graphics.RectShape rect, int layer=0);
Parameters
rect RectShape
The rectangle to render.
layer System.Int32
The layer to render the rectangle.
Exceptions
System.Exception
Thrown if the IBatcher.Begin method has not been called.
Remarks
Lower layer values will render before higher layer values. If two separate textures have the same layer value, they will render in the order that the method was invoked.
Example below:<b>Render Method Invoked Order:</b>
- Texture 1 (Layer -10)
- Texture 2 (Layer -20)
- Texture 3 (Layer 0)
- Texture 4 (Layer 0)
- Texture 5 (Layer 4)
- Texture 6 (Layer 3) <b>Texture Render Order:</b>
- Texture 2
- Texture 1
- Texture 3
- Texture 4
- Texture 6
- Texture 5
RenderLine(Vector2, Vector2, int)
Renders a line using the given start and end vectors on the given layer.
void RenderLine(System.Numerics.Vector2 start, System.Numerics.Vector2 end, int layer=0);
Parameters
start System.Numerics.Vector2
The start of the line.
The end of the line.
layer System.Int32
The layer to render the line.
Exceptions
System.Exception
Thrown if the IBatcher.Begin method has not been called.
Remarks
Lower layer values will render before higher layer values. If two separate textures have the same layer value, they will render in the order that the method was invoked.
Example below:<b>Render Method Invoked Order:</b>
- Texture 1 (Layer -10)
- Texture 2 (Layer -20)
- Texture 3 (Layer 0)
- Texture 4 (Layer 0)
- Texture 5 (Layer 4)
- Texture 6 (Layer 3) <b>Texture Render Order:</b>
- Texture 2
- Texture 1
- Texture 3
- Texture 4
- Texture 6
- Texture 5
RenderLine(Vector2, Vector2, Color, int)
Renders a line using the given start and end vectors on the given layer using the given color.
void RenderLine(System.Numerics.Vector2 start, System.Numerics.Vector2 end, System.Drawing.Color color, int layer=0);
Parameters
start System.Numerics.Vector2
The start of the line.
The end of the line.
color System.Drawing.Color
The color of the line.
layer System.Int32
The layer to render the line.
Exceptions
System.Exception
Thrown if the IBatcher.Begin method has not been called.
Remarks
Lower layer values will render before higher layer values. If two separate textures have the same layer value, they will render in the order that the method was invoked.
Example below:<b>Render Method Invoked Order:</b>
- Texture 1 (Layer -10)
- Texture 2 (Layer -20)
- Texture 3 (Layer 0)
- Texture 4 (Layer 0)
- Texture 5 (Layer 4)
- Texture 6 (Layer 3) <b>Texture Render Order:</b>
- Texture 2
- Texture 1
- Texture 3
- Texture 4
- Texture 6
- Texture 5
RenderLine(Vector2, Vector2, Color, uint, int)
Renders a line using the given start and end vectors on the given layer using the given color and line thickness.
void RenderLine(System.Numerics.Vector2 start, System.Numerics.Vector2 end, System.Drawing.Color color, uint thickness, int layer=0);
Parameters
start System.Numerics.Vector2
The start of the line.
The end of the line.
color System.Drawing.Color
The color of the line.
thickness System.UInt32
The thickness of the line.
layer System.Int32
The layer to render the line.
Exceptions
System.Exception
Thrown if the IBatcher.Begin method has not been called.
Remarks
Lower layer values will render before higher layer values. If two separate textures have the same layer value, they will render in the order that the method was invoked.
Example below:<b>Render Method Invoked Order:</b>
- Texture 1 (Layer -10)
- Texture 2 (Layer -20)
- Texture 3 (Layer 0)
- Texture 4 (Layer 0)
- Texture 5 (Layer 4)
- Texture 6 (Layer 3) <b>Texture Render Order:</b>
- Texture 2
- Texture 1
- Texture 3
- Texture 4
- Texture 6
- Texture 5
RenderLine(Vector2, Vector2, uint, int)
Renders a line using the given start and end vectors on the given layer using the given line thickness.
void RenderLine(System.Numerics.Vector2 start, System.Numerics.Vector2 end, uint thickness, int layer=0);
Parameters
start System.Numerics.Vector2
The start of the line.
The end of the line.
thickness System.UInt32
The thickness of the line.
layer System.Int32
The layer to render the line.
Exceptions
System.Exception
Thrown if the IBatcher.Begin method has not been called.
Remarks
Lower layer values will render before higher layer values. If two separate textures have the same layer value, they will render in the order that the method was invoked.
Example below:<b>Render Method Invoked Order:</b>
- Texture 1 (Layer -10)
- Texture 2 (Layer -20)
- Texture 3 (Layer 0)
- Texture 4 (Layer 0)
- Texture 5 (Layer 4)
- Texture 6 (Layer 3) <b>Texture Render Order:</b>
- Texture 2
- Texture 1
- Texture 3
- Texture 4
- Texture 6
- Texture 5