Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    SpriteFromSheet Class

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

    A sprite provider from a SpriteSheet

    System.Object → SpriteFromSheet
    Derived from SpriteFromSheet:

    [DataContract("SpriteFromSheet")]
    [Display("Sprite Group", null)]
    public class SpriteFromSheet : IAnimatableSpriteProvider, ISpriteProvider
    Name Description
    Properties
    CurrentFrame

    Gets or sets the current frame of the animation.

    Sheet

    Gets or sets the Sheet of the provider.

    SpritesCount

    Gets the number of sprites available in the provider.

    Methods
    Create(SpriteSheet, String)

    Creates a new instance of SpriteFromSheet with the specified SpriteSheet. CurrentFrame is initialized according to the specified spriteName.

    GetSprite()

    Get a sprite from the provider.

    | Improve this Doc View Source

    Properties


    CurrentFrame

    Gets or sets the current frame of the animation.

    [DataMember]
    [Display("Default Frame", null)]
    public int CurrentFrame { get; set; }
    Property Value
    Type Description
    System.Int32

    Sheet

    Gets or sets the Sheet of the provider.

    [DataMember]
    public SpriteSheet Sheet { get; set; }
    Property Value
    Type Description
    SpriteSheet

    SpritesCount

    Gets the number of sprites available in the provider.

    public int SpritesCount { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Methods


    Create(SpriteSheet, String)

    Creates a new instance of SpriteFromSheet with the specified SpriteSheet. CurrentFrame is initialized according to the specified spriteName.

    public static SpriteFromSheet Create(SpriteSheet sheet, string spriteName)
    Parameters
    Type Name Description
    SpriteSheet sheet
    System.String spriteName

    The name of the sprite.

    Returns
    Type Description
    SpriteFromSheet
    Remarks

    If two sprites have the provided name then the first sprite found is used.

    Exceptions
    Type Condition
    System.ArgumentNullException

    sheet

    System.Collections.Generic.KeyNotFoundException

    No sprite in the sheet has the given name.


    GetSprite()

    Get a sprite from the provider.

    public Sprite GetSprite()
    Returns
    Type Description
    Sprite

    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