SpriteFromTexture Class
Namespace: Stride.Rendering.SpritesAssembly: Stride.Rendering.dll
[DataContract("SpriteFromTexture")]
[Display("Texture", null)]
public class SpriteFromTexture : ISpriteProvider
| Name | Description | |
|---|---|---|
| Constructors | ||
| SpriteFromTexture() | Creates a new instance of SpriteFromTexture. |
|
| Properties | ||
| Center | The position of the center of the image in pixels. |
|
| 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. |
|
| IsTransparent | Gets or sets the transparency value of the sprite. |
|
| PixelsPerUnit | Gets or sets the value specifying the size of one pixel in scene units |
|
| SpritesCount | Gets the number of sprites available in the provider. |
|
| Texture | Gets or sets the texture of representing the sprite |
|
| Methods | ||
| GetSprite() | Get a sprite from the provider. |
|
| Operators | ||
| Explicit(Sprite to SpriteFromTexture) | ||
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
| Type | Description |
|---|---|
| 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
| Type | Description |
|---|---|
| System.Boolean |
IsTransparent
Gets or sets the transparency value of the sprite.
[DataMember(20)]
public bool IsTransparent { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
PixelsPerUnit
Gets or sets the value specifying the size of one pixel in scene units
[DataMember(8)]
public float PixelsPerUnit { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
SpritesCount
Gets the number of sprites available in the provider.
public int SpritesCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Texture
Gets or sets the texture of representing the sprite
[DataMember(5)]
public Texture Texture { get; set; }
Property Value
| Type | Description |
|---|---|
| Texture |
Methods
GetSprite()
Get a sprite from the provider.
public Sprite GetSprite()
Returns
| Type | Description |
|---|---|
| Sprite |
Operators
Explicit(Sprite to SpriteFromTexture)
public static explicit operator SpriteFromTexture(Sprite sprite)
Parameters
| Type | Name | Description |
|---|---|---|
| Sprite | sprite |
Returns
| Type | Description |
|---|---|
| SpriteFromTexture |