Advanced text: Line-by-line scrolling

0 favourites
  • 1 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • I'm not sure how possible this is, but it would help make my game more professional.

    What I have:

    During cutscenes, text is sent several "blocks" at a time to a message queue.

    While the queue is not empty, the blocks are sent one at a time to a textbox.

    The textbox starts displaying the text, adding one letter at a time.

    When you press a button after the text is all written out, the text is cleared and the next block is filled in.

    When the last block is finished, the textbox disappears.

    What I want:

    While a block is being written out, if there is any overflow (it doesn't fit into the textbox), it will automatically remove the top line of the textbox. This way, the text will be filled in line by line and the blocks don't have to be short enough to all fit on screen at once.

    So, in short: I want to:

    a) Detect that the current text doesn't fit in the textbox

    b) When that happens, find the substring that makes up the first line of the textbox and remove it

    Is this possible?

    It looks like this plugin can handle scrolling to the next line, but how do I detect overflow?

    EDIT: Solved it! I looked around at rex's samples for the Scrolling behavior and found that I can accomplish this by always scrolling to the bottom (scroll by percent: 1.0).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)