Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Add to a new line in an Edit Box?

Author
Message
BuccaneerBob
AGK Developer
13
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 30th Nov 2018 07:50
Hey guys,

I'm trying to create a "log" within my game, basically whenever the user does something it appends a new string to the log. My thought was to have an edit box on the page somewhere where they can view the log, my issue is, I can easily do something like

Old_Log = GetEditboxText(Log_Editbox)
Old_Log = Old_Log + New_String
SetEditboxText(Log_Editbox, Old_Log)

I'm just wondering if it's possible to put a line break in there somewhere, akin to doing chr$(13) or something similar so that when it writes to the edit box, it writes it into a new line.

Maybe I shouldn't be using Editboxes at all and there's a better solution.

The only workaround I can think of is writing it to an actual external log file with "WriteLine" and then loading that log file back into the Editbox, but this seems very cumbersome if it's going to writing to the log a lot.

Thoughts?

Cheers

Rob
Robert Janes (Samu Games)
http://www.samugames.com/artifact
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 30th Nov 2018 07:59
What happens when you use chr(13)?
BuccaneerBob
AGK Developer
13
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 30th Nov 2018 08:06
It just adds it as a string to current line.
Robert Janes (Samu Games)
http://www.samugames.com/artifact
BuccaneerBob
AGK Developer
13
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 30th Nov 2018 08:11
Apparently though doing + chr(13) + chr(10) + works
Robert Janes (Samu Games)
http://www.samugames.com/artifact
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 30th Nov 2018 08:22
Great! I'll have to make a note of that
Bored of the Rings
User Banned
Posted: 30th Nov 2018 10:17
escape codes should be recognised by AppGameKit e.g. \n for new line
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others

Login to post a reply

Server time is: 2024-04-19 13:46:42
Your offset time is: 2024-04-19 13:46:42