LFSLapper Simple Button Coding ======================== Although in lapper they’re called buttons, the majority of these ‘buttons’ are more like labels. These labels can contain text for showing information (e.g. a pop up label that tells you something like how to contact the team or don’t crash on turn 1) Or a label may have a bit of code associated with it, so that when it appears it might show you something like a sector time or a drift score. Or a label may need clicking to start or finish an event (in which case this label really is a button!). You can make labels (buttons) with a blank background, a light coloured background and a dark coloured background. Light and dark are really shades of translucent (see through) gray. You can put one coloured label on top of another to give you a lighter or darker effect. Usually people put a smaller lighter label on a slightly larger darker label to make the small label look like it has a border. Put 3 light labels one on top of another and the finished label will look almost opaque (can’t see through) white, while 3 dark labels will give you almost opaque black. These labels / buttons can either be Global, so that everyone sees it, or Private, so that only the driver sees it. For instance, if you were advertising your team server, you would make your label global, but if you were showing someone their split time, then label would be private. All labels/buttons must be given their own unique name (better to be descriptive rather than button1, button2, etc!), and you position them on a 200 x 200 grid with 0,0 being top left and 200,200 being bottom right. Try not to use the corners as LFS already uses them all (top left for typed messages, top right for positions at end of race, etc). You then have to specify how wide you want your label/button, and the size of your lettering. After that you define the spacing if there’s more than 1 line of text. Then length of time you want label/button to appear. If you want your label to be permanent (say to advertise your team name), then the time would be -1. Text will stretch or narrow to fit label – it’s not like a truetype font with letters being in constant proportion. After this you choose the colour of the label/button (transparent, light, mid or dark) with the text alignment (left, centred or right), what text (if any, and in a colour of your choice) you may want to appear on your label/button. You then have an option to add a subroutine (sometimes called ‘backcall’) at the end. When finished, you label/button coding could look like this: openPrivButton( "help",25,28,150,10,5,-1,0,"^2Commands list", subroutine_A ); This tells lapper to open a private label/button called “help”, and place it 25 from the left, and 28 from the top, the label is to be 150 wide with 10 high letters with a space of 5 between lines of text, and always show label/button, which is to have transparent background. The label/button is to say Commands List (text appears in between quotes) and is to be in Green (^2) and with centred alignment. The label/button also has a subroutine associated with it. Colours: 0 - transparent label / 16 - light button / 32 – dark button Justification: 64 - align text to left / 128 - align text to right Add colour and justification together to get label colour and how you want to align, e.g. 80 (16+64) is light label with text to left or Text colours available are as follows with the following codes: ^0 - black ^1 - red ^2 - green ^3 - yellow ^4 - blue ^5 - violet ^6 - cyan ^7 - white ^8 - no colour (i.e.a light gray) Codes are placed in front of the text you want to colour: You can use more than 1 colour in a line of text (e.g. “^1Sin'rs ^3(^1Sin^3anju^1'^3s ^1r^3acing ^1s^3erver)" would have ‘Sinanju’s Racing Server’ in a mixture of Red and Yellow lettering. Open and closing brackets must be used to enclose your label/button coding, with semi-colon at end of code. If using more line of text, you need to have an ampersand (&) to split lines. If you just want a blank label, you would just use “ “ (2 quote marks with a space in between). In my Drift Master coding I’ve used Global ‘buttons’ for majority as everyone that joins the game will see the label information on the buttons, with the score and the angles done on Private buttons as it’s only the drivers that will see these. I haven’t tested it at all, but it’s possible that if all the labels/buttons were Global, and you were having some sort of competition where only a single driver competed at once, then everyone could see the drivers scores as they happened. Maybe. If hash marks (#) aren’t in quotes, then lapper will ignore the mark and any text you have after it – people use this as ways to record what the lines of coding mean Hope that's all fairly straightforward Sinanju, June 2009