Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Game Creator 3 logo Dialogue

Active Line Actor Sprite#

Game Creator / Dialogue / Active Line Actor Sprite

  • Can Read

  • Cannot Write

Description#

Returns the Actor Sprite value of the current active line of the Dialogue component

Code#

using System;
using UnityEngine;
using VisualScript.Icons;
using VisualScript.Runtime;

namespace GameCreator.Runtime.Dialogue
{
    [Get]

    [Title("Active Line Actor Sprite")]
    [Category("Game Creator/Dialogue/Active Line Actor Sprite")]

    [Description("Returns the Actor Sprite value of the current active line of the Dialogue component")]
    [Image(typeof(IconScriptActor), ColorTheme.Type.TextLight, typeof(BadgeHash))]

    [Serializable]
    public class TypeSpriteDialogueActiveLineActorSprite : TypeSprite
    {
        [SerializeField] private GetGameObject m_Dialogue = new GetGameObject(
            new TypeGameObjectDialogue()
        );

        public override Sprite Get(Args args)
        {
            Dialogue dialogue = this.m_Dialogue.Get<Dialogue>(args);
            if (dialogue == null || dialogue.CurrentNode is not NodeText nodeText) return null;

            ScriptActor actor = RuntimeScript.GetActor(dialogue.CurrentRuntimeScript, nodeText.Actor);
            return actor?.GetSprite(dialogue.CurrentRuntimeScript.Args);
        }

        public override string ToString()
        {
            return $"Active {this.m_Dialogue} Actor Sprite";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Game Creator 3 logoGame Creator 3 © Catsoft Works 2026. All rights reserved.