Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8098203

need utility methods for converting to/from screen coordinates

XMLWordPrintable

      Right now there is no convenient way for fx code to convert points to/from screen coordinates.
      We should add these utitilites to the api to make it easier out of the box:

      e.g. from Stephen Chin's library:

         protected function screenToLocal(screenX:Integer, screenY:Integer):Point2D {
             return sceneToLocal(screenX - scene.x - scene.stage.x, screenY - scene.y - scene.stage.y);
         }

         protected function localToScreen(localX:Integer, localY:Integer):Point2D {
             var sceneCoord = localToScene(localX, localY);
             return Point2D {
                 x: sceneCoord.x + scene.x + scene.stage.x
                 y: sceneCoord.y + scene.y + scene.stage.y
             }
         }

            msladecek Martin Sládeček
            amfowler Anne Fowler (Inactive)
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: