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 / Suggestion: Text line commands

Author
Message
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 21st Nov 2011 13:07
I'm looking at the text commands and they seem a bit limited. There is no commands for managing text "objects" with multiple lines. So I figured it would be quite nice with some commands to add text and lines to a text object. There is already a command to change the spacing between lines (SetTextLineSpacing) but I see no way of adding new lines.

AddTextSting( iTextIndex, bNewLine )
- Adds a string at the end of an existing text object.
- Optionally bNewLine = 1 adds the text to a new line.

AddTextNewLine( iTextIndex, iLines, iLineIndex )
- Adds a new line to a text object.
- Optionally iLines allows you to add multiple lines at once.
- Optionally iLineIndex allows you to add lines at a specified line.

integer GetTextLines( iTextIndex )
- Returns the number of lines.

SetTextLine( iTextIndex, iLineIndex, string )
- Sets the string of a specified line.

string GetTextLine( iTextIndex, iLineIndex )
- Returns the content of a specific line

RemoveTextLine( iTextIndex, iLineIndex )
- Removes a specific line.


If you have suggestions for commands I might have missed, feel free to mention them

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 21st Nov 2011 15:26 Edited at: 21st Nov 2011 15:26
You can add a new line character to the string, although the tier 1 compiler doesn't like \n I think someone found out you can use chr(10) to get the new line character.
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 21st Nov 2011 15:39
Paul:
Thanks for the tip. Although my suggestions would be quite handy. I only had 18 short lines of text so I made 18 text items instead

Login to post a reply

Server time is: 2024-03-29 07:29:29
Your offset time is: 2024-03-29 07:29:29