[Plugin] tag text

  • Thank you, rexrainbow

    This plugin (and many others that you already created) saved me.

  • This plugin is a lifesaver. I was so disappointed when I discovered that C2 couldn't do this natively. Going forward, all of my text objects will be TagText objects!

  • My only complaint is if the text block has line breaks after a class. It seems to randomly add an extra line break. Hmmmm...

  • My only complaint is if the text block has line breaks after a class. It seems to randomly add an extra line break. Hmmmm...

    Could you please provide a sample capx? So I could fix this bug by this capx.

  • [quote:5ie6wdu0]@rexrainbow: Could you please provide a sample capx? So I could fix this bug by this capx.

    Here's a sample of the problem I'm talking about. To see the problem, just load the game, select "Continue Adventure", enter any credentials you want to start playing. Use the arrow keys to wander around (don't go into the town unless you need to visit the inn) until you get into combat. In the battle screen, you will notice the extra line breaks when either you or the mob scores a hit. The text class I'm using is <class='red'>, and the style is just that, rgb(255, 0, 0).

    I defined the class on the "Styles" event sheet, and all of the other relevant code you'll want to see is on the "Ev Battle" event sheet. You will notice that I replaced the old txto_battleLog text object with one of your Tag Text objects, and called it txto_battleLog_NEW. Lines 47 and 50 are where I invoke the "red" class. On those same lines I have disabled versions of them that don't invoke the class. You can see for yourself that when you don't invoke the "red" class, there are no extra line breaks, but when you do there are.

    I assure you that the Tag Text object is plenty wide; there is ample room for the appended text (most any of the lines that may pop up shouldn't need to word wrap).

    In the sample screenshot you can see the extra line break I'm talking about, but oddly enough it doesn't always appear in the line where I invoke the "red" class. Sometimes it appears later in the text block. In the "Ev Battle" event sheet you can see that every combat round I append lots of separate lines of text, depending on what happens. So sometimes this extra line break appears further down the text than where the "red" class is invoked. Really odd.

  • Sestenes

    Sorry, this sample capx is too large. You might provide a segment of text which had bugs.

  • Sestenes

    Sorry, this sample capx is too large. You might provide a segment of text which had bugs.

    Sorry about that. Here is a simple capx that illustrates the bug.

    Both buttons "Plain" and "Styled" just append a simple string: "More text more text more text more text." The only difference is that the "Styled" button uses a tag text class to make the font color red.

    You will notice that after you use the "Styled" button at least once, then when appending additional non-styled text to the tag text object there will occasionally be an odd line break that is clearly not a part of the event sheet logic. Just press "Styled" once, and then "Plain" a few times to see the problem.

    Cheers, and thanks for looking into the problem.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Update

    Fix bug of wrapping text.

    Sestenes

    Thanks for pointing this bug. Please download it and try again.

  • Thanks for the fix! This is a great addition to C2

  • Update

    Fix bug when the content has ">". Tested passed with my sample capx.

    (But I am not good at regex, I am not sure this fixed will not bring more bugs. )

    norman74

    Thanks, I had fixed it.

  • rexrainbow

    Yo rex!

    There seems to be a bug in your plugin with the TagText.textWidth property. It always return 0. I've compared with the original text object and there seem to be some differences. The textHeight however works as intended.

    Pretty gamebreaking for now since i need it for aligment of stuff.

    I've attatched a capx demonstrating the problem.

    Otherwise great plugin man! ^^

    Cheers mate!

  • Maisey

    Thanks. I had fixed it, please download plugin and try again.

  • Hey rexrainbow, the plugins you've made are awesome timesavers! And thank you for creating them.

    I'm running into issues with dynamic text and multiple web fonts. I'm setting classes but am getting odd results. Only the last webfont is being respected.

  • jayrok

    It only support one web font currently. Add it in my TODO list.

  • Update

    Support webfonts in tags.

    jayrok

    Here it is. I also put your test case in my sample capxs, thanks.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)