Search Results for

    Show / Hide Table of Contents

    Class CustomSprite

    A sprite element using a custom image texture.

    Inheritance
    Object
    CustomSprite
    Implements
    ISpriteElement
    IElement
    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 CustomSprite : ISpriteElement, IElement

    Constructors

    | Improve this Doc View Source

    CustomSprite(String, SizeF, PointF)

    Initializes a new instance of the CustomSprite class used for drawing external textures on the screen.

    Declaration
    public CustomSprite(string filename, SizeF size, PointF position)
    Parameters
    Type Name Description
    String filename

    Full path to location of the CustomSprite on the disc.

    SizeF size

    Set the Size of the CustomSprite.

    PointF position

    Set the Position on screen where to draw the CustomSprite.

    Exceptions
    Type Condition
    FileNotFoundException

    Thrown if the specified file doesn't exist

    | Improve this Doc View Source

    CustomSprite(String, SizeF, PointF, Color)

    Initializes a new instance of the CustomSprite class used for drawing external textures on the screen.

    Declaration
    public CustomSprite(string filename, SizeF size, PointF position, Color color)
    Parameters
    Type Name Description
    String filename

    Full path to location of the CustomSprite on the disc.

    SizeF size

    Set the Size of the CustomSprite.

    PointF position

    Set the Position on screen where to draw the CustomSprite.

    Color color

    Set the Color used to draw the CustomSprite.

    Exceptions
    Type Condition
    FileNotFoundException

    Thrown if the specified file doesn't exist

    | Improve this Doc View Source

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

    Initializes a new instance of the CustomSprite class used for drawing external textures on the screen.

    Declaration
    public CustomSprite(string filename, SizeF size, PointF position, Color color, float rotation)
    Parameters
    Type Name Description
    String filename

    Full path to location of the CustomSprite on the disc.

    SizeF size

    Set the Size of the CustomSprite.

    PointF position

    Set the Position on screen where to draw the CustomSprite.

    Color color

    Set the Color used to draw the CustomSprite.

    Single rotation

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

    Exceptions
    Type Condition
    FileNotFoundException

    Thrown if the specified file doesn't exist

    | Improve this Doc View Source

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

    Initializes a new instance of the CustomSprite class used for drawing external textures on the screen.

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

    Full path to location of the CustomSprite on the disc.

    SizeF size

    Set the Size of the CustomSprite.

    PointF position

    Set the Position on screen where to draw the CustomSprite.

    Color color

    Set the Color used to draw the CustomSprite.

    Single rotation

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

    Boolean centered

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

    Exceptions
    Type Condition
    FileNotFoundException

    Thrown if the specified file doesn't exist

    Properties

    | Improve this Doc View Source

    Centered

    Gets or sets a value indicating whether this CustomSprite 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 CustomSprite.

    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 CustomSprite 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 CustomSprite.

    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 CustomSprite.

    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 CustomSprite

    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

    Draw()

    Draws this CustomSprite.

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

    Draw(SizeF)

    Draws the CustomSprite at the specified offset.

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

    The offset.

    | Improve this Doc View Source

    ScaledDraw()

    Draws this CustomSprite using the width returned in ScaledWidth.

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

    ScaledDraw(SizeF)

    Draws the CustomSprite 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
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX