I am developing a musical instrument which is round with notes on the inside. When a note is clicked a sound is heard. However i am having a problem scaling this for different sized android devices.
The code that i am using is not really scalable... how can i change this to scale the code with the coordinates referencing the polygon shapes to different sized devices.....
I have nine different instruments, each with many notes so mapping each note to a different screen resolution is a nightmare...
//test if point clicked is within defined chord
`private boolean testIfFSharp6(int x, int y){
boolean _retVal = false;
if(resolutionType == "480X800"){
int[] xPts = new int[] { 182,223,221,180,182};
int[] yPts = new int[] { 172,172,215,214,172};
_retVal = in_or_out_of_polygon(xPts, yPts, x, y);
}else if(resolutionType == "320X480"){
int[] xPts = new int[] { 120,146,145,120,120};
int[] yPts = new int[] { 116,116,146,142,116};
_retVal = in_or_out_of_polygon(xPts, yPts, x, y);
}else if(resolutionType == "240X400"){
int[] xPts = new int[] { 89,110,109,90,89 };
int[] yPts = new int[] { 87,86,108,111,87};
_retVal = in_or_out_of_polygon(xPts, yPts, x, y);
}else{
int[] xPts = new int[] { 231,281,277,231,231 };
int[] yPts = new int[] { 222,223,277,272,222};
_retVal = in_or_out_of_polygon(xPts, yPts, x, y);
}
return _retVal;
}`