The online racing simulator
Buttons - Learn how to use them - Advanced (Symbols/Glyphs)
(2 posts, started )
Buttons - Learn how to use them - Advanced (Symbols/Glyphs)
Advanced Button Making - Escape Codes and symbol Glyphs

List of available colours, language Code Pages and Special Characters:

= Colours

As you should already be well aware by now, caret/circumflex (^) in front of a number in a text string will colour the text, e.g. "^1 test" will output test.

openPrivButton( "test_colours",50,70,20,6,6,8,96,"^0 - black%nl%^1 - red%nl%^2 - green%nl%^3 - yellow%nl%^4 - blue%nl%^5 - violet%nl%^6 - cyan%nl%^7 - white%nl%^8 - no color");

= Special Characters

A caret/circumflex in front of certain lower case letters will output special characters.

openPrivButton( "test_characters1",50,70,10,6,6,8,96,"^1^v%nl%^1^d%nl%^1^s%nl%^1^t%nl%^1^a%nl%^1^q%nl%^1^l%nl%^1^r");

For instance, if you want to output a special character such as the hash sign (#) you would use "^h" within your text string.

In truth, most of these special characters are not required to be used in lapper as these symbols appear on a normal keyboard and you can just type the symbols in between quotes and the text will be output as you've typed it. However, some characters are required, such as the single quotation mark. If you try outputting a text string like

openPrivButton( "test_characters2",70,70,50,6,6,8,96,"^1 this string wants to use the "quote" marks");

then lapper will actually output

You would have to use

openPrivButton( "test_characters2",70,70,50,6,6,8,96,"^1 this string wants to use the ^tquote^t marks");

which outputs as

= Code Pages

A caret/circumflex in front of certain upper case letters will change the Code Page (language lookup).

Lapper appears to use Latin 1 as standard for most European languages, but it is possible to use the characters and symbol glyphs as used in other language Code Pages.

For instance, if you want to use some symbol glyphs that you find in the Traditional Chinese Character A1 set, then, with your lapper script open and LFS running;

- In LFS, type "t" to open message window, click on Latin 1, and change to Traditional Chinese, and click OK. Message window should expand down to show all the standard characters, along with a huge number of buttons with numbers/letters and buttons with numbers under the rows of normal Latin text and greyed out buttons.

If these additional characters don't appear, click the triangular up arrow.

Click on the A1 button, and then click the symbol you want to use in your script. This will now appear in the message.

CTRL C (copy) this symbol then go to your lapper script and paste into a button text string. When you do this, the symbol you copied will have changed into different text.

In front of this text, you will have to put the Code Page letter, in this case, ^H (for Traditional Chinese), and then ^9. The ^9 converts any subsequent buttons back to default code page, e.g. Latin 1. If you don't use this, then other buttons appearing after your new button may not show text as expected.

After the ^H^9, put your colour number, e.g. ^1, then the text message you want to display.

It is possible to mix the order of Code Pages / Convert and still have text display properly. Putting colour first will result in grey (no colour) text. However, for bug fixing I would recommend you keep to same convention throughout, as the text strings will make little sense on a quick look.

openPrivButton( "test_characters2",70,70,50,6,6,8,96,"^1 this string wants to uses the ^tquote^t marks");
openPrivButton( "test_characters3",70,76,50,6,6,8,96,"^0^H ¢R ¡ø ¡¹ ¢g - test char 3");
openPrivButton( "test_characters4",70,82,50,6,6,8,96,"^2^H^9 ¢R ¡ø ¡¹ ¢g - test char 4"); # outputs no colour instead of green
openPrivButton( "test_characters5",70,88,50,6,6,8,96,"^H^1 ¢R ¡ø ¡¹ ¢g - test char 5");
openPrivButton( "test_characters6",70,94,50,6,6,8,96,"^H^9^2 ¢R ¡ø ¡¹ ¢g - test char 6");
openPrivButton( "test_characters7",70,100,50,6,6,8,96,"^H^3 ¢R ¡ø ¡¹ ¢g - test char 7^9");

Although in the above examples, the ^H (for Traditional Chinese) works with the symbols I chose, there is no guarantee that all symbols will work for any language choice. I was unable to use some ^J (Japanese) and ^G (Greek) symbols during my limited tests.
Attached images
Code pages and special characters.png
quote marks.png
Special characters.png
Escape Codes.png
thank you for your help

Buttons - Learn how to use them - Advanced (Symbols/Glyphs)
(2 posts, started )