OblivionSkull21
Member
I've had this issue for a while now but just kind of looked past it. Well, now I'm ready to fix it.
So, I have an inventory screen which is supposed to pop up dead center on the screen every time I open it. I have this code to do that:
It pops up in the center of the screen just fine ONLY IF:
a.)The player is at the edge of the screen, so the view isn't moving
b.)The player is standing still
When the player opens the inventory, they are unable to move until they close it (that's how I want it).
Now, the issue is that, when the player tries to open the inventory while they're moving (and the view is following them), then the player will stand still as planned, but the inventory screen will pop up slightly off center and then slide to the center (this takes about a half second).
My code for the view object that follows the player:
Now, it's worth noting that if I switch the object following in the room editor from obj_view to obj_player, the inventory doesn't slide when the player is moving, which is what I want. But, I wanted better view movement, which is why I wanted the camera to follow obj_view instead.
Any help?
So, I have an inventory screen which is supposed to pop up dead center on the screen every time I open it. I have this code to do that:
Code:
x = camera_get_view_x(view_camera[0]) + 160;
y = camera_get_view_y(view_camera[0])+ 120;
a.)The player is at the edge of the screen, so the view isn't moving
b.)The player is standing still
When the player opens the inventory, they are unable to move until they close it (that's how I want it).
Now, the issue is that, when the player tries to open the inventory while they're moving (and the view is following them), then the player will stand still as planned, but the inventory screen will pop up slightly off center and then slide to the center (this takes about a half second).
My code for the view object that follows the player:
Code:
x += (obj_player.x - x) * .6 ;
y += (obj_player.y - y) * .6 ;
Any help?