-
-
Notifications
You must be signed in to change notification settings - Fork 19
IRoom
IMPORTANT: In future versions of Popochiu (> 1.9.0) this class will become more relevant in terms of room management. That will imply that new properties and methods will appear.
Use it to access props, hotspots, regions and walkable areas in the current room; or to access to data from other rooms. Is the shortcut for IRoom.gd, and can be used (from any script) with R (E.g. R.get_prop('Drawer')
).
Examples
R.get_prop('Scissors').modulate.a = 1.0 # Get Scissors prop and make it visible
R.Outside.state.is_rainning # Access the is_rainning property in the Outside room
-
current PopochiuRoom. Default
null
. A reference to the current room (same asE.current_room
).
-
_room_instances Dictionary. Default
{}
. Holds temporary instances of rooms accessed from the current room withR.AnotherRoom.some_property
.This Dictionary is cleared each time players leave a room.
-
clear_instances() void
Clears the
_room_instances
to free memory and orphan childs. -
get_hotspot( String
hotspot_name
) PopochiuHotspotReturns the PopochiuHotspot inside the "hotspots" group which
script_name
matcheshotspot_name
. -
get_hotspots() Array
Returns all the PopochiuHotspots inside the "hotspots" group.
-
get_point( String
point_name
) Vector2Returns the global position of the Position2D node inside
$Points
whichname
is equal topoint_name
. ReturnsVector2D.ZERO
if the node doesn't exists. -
get_points() Array
Returns all the Position2D inside the
$Points
child. -
get_prop( String
prop_name
) PopochiuPropReturns the PopochiuProp inside the "props" group which
script_name
matchesprop_name
. -
get_props() Array
Returns all the PopochiuProps inside the "props" group.
-
get_region( String
region_name
) PopochiuRegionReturns the PopochiuRegion inside the "regions" group which
script_name
matchesregion_name
. -
get_regions() Array
Returns all the PopochiuRegions inside the "regions" group.
-
get_runtime_room( String
script_name
) PopochiuRoomReturns the instance of the room accessed with R. It stores the instance in
_room_instances
for quicker later access. -
get_walkable_area( String
walkable_area_name
) PopochiuWalkableAreaReturns the PopochiuWalkableArea inside the "walkable_areas" group which
script_name
matcheswalkable_area_name
. -
get_walkable_areas() Array
Returns all the PopochiuWalkableAreas inside the "walkable_areas" group.