Z
zendraw
Guest
im not sure if im doing somthing wrong, but camera/view functions dont seem to work. i have this code that runs in the first room, then we go to 2nd room in the project with 0 effect.
-camera shuld be destroyed, it is not
-matrices nor camera resizing works
-setting viewport and enabling view in rooms does nothing and i also set them in room start event
how is it so hard to:
1-create a custom camera and set it to a view
2-set that view`s size
3-enable views
i mean nothing really works atall. in the room settings i havent touched anything, its all default.
GML:
/// @desc scrstart();
camera_destroy(view_camera[0]);
show_debug_message(111111111111111111);
if (view_camera[0]==-1) {show_debug_message("camera deleted!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")};
var nc=camera_create();
show_debug_message(nc);
view_camera[0]=nc;
show_debug_message(view_get_camera(view_camera[0]));
var vm = matrix_build_lookat(0, 0, -10, 0, 0, 0, 0, 1, 0);
var pm = matrix_build_projection_ortho(480, 270, 1.0, 32000.0);
camera_set_view_mat(view_camera[0], vm);
camera_set_proj_mat(view_camera[0], pm);
camera_set_view_size(view_camera[0], 480, 270);
var i=0;
repeat (room_last+1)
{
if (room_exists(i))
{
room_set_viewport(i, view_camera[0], true, 0, 0, 480, 270);
room_set_view_enabled(i, true);
} else {break;};
i++;
}
with (ocamera) {instance_destroy()};
instance_create_depth(0, 0, 0, ocamera);
room_goto_next();
-matrices nor camera resizing works
-setting viewport and enabling view in rooms does nothing and i also set them in room start event
GML:
view_enabled=true;
view_set_visible(view_camera[0], true);
1-create a custom camera and set it to a view
2-set that view`s size
3-enable views
i mean nothing really works atall. in the room settings i havent touched anything, its all default.