Xer0botXer0
Senpai
Hi guys,
Update:
So I've moved over to the spacebar + left click combo for panning the screen, it seems to work great besides for jitter. Here's the code, I thought perhaps slight movements of the hand caused the jitter but infact after moving the mouse and stop moving while still having the combo pressed it jitters. I draw the x/y coordinates on screen and the view_x/yview values are jumping around, but very little.
--------------
So I needed to implement zoom/pan functionality to help me decide if I'm gonna create two rooms or stick to one room and just zoom in to the scenes.
And I've had horrible experiences with views, so beside from reading the documentation which hasn't helped me very much I've decided to keybind incrementing/decrementing values to view_xview, view_yview, view_hview, view_wview, view_xport, view_yport, view_wport and view_hport..
With that I've concluded that view_x/yview moves the visible window around the view port.
The view_w/hview zooms in/out, I do have a question about this or an issue which I'll ask in a moment.
The view_x/yport doesn't do anything when I increment/decrement their values (+/- 30) ? If I remember correctly that only works before entering a room or restarting a room.
View_w/hport I haven't tested yet. I assume it would zoom in as well ? is it similar to image_xscale/image_yscale ? but of the room view ?
And back to zooming in and out with view_w/hview, it seems to zoom in and out on the view_x/yview position instead of zooming in on the center. So my guess is it's sort of like cropping the view by the width and height.
So far I'm happy with my tests, I'm going to do some proper key binding now like hold space + left clicking and dragging will activate a boolean which when active will pan the camera around, zooming will be hold space + mouse scroll, but how would I zoom in to the center instead of on the x/y coordinates of the view ? I assume some sort of offset.
Finally I do wonder, is there a way to actually change the game window width/height itself ? like if my main menu is w:1024/4 h:800/1.5 and then I could change it back to the larger resolution when in-game and full screen. Or alternatively a way to resize the window with the mouse on border ?
Update:
So I've moved over to the spacebar + left click combo for panning the screen, it seems to work great besides for jitter. Here's the code, I thought perhaps slight movements of the hand caused the jitter but infact after moving the mouse and stop moving while still having the combo pressed it jitters. I draw the x/y coordinates on screen and the view_x/yview values are jumping around, but very little.
GML:
///Test Camera location
if keyboard_check(vk_space) && mouse_check_button(mb_left)
{
if prev_x != mouse_x
{
if prev_x > mouse_x
{
xview += floor(prev_x - mouse_x);
}
if prev_x < mouse_x
{
xview -= floor(mouse_x - prev_x);
}
}
if prev_y != mouse_y
{
if prev_y > mouse_y
{
yview += floor(prev_y - mouse_y);
}
if prev_y < mouse_y
{
yview -= floor(mouse_y - prev_y);
}
}
}
prev_x = mouse_x;
prev_y = mouse_y;
So I needed to implement zoom/pan functionality to help me decide if I'm gonna create two rooms or stick to one room and just zoom in to the scenes.
And I've had horrible experiences with views, so beside from reading the documentation which hasn't helped me very much I've decided to keybind incrementing/decrementing values to view_xview, view_yview, view_hview, view_wview, view_xport, view_yport, view_wport and view_hport..
With that I've concluded that view_x/yview moves the visible window around the view port.
The view_w/hview zooms in/out, I do have a question about this or an issue which I'll ask in a moment.
The view_x/yport doesn't do anything when I increment/decrement their values (+/- 30) ? If I remember correctly that only works before entering a room or restarting a room.
View_w/hport I haven't tested yet. I assume it would zoom in as well ? is it similar to image_xscale/image_yscale ? but of the room view ?
And back to zooming in and out with view_w/hview, it seems to zoom in and out on the view_x/yview position instead of zooming in on the center. So my guess is it's sort of like cropping the view by the width and height.
So far I'm happy with my tests, I'm going to do some proper key binding now like hold space + left clicking and dragging will activate a boolean which when active will pan the camera around, zooming will be hold space + mouse scroll, but how would I zoom in to the center instead of on the x/y coordinates of the view ? I assume some sort of offset.
Finally I do wonder, is there a way to actually change the game window width/height itself ? like if my main menu is w:1024/4 h:800/1.5 and then I could change it back to the larger resolution when in-game and full screen. Or alternatively a way to resize the window with the mouse on border ?
Last edited: