How to drag the camera at high x_border value

Discussion in 'Programming' started by saito kami, Jul 11, 2019.

  1. saito kami

    saito kami Member

    Jul 11, 2019
    I use the following code:

    view_enabled = true;
    view_visible[0] = true;
    var width = 480, height = 270, scale = 2;
    var cam = camera_create_view(0,0,width,height, 0, object0, -1, -1, 430, height/2);
    view_set_camera(0, cam);
    window_set_size(width*scale, height*scale);
    surface_resize(application_surface, width*scale, height*scale);
    From the docs i read that the last 2 arguments of camera_create_view are used to set the position where to drag the camera from, my problem is if the x_border is higher than width/2 (430 in this case), no matter how high the value are, the camera still drags at the centre.
    Did i understand it wrong? or is there a problem in this code.
  2. samspade

    samspade Member

    Feb 26, 2017
    I don't understand the question. You might need to explain it in more detail.

    One thing to note is that if all use use is the built in functions listed, then the camera will not leave the room. If you want the camera to leave the room, then you have to manually set the position of the camera. This isn't as hard as it sounds though.


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice