Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
In my game, I've got a text field made with Spritefont. This box displays a text that is appended from time to time to record player actions. It's a sort of archive of the game progress and the amount of text quickly overflows the size of the text box.
How can I allow the player to scroll through this text to explore the record ?
You can replace Text with SpriteFont.
Note, that this will only work if you have one record per line, each ending with newline. If your records are longer and getting auto-wrapped, it will scroll 2 or more lines at a time.
Thank you so much, dop2000 !
I managed to adapt it to sprite font and to add the routine I need to have lines added to record player actions (simulated it by a line added every few seconds). Scroll up when line is added works nicely
but one point remains, it is that the new created line should appear at the bottom of the text box.
How should I do that ?
You mean when a new line is added, the text should scroll to the end?
In event 2 set scrollPosition to tokencount(s, newline)-MAXLINES
It works. Thank you so much !
Now, i'll try to figure out how to make the scrolling happen using swipe movement on mobile ;)
Develop games in your browser. Powerful, performant & highly capable.
You can use Touch.AngleAt(0) and Touch.SpeedAt(0) to detect swipes.
OK, it works !
Shared here if it may be useful to anyone.
Thanks for your help !