Difference between revisions of "Click Expression Reference"
From Mario Fan Games Galaxy Wiki
m (fixing stupid oversights and misc stuff) |
m (clarifying int() ceil() and floor()) |
||
Line 19: | Line 19: | ||
{{ClickExpRef/Row| expression = FloatToString$( float, total_digits, digits_after_point ) | desc = Converts a float into a string, with some formatting options.|avail = {{TGF2}} {{MMF2}}}} | {{ClickExpRef/Row| expression = FloatToString$( float, total_digits, digits_after_point ) | desc = Converts a float into a string, with some formatting options.|avail = {{TGF2}} {{MMF2}}}} | ||
{{ClickExpRef/Row| expression = Val( string ) | desc = Converts a string to a number up until the first non-numeric character in the string (Ex: "12345a67" converts to 12345). However, if the string is a hex or binary string starting with '0x' or '0b', it will be converted to decimal.}} | {{ClickExpRef/Row| expression = Val( string ) | desc = Converts a string to a number up until the first non-numeric character in the string (Ex: "12345a67" converts to 12345). However, if the string is a hex or binary string starting with '0x' or '0b', it will be converted to decimal.}} | ||
− | {{ClickExpRef/Row| expression = Int( float ) | desc = Converts a float into | + | {{ClickExpRef/Row| expression = Int( float ) | desc = Converts a float into a true integer (anything after the decimal point is lost). Rounds toward 0.|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} |
{{ClickExpRef/Row| expression = Round( float ) | desc = Rounds a float up if the decimal is >= .5, or down otherwise—the opposite if negative. The resulting number is still a float.|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} | {{ClickExpRef/Row| expression = Round( float ) | desc = Rounds a float up if the decimal is >= .5, or down otherwise—the opposite if negative. The resulting number is still a float.|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} | ||
{{ClickExpRef/Row| expression = Hex$( integer ) | desc = Converts an integer to a hex string in the form ''0xNNNNNNNN''. The resulting hex string past the '0x' may be up to 8 characters, but can be less.|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} | {{ClickExpRef/Row| expression = Hex$( integer ) | desc = Converts an integer to a hex string in the form ''0xNNNNNNNN''. The resulting hex string past the '0x' may be up to 8 characters, but can be less.|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} | ||
{{ClickExpRef/Row| expression = Bin$( integer ) | desc = Converts an integer to a binary string in the form ''0bNNNNNNNN''. The resulting binary string past the '0b' may be up to 32 characters, but can be less.|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} | {{ClickExpRef/Row| expression = Bin$( integer ) | desc = Converts an integer to a binary string in the form ''0bNNNNNNNN''. The resulting binary string past the '0b' may be up to 32 characters, but can be less.|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} | ||
{{ClickExpRef/Row| expression = abs( number ) | desc = Returns the absolute value of a number (removes the negative sign if present).|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} | {{ClickExpRef/Row| expression = abs( number ) | desc = Returns the absolute value of a number (removes the negative sign if present).|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} | ||
− | {{ClickExpRef/Row| expression = ceil( float ) | desc = Forces a float to round to the nearest number larger than it. The result remains a float. (Ex: 3.2 -> 4.0; -3.2 -> -3.0)|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} | + | {{ClickExpRef/Row| expression = ceil( float ) | desc = Forces a float to round to the nearest number larger than it. The result remains a float. (Ex: 3.2 -> 4.0; -3.2 -> -3.0). Rounds toward positive infinity. |avail = {{MMF1}} {{TGF2}} {{MMF2}}}} |
− | {{ClickExpRef/Row| expression = floor( float ) | desc = Forces a float to round to the nearest number smaller than it. The result remains a float. (Ex: 4.8 -> 4.0; -4.8 -> -5.0)|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} | + | {{ClickExpRef/Row| expression = floor( float ) | desc = Forces a float to round to the nearest number smaller than it. The result remains a float. (Ex: 4.8 -> 4.0; -4.8 -> -5.0). Rounds toward negative infinity.|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} |
{{ClickExpRef/Row| expression = sqr( number ) | desc = Returns the square root of a number.|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} | {{ClickExpRef/Row| expression = sqr( number ) | desc = Returns the square root of a number.|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} | ||
{{ClickExpRef/Row| expression = log( number ) | desc = Returns the base-10 log of a number.|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} | {{ClickExpRef/Row| expression = log( number ) | desc = Returns the base-10 log of a number.|avail = {{MMF1}} {{TGF2}} {{MMF2}}}} |
Latest revision as of 19:26, 27 September 2009
The following is a list of the expressions that are used in the various Click programs.
Note: this list only includes expressions for the default system objects and the Expression Editor dialog; extensions' expressions are not listed here. Some of these expressions may only be available in newer builds of specified programs. Expression names are not case-sensitive. Expressions including a $ return strings, and those without generally return numbers (but there is an exception in this list [and within some other extensions] which returns a string: key( "Player" )). TGF1 may use "level" instead of "frame" in some cases
Contents
Special Object
Sound Object
Storyboard Controls Object
Timer Object
Create Object
total objects | Returns the count of all objects on the frame. |
Mouse and Keyboard Object
Player Objects
Expression Editor
includes operators