GDevelop icon indicating copy to clipboard operation
GDevelop copied to clipboard

BBCode Text Object: Scroll Clipped Text Issues

Open AtomicCrocStudios opened this issue 3 years ago • 3 comments

Describe the bug

When using formatted BBCode Text object with the YARN dialogue system you run into 2 weird issues/bugs. I have added both examples below using a normal, BBCode and Bitmap text object. Each object is displaying the same text at the same time.

  1. Formatted text is delayed compared to unformatted text. Whilst this might only be 1/2 - 1 second, it causes unnecessary pauses in the flow of text. Please see the example below slowed down. ff542c9c0770242c626ce0158fa78316
  2. Once any formatting is added to the BBCode text object, it starts to have trouble wrapping text cleanly and will often stutter or loop back for a moment. Please see the example below using the same text formatted and unformatted. 6cfe2afb6a039307ea409e44f41cd5e6 00fdc888cc4493e7e3e6425a305f94a5

I believe both these issues stem from the fact that 'Scroll Clipped Text' scrolls through the BBCode as if it's normal text rather then however it is done when there is no formatting other then the Base Color for the Object.

Text Type Test.zip

Other details

  • Windows 10
  • GDev 115

AtomicCrocStudios avatar Sep 05 '21 05:09 AtomicCrocStudios

Yup, its a known issue. Not easy to fix, but fixable for sure

On Sun, 5 Sep 2021, 08:27 AtomicCrocStudo - Chalkie, < @.***> wrote:

Describe the bug

When using formatted BBCode Text object with the YARN dialogue system you run into 2 weird issues/bugs. I have added both examples below using a normal, BBCode and Bitmap text object. Each object is displaying the same text at the same time.

  1. Formatted text is delayed compared to unformatted text. Whilst this might only be 1/2 - 1 second, it causes unnecessary pauses in the flow of text. Please see the example below slowed down. [image: ff542c9c0770242c626ce0158fa78316] https://user-images.githubusercontent.com/71751097/132115841-eba5dec5-11f9-4f22-b16b-a39cc73aea8e.gif
  2. Once any formatting is added to the BBCode text object, it starts to have trouble wrapping text cleanly and will often stutter or loop back for a moment. Please see the example below using the same text formatted and unformatted. [image: 6cfe2afb6a039307ea409e44f41cd5e6] https://user-images.githubusercontent.com/71751097/132116197-ebca1938-696c-4888-b432-ebe6942404c8.gif [image: 00fdc888cc4493e7e3e6425a305f94a5] https://user-images.githubusercontent.com/71751097/132116238-ee946c38-c2ab-4f63-a127-48d8b14cdf2b.gif

I believe both these issues stem from the fact that 'Scroll Clipped Text' scrolls through the BBCode as if it's normal text rather then however it is done when there is no formatting other then the Base Color for the Object.

Text Type Test.zip https://github.com/4ian/GDevelop/files/7110948/Text.Type.Test.zip Other details

  • Windows 10
  • GDev 115

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/4ian/GDevelop/issues/3011, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRRWVJOSK7MIXSA5UFZAG3UAL5TDANCNFSM5DOHHGUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

blurymind avatar Sep 05 '21 08:09 blurymind

Hi @AtomicCrocStudios ! Thanks for reporting this behavior!

They are indeed 2 different issues here, but probably caused by the same piece of code.

The DialogTree extension considers the dialog entry as "text" and thus tries to display the characters 1 by 1, even the ones which will not be displayed (tags). (https://github.com/4ian/GDevelop/blob/25acb603b413b3bce6fac338a3e688752ca49234/Extensions/DialogueTree/dialoguetools.ts#L119-L127)

  • For your first example, the color opening tag being written (but not displayed) causes the delay
  • For your second example, the shadow closing tag being written (but not displayed) causes the word to wrap to a new line

Maybe an option could be to modify bondage to detect "EnrichedText" (text with tags in it) and then handle it differently in the DialogTree extension. Do you think that sounds realistic @blurymind ? Or we could do all the logic in the extension itself, something like: if we detect a "[" character then we ensure this is a valid styling tag and advance the scrolling to the "]". This should help tackle both cases.

Note that adding spaces between your words and your style tags should help avoid the second issue in some cases. (adding a space between "controller." and "[/shadow]" fixed the issue on my end as this is not considered as one word any more.)

ClementPasteau avatar Sep 09 '21 07:09 ClementPasteau

I might be missing something but this is something that should be handled in events yes? Because a user might use a Text object instead of a BBText object and so don't want the rich text markup filtered out.

the event would be something like "if BBText character length hasn't changed and NOT Clipped text has completed scrolling then Scroll clipped text" in a loop.

MechanicalPen avatar Sep 19 '21 05:09 MechanicalPen