Skip to content

UI.UISprite

Matthew Daly edited this page Feb 12, 2023 · 7 revisions

Namespace: Verdant.UI

class UISprite

public class UISprite : UIElement

A UIElement that displays a sprite.

Navigate

Properties

Property Description
Sprite The RenderObject to draw.
SpriteIndex The index of the RenderObject to draw (only use if it is an Animation or SpriteSheet).

Constructors

public UISprite

public UISprite(RenderObject sprite, Vec2 position) : base(position, sprite.Width, sprite.Height)

Initialize a new UISprite.

Parameter Description
RenderObject sprite The sprite to draw.
Vec2 position The position of the sprite on the UI.

public UISprite

public UISprite(RenderObject sprite, Vec2 position, int width, int height) : base(position, width, height)

Initialize a new UISprite.

Parameter Description
RenderObject sprite The sprite to draw.
Vec2 position The position of the sprite on the UI.
int width The width of the sprite.
int height The height of the sprite.

Methods

void Draw

public override void Draw(SpriteBatch spriteBatch)
Parameter Description
SpriteBatch spriteBatch
Clone this wiki locally