Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    SpriteFromTexture Class

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

    A Sprite provider from a Texture.

    System.Object → SpriteFromTexture
    Derived from SpriteFromTexture:

    [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)
    | Improve this Doc View Source

    Constructors


    SpriteFromTexture()

    Creates a new instance of SpriteFromTexture.

    public SpriteFromTexture()
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    Methods


    GetSprite()

    Get a sprite from the provider.

    public Sprite GetSprite()
    Returns
    Type Description
    Sprite
    | Improve this Doc View Source

    Operators


    Explicit(Sprite to SpriteFromTexture)

    public static explicit operator SpriteFromTexture(Sprite sprite)
    Parameters
    Type Name Description
    Sprite sprite
    Returns
    Type Description
    SpriteFromTexture

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation