January 2002
Beginner
768 pages
25h 51m
English
When you set up a callback and use the
Ev('x') and/or Ev('y')
arguments to find out where the user clicked, you must translate that
information into Canvas coordinates (Ev is
explained in Chapter 15). To do this, use the
canvasx and canvasy methods:
$x = $canvas->canvasx(screenx [, gridspacing ]); $y = $canvas->canvasy(screeny [, gridspacing ]);
Each method takes an optional gridspacing argument; the Canvas coordinate value will be rounded to the nearest value to fit the grid.
Read now
Unlock full access