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 / New line character?

Author
Message
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 27th Jul 2012 15:31
I want to make a multi line string. But how do I enter a new line character?

"Line 1" + ??? + "Line 2"

Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 27th Jul 2012 16:25
chr(10) represents a new line and will work with Text and Print Instructions;

"Line 1" + chr(10) + "Line 2"

Regards.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 27th Jul 2012 16:29
Chr(10) is a line feed, but you might be better off pairing that with a carriage return as well, like:

CRLF$=chr(13)+chr(10)

Then add CRLF$ to the string to go onto a new line.

Health, Ammo, and bacon and eggs!
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 27th Jul 2012 16:35
Thanks both of you Will give it a try later.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 27th Jul 2012 16:46
chr(10) is sufficient, you don't need to use chr(13).

I use just chr(10) all over and it works fine.

Cheers,
Ancient Lady
AGK Community Tester
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 27th Jul 2012 17:03
I always use #13 !!!

-- Jim
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 28th Jul 2012 14:36
Does anyone know if this means we can produce a multi-line text object in AppGameKit? That would improve my text box function quite a lot...


this.mess = abs(sin(times#))
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th Jul 2012 14:55
Yeah, just add a chr(10) inbetween lines and it'll work. I think that including a chr(13) is just a leftover from working with visual basic, AppGameKit doesn't seem to mind.

Health, Ammo, and bacon and eggs!
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 28th Jul 2012 15:34
Quote: "Does anyone know if this means we can produce a multi-line text object in AppGameKit?"

Looks like it:



Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 28th Jul 2012 23:41
Yeah I used it to write my credits page with one text object.

Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 29th Jul 2012 13:14
Maybe make a multiline text object, copy it to a sprite, then use uv-scroll to scroll it, and show only a small portion of it at a time, maybe with scissors. Easy scroll credits function?

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Jul 2012 15:32
With the scissor, you could do a Star Wars 3D title scroll, like Cliffs mode7 example .

Health, Ammo, and bacon and eggs!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 29th Jul 2012 16:07
Quote: "Maybe make a multiline text object, copy it to a sprite, then use uv-scroll to scroll it, and show only a small portion of it at a time, maybe with scissors. Easy scroll credits function?"

There is a scissor command for text so you wouldn't have to turn it into a sprite really.


this.mess = abs(sin(times#))

Login to post a reply

Server time is: 2024-04-28 08:27:47
Your offset time is: 2024-04-28 08:27:47