SHVDN  v3
An ASI plugin for Grand Theft Auto V, which allows running scripts written in any .NET language in-game. Developed by crosire https://github.com/crosire/scripthookvdotnet/
GTA.UI.CustomSprite Class Reference

A sprite element using a custom image texture. More...

Inheritance diagram for GTA.UI.CustomSprite:
GTA.UI.ISpriteElement GTA.UI.IElement

Public Member Functions

 CustomSprite (string filename, SizeF size, PointF position)
 Initializes a new instance of the CustomSprite class used for drawing external textures on the screen. More...
 
 CustomSprite (string filename, SizeF size, PointF position, Color color)
 Initializes a new instance of the CustomSprite class used for drawing external textures on the screen. More...
 
 CustomSprite (string filename, SizeF size, PointF position, Color color, float rotation)
 Initializes a new instance of the CustomSprite class used for drawing external textures on the screen. More...
 
 CustomSprite (string filename, SizeF size, PointF position, Color color, float rotation, bool centered)
 Initializes a new instance of the CustomSprite class used for drawing external textures on the screen. More...
 
void Draw ()
 Draws this CustomSprite. More...
 
void Draw (SizeF offset)
 Draws the CustomSprite at the specified offset. More...
 
virtual void ScaledDraw ()
 Draws this CustomSprite using the width returned in Screen.ScaledWidth. More...
 
virtual void ScaledDraw (SizeF offset)
 Draws the CustomSprite at the specified offset using the width returned in Screen.ScaledWidth. More...
 

Properties

bool Enabled [get, set]
 Gets or sets a value indicating whether this CustomSprite will be drawn. More...
 
Color Color [get, set]
 Gets or sets the color of this CustomSprite. More...
 
PointF Position [get, set]
 Gets or sets the position of this CustomSprite. More...
 
SizeF Size [get, set]
 Gets or sets the size to draw the CustomSprite More...
 
float Rotation [get, set]
 Gets or sets the rotation to draw thie CustomSprite. More...
 
bool Centered [get, set]
 Gets or sets a value indicating whether this CustomSprite should be positioned based on its center or top left corner More...
 
- Properties inherited from GTA.UI.ISpriteElement
SizeF Size [get, set]
 Gets or sets the size to draw the ISpriteElement More...
 
float Rotation [get, set]
 Gets or sets the rotation to draw thie ISpriteElement. More...
 
- Properties inherited from GTA.UI.IElement
bool Enabled [get, set]
 Gets or sets a value indicating whether this IElement will be drawn. More...
 
Color Color [get, set]
 Gets or sets the color of this IElement. More...
 
PointF Position [get, set]
 Gets or sets the position of this IElement. More...
 
bool Centered [get, set]
 Gets or sets a value indicating whether this IElement should be positioned based on its center or top left corner More...
 

Detailed Description

A sprite element using a custom image texture.

Constructor & Destructor Documentation

◆ CustomSprite() [1/4]

GTA.UI.CustomSprite.CustomSprite ( string  filename,
SizeF  size,
PointF  position 
)

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

Parameters
filenameFull path to location of the CustomSprite on the disc.
sizeSet the Size of the CustomSprite.
positionSet the Position on screen where to draw the CustomSprite.
Exceptions
FileNotFoundExceptionThrown if the specified file doesn't exist

◆ CustomSprite() [2/4]

GTA.UI.CustomSprite.CustomSprite ( string  filename,
SizeF  size,
PointF  position,
Color  color 
)

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

Parameters
filenameFull path to location of the CustomSprite on the disc.
sizeSet the Size of the CustomSprite.
positionSet the Position on screen where to draw the CustomSprite.
colorSet the Color used to draw the CustomSprite.
Exceptions
FileNotFoundExceptionThrown if the specified file doesn't exist

◆ CustomSprite() [3/4]

GTA.UI.CustomSprite.CustomSprite ( string  filename,
SizeF  size,
PointF  position,
Color  color,
float  rotation 
)

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

Parameters
filenameFull path to location of the CustomSprite on the disc.
sizeSet the Size of the CustomSprite.
positionSet the Position on screen where to draw the CustomSprite.
colorSet the Color used to draw the CustomSprite.
rotationSet the rotation to draw the sprite, measured in degrees, see also
See also
Rotation
.
Exceptions
FileNotFoundExceptionThrown if the specified file doesn't exist

◆ CustomSprite() [4/4]

GTA.UI.CustomSprite.CustomSprite ( string  filename,
SizeF  size,
PointF  position,
Color  color,
float  rotation,
bool  centered 
)

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

Parameters
filenameFull path to location of the CustomSprite on the disc.
sizeSet the Size of the CustomSprite.
positionSet the Position on screen where to draw the CustomSprite.
colorSet the Color used to draw the CustomSprite.
rotationSet the rotation to draw the sprite, measured in degrees, see also
See also
Rotation
.
centeredPosition the CustomSprite based on its center instead of top left corner, see also
See also
Centered
.
Exceptions
FileNotFoundExceptionThrown if the specified file doesn't exist

Member Function Documentation

◆ Draw() [1/2]

void GTA.UI.CustomSprite.Draw ( )

Draws this CustomSprite.

Implements GTA.UI.IElement.

◆ Draw() [2/2]

void GTA.UI.CustomSprite.Draw ( SizeF  offset)

Draws the CustomSprite at the specified offset.

Parameters
offsetThe offset.

Implements GTA.UI.IElement.

◆ ScaledDraw() [1/2]

virtual void GTA.UI.CustomSprite.ScaledDraw ( )
virtual

Draws this CustomSprite using the width returned in Screen.ScaledWidth.

Implements GTA.UI.IElement.

◆ ScaledDraw() [2/2]

virtual void GTA.UI.CustomSprite.ScaledDraw ( SizeF  offset)
virtual

Draws the CustomSprite at the specified offset using the width returned in Screen.ScaledWidth.

Parameters
offsetThe offset.

Implements GTA.UI.IElement.

Property Documentation

◆ Centered

bool GTA.UI.CustomSprite.Centered
getset

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

true if centered; otherwise, false.

◆ Color

Color GTA.UI.CustomSprite.Color
getset

Gets or sets the color of this CustomSprite.

The color.

◆ Enabled

bool GTA.UI.CustomSprite.Enabled
getset

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

true if enabled; otherwise, false.

◆ Position

PointF GTA.UI.CustomSprite.Position
getset

Gets or sets the position of this CustomSprite.

The position scaled on a 1280*720 pixel base.

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

◆ Rotation

float GTA.UI.CustomSprite.Rotation
getset

Gets or sets the rotation to draw thie CustomSprite.

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

◆ Size

SizeF GTA.UI.CustomSprite.Size
getset

Gets or sets the size to draw the CustomSprite

The size on a 1280*720 pixel base

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


The documentation for this class was generated from the following file: