-
-
Notifications
You must be signed in to change notification settings - Fork 19
PopochiuClickable
Inherits from Area2D.
Base class of the objects which players interact with inside rooms: Props, Hotspots and characters.
-
always_on_top bool. Default
false
. Whether the object will be rendered always above other objects in the room. -
baseline int. Default
0
. They
position of the baseline relative to the center of the object.. -
clickable bool. Default
true
. Whether the object will listen to interactions. -
cursor Cursor. Default
Cursor.NONE
. The texture to use when the cursor hovers the object. -
description String. Default
''
. The text shown to players when the cursor hovers the object. -
script_name String. Default
''
. The identifier of the object used in scripts. -
walk_to_point Vector2. Default
Vector2.ZERO
. The position where characters will move when aproaching the object.
-
room PopochiuRoom. Default
null
. The room to which the object belongs.
-
_description_code String. Default
''
. The code to use as the description of the object when using localization.
-
on_interact() void
Called when players INTERACT (click) with the object.
-
on_item_used( PopochiuInventoryItem
item
) voidCalled when a PopochiuInventoryItem is used on the object.
-
on_look() void
Called when players LOOK AT/EXAMINE (right click) the object.
-
on_room_set() void
Called once the PopochiuRoom which this object belongs to finishes its _ready() call.
-
disable( bool
is_in_queue = true
) voidMakes the object invisible, and consequently disables it from registering interactions.
-
enable( bool
is_in_queue = true
) voidMakes the object visible, and consequently enables it from registering interactions.
-
hide_helpers() void
Used by the plugin to hide the visual helpers that show the
baseline
andwalk_to_point
of the object in Godot´s 2D Canvas. -
show_helpers() void
Used by the plugin to make visible the visual helpers that show the
baseline
andwalk_to_point
of the object in Godot´s 2D Canvas when a PopochiuClickable is selected in the scene tree.
-
get_description() String
Returns the
description
of the object passing it throughE.get_text()
, which can be used to show it in different languages when using localization. -
get_walk_to_point() Vector2
When running the game, returns the global position of the
walk_to_point
. When in the Editor, returns the value of thewalk_to_point
. -
set_baseline( int
value
) voidWhen in the Editor, makes the
$BaselineHelper
child to be rendered in the Canvas showing a line where thebaseline
of this object is. -
set_room( PopochiuRoom
value
) voidCalls
on_room_set()
when the room to which this object belongs is setted. -
set_walk_to_point( Vector2
value
) voidWhen in the Editor, makes the
$WalkToHelper
child to be rendered in the Canvas showing a Position2D where thewalk_to_point
of this object is.
-
_toggle_description( bool
display
) voidShows and hides (depending on the value of
display
) thedescription
when the cursor hovers or leaves the object. When the cursor is over it takes into account the queue of hovered objects in Popochiu (E) to add itself to its head or tale depending on its relation to the other objects in the queue. Thedescription
shown by Popochiu will be always the object in the tale of the queue. -
_toggle_input() void
Calles when the visibility of the object changes. If it is
clickable
, then the input will be enabled or disabled Whether the object is or not visible. -
_translate() void
When the game is using localization, this changes the value of
description
to match the code used by the TranslationServer to show the text in the current language.