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.Sprite Class Reference

A sprite element using a built-in texture. More...

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

Public Member Functions

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

Protected Member Functions

virtual void Dispose (bool disposing)
 

Properties

bool Enabled [get, set]
 Gets or sets a value indicating whether this Sprite will be drawn. More...
 
Color Color [get, set]
 Gets or sets the color of this Sprite. More...
 
PointF Position [get, set]
 Gets or sets the position of this Sprite. More...
 
SizeF Size [get, set]
 Gets or sets the size to draw the Sprite More...
 
float Rotation [get, set]
 Gets or sets the rotation to draw thie Sprite. More...
 
bool Centered [get, set]
 Gets or sets a value indicating whether this Sprite 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 built-in texture.

Constructor & Destructor Documentation

◆ Sprite() [1/4]

GTA.UI.Sprite.Sprite ( string  textureDict,
string  textureName,
SizeF  size,
PointF  position 
)

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

Parameters
textureDictThe Texture dictionary where the Sprite is stored (the *.ytd file).
textureNameName of the Sprite inside the Texture dictionary.
sizeSet the Size of the Sprite.
positionSet the Position on screen where to draw the Sprite.

◆ Sprite() [2/4]

GTA.UI.Sprite.Sprite ( string  textureDict,
string  textureName,
SizeF  size,
PointF  position,
Color  color 
)

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

Parameters
textureDictThe Texture dictionary where the Sprite is stored (the *.ytd file).
textureNameName of the Sprite inside the Texture dictionary.
sizeSet the Size of the Sprite.
positionSet the Position on screen where to draw the Sprite.
colorSet the Color used to draw the Sprite.

◆ Sprite() [3/4]

GTA.UI.Sprite.Sprite ( string  textureDict,
string  textureName,
SizeF  size,
PointF  position,
Color  color,
float  rotation 
)

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

Parameters
textureDictThe Texture dictionary where the Sprite is stored (the *.ytd file).
textureNameName of the Sprite inside the Texture dictionary.
sizeSet the Size of the Sprite.
positionSet the Position on screen where to draw the Sprite.
colorSet the Color used to draw the Sprite.
rotationSet the rotation to draw the sprite, measured in degrees, see also
See also
Rotation
.

◆ Sprite() [4/4]

GTA.UI.Sprite.Sprite ( string  textureDict,
string  textureName,
SizeF  size,
PointF  position,
Color  color,
float  rotation,
bool  centered 
)

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

Parameters
textureDictThe Texture dictionary where the Sprite is stored (the *.ytd file).
textureNameName of the Sprite inside the Texture dictionary.
sizeSet the Size of the Sprite.
positionSet the Position on screen where to draw the Sprite.
colorSet the Color used to draw the Sprite.
rotationSet the rotation to draw the sprite, measured in degrees, see also
See also
Rotation
.
centeredPosition the Sprite based on its center instead of top left corner, see also
See also
Centered
.

Member Function Documentation

◆ Dispose() [1/2]

void GTA.UI.Sprite.Dispose ( )

◆ Dispose() [2/2]

virtual void GTA.UI.Sprite.Dispose ( bool  disposing)
protectedvirtual

◆ Draw() [1/2]

virtual void GTA.UI.Sprite.Draw ( )
virtual

Draws this Sprite.

Implements GTA.UI.IElement.

◆ Draw() [2/2]

virtual void GTA.UI.Sprite.Draw ( SizeF  offset)
virtual

Draws the Sprite at the specified offset.

Parameters
offsetThe offset.

Implements GTA.UI.IElement.

◆ ScaledDraw() [1/2]

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

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

Implements GTA.UI.IElement.

◆ ScaledDraw() [2/2]

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

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

Parameters
offsetThe offset.

Implements GTA.UI.IElement.

Property Documentation

◆ Centered

bool GTA.UI.Sprite.Centered
getset

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

true if centered; otherwise, false.

◆ Color

Color GTA.UI.Sprite.Color
getset

Gets or sets the color of this Sprite.

The color.

◆ Enabled

bool GTA.UI.Sprite.Enabled
getset

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

true if enabled; otherwise, false.

◆ Position

PointF GTA.UI.Sprite.Position
getset

Gets or sets the position of this Sprite.

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.Sprite.Rotation
getset

Gets or sets the rotation to draw thie Sprite.

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

◆ Size

SizeF GTA.UI.Sprite.Size
getset

Gets or sets the size to draw the Sprite

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: