GML [SOLVED]Camera View/Follow player around (centered)

Discussion in 'Programming' started by ejoshuat, Jan 13, 2017.

  1. ejoshuat

    ejoshuat Guest

    How do I get the camera to follow around the player at its center, and for it to be a small area (zoomed in) so the player has to move and explore to see other areas of the map etc if you know what I mean?
     
  2. jo-thijs

    jo-thijs Member

    Joined:
    Jun 20, 2016
    Posts:
    2,844
    To "zoom in", you just decrease the view size.
    In the room editor, under the view tab, you set for "View in room" the values of W and H to something lower.

    To make the camera follow the player and keep the player centered, there are 2 main ways to go about it.
    1) Let GameMaker do it for you by going to the room editor under the view tab and select which object to follow.
    Then set Hbor to half the value of W for "View in room" and set Vbor to half the value of H for "View in room".

    2) Manually set view_xview and view_yview through code.
     
    mafon2 and Izumi like this.

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