x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

UMG covers subitles played by PlayDialogueAtLocation

Hello,

I have an actor monologue system based on the DialogueVoice / DialogueWave infrastructure.

The system works until I display fullscreen UMG window. At that point caption is hidden beneath this window. The sound always works, so only caption is invisible.

It's the same as with DrawText so I presume it's the common cause.

Is any fix planned or at least a workaround available?

Thank you! Jan

Product Version: UE 4.10
Tags:
more ▼

asked Jan 31 '16 at 02:55 PM in Bug Reports

avatar image

metamorphium
107 8 13 23

avatar image Rudy Q ♦♦ STAFF Feb 01 '16 at 04:15 PM

Hello metamorphium,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?

  2. If so, could you provide a detailed list of steps to reproduce this issue in clean project?

  3. Could you provide screen shots of any blueprints that may be involved with this issue?

avatar image Rudy Q ♦♦ STAFF Feb 04 '16 at 04:26 PM

Hello metamorphium,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

avatar image soulmapp Oct 20 '17 at 02:10 PM

Subtitles still displaying under umg widgets,, and subtitles dont have any Z order option. Tested in 4.17and 4.18 P4

avatar image Rudy Q ♦♦ STAFF Oct 20 '17 at 06:21 PM

Hello soulmapp,

Could you answer the questions that were asked of the original poster?

avatar image soulmapp Oct 21 '17 at 01:20 PM

Create a clean project - Third Person Template

Create a umg widget, inside the umg widget, place a image widget, anchored to the bottom middle. alt text

Create dialogue Voice and Wave, setup the dialogue with wav file and the subtitles you wish to display when the sound plays. alt text

Level blueprint - Event begin play - add widget to viewport alt text

And as you can see the subtitle text is behind the widget. alt text

umg-widget.jpg (190.9 kB)
untitled-1.jpg (70.6 kB)
lvlbp.jpg (182.6 kB)
game.jpg (37.2 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

So after a lot of searching and not a whole lot of finding answers. I've discovered that there is nothing you can do about this in Blueprints, sorry folks. There is however, a solution if you want to dive into cpp, and its actually a really easy change to move the location the text shows up on the screen. The file you want is SubtitleManager.cpp and is located in your engines source code directory Engine/Source/Runtime/Engine/Private/SubtitleManager.cpp

One you have this open in visual studios you want to find the DisplaySubtitle function. This function uses the canvas to draw a text item which renders directly to the players display, so it is not compatible in any way with UMG and widgets, which is why changing the TextItem.Depth won't have any effect on the draw order. Instead, the best you can hope for is to be able to move the location to somewhere you don't have any active UI elements. I'm guessing there could be a way to program this function to implement a UMG solution and expose the z order and location properties to a blueprint you could then edit, but I didn't have time to do that. Instead I had the function draw the code from the top down instead of the bottom up due to our game having a hot bar at the bottom. Below is the newly modified code (only a few small changes).

 //For displaying subtitles to a good location
 void FSubtitleManager::DisplaySubtitle(FCanvas* Canvas, FActiveSubtitle* Subtitle, FIntRect& Parms, const FLinearColor& Color)
 {
     if (OnSetSubtitleTextDelegate.IsBound())
     {
         // If we have subtitle displays, they should be rendered directly through those, not via the canvas.
         DisplaySubtitle_ToDisplays(Subtitle);
         return;
     }
 
     // These should be valid in here
     check(GEngine);
     check(Canvas);
     check(Subtitle != nullptr);
 
     CurrentSubtitleHeight = 0.0f;
 
     // This can be NULL when there's an asset mixup (especially with localization)
     if (!GEngine->GetSubtitleFont())
     {
         UE_LOG(LogSubtitle, Warning, TEXT("NULL GEngine->GetSubtitleFont() - subtitles not rendering!"));
         return;
     }
 
     float FontHeight = GEngine->GetSubtitleFont()->GetMaxCharHeight();
     float HeightTest = Canvas->GetRenderTarget()->GetSizeXY().Y;
     int32 SubtitleHeight = FMath::TruncToInt((FontHeight * MULTILINE_SPACING_SCALING));
     FIntRect BackgroundBoxOffset = DrawStringOutlineBoxOffset;
     //SYMMETRIC - Set the minimum to be 1/5 of the maximum - jb
     Parms.Min.Y += Parms.Max.Y/5;
     // Needed to add a drop shadow and doing all 4 sides was the only way to make them look correct.  If this shows up as a framerate hit we'll have to think of a different way of dealing with this.
     if (Subtitle->bSingleLine)
     {
         const FText& SubtitleText = Subtitle->Subtitles[Subtitle->Index].Text;
 
         if (!SubtitleText.IsEmpty())
         {
             
             // Display lines up from the bottom of the region
             //SYMMETRIC - Changed to display lines down from the top of the region -jb
             Parms.Min.Y += SUBTITLE_CHAR_HEIGHT;
             FCanvasTextItem TextItem(FVector2D(Parms.Min.X + (Parms.Width() / 2), Parms.Min.Y), SubtitleText , GEngine->GetSubtitleFont(), Color);
             {
                 TextItem.Depth = SUBTITLE_SCREEN_DEPTH_FOR_3D;
                 TextItem.bOutlined = true;
                 TextItem.bCentreX = true;
                 TextItem.OutlineColor = FLinearColor::Black;
             }
             Canvas->DrawItem(TextItem);        
             CurrentSubtitleHeight += SubtitleHeight;
         }
     }
     else
     {
         for (int32 Idx = Subtitle->Subtitles.Num() - 1; Idx >= 0; Idx--)
         {
             const FText& SubtitleText = Subtitle->Subtitles[Idx].Text;
 
             // Display lines up from the bottom of the region
             //SYMMETRIC - Changed to dispay lines down from the top of the region -jbogaard
             if (!SubtitleText.IsEmpty())
             {
                 FCanvasTextItem TextItem(FVector2D(Parms.Min.X + (Parms.Width() / 2), Parms.Min.Y), SubtitleText, GEngine->GetSubtitleFont(), Color);
                 {
                     TextItem.Depth = SUBTITLE_SCREEN_DEPTH_FOR_3D;
                     TextItem.bOutlined = true;
                     TextItem.bCentreX = true;
                     TextItem.OutlineColor = FLinearColor::Black;
                 }
                 Canvas->DrawItem(TextItem);
                 Parms.Min.Y -= SubtitleHeight;
                 CurrentSubtitleHeight += SubtitleHeight;
 
                 // Don't overlap subsequent boxes...
                 BackgroundBoxOffset.Max.Y = BackgroundBoxOffset.Min.Y;
             }
         }
     }
 }

more ▼

answered Nov 14 '17 at 09:48 PM

avatar image

EndersGame0327
31 3 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I was able to reproduce this issue on our end. I have written up a report and I have submitted it to the developers for further consideration. I have provided a link to the public tracker. Please feel free to use the link provided for future updates.

Link: https://issues.unrealengine.com/issue/UE-51522

Make it a great day

more ▼

answered Oct 23 '17 at 02:51 PM

avatar image

Rudy Q ♦♦ STAFF
47.3k 545 132 525

avatar image Blackigle Dec 02 '18 at 09:10 PM

Same problem at version 4.19

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I am also having a similar issue with the dialogue system not having any options for Z order or where the draw text is to be displayed on screen. Would appreciate any advice on how to code around this limited functionality in BP.

more ▼

answered Nov 14 '17 at 12:41 AM

avatar image

EndersGame0327
31 3 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question