nosenseworrying Posted April 17, 2015 Share Posted April 17, 2015 Here's what I'm trying to accomplish:Game world size 1200x900Game view / Camera view size 800x600Freely move camera around world with keyboard arrowsLoad characters in various places around the mapSelect from a list of character thumbnails and move the camera to focus on that character (wherever they are on the map)I've got the basic functionality in play, and I'm using the Camera focusOn() method to move the camera to the selected character (based on the thumbnail clicked), however here is the issue: When the camera has the selected character in the current view, all is well. But, when the character is out of the current view (if you move the camera with the keyboard so that the selected character is completely out of view), the character sprite itself gets moved after the focusOn() call to the 0,0 coordinate of the rectangle representing the previous view.Is there some attribute I need to set on the camera and/or sprite so that I can call focusOn() and only move the camera, leaving the sprite at its current coordinates, even if they're currently out of view?Please let me know if I can further clarify... Thanks for your time and your help! Link to comment Share on other sites More sharing options...
Recommended Posts