Skip to main content
Version: 1.0.0-preview.34

Velaptor.Graphics.Renderers.ITextureRenderer

Velaptor

Velaptor.Graphics.Renderers

ITextureRenderer Interface

Renders textures to the screen.

public interface ITextureRenderer

Methods

Render(ITexture, int, int, float, int)

Renders the given texture at the given x and y coordinates and the given angle.

void Render(Velaptor.Content.ITexture texture, int x, int y, float angle, int layer=0);

Parameters

texture ITexture

The texture to render.

x System.Int32

The X location of the texture.

y System.Int32

The Y location of the texture.

angle System.Single

The angle of rotation in degrees of the rendering.

layer System.Int32

The layer to render the texture.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

The x and y position are based on the center of the texture.

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:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

Render(ITexture, int, int, int)

Renders the given texture at the given x and y coordinates.

void Render(Velaptor.Content.ITexture texture, int x, int y, int layer=0);

Parameters

texture ITexture

The texture to render.

x System.Int32

The X location of the texture.

y System.Int32

The Y location of the texture.

layer System.Int32

The layer to render the texture.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

The x and y position are based on the center of the texture.

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:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

Render(ITexture, int, int, Color, int)

Renders the given texture at the given x and y coordinates.

void Render(Velaptor.Content.ITexture texture, int x, int y, System.Drawing.Color color, int layer=0);

Parameters

texture ITexture

The texture to render.

x System.Int32

The X location of the texture.

y System.Int32

The Y location of the texture.

color System.Drawing.Color

The color to apply to the texture.

layer System.Int32

The layer to render the texture.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

The x and y position is based on the center of the texture.

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:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

Render(ITexture, int, int, Color, RenderEffects, int)

Renders the given texture at the given x and y coordinates.

void Render(Velaptor.Content.ITexture texture, int x, int y, System.Drawing.Color color, Velaptor.Graphics.RenderEffects effects, int layer=0);

Parameters

texture ITexture

The texture to render.

x System.Int32

The X location of the texture.

y System.Int32

The Y location of the texture.

color System.Drawing.Color

The color to apply to the texture.

effects RenderEffects

The rendering effects to apply to the texture when rendering.

layer System.Int32

The layer to render the texture.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

The x and y position is based on the center of the texture.

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:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

Render(ITexture, int, int, RenderEffects, int)

Renders the given texture at the given x and y coordinates.

void Render(Velaptor.Content.ITexture texture, int x, int y, Velaptor.Graphics.RenderEffects effects, int layer=0);

Parameters

texture ITexture

The texture to render.

x System.Int32

The X location of the texture.

y System.Int32

The Y location of the texture.

effects RenderEffects

The rendering effects to apply to the texture when rendering.

layer System.Int32

The layer to render the texture.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

The x and y position is based on the center of the texture.

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:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

Render(ITexture, Rectangle, Rectangle, float, float, Color, RenderEffects, int)

Renders the given Texture using the given parameters.

void Render(Velaptor.Content.ITexture texture, System.Drawing.Rectangle srcRect, System.Drawing.Rectangle destRect, float size, float angle, System.Drawing.Color color, Velaptor.Graphics.RenderEffects effects, int layer=0);

Parameters

texture ITexture

The texture to render.

srcRect System.Drawing.Rectangle

The rectangle of the sub texture within the texture to render.

destRect System.Drawing.Rectangle

The destination rectangle of rendering.

size System.Single

The size to render the texture. 1 is for 100%/normal size.

angle System.Single

The angle of rotation in degrees of the rendering.

color System.Drawing.Color

The color to apply to the rendering.

effects RenderEffects

The rendering effects to apply to the texture when rendering.

layer System.Int32

The layer to render the texture.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

The position in the destRect is based on the center of the texture.

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:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

Render(ITexture, Vector2, float, int)

Renders the given texture at the given pos coordinates and the given angle.

void Render(Velaptor.Content.ITexture texture, System.Numerics.Vector2 pos, float angle, int layer=0);

Parameters

texture ITexture

The texture to render.

pos System.Numerics.Vector2

The location of the texture.

angle System.Single

The angle of rotation in degrees of the rendering.

layer System.Int32

The layer to render the texture.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

The pos position are based on the center of the texture.

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:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

Render(ITexture, Vector2, int)

Renders the given texture at the given pos coordinates.

void Render(Velaptor.Content.ITexture texture, System.Numerics.Vector2 pos, int layer=0);

Parameters

texture ITexture

The texture to render.

pos System.Numerics.Vector2

The location of the texture.

layer System.Int32

The layer to render the texture.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

The pos position are based on the center of the texture.

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:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

Render(ITexture, Vector2, Color, int)

Renders the given texture at the given pos coordinates.

void Render(Velaptor.Content.ITexture texture, System.Numerics.Vector2 pos, System.Drawing.Color color, int layer=0);

Parameters

texture ITexture

The texture to render.

pos System.Numerics.Vector2

The location of the texture.

color System.Drawing.Color

The color to apply to the texture.

layer System.Int32

The layer to render the texture.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

The pos position are based on the center of the texture.

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:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

Render(ITexture, Vector2, Color, RenderEffects, int)

Renders the given texture at the given pos coordinates.

void Render(Velaptor.Content.ITexture texture, System.Numerics.Vector2 pos, System.Drawing.Color color, Velaptor.Graphics.RenderEffects effects, int layer=0);

Parameters

texture ITexture

The texture to render.

pos System.Numerics.Vector2

The location of the texture.

color System.Drawing.Color

The color to apply to the texture.

effects RenderEffects

The rendering effects to apply to the texture when rendering.

layer System.Int32

The layer to render the texture.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

The pos position are based on the center of the texture.

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:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

Render(ITexture, Vector2, RenderEffects, int)

Renders the given texture at the given pos coordinates.

void Render(Velaptor.Content.ITexture texture, System.Numerics.Vector2 pos, Velaptor.Graphics.RenderEffects effects, int layer=0);

Parameters

texture ITexture

The texture to render.

pos System.Numerics.Vector2

The location of the texture.

effects RenderEffects

The rendering effects to apply to the texture when rendering.

layer System.Int32

The layer to render the texture.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

The pos position are based on the center of the texture.

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:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5