Difference between revisions of "MessageBox"
Jump to navigation
Jump to search
Added syntax for formating variable-output
imported>Stryfe m (Stupid spelling mistake. Previous version specified number of buttons to 10.) |
imported>JOG (Added syntax for formating variable-output) |
||
|
== Description ==
'''Syntax:'''
MessageBox "Message", [var1], ..., [var9], ["button01"], ..., ["button10"]
This function sends the value -1 to the GetButtonPressed function while the window is still open, until the player selects a button.
Formatting notation: ▼
%.2f ▼
== Displaying Variables ==
▲'''%.2f'''
This means format the variable with 2 decimal places.
'''%.0f'''
This will format the variable with 0 decimal places, so is the normal choice for integers.
'''%5.0f'''
The number in front of the point specifies the minimum width of the number. In this case, there will always be enough space in front of the number for 5 digits:
Number 12 wins
Number 1234 wins
===Formating switches===
The following formatting switches can be used in Oblivion. Put them in any sequence right after the '%'
{|border="1" cellpadding="5" cellspacing="0"
|-
! style="background:#efefef;" | Switch
! style="background:#efefef;" | Function
|-
|<nowiki>+</nowiki>
|Display + in front of positive numbers
|-
|<nowiki><Space></nowiki>
|Leave a leading space in front of positive numbers
|-
|<nowiki>-</nowiki>
|Use left-aligned formation instead of right alligned.
|-
|<nowiki>0</nowiki>
|The filling-char used for formatting is '0' instead of ' '
|}
===Other Functions===
'''%d'''
This one works just like "%.0f", displaying 0 decimal places.
'''%.3e'''
Shows numbers in scientific formation (123000 = 1.23E+5)
===Examples===
'''Messagebox "Var1:% 5.2f / Var2:% 5.2f"'''
"Var1: 123.45 / Var1: -123.45"
'''Messagebox "Var1:%05.2f / Var2:%05.2f"'''
"Var1: 00123.45 / Var1:-00123.45"
'''Messagebox "Var1:%+-5.0f / Var2:%+-5.0f"'''
"Var1:+123 / Var1:-123 "
'''Messagebox "Var1:% .3e / Var2:% .3e'''
"Var1: 1.234E+2 / Var2:-1.234E+2"
==See Also==
| |||