gm-docs-parser 1.0.0

A collection of typings for GameMaker Studio 2 manual pages
Documentation
<?xml version="1.0" encoding="utf-8" ?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>

  <script type="text/javascript" language="JavaScript">
    //<![CDATA[
    function reDo() {
      if (innerWidth != origWidth || innerHeight != origHeight)
        location.reload();
    }
    if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
      origWidth = innerWidth;
      origHeight = innerHeight;
      onresize = reDo;
    }
    onerror = null;
  //]]>
  </script>
  <style type="text/css">/*<![CDATA[*/

    < !-- div.WebHelpPopupMenu {
      position: absolute;
      left: 0px;
      top: 0px;
      z-index: 4;
      visibility: hidden;
    }

    p.WebHelpNavBar {
      text-align: right;
    }

    -->
  
/*]]>*/</style>

  <script type="text/javascript">//<![CDATA[

    gRootRelPath = "../../../..";
    gCommonRootRelPath = "../../../..";
    gTopicId = "9.2.2.14";
  
//]]></script>

  <script type="text/javascript" src="../../../../template/scripts/rh.min.js"></script>
  <script type="text/javascript" src="../../../../template/scripts/common.min.js"></script>
  <script type="text/javascript" src="../../../../template/scripts/topic.min.js"></script>
  <script type="text/javascript" src="../../../../template/scripts/topicwidgets.min.js"></script>
<script type="text/javascript" src="../../../../whxdata/projectsettings.js"></script>
  <link rel="stylesheet" type="text/css" href="../../../../template/styles/topic.min.css"/>
  <link rel="stylesheet" type="text/css" href="../../../../template/Charcoal_Grey/topicheader.css"/>
  <meta name="topic-status" content="Draft"/>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>Rooms</title>
  <meta name="generator" content="Adobe RoboHelp 2019"/>
  <link rel="stylesheet" href="../../../../assets/css/default.css" type="text/css"/>
  <meta name="rh-authors" content="Mark Alexander"/>
  <meta name="topic-comment" content="Page outlining the different functions and variables associated with Rooms"/>
  <meta name="rh-index-keywords" content=""/>
  <meta name="search-keywords" content="Rooms"/>
</head>

