Forum rules - please read before posting.

Cursor visible whilst subtitles run

edited October 2021 in Technical Q&A

Hi, is it possible to have the cursor visible when subtitles run? So that the player knows their is an interaction to click through? And could their be a specific cursor for when subtitles are on?

Comments

  • If gameplay is blocked while they're shown, the Cursor Manager's Cutscene cursor will be used. You can hook into the OnStartSpeech / OnStopSpeech events to update it's graphic to a specific texture while speech is playing:

    using UnityEngine;
    using AC;
    
    public class SpeechCursor : MonoBehaviour
    {
    
        public Texture2D speechIcon;
        public Texture2D defaultWaitIcon;
    
        private void OnEnable ()
        {
            EventManager.OnStartSpeech_Alt += StartSpeech;
            EventManager.OnStopSpeech_Alt += StopSpeech;
        }
    
        private void OnDisable ()
        {
            EventManager.OnStopSpeech_Alt -= StopSpeech;
            EventManager.OnStartSpeech_Alt -= StartSpeech;
        }
    
        private void StartSpeech (Speech speech)
        {
            KickStarter.cursorManager.waitIcon.ReplaceTexture (speechIcon);
        }
    
        private void StopSpeech (Speech speech)
        {
            if (!KickStarter.dialog.IsAnySpeechPlaying (true))
            {
                KickStarter.cursorManager.waitIcon.ReplaceTexture (defaultWaitIcon);    
            }
        }
    
    }
    
  • Ok, so could I turn this into a custom action?

  • edited October 2021
    using UnityEngine;
    #if UNITY_EDITOR
    using UnityEditor;
    #endif
    
    namespace AC
    {
    
        [System.Serializable]
        public class ActionSetWaitCursor : Action
        {
    
            public override ActionCategory Category { get { return ActionCategory.Custom; }}
            public override string Title { get { return "Set wait cursor"; }}
    
    
            public Texture2D newTexture;
    
    
            public override float Run ()
            {
                KickStarter.cursorManager.waitIcon.ReplaceTexture (newTexture);
                return 0f;
            }
    
    
            public override void Skip ()
            {
                 Run ();
            }
    
    
            #if UNITY_EDITOR
    
            public override void ShowGUI ()
            {
                newTexture = (Texture2D) EditorGUILayout.ObjectField ("New cursor texture:", newTexture, typeof (Texture2D), false);
            }
    
            #endif
    
        }
    
    }
    
  • one q, is it no possible to animate Cutscene cursor? If not, how can i show an animated cursor for pause gameplay when speech happens?

  • You can configure a cursor's animation settings in the Cursor Manager.

  • edited October 2021

    Yep, however the Cutscene cursor has no animation options like the others? And the script you created switches out the he Cursor Manager's Cutscene cursor texture?

  • edited October 2021

    Yep, however the Cutscene cursor has no animation options like the others?

    Once a texture is assigned, animation options will show.

    And the script you created switches out the he Cursor Manager's Cutscene cursor texture?

    Try getting the animation working without the script (i.e. have it show the whole time) for now.

  • my mistake. Yep works perfectly!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.