Quote from: Wretched on Thu 10/08/2006 21:42:35I don't get what you mean by "using 2 screens"? The regions and hotspots are drawn on separate backgrounds, different rooms ?
In Zugzwang I used two Screens, one with Hotspots and one with Regions. I read both on a mouse click. The Hotspots gives me the Board X value and Regions the Board Y value.
Quote from: Wretched on Thu 10/08/2006 21:42:35
function ScreenXY(int x, int y)Ã, Ã, //Board (x,y)Ã, Ã, (0,0) is top left
{
Ã, if (y==0) SY=220;Ã, Ã, //Get Screen Y values for vertical centre of each square
Ã, if (y==1) SY=195;
Ã, if (y==2) SY=171;
Ã, if (y==3) SY=150;
Ã, if (y==4) SY=129;
Ã, if (y==5) SY=110;
Ã, if (y==6) SY=94;
Ã, if (y==7) SY=81;
I think I understand the part where SY is initialized to eg. SY=81 (calculated based on the height of the squares on the background) but I don't get the part if(y==0) etc.
I understand that it is linked to the region or hotspot assigned in a specific row (depending on what you used for the y valuesi.e hotspot or region) but have no idea how it is linked.
Quote from: Wretched on Thu 10/08/2006 21:42:35Can you elaborate on what value you used for the calculations.
Ã, ky=1.0-(IntToFloat(SY)-81.0)/(225.0-89.0);Ã, //ky=1.0 at bottom =0.0 at top
Ã,Â
Quote from: Wretched on Thu 10/08/2006 21:42:35
Ã, kx=(IntToFloat(x))/(IntToFloat(BoardSize-1));
I couldn't find anything on the BoardSize variable that was used here (was not declared)
Thanks for the help so far I appreciate the effort!