Search Results for

    Show / Hide Table of Contents

    Class SpriteHandle

    Handle to sprite atlas slot with a single sprite texture.

    Inheritance
    System.Object
    SpriteHandle
    Implements
    System.IEquatable<SpriteHandle>
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public sealed class SpriteHandle : ValueType, IEquatable<SpriteHandle>

    Constructors

    SpriteHandle(SpriteAtlas, Int32)

    Initializes a new instance of the Sprite struct.

    Declaration
    public SpriteHandle(SpriteAtlas atlas, int index)
    Parameters
    SpriteAtlas atlas

    The atlas.

    System.Int32 index

    The index.

    Fields

    Atlas

    The parent atlas.

    Declaration
    public SpriteAtlas Atlas
    Field Value
    SpriteAtlas

    Index

    The atlas sprites array index.

    Declaration
    public int Index
    Field Value
    System.Int32

    Invalid

    Invalid sprite handle.

    Declaration
    public static SpriteHandle Invalid
    Field Value
    SpriteHandle

    Properties

    Area

    Gets or sets the sprite area in atlas (in normalized atlas coordinates [0;1]).

    Declaration
    [NoSerialize]
    public Rectangle Area { get; set; }
    Property Value
    Rectangle

    Default

    The default SpriteHandle.

    Declaration
    public static SpriteHandle Default { get; }
    Property Value
    SpriteHandle

    IsValid

    Returns true if sprite is valid.

    Declaration
    public bool IsValid { get; }
    Property Value
    System.Boolean

    Location

    Gets or sets the sprite location (in pixels).

    Declaration
    [NoSerialize]
    public Float2 Location { get; set; }
    Property Value
    Float2

    Name

    Gets or sets the sprite name.

    Declaration
    [NoSerialize]
    public string Name { get; set; }
    Property Value
    System.String

    Size

    Gets or sets the sprite size (in pixels).

    Declaration
    [NoSerialize]
    public Float2 Size { get; set; }
    Property Value
    Float2

    Methods

    Equals(SpriteHandle)

    Declaration
    public bool Equals(SpriteHandle other)
    Parameters
    SpriteHandle other

    Returns
    System.Boolean

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    System.Object obj

    Returns
    System.Boolean

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    System.Int32

    ToString()

    Declaration
    public override string ToString()
    Returns
    System.String

    Operators

    Equality(SpriteHandle, SpriteHandle)

    Tests for equality between two objects.

    Declaration
    public static bool operator ==(SpriteHandle left, SpriteHandle right)
    Parameters
    SpriteHandle left

    The first value to compare.

    SpriteHandle right

    The second value to compare.

    Returns
    System.Boolean

    true if left has the same value as right; otherwise, false.

    Inequality(SpriteHandle, SpriteHandle)

    Tests for inequality between two objects.

    Declaration
    public static bool operator !=(SpriteHandle left, SpriteHandle right)
    Parameters
    SpriteHandle left

    The first value to compare.

    SpriteHandle right

    The second value to compare.

    Returns
    System.Boolean

    true if left has a different value than right; otherwise, false.

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat