Sorry, I'll try to elaborate that a little better
I have a 40x40 map that I want to show a total overlay on. The picture, therefore, is 640x640 (the total dimensions of a 40x40 tile map). This picture needs to be centered on the map. In other words, the center of the 640x640 picture needs to be, at all times, on the center of the 40x40 map.
At any given point on the map, you can make adjustments to make that happen. Find the location of the hero, add or subtract based on that location, and show the picture at the resultant points. If you have total control over where the hero enters the map from, then it's pretty easy to manually create those adjustments. But what if I don't have control? What if the player can enter the map onto any given tile?
Keep in mind that the screen ceases to move before the player does (going to the sides of the map, for example. the player keeps going left or right, but the screen is stationary).
I would like some kind of formula or method that can find the necessary adjustments at any given point on the map. The hero is at (X,Y), the picture gets shown at (X',Y').
Hope we can get this sorted out
EDIT: Yet to try it, but I think this might work:
Set [Hero X] to hero's X coordinate.
Set [Hero Y] to hero's Y coordinate
***next part checks for screen edges of a 40x40***
If [Hero X] is less than 10, set it to 10
If [Hero X] is greater than 28, set it to 28
If [Hero Y] is less than 7, set it to 7
If [Hero Y] is greater than 31, set it to 31
***next part gets the distance from center in pixels***
[Hero X] +/-20 (sign determined by whether the Var is already greater than or less than 20)
[Hero Y] +/-20
[Hero X] *16
[Hero Y] *16
***lastly, flipping the signs to give coordinates***
[Hero X] * -1
[Hero Y] * -1
I think that has a shot to work.