title: In JavaFX how do I move a sprite across the screen?
body: <p>I'm new to JavaFX and am trying to write a game where an animated 2D character walks across the screen (for example like the original Legend of Zelda game). I had done this in Swing, by creating my own Sprite class and overriding the paintComponent() method in Swing, and putting my own  g2d.drawImage(...); call in there, where it would copy the correct subframe from a Sprite to the correct x,y destination in a JPanel, thus achieving the movement of an animated (walking) 2D image across the screen.</p>
  
  <p>How can I do this in JavaFX? I found this excellent example on how to create a sprite:
  <a href="http://blog.netopyr.com/2012/03/09/creating-a-sprite-animation-with-javafx/" rel="noreferrer">http://blog.netopyr.com/2012/03/09/creating-a-sprite-animation-with-javafx/</a>
  in JavaFX, but how do I do the PaintComponent and drawImage(...) parts? Does JavaFX have an equivalent method to PaintComponent where everything is redrawn?
  I tried calling the primaryStage.show(); method, but that didn't work.</p>
  
  <p>I guess I'm not clear on how exactly to set up my master game loop, where a refresh is triggered and an image is painted on the scene at a different x,y location? </p>
  
  <p>What's the JavaFX equivalent to the drawImage(...) method? this method allows me to copy a part of a source image into a destination scene at any given x,y offset. That is how I achieved moving an animated sprite on screen in Swing.</p>
  
  <p>Best Regards,</p>
  
  <p>Zareh</p>