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 / Text object with new line

Author
Message
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 7th Nov 2013 19:32
I had no idea I could do this... not sure if it is general knowledge and I just never thought of it, but if you want a text object with multiple lines then just insert a new line character... I feel silly not thinking of this before.


Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 7th Nov 2013 20:00 Edited at: 7th Nov 2013 20:03
the normal line break in windows is 13 10 = cr lf

createtext(1 , "Test newline"+chr(13)+chr(10)+"next line")

AGK 108 B19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 7th Nov 2013 20:07
Ah good to know, just 10 seemed to work though.

JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 7th Nov 2013 21:50
Just #13 is fine as well.

-- Jim - When is there going to be a release?
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 7th Nov 2013 22:05
It's possible to do some cool stuff with text, like, use other ascii values to say, change the colour of the text. I scan through the text 1 character at a time, then change the text depending on the ascii character.

Like this:



There's quite a lot you can do with the text in AGK.

I am the one who knocks...
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 7th Nov 2013 22:09
You know what I'd really like? Is a function that does some smart sizing. For example, if I set textMaxWidth to 80 and I have a message like this:
Hi this is a message. It
is not our intention to
work correctly!

It would be awesome to do this instead:
Hi this is a message.
It is not our intention
to work correctly!

But I've no idea how to figure that out... I think it would be a bit of overhead like I'd need a text object for each sentence, determine if its width will cause it to carry over, if not and the rest of the message text will cause a carry over then insert a new line after the first sentence.
It could be done, but it would be messy!

Rknight
20
Years of Service
User Offline
Joined: 25th Sep 2003
Location: NJ
Posted: 20th Nov 2013 01:11
Quote: "It's possible to do some cool stuff with text, like, use other ascii values to say, change the colour of the text. I scan through the text 1 character at a time, then change the text depending on the ascii character.
"


Hmm, is it possible to use something like this to highlight a particular word in a textbox?

So far SetTextCharColor() hasn't seemed to be working for me?
Rknight
20
Years of Service
User Offline
Joined: 25th Sep 2003
Location: NJ
Posted: 21st Nov 2013 00:40
Hmm, oh I see -- my mistake. I had tried to use it on an edit box instead of a normal text object.

Login to post a reply

Server time is: 2024-05-20 10:40:06
Your offset time is: 2024-05-20 10:40:06