Don't like ads? PRO users don't see any ads ;-)
Guest

MouseOver Iso Beispiel

By: a guest on Aug 5th, 2012  |  syntax: Java  |  size: 0.49 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. if (foundTiles.size() == 2) {
  2.    midPoint0.x = foundTiles[0].x + tileWidth/2;
  3.    midPoint0.y = foundTiles[0].y + tileHeight/2;
  4.    midPoint1.x = foundTiles[1].x + tileWidth/2;
  5.    midPoint1.y = foundTiles[1].y + tileHeight/2;
  6.  
  7.    int smallerIndex;
  8.    if ( distance(midPoint0, mousePosition) <= distance(midPoint1, mousePosition) ) {
  9.       smallerIndex = 0;
  10.    } else {
  11.       smallerIndex = 1;
  12.    }
  13.    mouseOverTile = foundTiles[smallerIndex];
  14.  
  15. } else {
  16.    mouseOverTile = foundTiles[0];