Skip to content

SDL3Renderer.DrawTexture Method

Definition

Namespace: Brine2D.Rendering

Overloads
DrawTexture(ITexture, float, float) Draw texture at position (float x, y, top-left anchor).
DrawTexture(ITexture, float, float, float, float) Draw texture at position with explicit width/height (top-left anchor).
DrawTexture(ITexture, Vector2) Draw texture at position (Vector2, top-left anchor).
DrawTexture(ITexture, Vector2, Nullable<Rectangle>, Nullable<Vector2>, float, Nullable<Vector2>, Nullable<Color>, SpriteFlip) Draw a texture with full control over transform, origin, scale, and flip.

SDL3Renderer.DrawTexture(ITexture, float, float) Method

Draw texture at position (float x, y, top-left anchor).

public void DrawTexture(Brine2D.Rendering.ITexture texture, float x, float y);

Parameters

texture ITexture

x System.Single

y System.Single

Implements DrawTexture(ITexture, float, float)

SDL3Renderer.DrawTexture(ITexture, float, float, float, float) Method

Draw texture at position with explicit width/height (top-left anchor).

public void DrawTexture(Brine2D.Rendering.ITexture texture, float x, float y, float width, float height);

Parameters

texture ITexture

x System.Single

y System.Single

width System.Single

height System.Single

Implements DrawTexture(ITexture, float, float, float, float)

SDL3Renderer.DrawTexture(ITexture, Vector2) Method

Draw texture at position (Vector2, top-left anchor).

public void DrawTexture(Brine2D.Rendering.ITexture texture, System.Numerics.Vector2 position);

Parameters

texture ITexture

position System.Numerics.Vector2

Implements DrawTexture(ITexture, Vector2)

SDL3Renderer.DrawTexture(ITexture, Vector2, Nullable\<Rectangle>, Nullable\<Vector2>, float, Nullable\<Vector2>, Nullable\<Color>, SpriteFlip) Method

Draw a texture with full control over transform, origin, scale, and flip.

public void DrawTexture(Brine2D.Rendering.ITexture texture, System.Numerics.Vector2 position, System.Nullable<Brine2D.Core.Rectangle> sourceRect=null, System.Nullable<System.Numerics.Vector2> origin=null, float rotation=0f, System.Nullable<System.Numerics.Vector2> scale=null, System.Nullable<Brine2D.Core.Color> color=null, Brine2D.Rendering.SpriteFlip flip=Brine2D.Rendering.SpriteFlip.None);

Parameters

texture ITexture

The texture to draw.

position System.Numerics.Vector2

Position in world/screen space.

sourceRect System.Nullable<Rectangle>

Source rectangle (null = entire texture).

origin System.Nullable<System.Numerics.Vector2>

Rotation/scale origin (0-1 normalized, 0.5,0.5 = center, 0,0 = top-left). Defaults to center.

rotation System.Single

Rotation angle in radians.

scale System.Nullable<System.Numerics.Vector2>

Scale multiplier (null = no scaling).

color System.Nullable<Color>

Tint color (null = white).

flip SpriteFlip

Sprite flip flags.

Implements DrawTexture(ITexture, Vector2, Nullable<Rectangle>, Nullable<Vector2>, float, Nullable<Vector2>, Nullable<Color>, SpriteFlip)