Skip to content
Carenalga edited this page Feb 3, 2023 · 1 revision

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 as E.current_room).

Private

  • _room_instances Dictionary. Default {}. Holds temporary instances of rooms accessed from the current room with R.AnotherRoom.some_property.

    This Dictionary is cleared each time players leave a room.

Methods

Public

  • clear_instances() void

    Clears the _room_instances to free memory and orphan childs.

  • get_hotspot( String hotspot_name ) PopochiuHotspot

    Returns the PopochiuHotspot inside the "hotspots" group which script_name matches hotspot_name.

  • get_hotspots() Array

    Returns all the PopochiuHotspots inside the "hotspots" group.

  • get_point( String point_name ) Vector2

    Returns the global position of the Position2D node inside $Points which name is equal to point_name. Returns Vector2D.ZERO if the node doesn't exists.

  • get_points() Array

    Returns all the Position2D inside the $Points child.

  • get_prop( String prop_name ) PopochiuProp

    Returns the PopochiuProp inside the "props" group which script_name matches prop_name.

  • get_props() Array

    Returns all the PopochiuProps inside the "props" group.

  • get_region( String region_name ) PopochiuRegion

    Returns the PopochiuRegion inside the "regions" group which script_name matches region_name.

  • get_regions() Array

    Returns all the PopochiuRegions inside the "regions" group.

  • get_runtime_room( String script_name ) PopochiuRoom

    Returns 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 ) PopochiuWalkableArea

    Returns the PopochiuWalkableArea inside the "walkable_areas" group which script_name matches walkable_area_name.

  • get_walkable_areas() Array

    Returns all the PopochiuWalkableAreas inside the "walkable_areas" group.

Clone this wiki locally