How to manipulate Canvas elements: Difference between revisions

Jump to navigation Jump to search
Line 191: Line 191:
<hr/>
<hr/>
=== rotate180 ===
=== rotate180 ===
  '''parameters''': (elem, center=nil) {
  '''parameters''': (elem, center=nil)  
Rotates the element 180 deg around '''center'''.
Rotates the element 180 deg around '''center'''.
* '''elem''' element to be rotated.
* '''elem''' element to be rotated.
Line 198: Line 198:
=== alignX ===
=== alignX ===
  '''parameters''': (elem, ref, alignment)  
  '''parameters''': (elem, ref, alignment)  
Aligns the element, moving it horizontaly to ref.
Aligns the element, moving it horizontaly to '''ref'''.
Flips vertically the element.
* '''elem''' element to be moved.
* '''elem''' element to be moved.
*  '''ref''' reference may be an integer or another element.
*  '''ref''' reference may be an integer or another element.
*  '''alignment''' as string: may be 'left-left', 'left-center', 'left-right',
*  '''alignment''' as string: may be 'left-left', 'left-center', 'left-right',
            'center-left', 'center-center', 'center-right',
    'center-left', 'center-center', 'center-right',
'right-left', 'right-center', or 'right-right'.<br />
    'right-left', 'right-center', 'right-right'.
If '''ref''' is a single number, the 2nd word is ignored.
  If ref is a single number, the 2nd word is ignored.
<hr/>
    
=== alignY ===
'''parameters''': (elem, ref, alignment)
Aligns the element, moving it vertically to '''ref'''.
* '''elem''' element to be moved.
*  '''ref''' reference may be an integer or another element.
*  '''alignment''' as string: may be top-top', 'top-center', 'top-bottom',
            'center-top', 'center-center', 'center-bottom',
'bottom-top', 'bottom-center', or 'bottom-bottom'.<br />
''Text'' elements also accept   'baseline' as reference.<br />
If '''ref''' is a single number, the 2nd word is ignored.
<hr/>
<hr/>
229

edits

Navigation menu