Difference between revisions of "Mutation Operators"
From GiderosMobile
Line 2: | Line 2: | ||
'''Supported platforms:''' android, ios, mac, pc<br/> | '''Supported platforms:''' android, ios, mac, pc<br/> | ||
'''Available since:''' Gideros 2017.11<br/> | '''Available since:''' Gideros 2017.11<br/> | ||
− | === Description === | + | === <translate>Description</translate> === |
<translate><br /> | <translate><br /> | ||
Operators to mutate a value.<br /><br /> | Operators to mutate a value.<br /><br /> | ||
Line 12: | Line 12: | ||
a<b> %= </b>b   The result of 'a%b' is placed in 'a'.<br /> | a<b> %= </b>b   The result of 'a%b' is placed in 'a'.<br /> | ||
a<b> ^= </b>b   The result of 'a^b' is placed in 'a'. ^ is faster than a=math.pow(a,b)<br /></translate> | a<b> ^= </b>b   The result of 'a^b' is placed in 'a'. ^ is faster than a=math.pow(a,b)<br /></translate> | ||
− | === Examples === | + | === <translate>Examples</translate> === |
'''Simple larger example'''<br/> | '''Simple larger example'''<br/> | ||
<source lang="lua"> | <source lang="lua"> | ||
Line 18: | Line 18: | ||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === Methods === | + | === <translate>Methods</translate> === |
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === Events === | + | === <translate>Events</translate> === |
− | === Constants === | + | === <translate>Constants</translate> === |
|} | |} |
Revision as of 07:29, 24 August 2018
Supported platforms: android, ios, mac, pc
Available since: Gideros 2017.11
Description
Operators to mutate a value.
a += b Add 'b' to 'a'.
a -= b Subtract 'b from 'a'.
a *= b Multiply 'a' by 'b', result in 'a'.
a /= b Divide 'a' by 'b', result in 'a'.
a %= b The result of 'a%b' is placed in 'a'.
a ^= b The result of 'a^b' is placed in 'a'. ^ is faster than a=math.pow(a,b)
Examples
Simple larger example
score+=1 -- faster and less typing than score=score+1
Methods |
EventsConstants |