
MouseOver Iso Beispiel
By: a guest on
Aug 5th, 2012 | syntax:
Java | size: 0.49 KB | hits: 24 | expires: Never
if (foundTiles.size() == 2) {
midPoint0.x = foundTiles[0].x + tileWidth/2;
midPoint0.y = foundTiles[0].y + tileHeight/2;
midPoint1.x = foundTiles[1].x + tileWidth/2;
midPoint1.y = foundTiles[1].y + tileHeight/2;
int smallerIndex;
if ( distance(midPoint0, mousePosition) <= distance(midPoint1, mousePosition) ) {
smallerIndex = 0;
} else {
smallerIndex = 1;
}
mouseOverTile = foundTiles[smallerIndex];
} else {
mouseOverTile = foundTiles[0];