samspade
Member
I was drawing a bunch of variables to the screen to check something else when I noticed that my view port variables didn't seem to match much to anything. So I added some code into change the viewport, and it seems that I can change the view port to whatever I want (including negative numbers) and nothing changes on screen.
I didn't notice this at first because it isn't actually causing a problem for me, but now I'm curious as to why these variables don't seem to be doing what I think they should.
Does anyone know what is going on?
Code:
//debug code
var camera_port_width, camera_port_height;
camera_port_width = view_wport[0];
camera_port_height = view_hport[0];
print("Camera Port Width ", camera_port_width);
print("Camera Port Height ", camera_port_height);
//code that changes viewport
var change = 0;
if (keyboard_check(vk_up)) || (keyboard_check(vk_down)) {
change = keyboard_check(vk_down) - keyboard_check(vk_up);
view_set_hport(0, view_hport[0] + change);
}
if (keyboard_check(vk_left)) || (keyboard_check(vk_right)) {
change = keyboard_check(vk_right) - keyboard_check(vk_left);
view_set_wport(0, view_wport[0] + change);
}
Does anyone know what is going on?