-
Enhancement
-
Resolution: Fixed
-
P3
-
fx2.0
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
}
}
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
}
}
- duplicates
-
JDK-8107810 There is no way to obtain node coordinates on the screen
-
- Closed
-
- relates to
-
JDK-8101996 Add 3D versions of localToScreen methods
-
- Resolved
-
-
JDK-8099069 Add "localToParentTransform" and "localToSceneTransform" variables to Node.fx
-
- Resolved
-
-
JDK-8099403 No way to determine Node screen coordinates.
-
- Closed
-