<body>
  <div class="topic-header rh-hide" id="rh-topic-header" onclick="rh._.goToFullLayout()">
    <div class="logo">
    </div>
    <div class="nav">
      <div class="title" title="Rooms">
        <span>Rooms</span>
      </div>
      <div class="gotohome" title="Click here to see this page in full context">
        <span>Click here to see this page in full context</span>
      </div>
    </div>
  </div>
  <div class="topic-header-shadow rh-hide" id="rh-topic-header-shadow"></div>



  <!--<div class="body-scroll" style="top: 150px;">-->
  <h1>Rooms</h1>
  <p>Rooms are created in the <a href="../../../../The_Asset_Editors/Rooms.htm">Room Editor</a> in GameMaker Studio 2<span> and </span>are where everything happens in your game. You must have at least one room in any game for it to run, but you may
    need many more depending on the type of game and how you structure your project. This section has all the general GML functions and variables related to rooms and for getting information about them as well as for setting certain properties within
    them.</p>
  <p>The following <a href="../../../GML_Overview/Variables/Global_Variables.htm">global variables</a> and functions can be used for getting basic information about any given room:</p>
  <p> </p>
  <ul class="colour">
    <li><a href="room_first.htm">room_first</a></li>
    <li><a href="room_last.htm">room_last</a></li>
    <li><a href="room_next.htm">room_next</a></li>
    <li><a href="room_previous.htm">room_previous</a></li>
    <li><a href="room.htm">room</a></li>
    <li><a href="room_speed.htm">room_speed</a></li>
    <li><a href="room_height.htm">room_height</a></li>
    <li><a href="room_width.htm">room_width</a></li>
    <li><a href="room_persistent.htm">room_persistent</a></li>
  </ul>
  <p> </p>
  <p>You can also use the following functions to get the name of the current room (as defined in the <a href="../../../../Introduction/The_Asset_Browser.htm">Asset Browser</a>) as well as move between rooms:</p>
  <p> </p>
  <ul class="colour">
    <li><a href="room_get_name.htm">room_get_name</a></li>
    <li><a href="room_goto.htm">room_goto</a></li>
    <li><a href="room_goto_next.htm">room_goto_next</a></li>
    <li><a href="room_goto_previous.htm">room_goto_previous</a></li>
    <li><a href="room_restart.htm">room_restart</a></li>
  </ul>
  <p> </p>
  <p>Next, we have a series of functions that can be used to change rooms and their contents or even create new rooms and add to them. It should be noted that these functions should <i>never be run from within the room that you wish to change</i>, but rather
    be run from an instance in another room first. Also note that if you change any room asset in this way, the change is <strong>permanent</strong> and will be maintained for the entire duration of the game, even if you call the room_restart() function
    (closing and restarting the game will reset the room properties though).</p>
  <p> </p>
  <ul class="colour">
    <li><a href="room_exists.htm">room_exists</a></li>
    <li><a href="room_add.htm">room_add</a></li>
    <li><a href="room_duplicate.htm">room_duplicate</a></li>
    <li><a href="room_assign.htm">room_assign</a></li>
    <li><a href="room_instance_add.htm">room_instance_add</a></li>
    <li><a href="room_instance_clear.htm">room_instance_clear</a></li>
    <li><a href="room_set_height.htm">room_set_height</a></li>
    <li><a href="room_set_width.htm">room_set_width</a></li>
    <li><a href="room_set_persistent.htm">room_set_persistent</a></li>
    <li><a href="room_set_view_enabled.htm">room_set_view_enabled</a></li>
    <li><a href="room_set_viewport.htm">room_set_viewport</a></li>
    <li><a href="room_get_viewport.htm">room_get_viewport</a></li>
    <li><a href="room_set_camera.htm">room_set_camera</a></li>
    <li><a href="room_get_camera.htm">room_get_camera</a></li>
  </ul>
  <p> </p>
  <p>There are also a number of different functions related to creating and manipulating the different types of elements that can be placed on layers in the room. These functions are listed in the appropriate sections for each element type listed below:</p>
  <ul class="colour">
    <li><a href="General_Layer_Functions/General_Layer_Functions.htm">General Layer Functions</a></li>
    <li><a href="Tile_Map_Layers/Tile_Map_Layers.htm">Tile Map Layers</a></li>
    <li><a href="Background_Layers/Background_Layers.htm">Background Layers</a></li>
    <li><a href="Sprite_Layers/Sprite_Layers.htm">Sprite Layers</a></li>
    <li><a href="Sequence_Layers/Sequence_Layers.htm">Sequence Layers</a></li>
  </ul>
  <p> </p>
  <p>An important thing to note when creating room layers is that <i>you can have multiple different element types on one layer</i>. So, for example, you may have a layer for enemies, and on that layer have the enemy instances as well as certain sprite assets
    that are only related to that enemy. Or you could have a background element with a tile map element to create the look of a room. This is not permitted in the room editor, but when creating things dynamically you can do this, which is why functions
    like <a href="General_Layer_Functions/layer_get_all_elements.htm"><tt>layer_get_all_elements()</tt></a> exist.</p>
  <p> </p>
  <p> </p>
  <p> </p>
  <div class="footer">
    <div class="buttons">
      <div class="clear">
        <div style="float:left">Back: <a href="../Asset_Management.htm">Asset Management</a></div>
        <div style="float:right">Next: <a href="../Assets_And_Tags/Assets_And_Tags.htm">Assets And Tags</a></div>
      </div>
    </div>
    <h5>© Copyright YoYo Games Ltd. 2020 All Rights Reserved</h5>
  </div>
  <!-- KEYWORDS
Rooms
Room Layers
Layer Functions
-->
  <!-- TAGS
room_functions
-->

</body></html>