-
-
Notifications
You must be signed in to change notification settings - Fork 20
PopochiuProp
Inherits from PopochiuClickable.
Visual elements in the Room that can have interaction.
When selecting a Prop in the scene tree (Scene dock), Popochiu will enable two buttons in the Canvas menu: Baseline and Walk to point. This can be used to select the nodes that allow to modify the position of each node.
-
linked_item_discarded( PopochiuInventoryItem
node
). Emitted when the PopochiuInventoryItem linked to this object inlink_to_item
is discarded from the inventory (I.discard_item(...)
). This may happen when the inventory item is thrown away, but it still can be grabbed and put in the inventory again. -
linked_item_removed( PopochiuInventoryItem
node
). Emitted when the PopochiuInventoryItem linked to this object inlink_to_item
is removed from the inventory (I.remove_item(...)
). This may happen when the inventory item dissapears forever from the game.
-
current_frame int. Default
0
. The current frame to use as the texture of this node. Modifying this will change the value of thecurrent_frame
property in the$Sprite
child. Trying to assign a value lesser than 0 will make this property to be 0, and trying to assign a value higher than the number of frames will make this property to beframes - 1
. -
frames int. Default
1
. The number of frames this node's texture image has. Modifying this will change the value of thehframes
property in the$Sprite
child. -
link_to_item String. Default
''
. Links the prop to a PopochiuInventoryItem by itsscript_name
. This will make the prop to dissapear from the room, depending on said inventory item is it or not inside the inventory. -
texture Texture. Default
null
. The image to use as thetexture
of this node´s$Sprite
.
Nothing here yet.
-
_sprite Sprite. Default
$Sprite
. A reference to the$Sprite
child.
🍑 For a detailed and exemplified description of all the virtual methods of this class (included those inherited from PopochiuClickable), go to the Your scripts > Prop page.
-
on_linked_item_discarded() void.
Called when the PopochiuInventoryItem linked to the prop is discarded from the inventory (this may happen when the inventory item is thrown away, but it still can be grabbed and put in the inventory again). Can be used to define custom behaviors.
See this in detail in Your scripts > Prop page.
-
on_linked_item_removed() void.
Called when the PopochiuInventoryItem linked to the prop is removed from the inventory (this may happen when the inventory item dissapears forever from the game). Can be used to define custom behaviors.
See this in detail in Your scripts > Prop page.
-
change_frame( int
new_frame
) voidChanges the value of the
current_frame
property tonew_frame
when queuing instructions inside anE.run()
call. Can be yield.
-
set_current_frame( int
value
) voidUpdates the
current_frame
property of the$Sprite
child tovalue
. -
set_frames( int
value
) voidUpdates the
hframes
property of the$Sprite
child tovalue
. -
set_texture( Texture
value
) voidUpdates the
texture
property of the$Sprite
child tovalue
.
-
_on_item_added( PopochiuInventoryItem
item
, bool_animate
) voidCalled when the
item_added
signal from singleton I is emitted. This checks if the added item was the one linked to this prop to disable itself. -
_on_item_discarded( PopochiuInventoryItem
item
) voidCalled when the
item_discarded
signal from singleton I is emitted. This checks if the discarded item was the one linked to this prop to enable itself. -
_on_item_removed( PopochiuInventoryItem
item
, bool_animate
) voidCalled when the
item_removed
signal from singleton I is emitted.