Table of Contents

Class SpriteFromTexture

Namespace
Stride.Rendering.Sprites
Assembly
Stride.Rendering.dll

A Sprite provider from a Texture.

[DataContract("SpriteFromTexture")]
[Display("Texture", null)]
public class SpriteFromTexture : ISpriteProvider
Inheritance
SpriteFromTexture
Implements

Constructors

SpriteFromTexture()

Creates a new instance of SpriteFromTexture.

public SpriteFromTexture()

Properties

Center

The position of the center of the image in pixels.

[DataMember(10)]
public Vector2 Center { get; set; }

Property Value

Vector2

CenterFromMiddle

Gets or sets the value indicating position provided to Center is from the middle of the sprite region or from the left/top corner.

[DataMember(15)]
public bool CenterFromMiddle { get; set; }

Property Value

bool

IsTransparent

Gets or sets the transparency value of the sprite.

[DataMember(20)]
public bool IsTransparent { get; set; }

Property Value

bool

PixelsPerUnit

Gets or sets the value specifying the size of one pixel in scene units

[DataMember(8)]
public float PixelsPerUnit { get; set; }

Property Value

float

SpritesCount

Gets the number of sprites available in the provider.

public int SpritesCount { get; }

Property Value

int

Texture

Gets or sets the texture of representing the sprite

[DataMember(5)]
public Texture Texture { get; set; }

Property Value

Texture

Methods

GetSprite()

Get a sprite from the provider.

public Sprite GetSprite()

Returns

Sprite

Operators

explicit operator SpriteFromTexture(Sprite)

public static explicit operator SpriteFromTexture(Sprite sprite)

Parameters

sprite Sprite

Returns

SpriteFromTexture