Table of Contents

Class TextureCanvasExtensions

Namespace
Stride.CommunityToolkit.Rendering
Assembly
Stride.CommunityToolkit.dll

Provides extension methods for creating instances of TextureCanvas.

public static class TextureCanvasExtensions
Inheritance
TextureCanvasExtensions

Methods

CreateTextureCanvas(IServiceRegistry, Size2?, PixelFormat)

Creates a new instance of TextureCanvas using the specified IServiceRegistry.

public static TextureCanvas CreateTextureCanvas(this IServiceRegistry services, Size2? size, PixelFormat pixelFormat = PixelFormat.R8G8B8A8_UNorm)

Parameters

services IServiceRegistry

The service registry to use for creating the texture canvas.

size Size2?

The size of the texture canvas. If null, a default size will be used.

pixelFormat PixelFormat

The pixel format of the texture canvas. Default is Stride.Graphics.PixelFormat.R8G8B8A8_UNorm.

Returns

TextureCanvas

A new instance of TextureCanvas.

CreateTextureCanvas(IGame, Size2?, PixelFormat)

Creates a new instance of TextureCanvas using the specified IGame.

public static TextureCanvas CreateTextureCanvas(this IGame game, Size2? size, PixelFormat pixelFormat = PixelFormat.R8G8B8A8_UNorm)

Parameters

game IGame

The game instance to use for creating the texture canvas.

size Size2?

The size of the texture canvas. If null, a default size will be used.

pixelFormat PixelFormat

The pixel format of the texture canvas. Default is Stride.Graphics.PixelFormat.R8G8B8A8_UNorm.

Returns

TextureCanvas

A new instance of TextureCanvas.

CreateTextureCanvas(RenderContext, Size2?, PixelFormat)

Creates a new instance of TextureCanvas using the specified RenderContext.

public static TextureCanvas CreateTextureCanvas(this RenderContext renderContext, Size2? size, PixelFormat pixelFormat = PixelFormat.R8G8B8A8_UNorm)

Parameters

renderContext RenderContext

The render context to use for creating the texture canvas.

size Size2?

The size of the texture canvas. If null, a default size will be used.

pixelFormat PixelFormat

The pixel format of the texture canvas. Default is Stride.Graphics.PixelFormat.R8G8B8A8_UNorm.

Returns

TextureCanvas

A new instance of TextureCanvas.