i was searching in google for hours and i still cant find the right answer, so i have a last chance to come here and ask.
i\'m making school year JAVA FX project. I\
What I think you are asking for is a Scene
with a map (represented as an Image
) in the background and controls layered on top of the map to allow interaction with the map at certain positions. Your question is a little unclear, so I'm not exactly sure if that is what you are asking.
If so, here is some sample code to implement that.
For the example use the mouse (or probably touch commands or trackpad scroll gestures - though I haven't a touch screen or trackpad to test it) to drag the map around. Click on the button to "Kill the evil witch".
The solution works by:
ImageView
to hold the background map.StackPane
over the stacked background ImageView
.ScrollPane
bound to the scene's size.ScrollPane
to make it pannable.