Search Results for

    Show / Hide Table of Contents

    Class Sprite

    A sprite element using a built-in texture.

    Inheritance
    Object
    Sprite
    Implements
    ISpriteElement
    IElement
    IDisposable
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: GTA.UI
    Assembly: ScriptHookVDotNet3.dll
    Syntax
    public class Sprite : ISpriteElement, IElement, IDisposable

    Constructors

    | Improve this Doc View Source

    Sprite(String, String, SizeF, PointF)

    Initializes a new instance of the Sprite class used for drawing in game textures on the screen.

    Declaration
    public Sprite(string textureDict, string textureName, SizeF size, PointF position)
    Parameters
    Type Name Description
    String textureDict

    The Texture dictionary where the Sprite is stored (the *.ytd file).

    String textureName

    Name of the Sprite inside the Texture dictionary.

    SizeF size

    Set the Size of the Sprite.

    PointF position

    Set the Position on screen where to draw the Sprite.

    | Improve this Doc View Source

    Sprite(String, String, SizeF, PointF, Color)

    Initializes a new instance of the Sprite class used for drawing in game textures on the screen.

    Declaration
    public Sprite(string textureDict, string textureName, SizeF size, PointF position, Color color)
    Parameters
    Type Name Description
    String textureDict

    The Texture dictionary where the Sprite is stored (the *.ytd file).

    String textureName

    Name of the Sprite inside the Texture dictionary.

    SizeF size

    Set the Size of the Sprite.

    PointF position

    Set the Position on screen where to draw the Sprite.

    Color color

    Set the Color used to draw the Sprite.

    | Improve this Doc View Source

    Sprite(String, String, SizeF, PointF, Color, Single)

    Initializes a new instance of the Sprite class used for drawing in game textures on the screen.

    Declaration
    public Sprite(string textureDict, string textureName, SizeF size, PointF position, Color color, float rotation)
    Parameters
    Type Name Description
    String textureDict

    The Texture dictionary where the Sprite is stored (the *.ytd file).

    String textureName

    Name of the Sprite inside the Texture dictionary.

    SizeF size

    Set the Size of the Sprite.

    PointF position

    Set the Position on screen where to draw the Sprite.

    Color color

    Set the Color used to draw the Sprite.

    Single rotation

    Set the rotation to draw the sprite, measured in degrees, see also Rotation.

    | Improve this Doc View Source

    Sprite(String, String, SizeF, PointF, Color, Single, Boolean)

    Initializes a new instance of the Sprite class used for drawing in game textures on the screen.

    Declaration
    public Sprite(string textureDict, string textureName, SizeF size, PointF position, Color color, float rotation, bool centered)
    Parameters
    Type Name Description
    String textureDict

    The Texture dictionary where the Sprite is stored (the *.ytd file).

    String textureName

    Name of the Sprite inside the Texture dictionary.

    SizeF size

    Set the Size of the Sprite.

    PointF position

    Set the Position on screen where to draw the Sprite.

    Color color

    Set the Color used to draw the Sprite.

    Single rotation

    Set the rotation to draw the sprite, measured in degrees, see also Rotation.

    Boolean centered

    Position the Sprite based on its center instead of top left corner, see also Centered.

    Properties

    | Improve this Doc View Source

    Centered

    Gets or sets a value indicating whether this Sprite should be positioned based on its center or top left corner

    Declaration
    public bool Centered { get; set; }
    Property Value
    Type Description
    Boolean

    true if centered; otherwise, false.

    | Improve this Doc View Source

    Color

    Gets or sets the color of this Sprite.

    Declaration
    public Color Color { get; set; }
    Property Value
    Type Description
    Color

    The color.

    | Improve this Doc View Source

    Enabled

    Gets or sets a value indicating whether this Sprite will be drawn.

    Declaration
    public bool Enabled { get; set; }
    Property Value
    Type Description
    Boolean

    true if enabled; otherwise, false.

    | Improve this Doc View Source

    Position

    Gets or sets the position of this Sprite.

    Declaration
    public PointF Position { get; set; }
    Property Value
    Type Description
    PointF

    The position scaled on a 1280*720 pixel base.

    Remarks

    If ScaledDraw is called, the position will be scaled by the width returned in ScaledWidth.

    | Improve this Doc View Source

    Rotation

    Gets or sets the rotation to draw thie Sprite.

    Declaration
    public float Rotation { get; set; }
    Property Value
    Type Description
    Single

    The rotation measured in degrees, clockwise increasing, 0.0 at vertical

    | Improve this Doc View Source

    Size

    Gets or sets the size to draw the Sprite

    Declaration
    public SizeF Size { get; set; }
    Property Value
    Type Description
    SizeF

    The size on a 1280*720 pixel base

    Remarks

    If ScaledDraw is called, the size will be scaled by the width returned in ScaledWidth.

    Methods

    | Improve this Doc View Source

    Dispose()

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing
    | Improve this Doc View Source

    Draw()

    Draws this Sprite.

    Declaration
    public virtual void Draw()
    | Improve this Doc View Source

    Draw(SizeF)

    Draws the Sprite at the specified offset.

    Declaration
    public virtual void Draw(SizeF offset)
    Parameters
    Type Name Description
    SizeF offset

    The offset.

    | Improve this Doc View Source

    ScaledDraw()

    Draws this Sprite using the width returned in ScaledWidth.

    Declaration
    public virtual void ScaledDraw()
    | Improve this Doc View Source

    ScaledDraw(SizeF)

    Draws the Sprite at the specified offset using the width returned in ScaledWidth.

    Declaration
    public virtual void ScaledDraw(SizeF offset)
    Parameters
    Type Name Description
    SizeF offset

    The offset.

    Implements

    ISpriteElement
    IElement
    System.IDisposable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX