Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    SpriteSheet Class

    Namespace: Stride.Graphics
    Assembly: Stride.Graphics.dll

    A sheet (group) of sprites.

    System.Object → SpriteSheet
    Derived from SpriteSheet:

    [DataContract]
    [DataSerializerGlobal(typeof(ReferenceSerializer<SpriteSheet>), null, DataSerializerGenericMode.None, false, false, Profile = "Content")]
    [ContentSerializer(typeof(DataContentSerializer<SpriteSheet>))]
    public class SpriteSheet
    Name Description
    Properties
    Item[Int32]

    Gets or sets the image of the group at index.

    Item[String]

    Gets or sets the image of the group having the provided name.

    Sprites

    The list of sprites.

    Methods
    FindImageIndex(String)

    Find the index of a sprite in the group using its name.

    | Improve this Doc View Source

    Properties


    Item[Int32]

    Gets or sets the image of the group at index.

    public Sprite this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index

    The image index

    Property Value
    Type Description
    Sprite

    The image


    Item[String]

    Gets or sets the image of the group having the provided name.

    public Sprite this[string name] { get; set; }
    Parameters
    Type Name Description
    System.String name

    The name of the image

    Property Value
    Type Description
    Sprite

    The image


    Sprites

    The list of sprites.

    public List<Sprite> Sprites { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<Sprite>
    | Improve this Doc View Source

    Methods


    FindImageIndex(String)

    Find the index of a sprite in the group using its name.

    public int FindImageIndex(string spriteName)
    Parameters
    Type Name Description
    System.String spriteName

    The name of the sprite

    Returns
    Type Description
    System.Int32

    The index value

    Remarks

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

    Exceptions
    Type Condition
    System.Collections.Generic.KeyNotFoundException

    No sprite in the group have the given name


    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