Files
QtGameMaker/help/files/409_09_rooms.html
T

113 lines
5.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Rooms</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/back.gif">
<!--START-->
<h3>Rooms</h3>
Manipulating rooms on the fly is a dangerous thing to do. You have to realize that rooms
change all the time due to what is happening in the game. This normally only involves the
currently active room and there are many routines described in previous sections to
manipulate the instances, backgrounds, and tiles in the active room. But changes in the
active room will last if the room is persistent. Hence, you should never manipulate
aspects of the currently active room or any room that is persistent and that has already
been visited before. Such changes in general won't be noticed but might sometimes even
lead to unexpected errors. Due to the fact that rooms are linked in a complicated way
there is also no routine to delete a room.
<p>
The following routines are available
<p>
<blockquote></b>
<tt><b>room_set_width(ind,w)</b></tt>
Sets the width for the room with the indicated index.<br>
<tt><b>room_set_height(ind,h)</b></tt>
Sets the height for the room with the indicated index.<br>
<tt><b>room_set_caption(ind,str)</b></tt>
Sets the caption for the room with the indicated index.<br>
<tt><b>room_set_persistent(ind,val)</b></tt>
Sets whether the room with the indicated
index is persistent or not.<br>
<tt><b>room_set_code(ind,str)</b></tt>
Sets the initialization code string for the room
with the indicated index.<br>
<tt><b>room_set_background_color(ind,col,show)</b></tt>
Sets the color properties for
the room with the indicated index if is does not have a background image. col indicates
the color and show indicates whether the color must be shown or not.<br>
<tt><b>room_set_background(ind,bind,vis,fore,back,x,y,htiled,vtiled,hspeed,vspeed,alpha)</b></tt>
Sets background with index bind (0-7) for the room with the indicated index. vis
indicates whether the background is visible and fore whether it is actually a foreground.
back is the index of the background image. x,y indicate the position of the image and
htiled and vtiled indicate whether the image must be tiled. hspeed and vspeed indicate the
speed with which the background moves and alpha indicates an alpha translucency value (1 =
solid and fastest).<br>
<tt><b>room_set_view(ind,vind,vis,xview,yview,wview,hview,xport,yport,wport,hport,hborder,vborder,hspeed,vspeed,obj)</b></tt>
Sets the view with index vind (0-7) for the room with the indicated index. vis indicates
whether the view is visible. xview, yview, wview, and hview indicate the position of the view
in the room. xport, yport, wport, and hport indicate the position on the screen.
When the view must follow an object
hborder and vborder indicate the minimal visible border that must be kept around the
object. hspeed and vspeed indicate the maximal speed with which the view can move. obj is
the index of the object or the index of the instance.<br>
<tt><b>room_set_view_enabled(ind,val)</b></tt>
Sets whether views must be enabled for
the room with the indicated index.<br>
<tt><b>room_add()</b></tt>
Adds a new room. It returns the index of the room. Note that
the room will not be part of the room order. So the new room does not have a previous or a
next room. If you want to move to an added room you must provide the index of the room.<br>
<tt><b>room_duplicate(ind)</b></tt>
Adds a copy of the room with the given index. It returns the index of the room.<br>
<tt><b>room_assign(ind,room)</b></tt>
Assigns the indicated room to room ind. So this makes a copy of the room.<br>
<tt><b>room_instance_add(ind,x,y,obj)</b></tt>
Adds a new instance of object obj to the
room, placing it at the indicate position. It returns the index of the instance.<br>
<tt><b>room_instance_clear(ind)</b></tt>
Removes all instances from the indicated room.<br>
<tt><b>room_tile_add(ind,back,left,top,width,height,x,y,depth)</b></tt>
Adds a new tile
to the room at the indicate position. It returns the index of the tile. back is the
background from which the tile is taken. left, top, width and height indicate the part of
the background that forms the tile. x,y is the position of the tile in the room and depth
is the depth of the tile.<br>
<tt><b>room_tile_add_ext(ind,back,left,top,width,height,x,y,depth,xscale,yscale,alpha)</b></tt>
Same as the previous routine but this time you can also specify a scaling factor
in x and y direction and an alpha transparency for the tile.<br>
<tt><b>room_tile_clear(ind)</b></tt>
Removes all tiles from the indicated room.<br.
</blockquote>
<p>
<!--END-->
</body>
</html>
<!-- KEYWORDS
room_set_width()
room_set_height()
room_set_caption()
room_set_persistent()
room_set_code()
room_set_background_color()
room_set_background()
room_set_view()
room_set_view_enabled()
room_add()
room_duplicate()
room_assign()
room_instance_add()
room_instance_clear()
room_tile_add()
room_tile_add_ext()
room_tile_clear()
-->