Class SpriteRenderer
Renders a Sprite on the screen. The owner Entity must contain the Sprite to be drawn, plus a Transform2D.
Inheritance
SpriteRenderer
Implements
Inherited Members
Namespace: Evergine.Components.Graphics2D
Assembly: Evergine.Components.dll
Syntax
public class SpriteRenderer : Drawable2D, IDependencyObject
Constructors
SpriteRenderer()
Initializes a new instance of the SpriteRenderer class.
Declaration
public SpriteRenderer()
Fields
Sprite
Required Sprite. It provides the in memory representation for a visual asset.
Declaration
[BindComponent(false, true, BindComponentSource.Owner, null, true)]
public Sprite Sprite
Field Value
Type | Description |
---|---|
Sprite |
Properties
DrawMode
Gets or sets the draw mode.
Declaration
public SpriteDrawMode DrawMode { get; set; }
Property Value
Type | Description |
---|---|
SpriteDrawMode |
Methods
Draw(DrawContext)
Allows to perform custom drawing.
Declaration
public override void Draw(DrawContext drawContext)
Parameters
Type | Name | Description |
---|---|---|
DrawContext | drawContext | The draw context. |
Overrides
Remarks
This method will only be called if all the following points are true:
OnActivated()
Invoked when the object is activated once is attached.
Declaration
protected override void OnActivated()
Overrides
OnAttached()
Invoked when the object is attached to the system.
Declaration
protected override bool OnAttached()
Returns
Type | Description |
---|---|
bool | True if all is OK. |
Overrides
OnDeactivated()
Invoked when the object is deactivated.
Declaration
protected override void OnDeactivated()
Overrides
OnDestroy()
Invoked when the object is going to be disposed.
Declaration
protected override void OnDestroy()
Overrides
OnDetach()
Invoked when the object is detached.
Declaration
protected override void OnDetach()
Overrides
OnLoaded()
Invoked when the object is loaded.
Declaration
protected override void OnLoaded()