IRoom - carenalgas/popochiu GitHub Wiki
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.
Description
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
Properties
Public
- current PopochiuRoom. Default
null. A reference to the current room (same asE.current_room).
Private
-
_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.
Methods
Public
-
clear_instances() void
Clears the
_room_instancesto free memory and orphan childs. -
get_hotspot( String
hotspot_name) PopochiuHotspotReturns the PopochiuHotspot inside the "hotspots" group which
script_namematcheshotspot_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
$Pointswhichnameis equal topoint_name. ReturnsVector2D.ZEROif the node doesn't exists. -
get_points() Array
Returns all the Position2D inside the
$Pointschild. -
get_prop( String
prop_name) PopochiuPropReturns the PopochiuProp inside the "props" group which
script_namematchesprop_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_namematchesregion_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_instancesfor quicker later access. -
get_walkable_area( String
walkable_area_name) PopochiuWalkableAreaReturns the PopochiuWalkableArea inside the "walkable_areas" group which
script_namematcheswalkable_area_name. -
get_walkable_areas() Array
Returns all the PopochiuWalkableAreas inside the "walkable_areas" group.