How do I wrap my text in Construct 3?

0 favourites
  • 11 posts
From the Asset Store
Casino? money? who knows? but the target is the same!
  • Hi guys, it's me again. So I've my text with typewriter which is nice, but something doesn't seem to work. The sentence doesn't wrap properly.

    Honestly I could do it manually, if necessary. If I'm not mistaken in C++ you can do something like \n or /n, I don't remember exactly. But anyway, if I have to type the text in a global variable (idText in my events), I can't manually wrap the sentence. Personally, either manual or automatic is fine, as long as it works.

    So basically what I got is basically this, in the video below, from point 0:00 to 0:09.

    drive.google.com/file/d/1SXdypymgO5fgKeaGkSlkofrf5DtQbAqg/view

    However, I've noticed something. If I'm in that layout, and I've reproduced the typwriter, then reload the layout (I've made a pressing button for that) and do that again, the wrap works perfectly.

    How, I wonder?

    Here, here's a screenshot of the events.

    Thank you so much.

    (I'm sorry for being dumb, I have looked at JSON and Laura's teaching plus the demos but I admit I have half a clue of what happenes in the event section. I've looked at Mozilla's documentation which brings me to another website for CSS which brings me to another website for HTML, so I feel like I'm either too far to make something or... I don't know.)

  • If you want to manually add line breaks, you can use some symbol, for example #:

    Variable myText = "The quick brown fox#jumps over the lazy dog."

    Then before typewriting do:

    Set myText to replace(myText, "#", newline)

  • If you want to manually add line breaks, you can use some symbol, for example #:

    Variable myText = "The quick brown fox#jumps over the lazy dog."

    Then before typewriting do:

    Set myText to replace(myText, "#", newline)

    I see, thank you, it works fine.

    However the issue still remains. Even with the manual wrap, there is still issue of the text streching like in the video I posted.

    I feel like it has to do with how the game loads the text in the layout. Is it possible?

  • I have never seen anything like on your video. Are you sure there are no other events that can change text appearance, for example when typewriter is finished? Can you share your project file?

  • I have never seen anything like on your video. Are you sure there are no other events that can change text appearance, for example when typewriter is finished? Can you share your project file?

    Ah, yes, sure.

    https://drive.google.com/file/d/1NyranNJIcrYcKrPy_p6OOMj3KwY8PhHH/view?usp=sharing

    I've added the textbox in the second layout, so if you want to see it, go there. By pressing "I", you should see the textbox showing up and then the text.

  • I tried your project and it works fine, the text doesn't shrink like on your video.

  • I tried your project and it works fine, the text doesn't shrink like on your video.

    ...I don't get it. Is it a browser issue? I use Firefox... Altough, I doubt this is the problem, isn't it?

    Or is it? I used a web engine once, for a sort of visual novel game, and I remember playing the game on Firefox and Chrome, and they had for some reasons different results. Do you use Chrome, perphaps?

  • Yes, I used Chrome. Tried in Firefox and the text shrinks there! Must be a bug. If you can reproduce it in a small demo project, you can log a bug report:

    github.com/Scirra/Construct-3-bugs/issues

  • Yes, I used Chrome. Tried in Firefox and the text shrinks there! Must be a bug. If you can reproduce it in a small demo project, you can log a bug report:

    https://github.com/Scirra/Construct-3-bugs/issues

    I see...huh I've never used Github, but I'll try to figure out.

    So, does it mean I have to move on Chrome? Not exactly my favorite browser...

    But ok. Until then, thank you so much for your help (also following some of your tutorials on your website, really cool).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • huh I've never used Github

    You don't have to use github, there's just a form you need to fill to log a bug report.

  • > huh I've never used Github

    You don't have to use github, there's just a form you need to fill to log a bug report.

    Oh my goodness, I solved it.

    It all began with me making the demo as essential as possible.

    By removing objects, all remained was the textbox, the custom font and the text.

    I wanted to keep things as simple as possible, so I renamed the font name just "customfont", and surprisly it works perfectly.

    I tried on the original project, and now it's working as intended, with and without manual wrap in the sentence.

    What can I say... Wow.

    Apparently Construct on Firefox doesn't like underscores and extra dots in font names (the original name was VCR_OSD_MONO_1.00.1.ttf).

    I guess case closed?

    Thank you so much for your help, really.

    Actually, if it wasn't for you suggesting me to send the project as debug, reading the rules, modify the project to make it as essential as possible, by leaving only the interested objects, I would have never found the issue.

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