1. Hey! Guest! The 34th GMC Jam will take place between August 22nd, 12:00 UTC (Thursday noon) and August 26th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

GM:S 1.4 Need help with keeping objects consistent with room size

Discussion in 'Programming' started by dubas, Jun 30, 2016.

  1. dubas

    dubas Guest

    I am currently working on a puzzle game and I need to resize the room size so I can scale on devices correctly. I want to make sure that all the objects in the room stay in the middle of the room, but when I change the room height, it only adds space to the bottom of the room, making all the objects move to the top of the room, which I do not want. I was wondering if there was any way to make the room bigger without having to move all the objects in every room to the middle. Thanks!
     
  2. NazGhuL

    NazGhuL NazTaiL

    Joined:
    Jun 20, 2016
    Posts:
    522
    Last edited: Jun 30, 2016
    RangerX likes this.
  3. dubas

    dubas Guest

    That's what I am trying to do, but the issue is where I make the room big. I don't want to go through 60 levels having to move all the objects in the room back to the center after changing the room size. Is there any way to make the room larger while still keeping the objects in the middle of the room (where I currently have them in a 512x512 room)?
     
  4. NazGhuL

    NazGhuL NazTaiL

    Joined:
    Jun 20, 2016
    Posts:
    522
    If you set your room to, let say 3000x3000. To set an object in the middle you:

    Code:
    x = room_width/2;
    y = room_height/2;
    Generally, i'm setting a big enough room then adjust view then draw/moves objects acccording to view_xview and view_yview

    -edit-
    or edit the room size using
    room_set_height and room_set_width but: you can change (or set) the height and width of any room in your game except the current one.
     

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