How do I implement lots of text?

0 favourites
  • 5 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • Hello fellow constructors!

    Recently I have started my first project with Construct 2. It involves quite a lot of text. Since a text field (not a text box) cannot be styled using CSS, I have chosen buttons in order to display text (fill in the blank text).

    These buttons are disabled and use drag and drop. The Internet Explorer handles this very well but within Firefox and exported exe files (via NW.js) the buttons cannot be dragged.

    Example:

    Sentence start blank sentence end.

    ("Sentence start" and "sentence end" are text fields.)

    The text which is supposed to be dragged into the blank is written on buttons which are styled with CSS in order to have a background color.

    Does anyone know a workaround for this? Or does anyone know a really good way to implement a lot of text (fill in the blank text) with C2? I tried sprite fonts but I am not satisfied with the results.

    Any ideas are highly appreciated!

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Actually IE allowing you to drag/drop buttons is a fault on IE's part. DOM elements are not supposed to act that way and that's why it doesn't work in FF and Chrome/NW.JS.

    So in the end, what are you really looking for ?

    A way to add format to the text object ? From the sound of it all you'd need is a background color, right ? Add a Sprite underneath the Text object, possibly use the Pin behavior, you are set.

  • Hello Kyatric,

    Thank you for your DOM explanation. I had hoped for a problem on FF`s side.

    I was indeed looking for a way to add a background-color to text objects. Your sprite idea works very well! Thank you very much! It will take quite some time to change the layouts and code, but it will work!

    Probably you can help me with another problem, since you are obviously very experienced in C2.

    How do I handle high DPI displays and “normal” displays in an efficient way?

    Since one can only use pt as font size (text objects), I am really struggling to handle both variations. Is there something like the following?

    If highDPIdisplay

    font-size = 20

    else

    font-size = 14

    Or is there a better way of implementing high DPI displays?

    Again: Thank you very much for your help!

    Regards!

  • As you may see in the project's properties, C2 pretty much takes care of the high DPI on its own with a "fallback" when HDPI is not available.

    Not sure there's a need for you to modify the pixel size of the fonts. If it is readable, it is.

    This might go along supporting multiple screen resolutions.

  • Well, on high DPI displays the text is readable but too small. Is there something like the following?

    If highDPIdisplay

    font-size = 20

    else

    font-size = 14

    I have checked multiple ways but nothing worked.

    Do you have any idea?

    Thanks again!

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