How to manipulate Canvas elements: Difference between revisions

Jump to navigation Jump to search
Line 258: Line 258:
At the ''>>>'' prompt type:<syntaxhighlight>
At the ''>>>'' prompt type:<syntaxhighlight>
var arrow = canvas.plot2D.polyline(myGroup,[90,120,10],[20,30,30],'#0',"y");</syntaxhighlight>
var arrow = canvas.plot2D.polyline(myGroup,[90,120,10],[20,30,30],'#0',"y");</syntaxhighlight>
Do not forget the {{key press|Enter}}.<br />
Do not forget the {{key press|Enter}}.[[File:My_Arrow.png|thumb]]
You should have something like this:[[File:My_Arrow.png|thumb]]<br />
You should have something like this:<br />
Let's get closer to see some hidden stuff:<br />
Let's get closer to see some hidden stuff:<br />[[File:Arrow.gif|none]] <br />
[[File:Arrow.gif|none]] <br />
Our '''''arrow''''' has (like any other element) its own <big>'''''intrinsic'''''</big> coordinate system.
Our '''''arrow''''' has (like any other element) its own (intrinsic) coordinate system. Typing:
=== Intrinsic Coordenates ===
Typing:
<syntaxhighlight>
<syntaxhighlight>
arrow.getBoundingBox();
arrow.getBoundingBox();
Line 269: Line 270:
  <span style="background: white; color: red">'left-top'    'center-top'    'right-top'
  <span style="background: white; color: red">'left-top'    'center-top'    'right-top'
  'left-center'  'center-center'  'right-center'
  'left-center'  'center-center'  'right-center'
  'left-bottom'  'center-bottom'  'right-bottom'</span>
  'left-bottom'  'center-bottom'  'right-bottom'</span> Is nothing other than a convenient way to refer to (Xmin,Ymin), (xXmin+Xnax/2,Ymin), etc.
<br />
<br />
'''Plot2D''' (and '''Canvas API''') uses such nomenclature.<br />
229

edits

Navigation menu