Search Results for

    Show / Hide Table of Contents

    Class SpriteRenderer

    Renders a Sprite on the screen. The owner Entity must contain the Sprite to be drawn, plus a Transform2D.

    Inheritance
    object
    IdentifiableObject
    DependencyObject
    AttachableObject
    PrefabInstanceObject
    Component
    Drawable
    Drawable2D
    SpriteRenderer
    Implements
    IDependencyObject
    Inherited Members
    Drawable2D.Delta
    Drawable2D.DebugAlpha
    Drawable2D.Transform2D
    Drawable2D.Layer
    Drawable2D.DrawDebugLines()
    Drawable.DrawableType
    Drawable.RenderManager
    Drawable.IsCullingEnabled
    Drawable.BoundingBox
    Drawable.DebugBoundingbox
    Drawable.OrderBias
    Drawable.BaseDraw(DrawContext)
    Component.Owner
    Component.Managers
    Component.ShouldBeActivated
    Component.Clone()
    Component.Attach(Entity)
    Component.Start()
    PrefabInstanceObject.PrefabSource
    PrefabInstanceObject.PrefabElementId
    PrefabInstanceObject.IsPrefabInstance
    PrefabInstanceObject.IsMissingPrefabSource
    AttachableObject.AttachableStateChanged
    AttachableObject.IsEnabled
    AttachableObject.State
    AttachableObject.IsLoaded
    AttachableObject.IsAttached
    AttachableObject.IsActivated
    AttachableObject.IsStarted
    AttachableObject.IsDestroyed
    AttachableObject.Destroy()
    AttachableObject.DependencyBroken()
    DependencyObject.Dependencies
    DependencyObject.OnDependencyRemoved
    IdentifiableObject.Id
    IdentifiableObject.IdHasChanged(Guid)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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
    Drawable.Draw(DrawContext)
    Remarks

    This method will only be called if all the following points are true:

    • The entity passes the culling test.
    • The parent of the owner Entity of the Drawable cascades its visibility to its children and it is visible.
    • The Drawable is active.
    • The owner Entity of the Drawable is active and visible.

    OnActivated()

    Invoked when the object is activated once is attached.

    Declaration
    protected override void OnActivated()
    Overrides
    Component.OnActivated()

    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
    Drawable.OnAttached()

    OnDeactivated()

    Invoked when the object is deactivated.

    Declaration
    protected override void OnDeactivated()
    Overrides
    Component.OnDeactivated()

    OnDestroy()

    Invoked when the object is going to be disposed.

    Declaration
    protected override void OnDestroy()
    Overrides
    Component.OnDestroy()

    OnDetach()

    Invoked when the object is detached.

    Declaration
    protected override void OnDetach()
    Overrides
    Drawable.OnDetach()

    OnLoaded()

    Invoked when the object is loaded.

    Declaration
    protected override void OnLoaded()
    Overrides
    Component.OnLoaded()

    Implements

    IDependencyObject

    Extension Methods

    ReflectionHelper.GetMemberAssembly(object)
    ReflectionHelper.GetTypeName(object)
    In This Article
    Back to top
    Generated by DocFX