I want to create a board class from canvas, which will
allow to track click position on it in coordinates like A2, where
A…D is Y coordinate in some scale
and 1…3 is X coordinate
For example
see image http://img.skitch.com/20091001-k6ybfehid6y8irad36tbsiif15.jpg
What I want to create is a kind of convertor from canvas localX and localY to my
new coordinates like A2.
I am thinking of implementing if condition this way
if (0.4 - x*size(from 1-3 here)/canvas.width <= X <= 0.4 + x*size(from 1-3 here)/canvas.width)
X = x;
This way I can assigned needed coordinates in X range. e.g. 1, 2 ,3 etc
But what to do with alphanumeric range. (if for example I want to make it extensible)…
Maybe there is a way to convert ASCII to char? Pls. suggest your solution
The same way as in JavaScript: fromCharCode. If
yis an integer starting at1for A: