0 Favourites

Text scroll to bottom from bottom?

  • I am making an RPG system similar to Elder Scrolls and Ultima, but I like the way UO always put information in a little text box so you can see what's been happening, re-read messages, see combat output, etc.

    I understand how to make the Text object put new text in, but in order for it to input at the bottom, the keep focus on the bottom line, and keep scrolling up when you gain a skill etc, it requires a Java call from the browser object and requires the TextBox object. I don't like TextBox because I can't customize it with a transparent background or my own fonts etc.

    Again I've seen a few examples, but nothing I am really looking for.

    The best part about this is that it will ONLY output info, and you never input anything into the text area. This should make it easier to code for sure. If anyone has any info on this, please let me know.

    Yes, I've checked the forums already and found many examples that are good but not for what I'm doing.

    How it should work: Acrobatics has increased a point, and the text object should display "Acrobatics has gone up! It is now 2!" Then when sneak goes up, it should keep the previous text, and on a new line say "Sneak has gone up! It is now 13!" And so on, and so forth.

  • How about something like this ?

  • Yes it works well. However, I am having trouble implementing it in my project. It keeps updating the previous text instead of applying it to the new creation. I'll message you with a link to my capx.

  • roracle

    When you add text... do it like this..

    Newtext&newline&Textbox.Text

    Example

  • That method doesn't work too well. I need it to come from the bottom and push the other text upward. I'm surprised this isn't easier to do since it's such a big deal in...almost every game I've ever played. You'd think, at least with Construct 2, that someone would have made an easy plugin for something like this already.

  • Ok version 2 put into a function.

    Slight variation: I have set two fades - one kicks in when 5 or more texts are displayed (to fade out the earlier text so too many texts are not displayed) and a second that kicks in after 30 seconds to just remove old text after it has been displayed for long enough.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Plugin

    or

    you can use the append text, that inserts text to bottom, and all you need to do is scroll view to last line. There is an example somewhere in forums on how to do this with x/y axis and text box if I recall correctly.

    Sidenote;

    Most games I play have newest entry at the top and ability to scroll down all past game events.

  • DUTOIT I have already seen that example and isn't what I need. TextBox was the thing I mentioned in my original post that I did not want to use because it's not customizable. You can't change the box to transparent, etc.

    RamPackWobble:

    Your example still works well, but It is still doing this thing where it only updates the _original_ SpriteText object, as if it's creating the new ones, pushing the old one up, but only changing the old one, and not putting text in the new one.

  • You can't change the box to transparent, etc.

    Yes you can :)

    Set css

    "background" "transparent"

    "Border" "0"

  • Okay this is what I was looking for lol. Didn't realize the TextBox could do that.

    My only problem is getting it to display from the bottom instead of from the top.

    Also, what games do you play where the new text is at the top and old is at the bottom? I play MMOs and Single player games quite a bit and the only time I've seen it top to bottom is with a note or text, not with system messages or chatting (no chat in mine, but same concept as a system/chat box).

  • Look at this...

    Tutorial Demo capx

    The whole tutorial can be found in the tutorial section

    But like I said if you using texbox then its with the y axis self.y - ???. Haven't figured that out myself.

    But have a look at the example I posted. It is exactly what you want.

    What games? Dice games / card games etc / space games / anything that wants a newest in oldest out.

    But your way works too, seen it in mmo games etc. THey do same thing, just opposite direction.

    3.player one .... etc

    2.player one picked up a card

    1.player one rolled a 6

    0.start game

    A better search word is "event log"

  • Thanks a million guys, when I finally get home and have time to myself I'll work on this more. This isn't difficult at all, just when you aren't a programmer then these things don't make too much sense right off the bat. I'll likely be back in an hour or two lol.

  • RamPackWobble:

    Your example still works well, but It is still doing this thing where it only updates the _original_ SpriteText object, as if it's creating the new ones, pushing the old one up, but only changing the old one, and not putting text in the new one.

    Not sure what you mean - all you should need to do is call the function with your required text.

  • RamPack:

    What I was talking about is this:

    If a function is running, and it calls to display the text in the function you gave me, and part of that function activates another piece of code that also outputs text, it treats it as the same exact command, and puts both text in the same box, so it's all garbled. If you would like, I can send you my CAPX file to take a closer look.

    EDIT:

    Here you go:

    Scroll Text

    I simply updated your example and put the "spacebar" to not just display text, but to call a function that also displays text.

  • Bump.

    If anyone else wishes to take a look at my example bug duplication, feel free. I can't figure out how to fix it.

    The last event is the function I added to duplicate the bug, and if you look at the spacebar pressed, it calls two functions: one to display random text, and one that shows the bug (which is displaying the different text in the same line)

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